From: Agnibho Mondal Date: Wed, 8 Nov 2023 12:25:56 +0000 (+0530) Subject: Added patient ID X-Git-Tag: v0.5~47 X-Git-Url: https://code.agnibho.com/repo?a=commitdiff_plain;h=38f7c045b8efc81be38a28a7ad716b77256cfb27;p=medscript.git Added patient ID --- diff --git a/prescription.py b/prescription.py index c7a7dca..493e8d7 100644 --- a/prescription.py +++ b/prescription.py @@ -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") diff --git a/window.py b/window.py index 2ebc2a1..ca80b94 100644 --- 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)