2 ***********************************************************************
4 * Description: Pediatric Dose Calculator
5 * Author: Agnibho Mondal
6 * Website: http://code.agnibho.com
7 **********************************************************************
8 Copyright (c) 2016 Agnibho Mondal
10 **********************************************************************
11 This file is part of PDosage.
13 PDosage is free software: you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
18 PDosage is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with PDosage. If not, see <http://www.gnu.org/licenses/>.
25 ***********************************************************************
28 <div class="panel panel-default">
29 <div class="panel-heading">
32 <div class="panel-body">
33 <form data-toggle="validator">
35 <div class="col-md-1 col-md-offset-2">
38 <div class="col-md-6">
39 <div class="form-group">
40 <div class="input-group">
41 <input class="form-control" type="number" min="0" max="150" v-model.number="inAgeY" placeholder="Years" required autocomplete="off">
42 <span class="input-group-addon">Y</span>
43 <input class="form-control" type="number" min="0" max="11" v-model.number="inAgeM" placeholder="Months" autocomplete="off" data-error="Months must be between 0 to 11">
44 <span class="input-group-addon">M</span>
45 <input class="form-control" type="number" min="0" max="30" v-model.number="inAgeD" placeholder="Days" autocomplete="off" data-error="Days must be between 0 to 30">
46 <span class="input-group-addon">D</span>
48 <div class="help-block with-errors"></div>
53 <div class="col-md-1 col-md-offset-2">
54 <label>Weight:</label>
56 <div class="col-md-5">
57 <div class="form-group">
58 <div class="input-group">
59 <input class="form-control" type="number" min="0.25" max="200" step=".01" v-model.number="inWt" placeholder="Body weight in kg" required autocomplete="off">
60 <span class="input-group-addon">kg</span>
62 <div class="help-block with-errors"></div>
65 <div class="col-md-1"><input type="reset" class="btn btn-default pull-right"></div>
78 inWt: this.patient.wt,
79 inAgeY: this.patient.age.y,
80 inAgeM: this.patient.age.m,
81 inAgeD: this.patient.age.d
86 var val=parseFloat(this.inWt);
87 if(val>=0.25 && val<=200){
95 var val=parseFloat(this.inAgeY);
96 if(val>=0 && val<=150){
97 this.patient.age.y=val;
100 this.patient.age.y=null;
104 var val=parseFloat(this.inAgeM);
105 if(val>=0 && val<=11){
106 this.patient.age.m=val;
109 this.patient.age.m=null;
113 var val=parseFloat(this.inAgeD);
114 if(val>=0 && val<=30){
115 this.patient.age.d=val;
118 this.patient.age.d=null;