Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1444 location admin fix #1453

Merged
merged 5 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/fhir-helpers/src/constants/codeSystems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ export const eusmServicePointCodeSystemUri =
export const snomedCodeSystemUri = 'http://snomed.info/sct';
export const hl7PhysicalTypeCodeSystemUri =
'http://terminology.hl7.org/CodeSystem/location-physical-type';
export const administrativeLevelSystemUri =
'https://smartregister.org/CodeSystem/administrative-level';
export const administrativeLevelSystemUri = 'https://smartregister.org/codes/administrative-level';

const baseValuSetURI = 'http://smartregister.org/ValueSet';
export const unicefSectionValueSetURI = `${baseValuSetURI}/eusm-unicef-sections`;
Expand Down
2 changes: 1 addition & 1 deletion packages/fhir-helpers/src/utils/tests/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test('getCharacteristicWithCoding works correctly', () => {
test('getAdministrativeLevelTypeCoding works correctly', () => {
const level = 1;
expect(getAdministrativeLevelTypeCoding(level)).toEqual({
system: 'https://smartregister.org/CodeSystem/administrative-level',
system: 'https://smartregister.org/codes/administrative-level',
code: `${level}`,
display: `Level ${level}`,
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useEffect } from 'react';
import { TreeNode } from '../../../helpers/types';
import { serializeTree } from '../../../helpers/utils';
import { TreeSelect } from 'antd';
import { TreeSelectProps } from 'antd/lib/tree-select/';
import { LabelValueType, DataNode } from 'rc-tree-select/lib/interface';
Expand Down Expand Up @@ -30,7 +29,7 @@ export const CustomTreeSelect = (props: CustomTreeSelectProps) => {
fullDataCallback?.(tree);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [serializeTree(tree), fullDataCallback, value]);
}, [fullDataCallback, value]);

const userDefinedRoots = tree.children ?? [];
const selectOptions = treeToOptions(userDefinedRoots, disabledTreeNodesCallback);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const parentNode1 = {
{
coding: [
{
system: 'https://smartregister.org/CodeSystem/administrative-level',
system: 'https://smartregister.org/codes/administrative-level',
code: '1',
display: 'Level 1',
},
Expand All @@ -137,7 +137,7 @@ export const parentNode2 = {
{
coding: [
{
system: 'https://smartregister.org/CodeSystem/administrative-level',
system: 'https://smartregister.org/codes/administrative-level',
code: '2',
display: 'Level 2',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ test('generateLocationUnit works correctly', () => {
expect(getResourceType()).toEqual({
code: '0',
display: 'Level 0',
system: 'https://smartregister.org/CodeSystem/administrative-level',
system: 'https://smartregister.org/codes/administrative-level',
});

// Has parent id and parentNode
// eslint-disable-next-line @typescript-eslint/no-explicit-any
expect(getResourceType(parentNode1 as any, parentId)).toEqual({
system: 'https://smartregister.org/CodeSystem/administrative-level',
system: 'https://smartregister.org/codes/administrative-level',
code: '2',
display: 'Level 2',
});

// eslint-disable-next-line @typescript-eslint/no-explicit-any
expect(getResourceType(parentNode1 as any, parentId)).toEqual({
system: 'https://smartregister.org/CodeSystem/administrative-level',
system: 'https://smartregister.org/codes/administrative-level',
code: '2',
display: 'Level 2',
});

// eslint-disable-next-line @typescript-eslint/no-explicit-any
expect(getResourceType(parentNode2 as any, parentId)).toEqual({
system: 'https://smartregister.org/CodeSystem/administrative-level',
system: 'https://smartregister.org/codes/administrative-level',
code: '3',
display: 'Level 3',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const rootlocationFixture = {
{
coding: [
{
system: 'https://smartregister.org/CodeSystem/administrative-level',
system: 'https://smartregister.org/codes/administrative-level',
code: '0',
display: 'Level 0',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ test('check generated root fhir location payload', () => {
{
code: '0',
display: 'Level 0',
system: 'https://smartregister.org/CodeSystem/administrative-level',
system: 'https://smartregister.org/codes/administrative-level',
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ test('works correctly - physical location', async () => {

// check records shown in table
tableData = [...inventoryTab.querySelectorAll('table tbody tr')].map((tr) => tr.textContent);
waitFor(() => {
await waitFor(() => {
expect(tableData).toEqual(['No data']);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const centralProviceChildLocations = {
{
coding: [
{
system: 'https://smartregister.org/CodeSystem/administrative-level',
system: 'https://smartregister.org/codes/administrative-level',
code: '1',
display: 'Level 1',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export const centralProvinceInclude = {
{
coding: [
{
system: 'https://smartregister.org/CodeSystem/administrative-level',
system: 'https://smartregister.org/codes/administrative-level',
code: '1',
display: 'Level 1',
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`components/CreateEditUserGroup initializes form field with data if page is refreshed: full user group form 1`] = `"Edit User Group | AdminNameRealm Roles2 itemsAvailable RolesEDIT_KEYCLOAK_USERSVIEW_KEYCLOAK_USERS6 itemsAssigned RolesOPENMRSALL_EVENTSPLANS_FOR_USERrealm-adminoffline_accessuma_authorizationSaveCancel"`;

exports[`components/CreateEditUserGroup renders correctly: full user group form 1`] = `"Edit User Group | AdminNameRealm Roles2 itemsAvailable RolesEDIT_KEYCLOAK_USERSVIEW_KEYCLOAK_USERS6 itemsAssigned RolesOPENMRSALL_EVENTSPLANS_FOR_USERrealm-adminoffline_accessuma_authorizationSaveCancel"`;
Loading