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="modal fade" :id="id" tabindex="-1">
29 <div class="modal-dialog">
30 <div class="modal-content">
31 <div class="modal-header">
32 <div @click="toggleFav" class="clickable pull-left lead" title="Toggle Favorite" style="color:gold">
33 <span v-if="isFav" class="glyphicon glyphicon-star"></span>
34 <span v-else class="glyphicon glyphicon-star-empty"></span>
36 <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
37 <h3 class="modal-title">{{drug.name}}</h3>
39 <div class="modal-body">
40 <div class="panel panel-default">
41 <div class="panel-body">
43 <div class="col-sm-6">
45 <strong>Body Weight:</strong>
46 <span v-if="patient.wt!==null">{{patient.wt}} kg</span>
47 <span v-else>Not provided</span>
50 <div class="col-sm-6">
53 <span v-if="patient.age.y!==null">{{patient.age.y}} years</span> <span v-if="patient.age.m!==null">{{patient.age.m}} months</span> <span v-if="patient.age.d!==null">{{patient.age.d}} days</span>
54 <span v-if="patient.age.y===null && patient.age.m===null && patient.age.d===null">Not provided</span>
60 <template v-for="item in drug.form">
61 <div class="panel" :class="{'panel-info': item.gen, 'panel-default': !item.gen}">
62 <div class="panel-heading">
63 <div class="panel-title">
64 {{item.mode}} {{drug.name}} <span v-if="item.content">({{item.content}})</span>
67 <div class="panel-body">
68 <div class="table-responsive">
71 <template v-for="i in item.dose">
72 <template v-if="i.val[0]">
74 <td class="active" rowspan="2">Dose:</td>
75 <td>{{i.val[0]}}<span v-if="i.val[1]"> - {{i.val[1]}}</span> {{i.unit}}</td>
76 <td><span v-if="i.txt">{{i.txt}}</span><span v-else>per dose</span></td>
79 <td><template v-if="i.perKg && (!i.limit || i.limit[0]!=i.val[0] || i.limit[1]!=i.val[1])">
80 <template v-if="i.perKg">
81 <span v-if="i.perKg[0]">( {{i.perKg[0]}}<span v-if="i.perKg[1]">-{{i.perKg[1]}}</span> {{i.unit}}/kg</span>
82 <template v-if="i.adult">
83 ; Adult: {{i.adult[0]}}<span v-if="i.adult[1] && i.adult[1]!=i.adult[0]">-{{i.adult[1]}}</span> {{i.unit}}
85 <template v-if="i.limit">
86 ; Limit: {{i.limit[0]}}<span v-if="i.limit[1] && i.limit[1]!=i.limit[0]">-{{i.limit[1]}}</span> {{i.unit}}
91 <td><span v-if="i.comment">{{i.comment}}</span></td>
98 <div class="well" v-if="item.comment">
104 <div class="well" v-if="drug.comment">
108 <div class="modal-footer">
109 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
119 props: ["drug", "patient", "favs", "id"],
127 return this.favs.indexOf(this.drug.name) != -1;
131 toggleFav:function(){
133 this.favs.splice(this.favs.indexOf(this.drug.name), 1);
136 this.favs.push(this.drug.name);
138 localStorage.setItem("pdosage_favs", JSON.stringify(this.favs));