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 = ""
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")
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 ""
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)
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,
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(),
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?"))
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)