Replacing GFR with CrCl for cockcroft gault equation
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
import { Metadata } from "next";
|
||||
import RenderCalculator from "./renderCalc";
|
||||
|
||||
|
||||
import { CalculatorRegistry } from "@/app/utils/calculators/registry";
|
||||
export async function generateMetadata({params} : {params:Promise<{section:string, id:string}>}):Promise<Metadata>{
|
||||
const calcData : {section:string, id:string} = await params;
|
||||
const calculator = CalculatorRegistry[calcData.section].calculators.find(e => e.id === calcData.id);
|
||||
return {
|
||||
title:`${calculator?.name} calculator`,
|
||||
description:`A ${calculator?.name} calculator to evaluate the patient as accurately as possible`
|
||||
};
|
||||
}
|
||||
export default async function Calculator({params} : {params:Promise<{section:string, id:string}>}){
|
||||
const calcData : {section:string, id:string} = await params;
|
||||
return(
|
||||
|
||||
@@ -5,6 +5,7 @@ import Input from "@/app/utils/Input";
|
||||
import Result from "@/app/utils/Result";
|
||||
import { CalculatorRegistry } from "@/app/utils/calculators/registry";
|
||||
import { Interpretation } from "@/app/utils/calculators/types";
|
||||
import { Metadata } from "next";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function RenderCalculator({section, id} : {section:string, id:string}){
|
||||
|
||||
@@ -7,9 +7,9 @@ export default function Result({interpretation, calculated_value, unit} : {inter
|
||||
if(level === "none" || level === "low"){
|
||||
levelClass = "bg-success";
|
||||
}else if(level === "moderate"){
|
||||
levelClass = "bg-orange-600";
|
||||
levelClass = "bg-orange-600 text-white";
|
||||
}else if(level === "high" || level === "severe"){
|
||||
levelClass = "bg-red-500";
|
||||
levelClass = "bg-red-500 text-white";
|
||||
}else{
|
||||
levelClass = "bg-white";
|
||||
}
|
||||
|
||||
@@ -55,44 +55,44 @@ function calc_func(values : Values):number{
|
||||
? Math.floor(((140 - age) * weight)/(72 * creatinine))
|
||||
: Math.floor((((140 - age) * weight)/(72 * creatinine)) * 0.85);
|
||||
}
|
||||
function interpret_func(gfr:number):Interpretation{
|
||||
if(gfr >= 90){
|
||||
function interpret_func(crcl:number):Interpretation{
|
||||
if(crcl >= 90){
|
||||
return {
|
||||
level:"none",
|
||||
message:"Glomerular Filtration Rate (GFR) is normal or on the higher side, To be correlated with other clinical clues",
|
||||
message:"Creatinine Clearance (CrCl) is normal or on the higher side, To be correlated with other clinical clues",
|
||||
diagnosis:"CKD Stage 1"
|
||||
}
|
||||
}else if(gfr < 90 && gfr >= 60){
|
||||
}else if(crcl < 90 && crcl >= 60){
|
||||
return {
|
||||
level:"low",
|
||||
message:"Glomerular Filtration Rate (GFR) is slightly reduced, To be correlated with other clinical clues",
|
||||
message:"Creatinine Clearance (CrCl) is slightly reduced, To be correlated with other clinical clues",
|
||||
diagnosis:"CKD Stage 2"
|
||||
}
|
||||
}else if(gfr < 60 && gfr >= 45){
|
||||
}else if(crcl < 60 && crcl >= 45){
|
||||
return{
|
||||
level:"moderate",
|
||||
message:"Glomerular Filtration Rate (GFR) is moderately reduced",
|
||||
message:"Creatinine Clearance (CrCl) is moderately reduced",
|
||||
advice:"Consult a Nephrologist",
|
||||
diagnosis:"CKD Stage 3A"
|
||||
}
|
||||
}else if(gfr < 45 && gfr >= 30){
|
||||
}else if(crcl < 45 && crcl >= 30){
|
||||
return{
|
||||
level:"high",
|
||||
message:"Glomerular Filtration Rate (GFR) is significantly reduced",
|
||||
message:"Creatinine Clearance (CrCl) is significantly reduced",
|
||||
advice:"Consult a Nephrologist urgently",
|
||||
diagnosis:"CKD Stage 3B"
|
||||
}
|
||||
}else if(gfr < 30 && gfr >= 15){
|
||||
}else if(crcl < 30 && crcl >= 15){
|
||||
return{
|
||||
level:"high",
|
||||
message:"Glomerular Filtration Rate (GFR) is largely reduced",
|
||||
message:"Creatinine Clearance (CrCl) is largely reduced",
|
||||
advice:"Consult a Nephrologist urgently",
|
||||
diagnosis:"CKD Stage 4"
|
||||
}
|
||||
}else{
|
||||
return{
|
||||
level:"severe",
|
||||
message:"Glomerular Filtration Rate (GFR) is severely reduced",
|
||||
message:"Creatinine Clearance (CrCl) is severely reduced",
|
||||
advice:"Consult a Nephrologist urgently to consider dialysis",
|
||||
diagnosis:"CKD Stage 5 / ESRD (End Stage Renal Disease)"
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CalculatorRegistry = void 0;
|
||||
var cockcroft_gault_eq_1 = require("./miscellaneous/cockcroft-gault-eq");
|
||||
exports.CalculatorRegistry = {
|
||||
miscellaneous: {
|
||||
id: "miscellaneous",
|
||||
displayName: "Miscellaneous",
|
||||
textColor: "#ccc",
|
||||
svg: "",
|
||||
calculators: [
|
||||
cockcroft_gault_eq_1.cockcroftGault
|
||||
]
|
||||
}
|
||||
};
|
||||
@@ -1,2 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
Reference in New Issue
Block a user