Skip to content

Commit

Permalink
address the pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lucyjemutai committed May 21, 2024
1 parent 2e9ecc7 commit 50091ff
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions packages/esm-commons-lib/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,7 @@ export async function fetchData(

const response = await openmrsFetch(endpoint);
const data = await response.json();

if (data && data.results && data.results.length > 0) {
if (data && data.results && data.results?.length) {
const record = data.results[0].record;

for (const item of record) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const MaternalSummary: React.FC<PatientChartProps> = ({ patientUuid }) => {
setPtrackerId(pTrackerIdentifier.value);
}
}
}, [identifiersTypes.PTrackerIdentifierType, identifiersTypes.ptrackerIdentifierType, patient]);
}, [identifiersTypes.ptrackerIdentifierType, patient]);

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,29 +252,29 @@ const CurrentPregnancy: React.FC<PatientChartProps> = ({ patientUuid, pTrackerId
{
key: 'motherHIVStatus',
header: t('motherHIVStatus', 'Mother HIV Status'),
encounterTypes: [encounterTypes.labourAndDelivery],
getObsValue: async ([encounter]) => {
encounterTypes: [],
getObsValue: async () => {
return motherHivStatus;
},
},
{
key: 'expectedDeliveryDate',
header: t('expectedDeliveryDate', 'Expected Delivery Date'),
encounterTypes: [encounterTypes.labourAndDelivery],
getObsValue: async ([encounter]) => {
encounterTypes: [],
getObsValue: async () => {
return deliveryDate;
},
},
{
key: 'motherStatus',
header: t('motherStatus', 'Mother Status'),
encounterTypes: [encounterTypes.labourAndDelivery],
getObsValue: async ([encounter]) => {
encounterTypes: [],
getObsValue: async () => {
return motherStatus;
},
},
],
[motherStatus, deliveryDate],
[t, motherHivStatus, deliveryDate, motherStatus],
);

const arvTherapyColumns: SummaryCardColumn[] = useMemo(
Expand Down

0 comments on commit 50091ff

Please sign in to comment.