From 7b7e8be7a4e80d6ddd69005e91425dd9a1e8e6cd Mon Sep 17 00:00:00 2001 From: Amy Kintner Date: Wed, 18 Dec 2024 09:43:54 -0800 Subject: [PATCH] adds country to patient info for ecr view (#3045) * adds country to patient info for ecr view * update snapshot * updates snapshots for test --- .../ecr-viewer/src/app/api/fhirPath.yml | 1 + .../app/services/evaluateFhirDataService.ts | 4 ++++ .../tests/components/Demographics.test.tsx | 4 ++++ .../AccordionContent.test.tsx.snap | 19 +++++++++++++++++++ .../__snapshots__/Demographics.test.tsx.snap | 19 +++++++++++++++++++ 5 files changed, 47 insertions(+) diff --git a/containers/ecr-viewer/src/app/api/fhirPath.yml b/containers/ecr-viewer/src/app/api/fhirPath.yml index 7f6034ff56..6361e79e1d 100644 --- a/containers/ecr-viewer/src/app/api/fhirPath.yml +++ b/containers/ecr-viewer/src/app/api/fhirPath.yml @@ -2,6 +2,7 @@ patientNameList: "Bundle.entry.resource.where(resourceType = 'Patient').name" patientAddressList: "Bundle.entry.resource.where(resourceType = 'Patient').address" patientTelecom: "Bundle.entry.resource.where(resourceType = 'Patient').telecom" patientCounty: "Bundle.entry.resource.where(resourceType = 'Patient').address.first().county" +patientCountry: "Bundle.entry.resource.where(resourceType = 'Patient').address.first().country" patientIds: "Bundle.entry.resource.where(resourceType = 'Patient').identifier.where(system != 'urn:ietf:rfc:3986').value.join('\n')" patientDOB: "Bundle.entry.resource.where(resourceType = 'Patient').birthDate" diff --git a/containers/ecr-viewer/src/app/services/evaluateFhirDataService.ts b/containers/ecr-viewer/src/app/services/evaluateFhirDataService.ts index c4ab05bce7..646e4fe616 100644 --- a/containers/ecr-viewer/src/app/services/evaluateFhirDataService.ts +++ b/containers/ecr-viewer/src/app/services/evaluateFhirDataService.ts @@ -347,6 +347,10 @@ export const evaluateDemographicsData = ( title: "County", value: evaluate(fhirBundle, mappings.patientCounty)[0], }, + { + title: "Country", + value: evaluate(fhirBundle, mappings.patientCountry)[0], + }, { title: "Contact", value: formatContactPoint(evaluate(fhirBundle, mappings.patientTelecom)), diff --git a/containers/ecr-viewer/src/app/tests/components/Demographics.test.tsx b/containers/ecr-viewer/src/app/tests/components/Demographics.test.tsx index 020f6465cd..d7a39cb759 100644 --- a/containers/ecr-viewer/src/app/tests/components/Demographics.test.tsx +++ b/containers/ecr-viewer/src/app/tests/components/Demographics.test.tsx @@ -35,6 +35,10 @@ describe("Demographics", () => { title: "County", value: "test", }, + { + title: "Country", + value: "USA", + }, { title: "Contact", value: "test contact" }, { title: "Emergency Contact", diff --git a/containers/ecr-viewer/src/app/tests/components/__snapshots__/AccordionContent.test.tsx.snap b/containers/ecr-viewer/src/app/tests/components/__snapshots__/AccordionContent.test.tsx.snap index 2a54fe1720..20fddbc244 100644 --- a/containers/ecr-viewer/src/app/tests/components/__snapshots__/AccordionContent.test.tsx.snap +++ b/containers/ecr-viewer/src/app/tests/components/__snapshots__/AccordionContent.test.tsx.snap @@ -439,6 +439,25 @@ exports[`Snapshot test for Accordion Content Given no data, info message for emp class="section__line_gray" /> +
+
+
+ Country +
+
+ No data +
+
+
+
+
+
+
+ Country +
+
+ USA +
+
+
+