Skip to content

Commit 4306806

Browse files
Add pTracker Id to the mamba report endpoint (UCSF-IGHS#1908)
1 parent 594a85f commit 4306806

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

packages/esm-commons-lib/src/api.resource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ export function fetchEtlData(
285285
let endpoint = '';
286286
switch (reportType) {
287287
case 'fetchMambaAncData':
288-
endpoint = `/ws/rest/v1/mamba/report?report_id=${reportId}&person_uuid=${patientUuid}`;
288+
endpoint = `/ws/rest/v1/mamba/report?report_id=${reportId}&ptracker_id=${pTrackerId}&person_uuid=${patientUuid}`;
289289
break;
290290
case 'MotherHivStatus':
291291
endpoint = `/ws/rest/v1/mamba/report?report_id=${reportId}&ptracker_id=${pTrackerId}&person_uuid=${patientUuid}`;

packages/esm-commons-lib/src/utils/summary-card-config-builder.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,32 @@ export const getSummaryCardProps = (schemaConfig, config = null) => {
1616
return getConditionalConceptValue(encounter, column.conditionalConceptMappings, column.isDate);
1717
}
1818

19+
const pTrackerId = encounter?.patient?.identifiers.find(
20+
(id) => id?.identifierType?.uuid === config?.identifiersTypes?.ptrackerIdentifierType,
21+
)?.identifier;
22+
1923
if (column?.mambaEtlData === 'ancVisits') {
20-
const response = fetchEtlData('fetchMambaAncData', 'no_of_anc_visits', encounter?.patient?.uuid);
24+
const response = fetchEtlData('fetchMambaAncData', 'no_of_anc_visits', encounter?.patient?.uuid, pTrackerId);
2125
return response?.data;
2226
}
2327

2428
if (column?.mambaEtlData === 'motherStatus') {
25-
const response = fetchEtlData('fetchMambaAncData', 'mother_status', encounter?.patient?.uuid);
29+
const response = fetchEtlData('fetchMambaAncData', 'mother_status', encounter?.patient?.uuid, pTrackerId);
2630
return response?.data;
2731
}
2832

2933
if (column?.mambaEtlData === 'deliveryDate') {
30-
const response = fetchEtlData('fetchMambaAncData', 'estimated_date_of_delivery', encounter?.patient?.uuid);
34+
const response = fetchEtlData(
35+
'fetchMambaAncData',
36+
'estimated_date_of_delivery',
37+
encounter?.patient?.uuid,
38+
pTrackerId,
39+
);
3140
return response?.data;
3241
}
3342

3443
if (column?.mambaEtlData === 'motherHivStatus') {
35-
const response = fetchEtlData('fetchMambaAncData', 'mother_hiv_status', encounter?.patient?.uuid);
44+
const response = fetchEtlData('fetchMambaAncData', 'mother_hiv_status', encounter?.patient?.uuid, pTrackerId);
3645
return response?.data;
3746
}
3847

packages/esm-ohri-pmtct-app/src/pmtct/patient-chart/mch-summary/tabs/recent-pregnancy-config.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
{
66
"id": "motherHIVStatus",
77
"title": "Mother HIV Status",
8-
"encounterTypes": [],
8+
"encounterTypes": ["antenatalEncounterType", "laborAndDeliveryEncounterType", "motherPostnatalEncounterType"],
99
"mambaEtlData": "motherHivStatus"
1010
},
1111
{
1212
"id": "expectedDeliveryDate",
1313
"title": "Expected Delivery Date",
14-
"encounterTypes": [],
14+
"encounterTypes": ["antenatalEncounterType", "laborAndDeliveryEncounterType", "motherPostnatalEncounterType"],
1515
"mambaEtlData": "deliveryDate"
1616
},
1717
{
1818
"id": "motherStatus",
1919
"title": "Mother Status",
20-
"encounterTypes": [],
20+
"encounterTypes": ["antenatalEncounterType", "laborAndDeliveryEncounterType", "motherPostnatalEncounterType"],
2121
"mambaEtlData": "motherStatus"
2222
}
2323
]
24-
}
24+
}

0 commit comments

Comments
 (0)