Skip to content

Commit

Permalink
Empty fields in eCR Summary should not be displayed (#2294)
Browse files Browse the repository at this point in the history
apply evaluateData to eCR Summary sections
  • Loading branch information
angelathe authored Aug 1, 2024
1 parent bc02e2b commit cb92f3e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions containers/ecr-viewer/src/app/services/ecrSummaryService.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Bundle, Condition, Extension, Observation } from "fhir/r4";
import { PathMappings } from "@/app/utils";
import { evaluateData, PathMappings } from "@/app/utils";
import {
formatDate,
formatStartEndDateTime,
Expand Down Expand Up @@ -52,7 +52,7 @@ export const evaluateEcrSummaryPatientDetails = (
fhirBundle: Bundle,
fhirPathMappings: PathMappings,
) => {
return [
return evaluateData([
{
title: "Patient Name",
value: evaluatePatientName(fhirBundle, fhirPathMappings),
Expand All @@ -70,7 +70,7 @@ export const evaluateEcrSummaryPatientDetails = (
title: "Patient Contact",
value: evaluatePatientContactInfo(fhirBundle, fhirPathMappings),
},
];
]);
};

/**
Expand All @@ -83,7 +83,7 @@ export const evaluateEcrSummaryEncounterDetails = (
fhirBundle: Bundle,
fhirPathMappings: PathMappings,
) => {
return [
return evaluateData([
{
title: "Facility Name",
value: evaluate(fhirBundle, fhirPathMappings.facilityName),
Expand All @@ -104,7 +104,7 @@ export const evaluateEcrSummaryEncounterDetails = (
title: "Encounter Type",
value: evaluate(fhirBundle, fhirPathMappings.encounterType),
},
];
]);
};

/**
Expand Down
16 changes: 8 additions & 8 deletions containers/ecr-viewer/src/app/view-data/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ const ECRViewerPage: React.FC = () => {
eCR Summary
</h2>
<EcrSummary
patientDetails={evaluateEcrSummaryPatientDetails(
fhirBundle,
mappings,
)}
encounterDetails={evaluateEcrSummaryEncounterDetails(
fhirBundle,
mappings,
)}
patientDetails={
evaluateEcrSummaryPatientDetails(fhirBundle, mappings)
.availableData
}
encounterDetails={
evaluateEcrSummaryEncounterDetails(fhirBundle, mappings)
.availableData
}
conditionSummary={evaluateEcrSummaryConditionSummary(
fhirBundle,
mappings,
Expand Down

0 comments on commit cb92f3e

Please sign in to comment.