diff --git a/containers/ecr-viewer/src/app/services/ecrMetadataService.ts b/containers/ecr-viewer/src/app/services/ecrMetadataService.ts index 00b00e9c1b..46e8fb7163 100644 --- a/containers/ecr-viewer/src/app/services/ecrMetadataService.ts +++ b/containers/ecr-viewer/src/app/services/ecrMetadataService.ts @@ -70,7 +70,6 @@ export const evaluateEcrMetadata = ( const eicrReleaseVersion = (fhirBundle: any, mappings: any) => { const releaseVersion = evaluate(fhirBundle, mappings.eicrReleaseVersion)[0]; - console.log(releaseVersion); if (releaseVersion === "2016-12-01") { return "R1.1 (2016-12-01)"; } else if (releaseVersion === "2021-01-01") { diff --git a/containers/ecr-viewer/src/app/services/evaluateFhirDataService.ts b/containers/ecr-viewer/src/app/services/evaluateFhirDataService.ts index 8181f50a96..7d712f5c88 100644 --- a/containers/ecr-viewer/src/app/services/evaluateFhirDataService.ts +++ b/containers/ecr-viewer/src/app/services/evaluateFhirDataService.ts @@ -373,8 +373,8 @@ export const evaluateFacilityData = ( referenceString = facilityContactAddressRef[0].reference; } const facilityContactAddress = referenceString - ? evaluateReference(fhirBundle, mappings, referenceString).address[0] - : ""; + ? evaluateReference(fhirBundle, mappings, referenceString)?.address?.[0] + : undefined; const facilityData = [ { @@ -394,11 +394,11 @@ export const evaluateFacilityData = ( { title: "Facility Contact Address", value: formatAddress( - facilityContactAddress.line, - facilityContactAddress.city, - facilityContactAddress.state, - facilityContactAddress.postalCode, - facilityContactAddress.country, + facilityContactAddress?.line, + facilityContactAddress?.city, + facilityContactAddress?.state, + facilityContactAddress?.postalCode, + facilityContactAddress?.country, ), }, { diff --git a/containers/ecr-viewer/src/app/tests/components/Encounter.test.tsx b/containers/ecr-viewer/src/app/tests/components/Encounter.test.tsx index 0a6b26a524..d18a678ae5 100644 --- a/containers/ecr-viewer/src/app/tests/components/Encounter.test.tsx +++ b/containers/ecr-viewer/src/app/tests/components/Encounter.test.tsx @@ -16,18 +16,28 @@ describe("Encounter", () => { }, ]; const facilityData = [ - { - title: "Facility ID", - value: "2.16.840.1.113883.4.6", - }, { title: "Facility Name", value: "PRM- Palmdale Regional Medical Center", }, + { + title: "Facility Address", + value: + "5001 North Mount Washington Circle Drive\nNorth Canton, MA 02740", + }, + { + title: "Facility Contact Address", + value: + "5001 North Mount Washington Circle Drive\nNorth Canton, MA 02740", + }, { title: "Facility Type", value: "Healthcare Provider", }, + { + title: "Facility ID", + value: "2.16.840.1.113883.4.6", + }, ]; const providerData = [ { diff --git a/containers/ecr-viewer/src/app/tests/components/Unavailable.test.tsx b/containers/ecr-viewer/src/app/tests/components/Unavailable.test.tsx index 3558af90c6..6f76af499e 100644 --- a/containers/ecr-viewer/src/app/tests/components/Unavailable.test.tsx +++ b/containers/ecr-viewer/src/app/tests/components/Unavailable.test.tsx @@ -39,19 +39,47 @@ describe("UnavailableInfo", () => { ]; const encounterUnavailableData = [ { - title: "Encounter type", + title: "Encounter Date/Time", + value: "", + }, + { + title: "Encounter Type", + value: "", + }, + { + title: "Encounter ID", value: "", }, ]; const facilityUnavailableData = [ + { + title: "Facility Name", + value: "", + }, { title: "Facility Address", value: "", }, + { + title: "Facility Contact Address", + value: "", + }, + { + title: "Facility Type", + value: "", + }, + { + title: "Facility ID", + value: "", + }, ]; const providerUnavailableData = [ { - title: "Provider Name", + title: "Provider Facility Name", + value: "", + }, + { + title: "Provider Facility Address", value: "", }, ]; diff --git a/containers/ecr-viewer/src/app/tests/components/__snapshots__/Encounter.test.tsx.snap b/containers/ecr-viewer/src/app/tests/components/__snapshots__/Encounter.test.tsx.snap index 9ab5c1ca10..a480d39d7b 100644 --- a/containers/ecr-viewer/src/app/tests/components/__snapshots__/Encounter.test.tsx.snap +++ b/containers/ecr-viewer/src/app/tests/components/__snapshots__/Encounter.test.tsx.snap @@ -78,12 +78,12 @@ exports[`Encounter should match snapshot 1`] = `
- Facility ID + Facility Name
- 2.16.840.1.113883.4.6 + PRM- Palmdale Regional Medical Center
- Facility Name + Facility Address
- PRM- Palmdale Regional Medical Center + 5001 North Mount Washington Circle Drive +North Canton, MA 02740 +
+ +
+
+
+
+
+ Facility Contact Address +
+
+ 5001 North Mount Washington Circle Drive +North Canton, MA 02740
+
+
+
+ Facility ID +
+
+ 2.16.840.1.113883.4.6 +
+
+
+
- Encounter type + Encounter Date/Time +
+
+ No data +
+ +
+
+
+
+
+ Encounter Type +
+
+ No data +
+
+
+
+
+
+
+ Encounter ID
+
+
+
+ Facility Name +
+
+ No data +
+
+
+
+
+
+
+ Facility Contact Address +
+
+ No data +
+
+
+
+
+
+
+ Facility Type +
+
+ No data +
+
+
+
+
+
+
+ Facility ID +
+
+ No data +
+
+
+
- Provider Name + Provider Facility Name +
+
+ No data +
+
+
+
+
+
+
+ Provider Facility Address