]> Softwares of Agnibho - medscript.git/commitdiff
Multiple diagnosis
authorAgnibho Mondal <mondal@agnibho.com>
Wed, 6 Sep 2023 15:28:47 +0000 (20:58 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Wed, 6 Sep 2023 15:28:47 +0000 (20:58 +0530)
README
data/template/default/index.html
renderer.py
resource/help.html

diff --git a/README b/README
index a66e1a8c27ab65ae07e615243ef230a8917dc9f3..12f4c369c1ba071cb24e9a241ad889fffbcef717 100644 (file)
--- a/README
+++ b/README
@@ -47,7 +47,8 @@ There are eight tabs in the tab bar containing important parts of a
 prescription.
 
 1. Patient tab: It contains the demographical data of the patient, diagnosis
-and a few extra parameters of the prescription.
+and a few extra parameters of the prescription. The diagnosis can be entered
+here. To enter multiple diagnosis semicolon (;) may be used to separate them.
 
 2. Clinical tab: It contains the clinical note regarding the patient. The
 presets can be selected from the preset box at the top and inserted into the
index 8dafdc48321a96aaf58fa91b7827eaae9f33e4f3..703a21220f645194af4de05107785df1e528a021 100644 (file)
                   </tr>
                   <tr>
                     <td class="rbordered">
-                      {% if diagnosis %}<p class="formatted"><strong>{{diagnosis}}</strong></p>{% endif %}
+                      {% if diagnosis %}
+                      {% if diagnosis_list|length > 1 %}
+                      <ul>
+                        {% for diag in diagnosis_list %}<li><strong>{{diag}}</strong></li>{% endfor %}
+                      </ul>
+                      {% else %}
+                      <p><strong>{{diagnosis}}</strong></p>
+                      {% endif %}
+                      {% endif %}
                       {% if note %}<p class="formatted">{{note}}</p>{% endif %}
                       {% if report %}<p class="formatted">{{report}}</p>{% endif %}
                     </td>
index 6f18e38d34a3d755443330075e77e06247788ce5..43cc27af2780aec85c56ce30ca4e52a20f3688de 100644 (file)
@@ -22,7 +22,7 @@ class Renderer:
         with open(source, "r") as source_file, open(target, "w") as target_file:
             with open(template) as template_file:
                 template_data = Template(template_file.read())
-                data=self.process_medication(json.loads(source_file.read()))
+                data=self.process_medication(self.process_diagnosis(json.loads(source_file.read())))
                 try:
                     data["date"]=datetime.datetime.strptime(data["date"], "%Y-%m-%d %H:%M:%S")
                 except Exception as e:
@@ -31,6 +31,13 @@ class Renderer:
                 target_file.write(output)
         return(target)
 
+    def process_diagnosis(self, data):
+        diagnosis_list=[]
+        for d in data["diagnosis"].split(";"):
+            diagnosis_list.append(d.strip())
+        data["diagnosis_list"]=diagnosis_list
+        return data
+
     def process_medication(self, data):
         medication_list=[]
         pattern=re.compile(r".*?\[(.*)\].*")
index c124bfe7fea4dcfaa452ec8c4f0317b9b3dbeed5..f60e6592177e07165f3579dc9f891f2f043374fb 100644 (file)
@@ -27,7 +27,7 @@
     <p>A new prescription can be created right from the starting window.  Alternatively the "New" menu option can be used to create a new prescription.</p>
     <p>There are eight tabs in the tab bar containing important parts of a prescription.</p>
     <ol>
-      <li><strong>Patient tab:</strong> It contains the demographical data of the patient, diagnosis and a few extra parameters of the prescription.</li>
+      <li><strong>Patient tab:</strong> It contains the demographical data of the patient, diagnosis and a few extra parameters of the prescription. The diagnosis can be entered here. To enter multiple diagnosis semicolon (;) may be used to separate them.</li>
       <li><strong>Clinical tab:</strong> It contains the clinical note regarding the patient. The presets can be selected from the preset box at the top and inserted into the note by clicking the insert button.</li>
       <li><strong>Report tab:</strong> It contains the reports shown by the patient. It also has the preset option.</li>
       <li><strong>Advice tab:</strong> It contains the primary advices given to the patient. It is usually printed at the top of the advice section of the prescription.It also has the preset option.</li>