From 3e56961c7a8fae9c86443d987af1e0c35eae502b Mon Sep 17 00:00:00 2001 From: Agnibho Mondal Date: Sun, 11 Dec 2016 15:09:16 +0530 Subject: [PATCH] Show dosage rate --- index.html | 2 +- src/AboutView.vue | 4 +- src/DataInput.vue | 8 +- src/{dosage.js => Dosage.js} | 9 +- src/DrugView.vue | 20 ++- src/data/aciclovir.json | 4 +- src/data/amikacin.json | 8 +- src/data/amoxycillin_clavulinic_acid.json | 18 +-- src/data/cefixime.json | 14 +- src/data/ceftriaxone.json | 77 +++++++++- src/data/cefuroxime.json | 16 +- src/data/diazepam.json | 110 ++++++++++++++ src/data/domperidone.json | 10 +- src/data/furosemide.json | 10 +- src/data/hydroxyzine.json | 14 +- src/data/levosalbutamol.json | 10 +- src/data/ofloxacin.json | 16 +- src/data/ondansetron.json | 6 +- src/data/paracetamol.json | 43 +++--- src/data/phenytoin.json | 173 ++++++++++++++++++++++ src/data/prednisolone.json | 16 +- src/data/ranitidine.json | 14 +- src/data/valproate.json | 65 ++++++++ src/data/zinc.json | 2 +- src/main.js | 4 +- src/routine.js | 1 + 26 files changed, 554 insertions(+), 120 deletions(-) rename src/{dosage.js => Dosage.js} (96%) create mode 100644 src/data/diazepam.json create mode 100644 src/data/phenytoin.json create mode 100644 src/data/valproate.json diff --git a/index.html b/index.html index 517db77..b6a1203 100755 --- a/index.html +++ b/index.html @@ -68,7 +68,7 @@

PDosage

-

Pediatric Dose Calculator

+

Drug Dose Calculator

diff --git a/src/AboutView.vue b/src/AboutView.vue index 72dc6c6..82994b1 100644 --- a/src/AboutView.vue +++ b/src/AboutView.vue @@ -30,11 +30,13 @@
-

About PDosage

+

About PDosage

PDosage is a web application for calculating dosage of some commonly used drugs. Although it's primarily designed for the practice of Pediatrics, it also provides adult doses of drugs, making it useful for other disciplines too.

PDosage is written in Javascript.

+

App Version:

+

Data version:

Copyright © 2016 Agnibho Mondal

E-mail: mail@agnibho.com

diff --git a/src/DataInput.vue b/src/DataInput.vue index 9ac78aa..4b21cf2 100644 --- a/src/DataInput.vue +++ b/src/DataInput.vue @@ -75,10 +75,10 @@ props:["patient"], data:function(){ return{ - inWt: "", - inAgeY: "", - inAgeM: "", - inAgeD: "" + inWt: this.patient.wt, + inAgeY: this.patient.age.y, + inAgeM: this.patient.age.m, + inAgeD: this.patient.age.d } }, watch: { diff --git a/src/dosage.js b/src/Dosage.js similarity index 96% rename from src/dosage.js rename to src/Dosage.js index 7fa8ce5..672ea52 100644 --- a/src/dosage.js +++ b/src/Dosage.js @@ -195,7 +195,14 @@ export default function Dosage(data){ } function setLimit(dose){ - //console.log(">>"+JSON.stringify(dose)); + if(dose.adult && dose.val){ + if(dose.val[0]>dose.adult[0]){ + dose.val[0]=dose.adult[0]; + } + if(dose.val[1]>dose.adult[1]){ + dose.val[1]=dose.adult[1]; + } + } if(dose.limit && dose.val){ if(dose.val[0]>dose.limit[0]){ dose.val[0]=dose.limit[0]; diff --git a/src/DrugView.vue b/src/DrugView.vue index 3ba5928..6bcf5ce 100644 --- a/src/DrugView.vue +++ b/src/DrugView.vue @@ -71,10 +71,24 @@