From 7b6531260535327bc219b62b4b6e7098a70313c2 Mon Sep 17 00:00:00 2001 From: saksham vitwekar Date: Tue, 31 Mar 2026 16:50:38 +0530 Subject: [PATCH] Adding MELD Score and its docs --- docs/miscellaneous/MELD.md | 27 ++++++ .../calculate/[section]/[id]/renderCalc.tsx | 1 - src/app/utils/Result.tsx | 1 - .../utils/calculators/miscellaneous/MELD.ts | 83 +++++++++++++++++++ src/app/utils/calculators/registry.ts | 5 +- 5 files changed, 113 insertions(+), 4 deletions(-) create mode 100644 docs/miscellaneous/MELD.md create mode 100644 src/app/utils/calculators/miscellaneous/MELD.ts diff --git a/docs/miscellaneous/MELD.md b/docs/miscellaneous/MELD.md new file mode 100644 index 0000000..664c2a3 --- /dev/null +++ b/docs/miscellaneous/MELD.md @@ -0,0 +1,27 @@ +# Model for End-stage Liver Disease (MELD) score + +#### MELD score is a numerical value that is used to predict the 3-month mortality prediction risk of a patient. It is also used to prioritize patients for liver transplantations with higher score indicating a more urgent need. +### Parameters needed +| Parameter | Unit | +| --------- | ---- | +| Serum Bilirubin | mg/dL | +| Serum Creatinine | mg/dL | +| International Normalized Ratio (INR) | - | +### MELD Score interpretation table:- + +| Score range | Mortality risk | +| ----------- | -------------- | +| less than 9 | Low risk (under 1.9%) | +| 10 to 19 | Low to Moderate (6.0% - 19.6%) | +| 20 to 29 | Moderate risk (19.6% - 52.6%) | +| 30 to 39 | High risk (52.6% - 71.3%) | +| more than 40 | Extremely high risk (71.3% - 100%) | + +### Formula to calculate MELD:- +The MELD score is calculated using the following formula:- +$$ +\textbf{MELD} = (9.57 \times \ln(\text{Serum Creatinine})) + (3.78 \times \text{Serum Bilirubin}) + (11.2 \times \text{INR}) + 6.43 +$$ + +### Notice:- +The MELD score is not considered accurate for advanced liver diseases. Other calulcators like MELD-Na should be used before taking clinical decisions \ No newline at end of file diff --git a/src/app/(calculators)/calculate/[section]/[id]/renderCalc.tsx b/src/app/(calculators)/calculate/[section]/[id]/renderCalc.tsx index 8f129e9..c759bbf 100644 --- a/src/app/(calculators)/calculate/[section]/[id]/renderCalc.tsx +++ b/src/app/(calculators)/calculate/[section]/[id]/renderCalc.tsx @@ -25,7 +25,6 @@ export default function RenderCalculator({section, id} : {section:string, id:str level:"none", message:"none" }); - console.log(form); return calculator ? ( <>
diff --git a/src/app/utils/Result.tsx b/src/app/utils/Result.tsx index 414a6aa..972861a 100644 --- a/src/app/utils/Result.tsx +++ b/src/app/utils/Result.tsx @@ -13,7 +13,6 @@ export default function Result({interpretation, calculated_value, unit} : {inter }else{ levelClass = "bg-white"; } - console.log(levelClass); return(
diff --git a/src/app/utils/calculators/miscellaneous/MELD.ts b/src/app/utils/calculators/miscellaneous/MELD.ts new file mode 100644 index 0000000..9e3f846 --- /dev/null +++ b/src/app/utils/calculators/miscellaneous/MELD.ts @@ -0,0 +1,83 @@ +import { Calculator, Input, Interpretation, Values } from "../types"; + +const parameters : Input[] = [ + { + id:"sbilirubin", + type:"number", + name:"Serum (Total) Bilirubin", + defaultUnit:"mg/dL", + placeholder:"Enter serum bilirubin levels in mg/dL", + required:true, + min:0, + }, + { + id:"screatinine", + type:"number", + name:"Serum Creatinine", + defaultUnit:"mg/dL", + placeholder:"Enter Serum Creatinine levels in mg/dL", + required:true, + min:0.2 + }, + { + id:'inr', + name:"International Normalized Ratio", + type:'number', + placeholder:"Enter INR values", + required:true, + min:0 + } +]; + +export const MELD:Calculator = { + id:"meld-score", + name:"Model For End-stage Liver Disease (MELD) score", + desc:"MELD (Model for End-stage Liver Disease) score is a numerical scale ranging from 6 to 40 that estimates the 3-month mortality risk for patients with CLD (Chronic Liver Disease)", + inputs:parameters, + calc_func:(values : Values):number => { + const sbilirubin = values.sbilirubin as number; + const screatinine = values.screatinine as number; + const inr = values.inr as number; + const score = (9.57 * Math.log(screatinine)) + + (3.78 * Math.log(sbilirubin)) + + (11.2 * Math.log(inr)) + + 6.43; + return Math.floor(score); + }, + interpret_func:(score : number):Interpretation => { + if(score <= 9){ + return { + level:"none", + message:"The mortality prediction percent for the patient is 1.9%", + advice:"Patient is a great candidate for TIPS procedure" + } + }else if(score >= 10 && score < 20){ + if(score < 14){ + return{ + level:"low", + message:"The mortality risk percent for the patient is less than 6.0%", + advice:"Patient is a great candidate for TIPS procedure" + }; + } + return{ + level:"low", + message:"The mortality risk percent for the patient is from 6.0% to 19.6%", + }; + }else if (score >=20 && score < 30){ + return { + level:"moderate", + message:"The mortality risk percent for the patient is from 19.6% to 52.6%" + }; + }else if(score >= 30 && score < 40){ + return { + level:"high", + message:"The mortality risk percent for the patient is from 52.6% to 71.3%" + } + }else{ + return { + level:"severe", + message:"The mortality risk percent for the patient is more than 71.3%" + } + } + } +} \ No newline at end of file diff --git a/src/app/utils/calculators/registry.ts b/src/app/utils/calculators/registry.ts index 7d9e7b4..d5dbf38 100644 --- a/src/app/utils/calculators/registry.ts +++ b/src/app/utils/calculators/registry.ts @@ -1,7 +1,7 @@ import { cockcroftGault } from "./miscellaneous/cockcroft-gault-eq"; import { IMPACT } from "./transplantation/IMPACT"; import { Section } from "./types"; - +import { MELD } from "./miscellaneous/MELD"; export const CalculatorRegistry : Record = { transplantation:{ id:"transplantation", @@ -18,7 +18,8 @@ export const CalculatorRegistry : Record = { textColor:"#ccc", svg:"", calculators:[ - cockcroftGault + cockcroftGault, + MELD ] } } \ No newline at end of file