]> Softwares of Agnibho - medscript.git/commitdiff
Added patient ID
authorAgnibho Mondal <mondal@agnibho.com>
Wed, 8 Nov 2023 12:25:56 +0000 (17:55 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Wed, 8 Nov 2023 12:25:56 +0000 (17:55 +0530)
prescription.py
window.py

index c7a7dca0512784fd63e60b38e1bf70f7be19f75e..493e8d766537116fd01819cc26ff0bdf6bd3733b 100644 (file)
@@ -56,16 +56,17 @@ class Prescription:
 
     file=""
 
-    def __init__(self, date="", id="", name="", dob="", age="", sex="", address="", contact="", extra="", mode="", daw="", diagnosis="", note="", report="", advice="", investigation="", medication="", additional="", certificate="", custom=None, properties=None, prescriber=None):
+    def __init__(self, date="", id="", pid="", name="", dob="", age="", sex="", address="", contact="", extra="", mode="", daw="", diagnosis="", note="", report="", advice="", investigation="", medication="", additional="", certificate="", custom=None, properties=None, prescriber=None):
         self.set_data(date, name, dob, age, sex, address, contact, extra, mode, daw, diagnosis, note, report, advice, investigation, medication, additional, certificate, custom, properties)
         if prescriber is None:
             self.prescriber = Prescriber()
         else:
             self.prescriber = prescriber
 
-    def set_data(self, date="", id="", name="", dob="", age="", sex="", address="", contact="", extra="", mode="", daw="", diagnosis="", note="", report="", advice="", investigation="", medication="", additional="", certificate="", custom=None, properties=None):
+    def set_data(self, date="", id="", pid="", name="", dob="", age="", sex="", address="", contact="", extra="", mode="", daw="", diagnosis="", note="", report="", advice="", investigation="", medication="", additional="", certificate="", custom=None, properties=None):
         self.date = date
         self.id = id
+        self.pid = pid
         self.name = name
         if(age):
             self.dob = ""
@@ -95,6 +96,7 @@ class Prescription:
             self.prescriber.set_data_from_json(data.get("prescriber"))
             self.date = data.get("date")
             self.id = data.get("id")
+            self.id = data.get("pid")
             self.name = data.get("name")
             self.dob = data.get("dob")
             self.age = data.get("age")
index 2ebc2a152b3b3a3648a21f1dacf988c83824b71f..ca80b94556cc38a932e47b4b05e5f4e9e54ed664 100644 (file)
--- a/window.py
+++ b/window.py
@@ -330,7 +330,7 @@ class MainWindow(QMainWindow):
             if config["preset_newline"]:
                 self.input_certificate.insertPlainText("\n")
 
-    def load_interface(self, file="", date=None, id="", name="", dob="", age="", sex="", address="", contact="", extra="", mode="", daw="", diagnosis="", note="", report="", advice="", investigation="", medication="", additional="", certificate="", custom=None):
+    def load_interface(self, file="", date=None, id="", pid="", name="", dob="", age="", sex="", address="", contact="", extra="", mode="", daw="", diagnosis="", note="", report="", advice="", investigation="", medication="", additional="", certificate="", custom=None):
         try:
             file_msg=self.current_file.file if self.current_file.file else "New file"
             sign_msg="(signed)" if config["smime"] and self.current_file.is_signed() else ""
@@ -346,6 +346,7 @@ class MainWindow(QMainWindow):
                     logging.warning(e)
             self.input_date.setDateTime(d)
             self.input_id.setText(id)
+            self.input_pid.setText(pid)
             self.input_name.setText(name)
             try:
                 pdate=dateutil.parser.parse(dob)
@@ -389,6 +390,7 @@ class MainWindow(QMainWindow):
                 file=self.prescription.file,
                 date=self.prescription.date,
                 id=self.prescription.id,
+                pid=self.prescription.pid,
                 name=self.prescription.name,
                 dob=self.prescription.dob,
                 age=self.prescription.age,
@@ -414,6 +416,7 @@ class MainWindow(QMainWindow):
             self.prescription.set_data(
                     date=self.input_date.dateTime().toString("yyyy-MM-dd hh:mm:ss"),
                     id=self.input_id.text(),
+                    pid=self.input_pid.text(),
                     name=self.input_name.text(),
                     dob=self.input_dob.text(),
                     age=self.input_age.text(),
@@ -495,7 +498,6 @@ class MainWindow(QMainWindow):
             self.input_age.setText("")
             self.input_age.setEnabled(False)
 
-
     def confirm_close(self):
         self.refresh()
         flag=(self.save_state==md5(self.prescription.get_json().encode()).hexdigest() or QMessageBox.StandardButton.Yes==QMessageBox.question(self,"Confirm action", "Unsaved changes may be lost. Continue?"))
@@ -662,7 +664,9 @@ class MainWindow(QMainWindow):
         self.input_date.setCalendarWidget(QCalendarWidget())
         layout_info.addRow("Date", self.input_date)
         self.input_id=QLineEdit(self)
-        layout_info.addRow("ID", self.input_id)
+        layout_info.addRow("Prescription ID", self.input_id)
+        self.input_pid=QLineEdit(self)
+        layout_info.addRow("Patient ID", self.input_pid)
         self.input_name=QLineEdit(self)
         layout_info.addRow("Name", self.input_name)