Added HEART Score, GRACE 1.0 In Hospital, and MELD-Na
This commit is contained in:
@@ -6,6 +6,7 @@ export default function InputComponent({id, type, inputOptions, min, max, requir
|
||||
const [showError, setErrorStatus] = useState(false);
|
||||
const [error, setError] = useState<string>();
|
||||
const [option, setOption] = useState<string>("");
|
||||
const [open, setOpen] = useState<boolean>(false);
|
||||
if(type === "number"){
|
||||
return(
|
||||
<>
|
||||
@@ -124,5 +125,53 @@ export default function InputComponent({id, type, inputOptions, min, max, requir
|
||||
</label>
|
||||
</fieldset>
|
||||
)
|
||||
}else if(type === "search"){
|
||||
console.log('ran');
|
||||
return(
|
||||
<>
|
||||
<fieldset className="fieldset">
|
||||
<legend className="fieldset-legend text-black"> { info ?
|
||||
<>
|
||||
<div className="tooltip inline-block" data-tip={info}>
|
||||
<svg fill="#000000" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg"
|
||||
className="w-4 h-4" viewBox="0 0 416.979 416.979"
|
||||
>
|
||||
<g>
|
||||
<path d="M356.004,61.156c-81.37-81.47-213.377-81.551-294.848-0.182c-81.47,81.371-81.552,213.379-0.181,294.85
|
||||
c81.369,81.47,213.378,81.551,294.849,0.181C437.293,274.636,437.375,142.626,356.004,61.156z M237.6,340.786
|
||||
c0,3.217-2.607,5.822-5.822,5.822h-46.576c-3.215,0-5.822-2.605-5.822-5.822V167.885c0-3.217,2.607-5.822,5.822-5.822h46.576
|
||||
c3.215,0,5.822,2.604,5.822,5.822V340.786z M208.49,137.901c-18.618,0-33.766-15.146-33.766-33.765
|
||||
c0-18.617,15.147-33.766,33.766-33.766c18.619,0,33.766,15.148,33.766,33.766C242.256,122.755,227.107,137.901,208.49,137.901z"/>
|
||||
</g>
|
||||
</svg>
|
||||
</div></> : null
|
||||
} {name} {defaultUnit ? `(${defaultUnit})` : null} </legend>
|
||||
<input type="text"
|
||||
className="input bg-white text-black border-black"
|
||||
placeholder={placeholder}
|
||||
list="searchlist"
|
||||
aria-required={required}
|
||||
onChange={(e) => {
|
||||
setOption(e.target.value);
|
||||
if(e.target.value !== ""){
|
||||
setOpen(true);
|
||||
}else{
|
||||
setOpen(false);
|
||||
}
|
||||
handleDataChange !== undefined ? handleDataChange(id, e.target.value) : null;
|
||||
}}
|
||||
required={required}
|
||||
/>
|
||||
<datalist id="searchlist">
|
||||
{open && inputOptions?.map(e => {
|
||||
return(
|
||||
<option key={e.label} value={e.value}/>
|
||||
)
|
||||
})}
|
||||
</datalist>
|
||||
{/* <span className="label text-red-400">Optional</span> */}
|
||||
</fieldset>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
233
src/app/utils/calculators/Emergency/GRACE_Inhosp.ts
Normal file
233
src/app/utils/calculators/Emergency/GRACE_Inhosp.ts
Normal file
@@ -0,0 +1,233 @@
|
||||
import { Calculator, Input, Interpretation, Values } from "../types";
|
||||
|
||||
const parameters:Input[] = [
|
||||
{
|
||||
id:"age",
|
||||
name:"Age",
|
||||
placeholder:"Enter the age",
|
||||
type:"number",
|
||||
required:true
|
||||
},
|
||||
{
|
||||
id:"hr",
|
||||
name:"Heart Rate",
|
||||
placeholder:"Enter the Heart Rate",
|
||||
type:"number",
|
||||
required:true,
|
||||
defaultUnit:"beats/minute"
|
||||
},
|
||||
{
|
||||
id:"sbp",
|
||||
name:"Systolic Blood Pressure",
|
||||
placeholder:"Enter the Systolic Blood Pressure",
|
||||
type:"number",
|
||||
required:true,
|
||||
defaultUnit:"mmHg"
|
||||
},
|
||||
{
|
||||
id:"cret",
|
||||
name:"Serum Creatinine",
|
||||
placeholder:"Enter the serum creatinine",
|
||||
type:"number",
|
||||
required:true,
|
||||
defaultUnit:"mg/dL"
|
||||
},
|
||||
{
|
||||
id:"killip",
|
||||
name:"Killip Class",
|
||||
type:"select",
|
||||
placeholder:"Select the killip class",
|
||||
required:true,
|
||||
inputOptions:[
|
||||
{
|
||||
label:"Class I",
|
||||
value:"I"
|
||||
},
|
||||
{
|
||||
label:"Class II",
|
||||
value:"II"
|
||||
},
|
||||
{
|
||||
label:"Class III",
|
||||
value:"III"
|
||||
},
|
||||
{
|
||||
label:"Class IV",
|
||||
value:"IV"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id:"cardiacarrest",
|
||||
name:"Cardiac Arrest",
|
||||
placeholder:"Whether the patient was in cardiac arrest at the time of admission",
|
||||
type:"checkbox",
|
||||
required:true
|
||||
},
|
||||
{
|
||||
id:"cardiacmarkers",
|
||||
name:"Elevated Cardiac Markers",
|
||||
placeholder:"Whether the patient had elevated cardiac markers",
|
||||
type:"checkbox",
|
||||
required:true
|
||||
},
|
||||
{
|
||||
id:"deviation",
|
||||
name:"ST segment deviation",
|
||||
placeholder:"Whether the patient had ST segment deviation",
|
||||
type:"checkbox",
|
||||
required:true
|
||||
}
|
||||
]
|
||||
|
||||
export const GRACE_Inhosp : Calculator = {
|
||||
id:"grace_inhosp",
|
||||
name:"GRACE 1.0 (In-Hospital)",
|
||||
desc:"The GRACE (Global Registry for Acut Coronary Events) Score is a clinical tool to estimate the risk of death or myocardial infarction (MI) during In-Hospital Admission in patients who have suffered Acute Coronary Syndrone (ACS)",
|
||||
inputs:parameters,
|
||||
calc_func:(values: Values):number => {
|
||||
const age = values.age as number;
|
||||
const hr = values.hr as number;
|
||||
const sbp = values.sbp as number;
|
||||
const cret = values.cret as number;
|
||||
const killip = values.killip as "I" | "II" | "III" | "IV";
|
||||
const cardiacarrest = values.cardiacarrest as boolean;
|
||||
const cardiacmarkers = values.cardiacmarkers as boolean;
|
||||
const deviation = values.deviation as boolean;
|
||||
var score = 0;
|
||||
|
||||
if(age >= 30 && age < 40) score = score + 8;
|
||||
else if(age >=40 && age < 50) score = score + 25;
|
||||
else if(age >= 50 && age < 60) score = score + 41;
|
||||
else if(age >= 60 && age < 70) score = score + 58;
|
||||
else if(age >= 70 && age < 80) score = score + 75
|
||||
else if(age >= 80 && age < 90) score = score + 91;
|
||||
else score = score + 100;
|
||||
|
||||
if (hr < 50) score += 0;
|
||||
else if (hr <= 69) score += 3;
|
||||
else if (hr <= 89) score += 9;
|
||||
else if (hr <= 109) score += 15;
|
||||
else if (hr <= 149) score += 24;
|
||||
else if (hr <= 199) score += 38;
|
||||
else score += 46;
|
||||
|
||||
if (sbp < 80) score += 58;
|
||||
else if (sbp <= 99) score += 53;
|
||||
else if (sbp <= 119) score += 43;
|
||||
else if (sbp <= 139) score += 34;
|
||||
else if (sbp <= 159) score += 24;
|
||||
else if (sbp <= 199) score += 10;
|
||||
else score += 0;
|
||||
|
||||
if (cret <= 0.39) score += 1;
|
||||
else if (cret <= 0.79) score += 4;
|
||||
else if (cret <= 1.19) score += 7;
|
||||
else if (cret <= 1.59) score += 10;
|
||||
else if (cret <= 1.99) score += 13;
|
||||
else if (cret <= 3.99) score += 21;
|
||||
else score += 28;
|
||||
|
||||
if (killip === "I") score += 0;
|
||||
else if (killip === "II") score += 20;
|
||||
else if (killip === "III") score += 39;
|
||||
else if (killip === "IV") score += 59;
|
||||
|
||||
if (cardiacarrest) score += 39;
|
||||
|
||||
if (cardiacmarkers) score += 14;
|
||||
|
||||
if (deviation) score += 28;
|
||||
return score;
|
||||
},
|
||||
interpret_func:(score : number) : Interpretation => {
|
||||
if(score <= 60) return {
|
||||
level:"low",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 0.2%"
|
||||
}
|
||||
if(score <= 70 ) return {
|
||||
level:"low",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 0.3%"
|
||||
}
|
||||
if(score <= 80 ) return {
|
||||
level:"low",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 0.4%"
|
||||
}
|
||||
if(score <= 90 ) return {
|
||||
level:"low",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 0.6%"
|
||||
}
|
||||
if(score <= 100 ) return {
|
||||
level:"low",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 0.8%"
|
||||
}
|
||||
if(score <= 110 ) return {
|
||||
level:"low",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 1.1%"
|
||||
}
|
||||
if(score <= 120 ) return {
|
||||
level:"low",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 1.6%"
|
||||
}
|
||||
if(score <= 130 ) return {
|
||||
level:"low",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 2.1%"
|
||||
}
|
||||
if(score <= 140 ) return {
|
||||
level:"low",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 2.9%"
|
||||
}
|
||||
if(score <= 150 ) return {
|
||||
level:"moderate",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 3.9%"
|
||||
}
|
||||
if(score <= 160 ) return {
|
||||
level:"moderate",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 5.4%"
|
||||
}
|
||||
if(score <= 170 ) return {
|
||||
level:"moderate",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 7.3%"
|
||||
}
|
||||
if(score <= 180 ) return {
|
||||
level:"severe",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 9.8%"
|
||||
}
|
||||
if(score <= 190 ) return {
|
||||
level:"severe",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 13%"
|
||||
}
|
||||
if(score <= 200 ) return {
|
||||
level:"severe",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 18%"
|
||||
}
|
||||
if(score <= 210 ) return {
|
||||
level:"severe",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 23%"
|
||||
}
|
||||
if(score <= 220 ) return {
|
||||
level:"severe",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 29%"
|
||||
}
|
||||
if(score <= 230 ) return {
|
||||
level:"severe",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 36%"
|
||||
}
|
||||
if(score <= 240 ) return {
|
||||
level:"severe",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 44%"
|
||||
}
|
||||
if(score < 250 ) return {
|
||||
level:"severe",
|
||||
message:"Probability of In Hospital Mortality is less than or equal to 44%"
|
||||
}
|
||||
if(score >= 250) return {
|
||||
level:"severe",
|
||||
message:"Probability of In Hospital Mortality is more than or equal to 52%"
|
||||
}
|
||||
return{
|
||||
level:"none",
|
||||
message:"Invalid Value"
|
||||
}
|
||||
}
|
||||
}
|
||||
146
src/app/utils/calculators/General Cardiology/HEART_Score.ts
Normal file
146
src/app/utils/calculators/General Cardiology/HEART_Score.ts
Normal file
@@ -0,0 +1,146 @@
|
||||
import { Calculator, Input, Interpretation, Values } from "../types";
|
||||
|
||||
const parameters : Input[] = [
|
||||
{
|
||||
id:"history",
|
||||
name:"History",
|
||||
placeholder:"Select the suspicion level based on history",
|
||||
type:"select",
|
||||
inputOptions:[
|
||||
{
|
||||
label:"Highly suspicious",
|
||||
value:"high"
|
||||
},
|
||||
{
|
||||
label:"Moderately suspicious",
|
||||
value:"moderate",
|
||||
},
|
||||
{
|
||||
label:"Slightly suspicious",
|
||||
value:"none"
|
||||
}
|
||||
],
|
||||
required:true
|
||||
},
|
||||
{
|
||||
id:"ecg",
|
||||
name:"ECG Interpretation",
|
||||
placeholder:"Select the interpretation of ECG",
|
||||
type:"select",
|
||||
inputOptions:[
|
||||
{
|
||||
label:"Significant ST-Depression",
|
||||
value:"stdepression"
|
||||
},
|
||||
{
|
||||
label:"Nonspecific Repolarization",
|
||||
value:"repolarization"
|
||||
},
|
||||
{
|
||||
label:"Normal",
|
||||
value:"normal"
|
||||
}
|
||||
],
|
||||
required:true
|
||||
},
|
||||
{
|
||||
id:"age",
|
||||
name:"Age",
|
||||
type:"number",
|
||||
placeholder:"Enter the age",
|
||||
required:true
|
||||
},
|
||||
{
|
||||
id:"risk",
|
||||
name:"Risk factors",
|
||||
type:"select",
|
||||
placeholder:"Select the number of risk factors found",
|
||||
inputOptions:[
|
||||
{
|
||||
label:"3 or more than 3 Risk Factors or history of CAD",
|
||||
value:"high"
|
||||
},
|
||||
{
|
||||
label:"1 or 2 Risk Factors",
|
||||
value:"moderate"
|
||||
},
|
||||
{
|
||||
label:"No risk factors",
|
||||
value:"none"
|
||||
}
|
||||
],
|
||||
required:true
|
||||
},
|
||||
{
|
||||
id:"trop",
|
||||
name:"Troponin Levels",
|
||||
placeholder:"Select the amount of Troponin",
|
||||
type:"select",
|
||||
inputOptions:[
|
||||
{
|
||||
label:"more than 3 times the normal limit",
|
||||
value:"high"
|
||||
},
|
||||
{
|
||||
label:"1 to 3 times the normal limit",
|
||||
value:"moderate"
|
||||
},
|
||||
{
|
||||
label:"within normal limits",
|
||||
value:"none"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
export const HEART_Score : Calculator = {
|
||||
id:"heart-score",
|
||||
name:"HEART Score",
|
||||
desc:"HEART (History, ECG, Age, Risk factors, Troponin) Score is a risk scoring which predicts 6-week risk of major cardiac events in patients with chest pain",
|
||||
inputs:parameters,
|
||||
calc_func:(values : Values):number => {
|
||||
const history = values.history as "high" | "moderate" | "none";
|
||||
const ecg = values.ecg as "stdepression" | "repolarization" | "normal";
|
||||
const age = values.age as number;
|
||||
const risk = values.risk as "high" | "moderate" | "none";
|
||||
const trop = values.trop as "high" | "moderate" | "none";
|
||||
var score = 0;
|
||||
|
||||
if(history === "high") score = score + 2;
|
||||
else if(history === "moderate") score++;
|
||||
|
||||
if(ecg === "stdepression") score = score + 2;
|
||||
else if(ecg === "repolarization") score++;
|
||||
|
||||
if(age >= 65) score = score + 2;
|
||||
else if(age > 45 && age < 65) score++;
|
||||
|
||||
if(risk === "high") score = score + 2;
|
||||
else if(risk === "moderate") score++;
|
||||
|
||||
if(trop === "high") score = score + 2;
|
||||
else if(trop === "moderate") score++;
|
||||
return score;
|
||||
},
|
||||
interpret_func:(score:number):Interpretation => {
|
||||
if(score >= 0 && score < 4){
|
||||
return {
|
||||
level:"low",
|
||||
message:"There is a chance of 2.5% of Major Adverse Cardiac Event",
|
||||
advice:"Discharge home"
|
||||
}
|
||||
}else if(score >= 4 && score < 7){
|
||||
return {
|
||||
level:"moderate",
|
||||
message:"There is a chance of 20.3% of Major Adverse Cardiac Event",
|
||||
advice:"Admit for Clinical Observation"
|
||||
}
|
||||
}else{
|
||||
return {
|
||||
level:"severe",
|
||||
message:"There is a chance of 72.7% of Major Adverse Cardiac Event",
|
||||
advice:"Consider early invasive strategies"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
92
src/app/utils/calculators/Utilities/MELDNa.ts
Normal file
92
src/app/utils/calculators/Utilities/MELDNa.ts
Normal file
@@ -0,0 +1,92 @@
|
||||
import { Calculator, Input, Interpretation, Values } from "../types";
|
||||
import { MELD } from "./MELD";
|
||||
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
|
||||
},
|
||||
{
|
||||
id:"na",
|
||||
name:"Sodium levels",
|
||||
type:"number",
|
||||
placeholder:"Enter the sodium value",
|
||||
required:true,
|
||||
min:127,
|
||||
max:137,
|
||||
defaultUnit:"mmol/L"
|
||||
}
|
||||
];
|
||||
|
||||
export const MELDNa:Calculator = {
|
||||
id:"meldna-score",
|
||||
name:"Model For End-stage Liver Disease sodium (MELD-Na) score",
|
||||
desc:"MELD-Na (Model for End-stage Liver Disease sodium) score is a numerical scale ranging from 6 to 40 that estimates the 3-month mortality risk for patients with CLD (Chronic Liver Disease) which also takes in account of sodium levels",
|
||||
inputs:parameters,
|
||||
calc_func:(values : Values):number => {
|
||||
const meldscore:number = MELD.calc_func(values);
|
||||
const na = values.na as number;
|
||||
const score:number = meldscore
|
||||
+ 1.32
|
||||
* (137 - na)
|
||||
+ (0.033 * meldscore * (137 - na));
|
||||
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%"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,9 @@ import { MELD } from "./Utilities/MELD";
|
||||
import { MAP } from "./General Cardiology/MAP";
|
||||
import { TIMI } from "./Emergency/TIMI_score";
|
||||
import { cha2ds2 } from "./Arrhythmias and Anti-Coagulation/CHA2DS2-VASc-score";
|
||||
import { MELDNa } from "./Utilities/MELDNa";
|
||||
import { GRACE_Inhosp } from "./Emergency/GRACE_Inhosp";
|
||||
import { HEART_Score } from "./General Cardiology/HEART_Score";
|
||||
|
||||
export const CalculatorRegistry : Record<string, Section> = {
|
||||
generalCardiology:{
|
||||
@@ -31,7 +34,9 @@ export const CalculatorRegistry : Record<string, Section> = {
|
||||
textColor:"#ccc",
|
||||
svg:"",
|
||||
calculators:[
|
||||
TIMI
|
||||
TIMI,
|
||||
GRACE_Inhosp,
|
||||
HEART_Score
|
||||
]
|
||||
},
|
||||
transplantation:{
|
||||
@@ -50,7 +55,8 @@ export const CalculatorRegistry : Record<string, Section> = {
|
||||
svg:"",
|
||||
calculators:[
|
||||
cockcroftGault,
|
||||
MELD
|
||||
MELD,
|
||||
MELDNa
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ export interface Input{
|
||||
id:string,
|
||||
name:string,
|
||||
placeholder?:string,
|
||||
type: "number" | "text" | "select" | "checkbox",
|
||||
type: "number" | "text" | "select" | "checkbox" | "search",
|
||||
inputOptions?:inputOptions[],
|
||||
min?:number,
|
||||
max?:number,
|
||||
|
||||
Reference in New Issue
Block a user