From b86850bd5cc55644f7f19f57f6a6f99ba6dc4559 Mon Sep 17 00:00:00 2001 From: Laurent Ouma <98098891+Omoshlawi@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:43:52 +0300 Subject: [PATCH] Iit risk score-enhancment (#276) * Added esm-pharmacy-app monorepo * Added Listing for Registration location taged phamacies * fixed spelling * REmoved default iit risc score from hook * Added trend chart on iit for ML tab in care pannell * Mock data made realistic, formated risk score grid display * Fixed description if risk score and loading state * Mock data imprroved making it realistic, added risk score description on hover against risk score --- .../iit-risk-score/iit-risk-score-plot.tsx | 13 ++++++ .../src/iit-risk-score/risk-score.mock.ts | 46 +++++++++++-------- 2 files changed, 39 insertions(+), 20 deletions(-) diff --git a/packages/esm-care-panel-app/src/iit-risk-score/iit-risk-score-plot.tsx b/packages/esm-care-panel-app/src/iit-risk-score/iit-risk-score-plot.tsx index 90e2c72df..a2c1c8704 100644 --- a/packages/esm-care-panel-app/src/iit-risk-score/iit-risk-score-plot.tsx +++ b/packages/esm-care-panel-app/src/iit-risk-score/iit-risk-score-plot.tsx @@ -27,11 +27,24 @@ const CarePanelRiskScorePlot: React.FC = ({ patient title: 'Risk Score (%)', percentage: true, scaleType: ScaleTypes.LINEAR, + includeZero: true, }, }, curve: 'curveMonotoneX', height: '400px', + tooltip: { + // Tooltip configuration for displaying descriptions + enabled: true, + + valueFormatter(value, label) { + if (label === 'Risk Score (%)') { + return `${value} (${patientRiskScore.find((r) => `${r.riskScore}` === `${value}`)?.description ?? ''})`; + } + return `${value}`; + }, + }, }; + return (
IIT Risk Score Trend diff --git a/packages/esm-care-panel-app/src/iit-risk-score/risk-score.mock.ts b/packages/esm-care-panel-app/src/iit-risk-score/risk-score.mock.ts index 29734d417..87afd5031 100644 --- a/packages/esm-care-panel-app/src/iit-risk-score/risk-score.mock.ts +++ b/packages/esm-care-panel-app/src/iit-risk-score/risk-score.mock.ts @@ -1,48 +1,54 @@ export const patientRiskScore = [ { - evaluationDate: '2019-01-01T00:00:00.000Z', - riskScore: 5, - description: 'High Risk', + evaluationDate: '2023-01-12T00:00:00.000Z', + riskScore: 0, + description: 'Low Risk', riskFactors: 'Poor adherance, Missed appointments, Late drug pickup', }, { - evaluationDate: '2022-01-05T00:00:00.000Z', - riskScore: 7, - description: 'High Risk', + evaluationDate: '2023-04-10T00:00:00.000Z', + riskScore: 0, + description: 'Low Risk', riskFactors: 'Poor adherance, Missed appointments, Late drug pickup', }, { - evaluationDate: '2022-01-08T00:00:00.000Z', - riskScore: 10, - description: 'High Risk', + evaluationDate: '2023-07-06T00:00:00.000Z', + riskScore: 3, + description: 'Medium Risk', riskFactors: 'Poor adherance, Missed appointments, Late drug pickup', }, { - evaluationDate: '2023-01-13T00:00:00.000Z', - riskScore: 30, - description: 'High Risk', + evaluationDate: '2023-10-13T00:00:00.000Z', + riskScore: 3, + description: 'Medium Risk', riskFactors: 'Poor adherance, Missed appointments, Late drug pickup', }, { - evaluationDate: '2023-01-23T00:00:00.000Z', - riskScore: 23, - description: 'High Risk', + evaluationDate: '2023-11-23T00:00:00.000Z', + riskScore: 3, + description: 'Medium Risk', + riskFactors: 'Poor adherance, Missed appointments, Late drug pickup', + }, + { + evaluationDate: '2023-12-17T00:00:00.000Z', + riskScore: 3, + description: 'Medium Risk', riskFactors: 'Poor adherance, Missed appointments, Late drug pickup', }, { evaluationDate: '2024-01-17T00:00:00.000Z', - riskScore: 12, - description: 'High Risk', + riskScore: 3, + description: 'Medium Risk', riskFactors: 'Poor adherance, Missed appointments, Late drug pickup', }, { - evaluationDate: '2024-06-17T00:00:00.000Z', - riskScore: 2, + evaluationDate: '2024-04-09T00:00:00.000Z', + riskScore: 11, description: 'High Risk', riskFactors: 'Poor adherance, Missed appointments, Late drug pickup', }, { - evaluationDate: '2024-07-09T00:00:00.000Z', + evaluationDate: '2024-07-07T00:00:00.000Z', riskScore: 11, description: 'High Risk', riskFactors: 'Poor adherance, Missed appointments, Late drug pickup',