diff --git a/clinic.egg-info/SOURCES.txt b/clinic.egg-info/SOURCES.txt index c09962f..ae6f6a2 100644 --- a/clinic.egg-info/SOURCES.txt +++ b/clinic.egg-info/SOURCES.txt @@ -1,3 +1,4 @@ +README setup.py clinic/__init__.py clinic.egg-info/PKG-INFO @@ -6,4 +7,9 @@ clinic.egg-info/dependency_links.txt clinic.egg-info/top_level.txt clinic/controllers/__init__.py clinic/models/__init__.py -clinic/models/clinic_patients.py \ No newline at end of file +clinic/models/clinic_doctor.py +clinic/models/clinic_hd_case.py +clinic/models/clinic_hd_case_line.py +clinic/models/clinic_nurse.py +clinic/models/clinic_patient.py +clinic/models/clinic_visit.py \ No newline at end of file diff --git a/clinic/actions/clinic_doctor.xml b/clinic/actions/clinic_doctor.xml index 1394a78..696afce 100644 --- a/clinic/actions/clinic_doctor.xml +++ b/clinic/actions/clinic_doctor.xml @@ -3,5 +3,6 @@ multi_view clinic.doctor [["All",[]],["Draft",[["state","=","draft"]]],["Active",[["state","=","active"]]],["Deactive",[["state","=","deactive"]]]] + list,page,form clinic_menu diff --git a/clinic/actions/clinic_hd_case.xml b/clinic/actions/clinic_hd_case.xml new file mode 100644 index 0000000..1097fdc --- /dev/null +++ b/clinic/actions/clinic_hd_case.xml @@ -0,0 +1,8 @@ + + HD Case + multi_view + clinic.hd.case + [["All",[]],["Draft",[["state","=","draft"]]],["Pending",[["state","=","pending"]]],["Confirm",[["state","=","corfirmed"]]]] + list,page,form + clinic_menu + diff --git a/clinic/actions/clinic_hd_case_line.xml b/clinic/actions/clinic_hd_case_line.xml new file mode 100644 index 0000000..e60f4f6 --- /dev/null +++ b/clinic/actions/clinic_hd_case_line.xml @@ -0,0 +1,7 @@ + + clinic_hd_case_line + Hd Case Detial + list + clinic.hd.case.line + clinic_menu + diff --git a/clinic/actions/clinic_nurse.xml b/clinic/actions/clinic_nurse.xml index d321c1b..8dd47cf 100644 --- a/clinic/actions/clinic_nurse.xml +++ b/clinic/actions/clinic_nurse.xml @@ -3,5 +3,6 @@ multi_view clinic.nurse [["All",[]],["Draft",[["state","=","draft"]]],["Active",[["state","=","active"]]],["Deactive",[["state","=","deactive"]]]] + list,page,form clinic_menu diff --git a/clinic/layouts/clinic_doctor_form.xml b/clinic/layouts/clinic_doctor_form.xml index 2aab969..fedde8b 100644 --- a/clinic/layouts/clinic_doctor_form.xml +++ b/clinic/layouts/clinic_doctor_form.xml @@ -19,6 +19,12 @@ + + + + + + diff --git a/clinic/layouts/clinic_hd_case_form.xml b/clinic/layouts/clinic_hd_case_form.xml new file mode 100644 index 0000000..5b698a1 --- /dev/null +++ b/clinic/layouts/clinic_hd_case_form.xml @@ -0,0 +1,26 @@ +
+ + + + + + + + + + + + + + + + + + + + + + + diff --git a/clinic/layouts/clinic_hd_case_list.xml b/clinic/layouts/clinic_hd_case_list.xml new file mode 100644 index 0000000..9a65cb9 --- /dev/null +++ b/clinic/layouts/clinic_hd_case_list.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/clinic/layouts/clinic_nurse_form.xml b/clinic/layouts/clinic_nurse_form.xml index a0c4491..89ce74b 100644 --- a/clinic/layouts/clinic_nurse_form.xml +++ b/clinic/layouts/clinic_nurse_form.xml @@ -20,6 +20,12 @@ + + + + + + diff --git a/clinic/layouts/clinic_patient_form.xml b/clinic/layouts/clinic_patient_form.xml index df30526..2591afe 100644 --- a/clinic/layouts/clinic_patient_form.xml +++ b/clinic/layouts/clinic_patient_form.xml @@ -65,6 +65,9 @@ + + + diff --git a/clinic/models/__init__.py b/clinic/models/__init__.py index affba20..d135f53 100644 --- a/clinic/models/__init__.py +++ b/clinic/models/__init__.py @@ -2,3 +2,5 @@ from . import clinic_patient from . import clinic_doctor from . import clinic_nurse from . import clinic_visit +from . import clinic_hd_case +from . import clinic_hd_case_line diff --git a/clinic/models/__pycache__/__init__.cpython-32.pyc b/clinic/models/__pycache__/__init__.cpython-32.pyc index 4aadd5b..6ee129d 100644 Binary files a/clinic/models/__pycache__/__init__.cpython-32.pyc and b/clinic/models/__pycache__/__init__.cpython-32.pyc differ diff --git a/clinic/models/__pycache__/clinic_doctor.cpython-32.pyc b/clinic/models/__pycache__/clinic_doctor.cpython-32.pyc index 71d3587..0e2e4cc 100644 Binary files a/clinic/models/__pycache__/clinic_doctor.cpython-32.pyc and b/clinic/models/__pycache__/clinic_doctor.cpython-32.pyc differ diff --git a/clinic/models/__pycache__/clinic_nurse.cpython-32.pyc b/clinic/models/__pycache__/clinic_nurse.cpython-32.pyc index b94fc05..3d59319 100644 Binary files a/clinic/models/__pycache__/clinic_nurse.cpython-32.pyc and b/clinic/models/__pycache__/clinic_nurse.cpython-32.pyc differ diff --git a/clinic/models/__pycache__/clinic_patient.cpython-32.pyc b/clinic/models/__pycache__/clinic_patient.cpython-32.pyc index 6e6bc30..da7b23a 100644 Binary files a/clinic/models/__pycache__/clinic_patient.cpython-32.pyc and b/clinic/models/__pycache__/clinic_patient.cpython-32.pyc differ diff --git a/clinic/models/__pycache__/clinic_visit.cpython-32.pyc b/clinic/models/__pycache__/clinic_visit.cpython-32.pyc index ef35f80..80a1348 100644 Binary files a/clinic/models/__pycache__/clinic_visit.cpython-32.pyc and b/clinic/models/__pycache__/clinic_visit.cpython-32.pyc differ diff --git a/clinic/models/clinic_doctor.py b/clinic/models/clinic_doctor.py index fca0ddb..fbd46f7 100644 --- a/clinic/models/clinic_doctor.py +++ b/clinic/models/clinic_doctor.py @@ -22,6 +22,8 @@ class Doctor(Model): "addresses": fields.One2Many("address","related_id","Addresses"), "comments": fields.One2Many("message","related_id","Comments"), "patients": fields.Many2Many("clinic.patient","Patients"), + "visits": fields.One2Many("clinic.visit","doctor_id","Visits"), + "hd_cases": fields.One2Many("clinic.hd.case","doctor_id","HD Cases"), "company_id": fields.Many2One("company","Company"), } diff --git a/clinic/models/clinic_hd_case.py b/clinic/models/clinic_hd_case.py new file mode 100644 index 0000000..3d2567f --- /dev/null +++ b/clinic/models/clinic_hd_case.py @@ -0,0 +1,52 @@ +from netforce.model import Model, fields, get_model +from netforce.utils import get_data_path +import time +from netforce.access import get_active_user +from netforce.access import get_active_company + +class Hdcase(Model): + _name="clinic.hd.case" + _string="HD Case Treatment" + _audit_log=True + _name_field="number" + _multi_company=True + _fields={ + "number": fields.Char("Number",required=True,search=True), + "patient_id": fields.Many2One("clinic.patient","Patients",required=True,search=True), + "doctor_id": fields.Many2One("clinic.doctor","Doctor",search=True), + "nurse_id": fields.Many2One("clinic.nurse","Nurse",search=True), + "date": fields.Date("Create Date",required=True,search=True), + "department": fields.Char("Department",required=True,search=True), + "state": fields.Selection([("draft","Draft"),("pending","Pending"),("confirmed","Confirmed"),("canceled","Canceled")],"Status",required=True), + "lines": fields.One2Many("clinic.hd.case.line","hd_case_id","Details"), + "comments": fields.One2Many("message","related_id","Comments"), + "company_id": fields.Many2One("company","Company"), + } + + def _get_number(self,context={}): + while 1: + num=get_model("sequence").get_number("sale_order") + if not num: + return None + res=self.search([["number","=",num]]) + if not res: + return num + get_model("sequence").increment("sale_order") + + + _defaults={ + "state": "draft", + "date": lambda *a: time.strftime("%Y-%m-%d"), + "number": _get_number, + "company_id": lambda *a: get_active_company(), + } + _order="date desc,number desc" + + + + def void(self,ids,context={}): + obj=self.browse(ids)[0] + obj.write({"state":"voided"}) + + +Hdcase.register() diff --git a/clinic/models/clinic_hd_case_line.py b/clinic/models/clinic_hd_case_line.py new file mode 100644 index 0000000..695a70d --- /dev/null +++ b/clinic/models/clinic_hd_case_line.py @@ -0,0 +1,17 @@ +from netforce.model import Model, fields, get_model +from netforce.utils import get_data_path +import time +from netforce.access import get_active_user +from netforce.access import get_active_company + +class Hdcaseline(Model): + _name="clinic.hd.case.line" + _fields={ + "hd_case_id": fields.Many2One("clinic.hd.case","HdCase",required=True,on_delete="cascade"), + "description": fields.Char("description",required=True,search=True), + "dialzer_id": fields.Many2One("product","Dialzer",search=True), + "qty":fields.Integer("QTY"), + "dz_state":fields.Selection([("active","Active"),("drop","Drop")],"Status DZ",required=True), + } +Hdcaseline.register() + diff --git a/clinic/models/clinic_nurse.py b/clinic/models/clinic_nurse.py index 99a836e..4270fc2 100644 --- a/clinic/models/clinic_nurse.py +++ b/clinic/models/clinic_nurse.py @@ -22,6 +22,8 @@ class Nurse(Model): "addresses": fields.One2Many("address","related_id","Addresses"), "comments": fields.One2Many("message","related_id","Comments"), "patients": fields.Many2Many("clinic.patient","Patients"), + "visits": fields.One2Many("clinic.visit","nurse_id","Visits"), + "hd_cases": fields.One2Many("clinic.hd.case","nurse_id","HD cases"), "company_id": fields.Many2One("company","Company"), } diff --git a/clinic/models/clinic_patient.py b/clinic/models/clinic_patient.py index 52e6915..6ea37a7 100644 --- a/clinic/models/clinic_patient.py +++ b/clinic/models/clinic_patient.py @@ -67,17 +67,18 @@ class Patient(Model): "doctorsss": fields.Many2Many("clinic.doctor","Doctors"), "nurses": fields.Many2Many("clinic.nurse","Nurses"), "visits": fields.One2Many("clinic.visit","patient_id","Visits"), + "hd_cases": fields.One2Many("clinic.hd.case","patient_id","HD Cases"), } def _get_number(self,context={}): while 1: - num=get_model("sequence").get_number("sale_order") + num=get_model("sequence").get_number("clinic_patient") if not num: return None res=self.search([["number","=",num]]) if not res: return num - get_model("sequence").increment("sale_order") + get_model("sequence").increment("clinic_patient") _defaults={