Skip to content

Commit 63b597d

Browse files
committed
BN-71 | Fix. Category field to FHIR Get API of Conditions control
1 parent 3d3978c commit 63b597d

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/constants/app.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { HL7_CONDITION_CATEGORY_CONDITION_CODE } from './fhir';
2+
13
const BASE_PATH = process.env.PUBLIC_URL || '/';
24
const OPENMRS_FHIR_R4 = '/openmrs/ws/fhir2/R4';
35
const OPENMRS_REST_V1 = '/openmrs/ws/rest/v1';
@@ -13,7 +15,8 @@ export const BUNDLED_TRANSLATIONS_URL_TEMPLATE = (lang: string) =>
1315
export const PATIENT_RESOURCE_URL = (patientUUID: string) =>
1416
OPENMRS_FHIR_R4 + `/Patient/${patientUUID}?_summary=data`;
1517
export const PATIENT_CONDITION_RESOURCE_URL = (patientUUID: string) =>
16-
OPENMRS_FHIR_R4 + `/Condition?patient=${patientUUID}`;
18+
OPENMRS_FHIR_R4 +
19+
`/Condition?category=${HL7_CONDITION_CATEGORY_CONDITION_CODE}&patient=${patientUUID}`;
1720
export const PATIENT_ALLERGY_RESOURCE_URL = (patientUUID: string) =>
1821
OPENMRS_FHIR_R4 + `/AllergyIntolerance?patient=${patientUUID}`;
1922
export const PATIENT_ENCOUNTER_RESOURCE_URL = (patientUUID: string) =>

src/constants/fhir.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export const FHIR_ENCOUNTER_TYPE_CODE_SYSTEM =
22
'http://fhir.openmrs.org/code-system/encounter-type';
3+
export const HL7_CONDITION_CATEGORY_CONDITION_CODE = 'problem-list-item';

src/services/__tests__/conditionService.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('conditionService', () => {
3434
const result = await getPatientConditionsBundle(patientUUID);
3535

3636
expect(get).toHaveBeenCalledWith(
37-
`/openmrs/ws/fhir2/R4/Condition?patient=${patientUUID}`,
37+
`/openmrs/ws/fhir2/R4/Condition?category=problem-list-item&patient=${patientUUID}`,
3838
);
3939
expect(result).toEqual(mockConditionBundle);
4040
});
@@ -59,7 +59,7 @@ describe('conditionService', () => {
5959
const result = await getConditions(patientUUID);
6060

6161
expect(get).toHaveBeenCalledWith(
62-
`/openmrs/ws/fhir2/R4/Condition?patient=${patientUUID}`,
62+
`/openmrs/ws/fhir2/R4/Condition?category=problem-list-item&patient=${patientUUID}`,
6363
);
6464
expect(result).toEqual([mockCondition]);
6565
});

0 commit comments

Comments
 (0)