Skip to content

Commit

Permalink
(fix) O3-3046: Updated the interpretation keys for vital signs matchi…
Browse files Browse the repository at this point in the history
…ng table headers (#1791)
  • Loading branch information
vasharma05 authored Apr 17, 2024
1 parent fec559c commit ae4de5f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
8 changes: 4 additions & 4 deletions __mocks__/vitals-and-biometrics.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6020,7 +6020,7 @@ export const formattedVitals = [
diastolic: 89,
systolic: 121,
bmi: null,
bloodPressureInterpretation: 'normal',
bloodPressureRenderInterpretation: 'normal',
},
{
id: '1',
Expand All @@ -6034,15 +6034,15 @@ export const formattedVitals = [
temperature: 37,
spo2: 90,
bmi: 23,
bloodPressureInterpretation: 'normal',
bloodPressureRenderInterpretation: 'normal',
},
{
id: '2',
date: '2021-05-07T09:04:51.000Z',
diastolic: 80,
systolic: 120,
bmi: null,
bloodPressureInterpretation: 'normal',
bloodPressureRenderInterpretation: 'normal',
},
{
id: '3',
Expand All @@ -6053,7 +6053,7 @@ export const formattedVitals = [
pulse: 78,
respiratoryRate: 65,
bmi: 22.6,
bloodPressureInterpretation: 'normal',
bloodPressureRenderInterpretation: 'normal',
},
];

Expand Down
11 changes: 8 additions & 3 deletions packages/esm-patient-vitals-app/src/common/data.resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ interface VitalsConceptMetadataResponse {
}>;
}

function getInterpretationKey(header: string) {
// Reason for `Render` string is to match the column header in the table
return `${header}RenderInterpretation`;
}

export function useVitalsConceptMetadata() {
const customRepresentation =
'custom:(setMembers:(uuid,display,hiNormal,hiAbsolute,hiCritical,lowNormal,lowAbsolute,lowCritical,units))';
Expand Down Expand Up @@ -205,13 +210,13 @@ export function useVitalsAndBiometrics(patientUuid: string, mode: VitalsAndBiome
vitalsHashTable.set(recordedDate, {
...vitalsHashTable.get(recordedDate),
[getVitalsMapKey(vitalSign.code)]: vitalSign.value,
[getVitalsMapKey(vitalSign.code) + 'Interpretation']: vitalSign.interpretation,
[getInterpretationKey(getVitalsMapKey(vitalSign.code))]: vitalSign.interpretation,
});
} else {
vitalSign.value &&
vitalsHashTable.set(recordedDate, {
[getVitalsMapKey(vitalSign.code)]: vitalSign.value,
[getVitalsMapKey(vitalSign.code) + 'Interpretation']: vitalSign.interpretation,
[getInterpretationKey(getVitalsMapKey(vitalSign.code))]: vitalSign.interpretation,
});
}

Expand All @@ -230,7 +235,7 @@ export function useVitalsAndBiometrics(patientUuid: string, mode: VitalsAndBiome
}

if (mode === 'both' || mode === 'vitals') {
result.bloodPressureInterpretation = interpretBloodPressure(
result.bloodPressureRenderInterpretation = interpretBloodPressure(
vitalSigns.systolic,
vitalSigns.diastolic,
concepts,
Expand Down
2 changes: 1 addition & 1 deletion packages/esm-patient-vitals-app/src/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface PatientVitalsAndBiometrics {
date: string;
systolic?: number;
diastolic?: number;
bloodPressureInterpretation?: ObservationInterpretation;
bloodPressureRenderInterpretation?: ObservationInterpretation;
pulse?: number;
temperature?: number;
spo2?: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ describe('VitalsHeader: ', () => {
date: '2022-05-19T00:00:00.000Z',
systolic: 165,
diastolic: 150,
bloodPressureInterpretation: 'critically_high',
bloodPressureRenderInterpretation: 'critically_high',
pulse: 76,
spo2: undefined,
temperature: 37,
Expand Down

0 comments on commit ae4de5f

Please sign in to comment.