Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blood Pressure: Temp. fix to treat negative values as undefined #6987

Merged
merged 1 commit into from
Jan 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions src/Components/Facility/Consultations/PrimaryParametersPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ interface PrimaryParametersPlotProps {
consultationId: string;
}

const sanitizeBPAttribute = (value: number | undefined) => {
// Temp. hack until the cleaning of daily rounds as a db migration is done.
// TODO: remove once migration is merged.

if (value == null || value < 0) {
return;
}

return value;
};

export const PrimaryParametersPlot = ({
consultationId,
}: PrimaryParametersPlotProps) => {
Expand Down Expand Up @@ -77,19 +88,19 @@ export const PrimaryParametersPlot = ({
{
name: "diastolic",
data: Object.values(results)
.map((p: any) => p.bp && p.bp.diastolic)
.map((p: any) => p.bp && sanitizeBPAttribute(p.bp.diastolic))
.reverse(),
},
{
name: "systolic",
data: Object.values(results)
.map((p: any) => p.bp && p.bp.systolic)
.map((p: any) => p.bp && sanitizeBPAttribute(p.bp.systolic))
.reverse(),
},
{
name: "mean",
data: Object.values(results)
.map((p: any) => p.bp && p.bp.mean)
.map((p: any) => p.bp && sanitizeBPAttribute(p.bp.mean))
.reverse(),
},
];
Expand Down
Loading