-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d3a58e4
commit 59bf205
Showing
6 changed files
with
227 additions
and
217 deletions.
There are no files selected for viewing
24 changes: 17 additions & 7 deletions
24
packages/esm-commons-lib/src/utils/summary-card-config-builder.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,35 @@ | ||
import { getObsFromEncounter, getConditionalConceptValue } from "./encounter-list-utils"; | ||
import { getObsFromEncounter, getConditionalConceptValue } from './encounter-list-utils'; | ||
|
||
export const getSummarryCardProps = (schemaConfig) => { | ||
export const getSummaryCardProps = (schemaConfig) => { | ||
const columns = schemaConfig.columns?.map((column) => ({ | ||
key: column.id, | ||
header: column.title, | ||
concept: column.concept, | ||
encounterTypes: column.encounterTypes, | ||
getObsValue: async ([encounter]) => { | ||
if (column.isConditionalConcept) { return getConditionalConceptValue(encounter, column.conditionalConceptMappings, column.isDate); } | ||
if (column.isConditionalConcept) { | ||
return getConditionalConceptValue(encounter, column.conditionalConceptMappings, column.isDate); | ||
} | ||
return getObsFromEncounter( | ||
encounter, | ||
column.concept, | ||
column.isDate, | ||
column.isTrueFalseConcept, | ||
column.type, | ||
column.fallbackConcepts,); | ||
column.fallbackConcepts, | ||
); | ||
}, | ||
getObsSummary: async (encounters) => { | ||
const summaryValues = encounters.map((encounter) => { | ||
if (encounter && encounter.observation && encounter.observation.value) { | ||
return encounter.observation.value.join(', '); | ||
} else { | ||
return ''; | ||
} | ||
}); | ||
return summaryValues.join(' | '); | ||
}, | ||
getObsSummary: () => { } | ||
|
||
})); | ||
|
||
return columns; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
246 changes: 41 additions & 205 deletions
246
packages/esm-tb-app/src/views/tpt/patient-summary/patient-summary.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
packages/esm-tb-app/src/views/tpt/patient-summary/recent-tpt-config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
"menuId": "recentTpt", | ||
"cardTitle": "Recent Tuberculosis", | ||
"columns": [ | ||
{ | ||
"id": "tptTreatmentId", | ||
"title": "TPT Treatment ID", | ||
"encounterTypes": [ | ||
"dc6ce80c-83f8-4ace-a638-21df78542551" | ||
], | ||
"concept": "162727AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
}, | ||
{ | ||
"id": "tptEnrollmentDate", | ||
"isDate": true, | ||
"title": "Enrollment Date", | ||
"encounterTypes": [ | ||
"dc6ce80c-83f8-4ace-a638-21df78542551" | ||
], | ||
"concept": "164852AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
}, | ||
{ | ||
"id": "tptIndication", | ||
"title": "Indication", | ||
"encounterTypes": [ | ||
"dc6ce80c-83f8-4ace-a638-21df78542551" | ||
], | ||
"concept": "162276AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
}, | ||
{ | ||
"id": "tptRegimen", | ||
"title": "Regimen", | ||
"encounterTypes": [ | ||
"dc6ce80c-83f8-4ace-a638-21df78542551" | ||
], | ||
"concept": "1264AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
}, | ||
{ | ||
"id": "tptAdherence", | ||
"title": "Adherence", | ||
"encounterTypes": [ | ||
"1ac3de3f-8fc2-43a7-addb-e805c393ecae" | ||
], | ||
"concept": "164075AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
}, | ||
{ | ||
"id": "tptAppointmentDate", | ||
"isDate": true, | ||
"title": "Next Appointment Date", | ||
"encounterTypes": [ | ||
"1ac3de3f-8fc2-43a7-addb-e805c393ecae" | ||
], | ||
"concept": "5096AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
} | ||
] | ||
} | ||
|
Oops, something went wrong.