<filename>.mpaz (zipped file)
|-- meta.json (e.g. {"type": "MedScript", "version": "<mpaz version>"})
|-- prescription.json (Prescription object in JSON format)
- |-- template (included template for rendering)
+ |-- template (template for rendering, unsupported in MedScript Lite)
| |-- index.html (Jinja2 template)
| |-- <other template files e.g. CSS>
|-- attachment (directory containing attachments)
| |-- <attached files>
- |-- signature (optional: S/MIME signature)
+ |-- signature (optional: S/MIME signature, unsupported in MedScript Lite)
|-- certificate.pem (optional: full certificate chain including end-user, intermediates and root certificate)
Install
form.
The parts of a prescription are as follows:
+
1. ID
-2. Name
-3. Age
-4. Sex
-5. Address
-6. Contact
-7. Diagnosis
-8. Extra (any extra data about the patient. can also be used to certify)
-9. DAW (dispense as written)
-10. Mode (consultation mode e.g. tele-consultation)
-11. Note (clinical notes)
-12. Report (available reports)
-13. Advice
-14. Investigation
-15. Medication
-16. Additional
-17. Attachment (files can be attached with the prescription from this option)
+2. PID
+3. Name
+4. Date of Birth
+5. Age
+6. Sex
+7. Address
+8. Contact
+9. Diagnosis
+10. Extra
+11. DAW (dispense as written)
+12. Mode (consultation mode e.g. tele-consultation)
+13. Note (clinical notes)
+14. Report (available reports)
+15. Advice
+16. Investigation
+17. Medication
+18. Additional
+19. Certificate
+20. Attachment (files can be attached with the prescription from this option)
After editing the "Save" button below can be used to save the data in a
mpaz file and download it. The "Render" button will render the prescription
### Medical Certificate
-The Certify/Extra area can be used to write a medical prescription. Select the
+The certificate text area can be used to write a medical prescription. Select the
medical certificate template from the edit screen for proper rendering.
Prescriber
prescription (Prescription object)
|-- date (string: date-time in the %Y-%m-%d %H:%M:%S format)
|-- id (string: the id of the prescription)
+ |-- pid (string: the patient's id)
|-- name (string: the name of the patient)
+ |-- dob (string: the date of birth)
|-- age (string: the age of the patient, may contain unit)
|-- sex (string: sex of the patient)
|-- address (string: address of the patient)
|-- contact (string: contact number / email of the patient)
- |-- extra (string: extra data related to the prescription, may also be used for writing certificates)
+ |-- extra (string: extra data related to the prescription)
|-- mode (string: the mode of consultation e.g. tele-consultation)
|-- daw (boolean: dispense as written)
|-- diagnosis (string: diagnosis of the patient's condition)
|-- investigation (string: investigations suggested for the patient)
|-- medication (string: the list of medications prescribed)
|-- additional (string: any additional advice/instructions)
+ |-- certificate (string: content of a medical certificate)
+ |-- custom (list: contents of custom input forms)
+ |-- properties (object: unused, included for future/plugin use)
|-- prescriber (Prescriber object)
| |-- name (string: the name of the prescriber)
| |-- qualification (string: the qualification of the prescriber)
| |-- address (string: the address of the prescriber)
| |-- contact (string: contact number / email of the prescriber)
| |-- extra (string: any extra data about the prescriber)
+ | |-- properties (object: unused, included for future/plugin use)
Website
-------
<td>
<table class="table">
<tr>
- <td class="text-end" colspan="3"><small>{% if id %}ID: {{id}}{% endif %}</small></td>
+ <td class="text-end" colspan="3"><small>{% if id %}<strong>ID:</strong> {{id}}{% endif %} {% if pid %}<strong>PID:</strong> {{pid}}{% endif %}</small></td>
</tr>
<tr>
<td><p><strong>Name:</strong> {{name}}</p></td>
+ {% if age %}
<td><p><strong>Age:</strong> {{age}}</p></td>
+ {% else %}
+ <td><p><strong>Date of Birth:</strong> {{dob|date("MMMM DD, YYYY")}}</p></td>
+ {% endif %}
<td><p><strong>Sex:</strong> {{sex}}</p></td>
</tr>
<tr>
<div class="footer" style="position:fixed;bottom:0;width:95%;left:50%; transform:translateX(-50%);background:white;bottom:0;border-top:2px solid black;height:100px">
<table class="table">
<tr><td class="col-sm-8">{% if mode %}Consultation: {{mode}}{% endif %}<br>{% if daw %}Dispense as written{% endif %}</td><td class="col-sm-4"><br><br></td></tr>
- <tr><td><p>{{date|date("YYYY-MM-DDTHH:mm:ss")}}</p></td><td class="text-center" style="border-top: 2px solid gray"><p>Signature</p></td></tr>
+ <tr><td><p>{{date|date("MMMM DD, YYYY hh:mm a")}}</p></td><td class="text-center" style="border-top: 2px solid gray"><p>Signature</p></td></tr>
</table>
</div>
</div>
<td>
<table class="table">
<tr>
- <td class="text-end" colspan="3"><small>{% if id %}ID: {{id}}{% endif %}</small></td>
+ <td class="text-end" colspan="3"><small>{% if id %}<strong>ID:</strong> {{id}}{% endif %} {% if pid %}<strong>PID:</strong> {{pid}}{% endif %}</small></td>
</tr>
<tr>
<td><p><strong>Name:</strong> {{name}}</p></td>
+ {% if age %}
<td><p><strong>Age:</strong> {{age}}</p></td>
+ {% else %}
+ <td><p><strong>Date of Birth:</strong> {{dob|date("MMMM DD, YYYY")}}</p></td>
+ {% endif %}
<td><p><strong>Sex:</strong> {{sex}}</p></td>
</tr>
<tr>
<td>{% if diagnosis %}<strong>Provisional Diagnosis: {{diagnosis}}</strong>{% endif %}</td>
</tr>
<tr>
- <td><pre class="text-justify">{{extra}}</p></td>
+ <td><pre class="text-justify">{{certificate}}</p></td>
</tr>
</table>
</td>
<div class="footer" style="position:fixed;bottom:0;width:95%;left:50%; transform:translateX(-50%);background:white;bottom:0;border-top:2px solid black;height:100px">
<table class="table">
<tr><td class="col-sm-8">{% if mode %}Consultation: {{mode}}{% endif %}<br>{% if daw %}Dispense as written{% endif %}</td><td class="col-sm-4"><br><br></td></tr>
- <tr><td><p>{{date|date("YYYY-MM-DDTHH:mm:ss")}}</p></td><td class="text-center" style="border-top: 2px solid gray"><p>Signature</p></td></tr>
+ <tr><td><p>{{date|date("MMMM DD, YYYY hh:mm a")}}</p></td><td class="text-center" style="border-top: 2px solid gray"><p>Signature</p></td></tr>
</table>
</div>
</div>
<home-screen @openPrescription="loadPrescription" @openAttachment="loadAttachment" @newFile="newFile" @editPrescriber="editPrescriber" v-show="showComponent.home"></home-screen><br>
<edit-screen @renderPrescription="renderPrescription" @cancel="cancelEdit" :openedPrescription="openedPrescription" :openedAttachment="openedAttachment" v-show="showComponent.edit"></edit-screen>
<render-screen :prescription="prescription" :template="template" @closeRender="closeRender" v-show="showComponent.render"></render-screen>
- <prescriber-screen @cancel="cancelPrescriber" v-show="showComponent.prescriber"></prescriber-screen>
+ <prescriber-screen @save="closePrescriber" @cancel="closePrescriber" v-show="showComponent.prescriber"></prescriber-screen>
<div v-show="!showComponent.render">
<hr>
</div>
this.showComponent.render=true;
},
closeRender() {
- console.log("close")
this.showComponent.render=false;
this.showComponent.edit=true;
},
this.showComponent.home=false;
this.showComponent.prescriber=true;
},
- cancelPrescriber() {
+ closePrescriber() {
this.showComponent.prescriber=false;
this.showComponent.home=true;
},
<input type="text" class="form-control" id="id" v-model="prescription.id">
</div>
</div>
+ <div class="form-group row mb-2">
+ <label for="pid" class="col-sm-2">PID:</label>
+ <div class="col-sm-10">
+ <input type="text" class="form-control" id="pid" v-model="prescription.pid">
+ </div>
+ </div>
<div class="form-group row mb-2">
<label for="name" class="col-sm-2">Name:</label>
<div class="col-sm-10">
</div>
</div>
<div class="form-group row mb-2">
+ <div class="col-sm-10 offset-sm-2">
+ <div class="form-check form-check-inline">
+ <input class="form-check-input" type="radio" id="ageDob2" name="ageDob" value="dob" v-model="ageDob">
+ <label class="form-check-label" for="ageDob2">Date of Birth</label>
+ </div>
+ <div class="form-check form-check-inline">
+ <input class="form-check-input" type="radio" id="ageDob1" name="ageDob" value="age" v-model="ageDob">
+ <label class="form-check-label" for="ageDob1">Age</label>
+ </div>
+ </div>
+ </div>
+ <div class="form-group row mb-2" :class="{'d-none':ageDob!='dob'}">
+ <label for="dob" class="col-sm-2">Date of Birth:</label>
+ <div class="col-sm-10">
+ <input type="date" class="form-control" id="dob" v-model="prescription.dob">
+ </div>
+ </div>
+ <div class="form-group row mb-2" :class="{'d-none':ageDob!='age'}">
<label for="age" class="col-sm-2">Age:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="age" v-model="prescription.age">
</div>
</div>
<div class="form-group row mb-2">
- <label for="extra" class="col-sm-2">Extra/Certificate:</label>
+ <label for="extra" class="col-sm-2">Extra:</label>
<div class="col-sm-10">
<textarea class="form-control" id="extra" v-model="prescription.extra"></textarea>
</div>
</div>
</div>
<hr>
+ <div class="form-group row">
+ <label for="certificate" class="col-sm-2">Certificate:</label>
+ <div class="col-sm-10">
+ <textarea class="form-control" id="certificate" v-model="prescription.certificate"></textarea>
+ </div>
+ </div>
+ <hr>
<div class="form-group row mb-2">
<label for="attachment" class="col-sm-2">Attachments:</label>
<div class="col-sm-10">
data() {
return {
prescription: this.newData(),
+ ageDob: "age",
attachment: [],
selected: 0,
template: "default"
var prescription={
date: new Date(new Date() - new Date().getTimezoneOffset() * 60000).toISOString().split(".")[0],
id: "",
+ pid: "",
name: "",
+ dob: "",
age: "",
sex: "",
address: "",
investigation: "",
medication: "",
additional: "",
+ certificate: "",
attachment: "",
+ custom: null,
+ properties: null,
prescriber: this.loadPrescriber()
};
return prescription;
},
saveData() {
- var prescription=JSON.stringify(this.prescription, null, 2);
var filename=""
+ this.prescription.date=this.prescription.date.replace("T", " ")
if(this.prescription.id){
filename=this.prescription.id.name.replace(/ +/g, "_")
}
- else if(this.prescription.name){
- filename=this.prescription.name.replace(/ +/g, "_")
- }
else {
filename="prescription"
}
+ if(this.dobAge=="dob"){
+ this.prescription.age=""
+ }
+ else{
+ this.prescription.dob=""
+ }
+ var prescription=JSON.stringify(this.prescription, null, 2);
var zipfile=new JSZip();
zipfile.file("prescription.json", prescription);
- zipfile.file("meta.json", JSON.stringify({"type": "MedScript", "version": "0.2"}))
+ zipfile.file("meta.json", JSON.stringify({"type": "MedScript", "version": "0.3"}))
this.attachment.forEach((item) => {
zipfile.file("attachment/"+item.name, item.content)
});
openedPrescription: function(){
if(this.openedPrescription) {
this.prescription=structuredClone(this.openedPrescription)
+ if(JSON.stringify(this.prescription.prescriber)!=JSON.stringify(this.loadPrescriber())){
+ if(confirm("Original prescriber and current prescriber are different. Replace original with current?")){
+ this.prescription.prescriber=this.loadPrescriber()
+ }
+ }
}
else {
this.prescription=this.newData()
<input type="text" class="form-control" id="name" v-model="prescriber.name">
</div>
</div>
+ <div class="form-group row mb-2">
+ <label for="qualification" class="col-sm-2">Qualification:</label>
+ <div class="col-sm-10">
+ <input type="text" class="form-control" id="qualification" v-model="prescriber.qualification">
+ </div>
+ </div>
<div class="form-group row mb-2">
<label for="registration" class="col-sm-2">Registration:</label>
<div class="col-sm-10">
<div class="col-sm-3 d-grid gap-2">
<button type="button" @click="cancel" class="btn btn-warning">Cancel</button>
</div>
+ <div class="col-sm-3 d-grid gap-2">
+ <button type="button" @click="reset" class="btn btn-danger">Reset</button>
+ </div>
</div>
</form>
</div>
prescriber=JSON.parse(localStorage.getItem("prescriber"));
}
catch {
- prescriber={name: "", registration: "", address: "", contact: "", extra: ""}
+ prescriber={name: "", qualification: "", registration: "", address: "", contact: "", extra: "", properties: null}
}
return prescriber;
},
save() {
localStorage.setItem("prescriber", JSON.stringify(this.prescriber));
+ this.$emit("save");
},
cancel() {
this.$emit("cancel");
+ },
+ reset() {
+ this.prescriber={name: "", qualification: "", registration: "", address: "", contact: "", extra: "", properties: null}
}
}
}
},
methods: {
render() {
- console.log(this.prescription.prescriber);
- console.log(this.template);
fetch("template/"+this.template+".html")
.then((response)=>response.text())
.then(function(response) {