Skip to content

Commit

Permalink
change file location
Browse files Browse the repository at this point in the history
  • Loading branch information
AshrafMd-1 committed Nov 30, 2023
1 parent e2d28e4 commit 2ba0143
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,21 @@ export const Mews = (props: {
[101.4, Infinity, 2],
];

const consciousnessCalculator = (value: string) => {
switch (value) {
case "Alert":
return 0;
case "RESPONDS_TO_VOICE" || "AGITATED_OR_CONFUSED":
return 1;
case "RESPONDS_TO_PAIN" || "ONSET_OF_AGITATION_AND_CONFUSION":
return 2;
case "UNRESPONSIVE":
return 3;
default:
return undefined;
}
};

const mewsColorRange = [
[0, 2, "bg-primary-500"],
[3, 3, "bg-yellow-300"],
Expand Down Expand Up @@ -83,6 +98,7 @@ export const Mews = (props: {
<p>Heart rate : {props.rounds?.pulse}</p>
<p>Systolic BP : {props.rounds?.bp.systolic}</p>
<p>Temperature : {props.rounds?.temperature}</p>
<p>Consciousness Level : {props.rounds?.consciousness_level}</p>
</div>
<div
className={`mt-2 flex h-4 w-full flex-col items-center justify-center rounded-b-lg ${getIndividualScore(
Expand All @@ -109,13 +125,19 @@ export const Mews = (props: {
lastDailyRound.temperature,
temperatureRange
),
consciousnessLevel: consciousnessCalculator(
lastDailyRound.consciousness_level
),
};

console.log(score);

if (
score.resp === undefined ||
score.heartRate === undefined ||
score.systolicBloodPressure === undefined ||
score.temperature === undefined
score.temperature === undefined ||
score.consciousnessLevel === undefined
) {
return mewsCard(
true,
Expand All @@ -124,6 +146,7 @@ export const Mews = (props: {
score.heartRate === undefined ? "Heart rate" : "",
score.systolicBloodPressure === undefined ? "Systolic BP" : "",
score.temperature === undefined ? "Temperature" : "",
score.consciousnessLevel === undefined ? "Consciousness Level" : "",
].filter((x) => x !== "")
);
}
Expand All @@ -132,7 +155,8 @@ export const Mews = (props: {
score.resp +
score.heartRate +
score.systolicBloodPressure +
score.temperature;
score.temperature +
score.consciousnessLevel;

return mewsCard(false, totalScore);
};
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Patient/PatientInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import routes from "../../Redux/api.js";
import DropdownMenu from "../Common/components/Menu.js";
import { triggerGoal } from "../../Integrations/Plausible.js";
import useAuthUser from "../../Common/hooks/useAuthUser.js";
import { Mews } from "../Facility/ConsultationDetails/Mews.js";
import { Mews } from "../Facility/Consultations/Mews.js";

export default function PatientInfoCard(props: {
patient: PatientModel;
Expand Down

0 comments on commit 2ba0143

Please sign in to comment.