]> Softwares of Agnibho - medscript.git/commitdiff
Updated README
authorAgnibho Mondal <mondal@agnibho.com>
Sun, 17 Sep 2023 16:51:32 +0000 (22:21 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Sun, 17 Sep 2023 16:51:32 +0000 (22:21 +0530)
README
filehandler.py
resource/about.html [deleted file]
resource/help.html [deleted file]
viewbox.py
window.py

diff --git a/README b/README
index 12f4c369c1ba071cb24e9a241ad889fffbcef717..eaf0337c9139043e81437650fe1bd100205dd63e 100644 (file)
--- a/README
+++ b/README
@@ -14,18 +14,34 @@ File
 ----
 
 The program uses a custom file format .mpaz (Medical Prescription Archive -
-Zipped). It is a zip file in a specific format. The file can be shared,
-however, no mechanism of ensuring authenticity of a shared file is currently
-in place.
+Zipped). It is a zip file in a specific format which includes:
+
+1. A meta.json file containing file type and mpaz version.
+2. A prescription.zip file containing the actual prescription.
+3. An attachment folder containing attached files.
+4. A template folder containing the bundled prescription template.
+
+Optionally the mpaz archive may also include an S/MIME signature and
+certificate for authentication.
 
 Install
 -------
 
 MedScript can be used by simply downloading it from the repository and running
-it with the Python interpreter. The necessary python libraries need to
+it with the Python interpreter. The necessary python libraries need to
 be installed. Alternatively the release versions can be
 downloaded and used directly.
 
+The required Python libraries are as follows:
+
+1. PyQt6
+2. PyQt6_sip
+3. python_dateutil
+4. Jinja2
+5. lxml
+6. Markdown
+7. M2Crypto (optional)
+
 Usage
 -----
 
@@ -109,6 +125,19 @@ be used to switch between available templates.
 Note that the templates are packaged with the .mpaz file which can be used for
 rendering. However, modifying/saving the file overwrites it.
 
+### Markdown
+
+This program supports markdown formatting. Markdown can be used to format the
+prescriptions and certificates. It can be turned on from the
+configuration dialog under the settings menu.
+
+### Medical Certificate
+
+The Certify/Extra area can be used to write a medical prescription. Preset
+system is available for this as well. Certification requires different
+templates designed for it. A template named medcert is included with the
+program.
+
 Prescriber
 ----------
 
@@ -123,6 +152,11 @@ to load in the program, e.g. `<program> --prescriber <prescriber file>`.
 The data of the currently selected prescriber can be edited using the
 "Prescriber" option under the "Prepare" menu.
 
+If multiple prescribers have been configured (e.g. by copying the prescriber
+file and editing them individually), the prescribers can easily by switched by
+using the switch option in the settings menu and selecting the desired
+prescriber file.
+
 Preset
 ------
 
@@ -132,12 +166,13 @@ the respective files. These files are in the .csv format and can be edited
 with any spreadsheet editing software.
 
 The preset files are kept in the preset directory. The files associated with
-clinical note, report, advice, investigation, medication and additional are
-note.csv, report.csv, advice.csv, investigation.csv, medication.csv and
-additional.csv. Each file contains a top row indicating the variables in the
-columns. The data is entered in two columns with each row containing a KEY and
-a TEXT. The TEXT can be entered in to the edit area by selecting the KEY from
-the preset input.
+medical certificate, clinical note, report, advice, investigation, medication
+and additional are certify.csv, note.csv, report.csv, advice.csv,
+investigation.csv, medication.csv and additional.csv. Each file contains a top
+row indicating the variables in the columns. The data is entered in two
+columns with each row containing a KEY and a TEXT. The TEXT can be entered in
+to the edit area by selecting the KEY from the preset input. Blank files with
+only the top row are included with the program.
 
 Configuration
 -------------
@@ -153,6 +188,28 @@ However, a different config file may be provided by using the
 It is recommended to use the default config file as base while creating
 another customized config file.
 
+A graphical configuration editor is also included with the program. The
+options are as follows:
+
+1. Data directory: where the user data of the program is stored.
+
+2. Prescriber: the default prescriber which is loaded when the program
+starts.
+
+3. Preset newline: whether a newline / line break to be inserted after a preset
+is inserted.
+
+4. Preset delimiter: CSV files may have different delimiters. By default
+this program uses "," as delimiter, however this can be changed to ";" from
+here.
+
+5. Markdown: The markdown formatting can be enabled from here.
+
+6. S/MIME: This is an experimental feature and is not available on every
+platform. If it is available, it can be turned on from here. The Private
+key, X509 certificate and Root bundle can be selected from the options
+that follows this.
+
 License
 -------
 
@@ -176,5 +233,7 @@ Contact
 -------
 
 Dr. Agnibho Mondal
+
 mondal@agnibho.com
+
 www.agnibho.com
index 63d6b03d763a09221a9e42d46f68b4d6d7b4dc47..fcc7b062e6ce0b1652f86d71a475fec8ae03dd86 100644 (file)
@@ -12,7 +12,7 @@ from signature import Signature
 
 class FileHandler():
 
-    meta={"type":"MedScript", "version":"0.1"}
+    meta={"type":"MedScript", "version":"0.2"}
 
     file=""
     directory=""
diff --git a/resource/about.html b/resource/about.html
deleted file mode 100644 (file)
index 583d169..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <head>
-    <title>About</title>
-<style>
-h1, h4, h5, p {
-  text-align: center;
-}
-</style>
-  </head>
-  <body>
-    <h1>MedScript</h1>
-    <h4>Version 0.2</h4>
-    <p>MedScript is a medical prescription writing software.</p>
-    <h4>Copyright &copy; <span id="copyright"></span> Dr. Agnibho Mondal</h4>
-    <h5><a href="www.agnibho.com">www.agnibho.com</a></h5>
-    <p>MedScript is free software:<br>
-    you can redistribute it and/or modify it<br>
-    under the terms of the GNU General Public License<br>
-    as published by the Free Software Foundation,<br>
-    either version 3 of the License, or (at your option) any later version.</p>
-  </body>
-  <script>
-    (function(){
-      start=2023
-      end=new Date().getFullYear()
-      if(start == end){
-        txt=start;
-      }
-      else{
-        txt=start+"-"+end
-      }
-      document.getElementById("copyright").textContent=txt;
-    })()
-  </script>
-</html>
diff --git a/resource/help.html b/resource/help.html
deleted file mode 100644 (file)
index f60e659..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <head>
-    <title>Help</title>
-  </head>
-  <body>
-    <h1>MedScript</h1>
-
-    <p>MedScript is a medical prescription writing software. It is primarily for medical practitioners for writing prescriptions.</p>
-    <p>The purpose of the program is to enable medical practitioners to prepare computerized prescriptions. The program has been designed after the commonly used prescription format among the medical practitioners in India. Inclusion of prescription style of other regions will hopefully be implemented in future updates.</p>
-
-    <h2>File</h2>
-
-    <p>The program uses a custom file format .mpaz (Medical Prescription Archive - Zipped). It is a zip file in a specific format. The file can be shared, however, no mechanism of ensuring authenticity of a shared file is currently in place.</p>
-
-    <h2>Install</h2>
-
-    <p>MedScript can be used by simply downloading it from the repository and running it with the Python interpreter. The necessary python libraries need to be installed. Alternatively the release versions can be downloaded and used directly.</p>
-
-    <h2>Usage</h2>
-
-    <p>The common functionalities of the program can be used within the graphical interface. Editing of some configuration files are needed only for the advanced features such as custom presets.</p>
-    <p>When starting the program, the main window of is shown.The menu bar at the top can be used to access most of the functions. The toolbar below it contains the most commonly used functions for quick access.</p>
-
-    <h3>Creating a prescription</h3>
-
-    <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. 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>
-      <li><strong>Investigation tab:</strong> It contains the investigations suggested to the patient. It also has the preset option.</li>
-      <li><strong>Medication tab:</strong> It contains the medications advised to the patient. It has the preset option. It can contain both the generic and brand name of a medicine. To insert a alternative name (generic/brand) write it on the same line and surround it with square brackets i.e []. It also has the preset option.</li>
-      <li><strong>Additional tab:</strong> It contains additional advice given to the patient. It is commonly printed at the bottom of the prescription.</li>
-      <li><strong>Attachment tab:</strong> Files e.g. PDF, images may be attached to the prescription file from the attachment tab. These attachments can be viewed later when opening the prescription file with the program. However, this attachments are not printed with the prescription.</li>
-    </ol>
-
-    <h3>Saving a prescription</h3>
-
-    <p>The "Save" or the "Save As" option from the "File" menu can be used to save a file created or edited in the program.</p>
-
-    <h3>Opening a prescription</h3>
-
-    <p>The prescriptions are saved in .mpaz files and can be shared easily. To open a prescription file, the "Open" option from the file menu can be used.  Alternatively the file name can be supplied to the program as command line argument when starting from the command line.</p>
-
-    <h3>Rendering a prescription</h3>
-
-    <p>The prescriptions can be rendered and subsequently printed from the "Prepare" menu by selecting the "Render" option. Note that the files must be saved before rendering. The rendered prescription is opened in a separate window. It can be saved as PDF or it can be opened in the system browser and printed from there.</p>
-
-    <h3>Template</h3>
-
-    <p>The program uses jinja2 template for rendering the prescription. A default template is provided with the program. However, other templates (see default template for reference) can be created and placed in the template folder to be used for rendering the prescriptions. The drop down option in the toolbar can be used to switch between available templates.</p>
-    <p>Note that the templates are packaged with the .mpaz file which can be used for rendering. However, modifying/saving the file overwrites it.</p>
-
-    <h3>Prescriber</h3>
-
-    <p>The program is primarily targeted towards individual practitioners. However, it can be easily adapted for multiple practitioners.</p>
-    <p>The data of the practitioner is stored in json files in the prescriber directory. The default file to be loaded is configured in the config file. A command line option can be used to specify which alternative prescriber file to load in the program, e.g. <em>&lt;program&gt; --prescriber &lt;prescriber file&gt;</em>.</p>
-    <p>The data of the currently selected prescriber can be edited using the "Prescriber" option under the "Prepare" menu.</p>
-
-    <h2>Preset</h2>
-
-    <p>The program uses a preset system to insert repeatedly used text without the need to type them. To use this feature the text must be entered beforehand to the respective files. These files are in the .csv format and can be edited with any spreadsheet editing software.</p>
-    <p>The preset files are kept in the preset directory. The files associated with clinical note, report, advice, investigation, medication and additional are note.csv, report.csv, advice.csv, investigation.csv, medication.csv and additional.csv. Each file contains a top row indicating the variables in the columns. The data is entered in two columns with each row containing a KEY and a TEXT. The TEXT can be entered in to the edit area by selecting the KEY from the preset input.</p>
-
-    <h2>Configuration</h2>
-
-    <p>The default configuration file contains sane defaults and the program can be used without editing it. However, the json formatted configuration file can be edited to further tune the program to the users preference.</p>
-    <p>The default configuration is the config.json located in the config directory.  However, a different config file may be provided by using the <em>&lt;program&gt; --config &lt;config file&gt;</em> command line argument.</p>
-    <p>It is recommended to use the default config file as base while creating another customized config file.</p>
-
-    <h2>License</h2>
-    <p><strong>MedScript</strong></p>
-    <p>Copyright &copy; 2023 Dr. Agnibho Mondal</p>
-    <p>MedScript is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p>
-    <p>MedScript is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>
-    <p>You should have received a copy of the GNU General Public License along with MedScript. If not, see <a href="https://www.gnu.org/licenses/">&lt;https://www.gnu.org/licenses/&gt;</a>.</p>
-
-    <h3>Contact</h3>
-    <p>Dr. Agnibho Mondal</p>
-    <p>mondal@agnibho.com</p>
-    <p>www.agnibho.com</p>
-  </body>
-</html>
index 6aaa2ed54209c5f3ddc2a7ac55b14ba68e774c65..2a0e893f23898a590674576feb9e9effb9cb5ad9 100644 (file)
@@ -10,6 +10,7 @@ from PyQt6.QtWidgets import QMainWindow
 from PyQt6.QtWebEngineWidgets import QWebEngineView
 from PyQt6.QtCore import QUrl
 from PyQt6.QtGui import QIcon
+from markdown import markdown
 
 class ViewBox(QMainWindow):
     def __init__(self, *args, **kwargs):
@@ -26,3 +27,8 @@ class ViewBox(QMainWindow):
 
     def open(self, file):
         self.webview.load(QUrl("file:///"+os.path.abspath(file).replace(os.sep, "/")))
+
+    def md(self, file):
+        with open(file) as f:
+            html=markdown(f.read())
+            self.webview.setHtml(html)
index 78091eaea7b4e84dd2926c32f5b4eccceab54b05..05c9710105e95198b1f736b180d7980a07bf8f0d 100644 (file)
--- a/window.py
+++ b/window.py
@@ -181,11 +181,20 @@ class MainWindow(QMainWindow):
             print(e)
 
     def cmd_about(self):
-        self.viewbox.open(os.path.join(config["resource"], "about.html"))
-        self.viewbox.show()
+        year=datetime.datetime.now().year
+        if(year>2023):
+            copy="2023"+"-"+str(year)
+        else:
+            copy="2023"
+        txt="<h1>MedScript</h1>"
+        txt=txt+"<p>Version 0.2</p>"
+        txt=txt+"<p>The Prescription Writing Software</p>"
+        txt=txt+"<p><a href='https://code.agnibho.com/medscript/'>Website</a></p>"
+        txt=txt+"<p>Copyright © "+copy+" Dr. Agnibho Mondal</p>"
+        QMessageBox.about(self,"MedScript", txt)
 
     def cmd_help(self):
-        self.viewbox.open(os.path.join(config["resource"], "help.html"))
+        self.viewbox.md("README")
         self.viewbox.show()
 
     def insert_preset_extra(self):