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">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>
77 <td v-if="i.comment">{{i.comment}}</td>
84 <div class="well" v-if="item.comment">
90 <div class="well" v-if="drug.comment">
94 <div class="modal-footer">
95 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
105 props: ["drug", "patient", "favs", "id"],
113 return this.favs.indexOf(this.drug.name) != -1;
117 toggleFav:function(){
119 this.favs.splice(this.favs.indexOf(this.drug.name), 1);
122 this.favs.push(this.drug.name);
124 localStorage.setItem("pdosage_favs", JSON.stringify(this.favs));