diff --git a/src/Components/Facility/Consultations/Mews.tsx b/src/Components/Facility/Consultations/Mews.tsx index a96dde9a523..7ad31d97961 100644 --- a/src/Components/Facility/Consultations/Mews.tsx +++ b/src/Components/Facility/Consultations/Mews.tsx @@ -1,5 +1,5 @@ -import useQuery from "../../../Utils/request/useQuery"; -import routes from "../../../Redux/api"; +import { DailyRoundsModel } from "../../Patient/models"; +import RecordMeta from "../../../CAREUI/display/RecordMeta"; const respRange = [ [-Infinity, 7, 2], @@ -70,59 +70,72 @@ const getIndividualScore = (value: number | undefined, ranges: any[][]) => { } }; -export const Mews = (props: { consultationId: string }) => { - const { data: dailyRoundsData } = useQuery(routes.getDailyReports, { - pathParams: { - consultationId: props.consultationId, - }, - query: { - rounds_type: "NORMAL,VENTILATOR,ICU", - limit: 1, - }, - }); - +export const Mews = (props: { lastDailyRound: DailyRoundsModel }) => { const mewsCard = (isMissing: boolean, data: string[] | number) => { if (isMissing) { return ( -
N/A
-Missing :
-N/A
+Missing :
+{data}
-Respiratory rate : {dailyRoundsData?.results[0].resp}
-Heart rate : {dailyRoundsData?.results[0].pulse}
-Systolic BP : {dailyRoundsData?.results[0].bp?.systolic}
-Temperature : {dailyRoundsData?.results[0].temperature}
-- Consciousness Level :{" "} - {dailyRoundsData?.results[0].consciousness_level} -
+ <> +{data}
+Resp Rate : {props.lastDailyRound.resp}
+Pulse : {props.lastDailyRound.pulse}
+Sys BP : {props.lastDailyRound.bp?.systolic}
+Temp : {props.lastDailyRound.temperature}
+Conscious :
++ {props.lastDailyRound.consciousness_level + ?.split("_") + .map((x) => x[0] + x.slice(1).toLowerCase()) + .join(" ")} +
+- Mews Score -
- {mewsScore()} -Mews Score
+ {mewsScore()} +