-
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.
OHRI-2223: Implement the TB app schema based workflow (#1861)
* Implement the TB app schema based workflow * Ensure TB Treatement ID, Treatment Start Date and Regimen columns dispaly correct data * update * .. * proper date format, cleanup and indentation fix * update the tb * Update summary-card-config-builder.ts * update Tpt and fix indents
- Loading branch information
1 parent
82ff232
commit 07c4bce
Showing
26 changed files
with
1,005 additions
and
1,024 deletions.
There are no files selected for viewing
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
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
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
35 changes: 35 additions & 0 deletions
35
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { getObsFromEncounter, getConditionalConceptValue } from './encounter-list-utils'; | ||
|
||
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); | ||
} | ||
return getObsFromEncounter( | ||
encounter, | ||
column.concept, | ||
column.isDate, | ||
column.isTrueFalseConcept, | ||
column.type, | ||
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(' | '); | ||
}, | ||
})); | ||
|
||
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
61 changes: 61 additions & 0 deletions
61
packages/esm-tb-app/src/views/patient-summary/previous-cases-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,61 @@ | ||
{ | ||
"menuId": "previousCases", | ||
"tabDefinitions": [ | ||
{ | ||
"tabName": "Previous Cases", | ||
"headerTitle": "Previous Cases", | ||
"displayText": "Previous Cases", | ||
"encounterType": "9a199b59-b185-485b-b9b3-a9754e65ae57", | ||
"columns": [ | ||
{ | ||
"id": "caseID", | ||
"title": "Case ID", | ||
"concept": "162576AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
}, | ||
{ | ||
"id": "enrollmentDate", | ||
"isDate": true, | ||
"title": "Enrollment Date", | ||
"concept": "161552AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
}, | ||
{ | ||
"id": "type", | ||
"title": "Type", | ||
"concept": "159990AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
}, | ||
{ | ||
"id": "site", | ||
"title": "Site", | ||
"concept": "160040AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
}, | ||
{ | ||
"id": "regimen", | ||
"title": "Regimen", | ||
"isConditionalConcept": true, | ||
"conditionalConceptMappings": { | ||
"trueConcept": "16fd7307-0b26-4c8b-afa3-8362baff4042", | ||
"nonTrueConcept": "159909AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", | ||
"dependantConcept": "163775AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", | ||
"conditionalConcept": "160541AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
} | ||
}, | ||
{ | ||
"id": "outcome", | ||
"title": "Outcome", | ||
"concept": "159786AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
} | ||
], | ||
"launchOptions": { | ||
"hideFormLauncher": true, | ||
"displayText": "Add", | ||
"moduleName": "@ohri/openmrs-esm-ohri-tb-app" | ||
}, | ||
"formList": [ | ||
{ | ||
"name": "TB Case Enrollment Form", | ||
"uuid": "554b2017-e512-3fc8-9c6e-7baf9e69db9d" | ||
} | ||
] | ||
} | ||
] | ||
} |
77 changes: 77 additions & 0 deletions
77
packages/esm-tb-app/src/views/patient-summary/recent-tb-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,77 @@ | ||
{ | ||
"menuId": "recentTuberculosis", | ||
"cardTitle": "Recent Tuberculosis", | ||
"columns": [ | ||
{ | ||
"id": "caseID", | ||
"title": "Case ID", | ||
"encounterTypes": [ | ||
"9a199b59-b185-485b-b9b3-a9754e65ae57" | ||
], | ||
"concept": "162576AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
}, | ||
{ | ||
"id": "enrollmentDate", | ||
"isDate": true, | ||
"title": "Enrollment Date", | ||
"encounterTypes": [ | ||
"9a199b59-b185-485b-b9b3-a9754e65ae57" | ||
], | ||
"concept": "161552AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
}, | ||
{ | ||
"id": "type", | ||
"title": "Type", | ||
"encounterTypes": [ | ||
"9a199b59-b185-485b-b9b3-a9754e65ae57" | ||
], | ||
"concept": "159990AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
}, | ||
{ | ||
"id": "site", | ||
"title": "Site", | ||
"encounterTypes": [ | ||
"9a199b59-b185-485b-b9b3-a9754e65ae57" | ||
], | ||
"concept": "160040AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
}, | ||
{ | ||
"id": "drugSensitivity", | ||
"title": "Drug Sensitivity", | ||
"encounterTypes": [ | ||
"9a199b59-b185-485b-b9b3-a9754e65ae57" | ||
], | ||
"concept": "164368AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
}, | ||
{ | ||
"id": "regimen", | ||
"title": "Regimen", | ||
"encounterTypes": [ | ||
"9a199b59-b185-485b-b9b3-a9754e65ae57" | ||
], | ||
"isConditionalConcept": true, | ||
"conditionalConceptMappings": { | ||
"trueConcept": "16fd7307-0b26-4c8b-afa3-8362baff4042", | ||
"nonTrueConcept": "159909AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", | ||
"dependantConcept": "163775AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", | ||
"conditionalConcept": "160541AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
} | ||
}, | ||
{ | ||
"id": "hivStatus", | ||
"title": "HIV Status", | ||
"encounterTypes": [ | ||
"9a199b59-b185-485b-b9b3-a9754e65ae57" | ||
], | ||
"concept": "159576AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
}, | ||
{ | ||
"id": "outcome", | ||
"title": "Outcome", | ||
"encounterTypes": [ | ||
"9a199b59-b185-485b-b9b3-a9754e65ae57" | ||
], | ||
"concept": "159786AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
} | ||
] | ||
} |
Oops, something went wrong.