From: Agnibho Mondal Date: Fri, 10 Nov 2023 19:38:28 +0000 (+0530) Subject: Updated for mpaz 0.3 X-Git-Url: https://code.agnibho.com/repo?a=commitdiff_plain;p=medscript-lite.git Updated for mpaz 0.3 --- diff --git a/README b/README index 2498486..f3376e3 100644 --- a/README +++ b/README @@ -33,12 +33,12 @@ The structure of the mpaz file is as follows: .mpaz (zipped file) |-- meta.json (e.g. {"type": "MedScript", "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) | |-- |-- attachment (directory containing attachments) | |-- - |-- 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 @@ -84,23 +84,27 @@ prescription editing screen will open. The required data can be entered in the 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 @@ -130,7 +134,7 @@ Note that MedScript Lite do not include the templates in the mpaz file. ### 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 @@ -157,12 +161,14 @@ structure of the Prescription object is as follows: 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) @@ -172,6 +178,9 @@ structure of the Prescription object is as follows: |-- 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) @@ -179,6 +188,7 @@ structure of the Prescription object is as follows: | |-- 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 ------- diff --git a/public/template/default.html b/public/template/default.html index dc86644..f896eb6 100644 --- a/public/template/default.html +++ b/public/template/default.html @@ -40,11 +40,15 @@ You should have received a copy of the GNU General Public License along with Med - + + {% if age %} + {% else %} + + {% endif %} @@ -96,7 +100,7 @@ You should have received a copy of the GNU General Public License along with Med
{% if id %}ID: {{id}}{% endif %}{% if id %}ID: {{id}}{% endif %} {% if pid %}PID: {{pid}}{% endif %}

Name: {{name}}

Age: {{age}}

Date of Birth: {{dob|date("MMMM DD, YYYY")}}

Sex: {{sex}}

- +
{% if mode %}Consultation: {{mode}}{% endif %}
{% if daw %}Dispense as written{% endif %}


{{date|date("YYYY-MM-DDTHH:mm:ss")}}

Signature

{{date|date("MMMM DD, YYYY hh:mm a")}}

Signature

diff --git a/public/template/medcert.html b/public/template/medcert.html index c81e76e..3dd4f1c 100644 --- a/public/template/medcert.html +++ b/public/template/medcert.html @@ -40,11 +40,15 @@ You should have received a copy of the GNU General Public License along with Med - + + {% if age %} + {% else %} + + {% endif %} @@ -56,7 +60,7 @@ You should have received a copy of the GNU General Public License along with Med - +
{% if id %}ID: {{id}}{% endif %}{% if id %}ID: {{id}}{% endif %} {% if pid %}PID: {{pid}}{% endif %}

Name: {{name}}

Age: {{age}}

Date of Birth: {{dob|date("MMMM DD, YYYY")}}

Sex: {{sex}}

{% if diagnosis %}Provisional Diagnosis: {{diagnosis}}{% endif %}
{{extra}}

{{certificate}}

@@ -68,7 +72,7 @@ You should have received a copy of the GNU General Public License along with Med diff --git a/src/App.vue b/src/App.vue index d0fe856..3e64da1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -19,7 +19,7 @@ You should have received a copy of the GNU General Public License along with Med
- +

@@ -81,7 +81,6 @@ You should have received a copy of the GNU General Public License along with Med this.showComponent.render=true; }, closeRender() { - console.log("close") this.showComponent.render=false; this.showComponent.edit=true; }, @@ -93,7 +92,7 @@ You should have received a copy of the GNU General Public License along with Med this.showComponent.home=false; this.showComponent.prescriber=true; }, - cancelPrescriber() { + closePrescriber() { this.showComponent.prescriber=false; this.showComponent.home=true; }, diff --git a/src/components/EditScreen.vue b/src/components/EditScreen.vue index 9770b9b..02262cb 100644 --- a/src/components/EditScreen.vue +++ b/src/components/EditScreen.vue @@ -22,6 +22,12 @@ You should have received a copy of the GNU General Public License along with Med +
+ +
+ +
+
@@ -29,6 +35,24 @@ You should have received a copy of the GNU General Public License along with Med
+
+
+ + +
+
+ + +
+
+
+
+ +
+ +
+
+
@@ -59,7 +83,7 @@ You should have received a copy of the GNU General Public License along with Med
- +
@@ -122,6 +146,13 @@ You should have received a copy of the GNU General Public License along with Med

+
+ +
+ +
+
+
@@ -174,6 +205,7 @@ You should have received a copy of the GNU General Public License along with Med data() { return { prescription: this.newData(), + ageDob: "age", attachment: [], selected: 0, template: "default" @@ -184,7 +216,9 @@ You should have received a copy of the GNU General Public License along with Med var prescription={ date: new Date(new Date() - new Date().getTimezoneOffset() * 60000).toISOString().split(".")[0], id: "", + pid: "", name: "", + dob: "", age: "", sex: "", address: "", @@ -199,26 +233,33 @@ You should have received a copy of the GNU General Public License along with Med 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) }); @@ -278,6 +319,11 @@ You should have received a copy of the GNU General Public License along with Med 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() diff --git a/src/components/PrescriberScreen.vue b/src/components/PrescriberScreen.vue index b70056c..f0be3bb 100644 --- a/src/components/PrescriberScreen.vue +++ b/src/components/PrescriberScreen.vue @@ -16,6 +16,12 @@ You should have received a copy of the GNU General Public License along with Med
+
+ +
+ +
+
@@ -47,6 +53,9 @@ You should have received a copy of the GNU General Public License along with Med
+
+ +
@@ -66,15 +75,19 @@ You should have received a copy of the GNU General Public License along with Med 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} } } } diff --git a/src/components/RenderScreen.vue b/src/components/RenderScreen.vue index 33cc27c..899a78b 100644 --- a/src/components/RenderScreen.vue +++ b/src/components/RenderScreen.vue @@ -25,8 +25,6 @@ You should have received a copy of the GNU General Public License along with Med }, methods: { render() { - console.log(this.prescription.prescriber); - console.log(this.template); fetch("template/"+this.template+".html") .then((response)=>response.text()) .then(function(response) {