diff --git a/netforce_clinic/layouts/clinic_doctor_form.xml b/netforce_clinic/layouts/clinic_doctor_form.xml
deleted file mode 100644
index 22b2bc9..0000000
--- a/netforce_clinic/layouts/clinic_doctor_form.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
diff --git a/netforce_clinic/layouts/clinic_doctor_list.xml b/netforce_clinic/layouts/clinic_doctor_list.xml
deleted file mode 100644
index be1e6d2..0000000
--- a/netforce_clinic/layouts/clinic_doctor_list.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/netforce_clinic/layouts/clinic_hd_case_list.xml b/netforce_clinic/layouts/clinic_hd_case_list.xml
index a91d6ad..5c38410 100644
--- a/netforce_clinic/layouts/clinic_hd_case_list.xml
+++ b/netforce_clinic/layouts/clinic_hd_case_list.xml
@@ -5,5 +5,6 @@
+
diff --git a/netforce_clinic/layouts/clinic_nurse_form.xml b/netforce_clinic/layouts/clinic_nurse_form.xml
deleted file mode 100644
index 555b668..0000000
--- a/netforce_clinic/layouts/clinic_nurse_form.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-
diff --git a/netforce_clinic/layouts/clinic_nurse_list.xml b/netforce_clinic/layouts/clinic_nurse_list.xml
deleted file mode 100644
index ad94d58..0000000
--- a/netforce_clinic/layouts/clinic_nurse_list.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/netforce_clinic/models/__init__.py b/netforce_clinic/models/__init__.py
index 269f6e9..cc3d146 100644
--- a/netforce_clinic/models/__init__.py
+++ b/netforce_clinic/models/__init__.py
@@ -1,12 +1,11 @@
+from . import setting
from . import cause_chronic
from . import comorbidity
from . import department
-from . import doctor
from . import education
from . import graduation
from . import morbidity
from . import nation
-from . import nurse
from . import address
from . import patient
from . import patient_categ
@@ -14,10 +13,7 @@ from . import patient_cause_line
from . import patient_comorbidity_line
from . import patient_morbidity_line
from . import race
-from . import setting
from . import visit
-from . import visit_line
-from . import visit_plan
from . import hd_case
from . import hd_case_line
from . import hd_case_personal
diff --git a/netforce_clinic/models/doctor.py b/netforce_clinic/models/doctor.py
deleted file mode 100644
index e8663e6..0000000
--- a/netforce_clinic/models/doctor.py
+++ /dev/null
@@ -1,80 +0,0 @@
-import time
-
-from netforce.model import Model, fields, get_model
-from netforce.access import get_active_company, get_active_user, set_active_user
-
-class Doctor(Model):
- _name="clinic.doctor"
- _string="Doctor"
- _audit_log=True
- _multi_company=True
-
- def _get_age(self,ids,context):
- res={}
- year_now=int(time.strftime("%Y"))
- for obj in self.browse(ids):
- age=0
- if obj.birthday:
- year_bd=int(obj.birthday[0:4])
- age=year_now-year_bd
- res[obj.id]=age
- return res
-
- _fields={
- "number": fields.Char("Doctor No.",required=True,search=True),
- "name": fields.Char("Name",required=True,search=True),
- "identification" : fields.Char("Identification"),
- "expiry_card" : fields.Date("Card Expiry"),
- "birthday": fields.Date("Birthday",search=True),
- "age": fields.Integer("Age", function="_get_age"),
- "type": fields.Selection([["temporary","Temporary"],["permanent","Permanent"]],"Type"),
- "mobile": fields.Char("Mobile",required=False,search=True),
- "phone": fields.Char("Phone",search=True),
- 'email': fields.Char("Email"),
- "prof_license" : fields.Char("License."),
- "prof_license_date" : fields.Date("License Date"),
- "birthday": fields.Date("BirthDay",search=True),
- "department_id": fields.Many2One("clinic.department", "Department",search=True),
- "patients": fields.Many2Many("clinic.patient","Patients"),
- "addresses": fields.One2Many("address","related_id","Addresses"),
- "comments": fields.One2Many("message","related_id","Comments"),
- "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"),
- "user_id": fields.Many2One("base.user","User"),
- 'picture': fields.File("Picture"),
- 'note': fields.Text("Note"),
- 'categ_id': fields.Many2One("clinic.personal.categ", "Doctor Category", domain=[['type','=','doctor']]),
- 'active': fields.Boolean("Active"),
- }
-
-
- def _get_number(self,context={}):
- while 1:
- seq_id=get_model("sequence").find_sequence(name="Clinic Doctor")
- num=get_model("sequence").get_next_number(seq_id,context=context)
- if not num:
- return None
- user_id=get_active_user()
- set_active_user(1)
- res=self.search([["number","=",num]])
- set_active_user(user_id)
- if not res:
- return num
- get_model("sequence").increment_number(seq_id,context=context)
-
-
- _defaults={
- "type": "temporary",
- "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"})
-
-Doctor.register()
diff --git a/netforce_clinic/models/nurse.py b/netforce_clinic/models/nurse.py
deleted file mode 100644
index def9c37..0000000
--- a/netforce_clinic/models/nurse.py
+++ /dev/null
@@ -1,74 +0,0 @@
-import time
-
-from netforce.model import Model, fields, get_model
-from netforce.access import get_active_company, get_active_user, set_active_user
-
-class Nurse(Model):
- _name="clinic.nurse"
- _string="Nurse"
- _audit_log=True
- _multi_company=True
-
- def _get_age(self,ids,context):
- res={}
- year_now=int(time.strftime("%Y"))
- for obj in self.browse(ids):
- age=0
- if obj.birthday:
- year_bd=int(obj.birthday[0:4])
- age=year_now-year_bd
- res[obj.id]=age
- return res
-
- _fields={
- "number": fields.Char("Nurse No.",required=True,search=True),
- "name": fields.Char("Name",required=True,search=True),
- "identification" : fields.Char("Identification"),
- "expiry_card" : fields.Date("Card Expiry"),
- "birthday": fields.Date("Birthday",search=True),
- "age": fields.Integer("Age", function="_get_age"),
- "type": fields.Selection([["temporary","Temporary"],["permanent","Permanent"]],"Type"),
- "mobile": fields.Char("Mobile",required=False,search=True),
- "phone": fields.Char("Phone",search=True),
- 'email': fields.Char("Email"),
- "prof_license" : fields.Char("License."),
- "prof_license_date" : fields.Date("License Date"),
- "birthday": fields.Date("BirthDay",search=True),
- "department_id": fields.Many2One("clinic.department", "Department",search=True),
- "patients": fields.Many2Many("clinic.patient","Patients"),
- "addresses": fields.One2Many("address","related_id","Addresses"),
- "comments": fields.One2Many("message","related_id","Comments"),
- "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"),
- "user_id": fields.Many2One("base.user","User"),
- 'picture': fields.File("Picture"),
- 'note': fields.Text("Note"),
- 'categ_id': fields.Many2One("clinic.personal.categ", "Nurse Category", domain=[['type','=','nurse']]),
- 'active': fields.Boolean("Active"),
- }
-
- def _get_number(self,context={}):
- while 1:
- seq_id=get_model("sequence").find_sequence(name="Clinic Nurse")
- num=get_model("sequence").get_next_number(seq_id,context=context)
- if not num:
- return None
- user_id=get_active_user()
- set_active_user(1)
- res=self.search([["number","=",num]])
- set_active_user(user_id)
- if not res:
- return num
- get_model("sequence").increment_number(seq_id,context=context)
-
-
- _defaults={
- "type": "temporary",
- "date": lambda *a: time.strftime("%Y-%m-%d"),
- "number": _get_number,
- "company_id": lambda *a: get_active_company(),
- }
- _order="date desc,number desc"
-
-Nurse.register()
diff --git a/netforce_clinic/models/report_hd_detail.py b/netforce_clinic/models/report_hd_detail.py
index 44c7536..39a631d 100644
--- a/netforce_clinic/models/report_hd_detail.py
+++ b/netforce_clinic/models/report_hd_detail.py
@@ -10,8 +10,8 @@ class ReportHDDetail(Model):
_fields={
"patient_id" : fields.Many2One("clinic.patient","Patient"),
- "doctor_id" : fields.Many2One("clinic.doctor","Doctor"),
- "nurse_id" : fields.Many2One("clinic.nurse","Nurse"),
+ "doctor_id" : fields.Many2One("clinic.personal","Doctor",domain=[['type','=','doctor']]),
+ "nurse_id" : fields.Many2One("clinic.personal","Nurse",domain=[['type','=','nurse']]),
"date_from": fields.Date("From"),
"date_to": fields.Date("To"),
"cycle_id": fields.Many2One("clinic.cycle","Cycle"),
diff --git a/netforce_clinic/models/report_hd_payment.py b/netforce_clinic/models/report_hd_payment.py
index f8969f2..018063d 100644
--- a/netforce_clinic/models/report_hd_payment.py
+++ b/netforce_clinic/models/report_hd_payment.py
@@ -10,8 +10,8 @@ class ReportHDPayment(Model):
_fields={
"patient_id" : fields.Many2One("clinic.patient","Patient"),
- "doctor_id" : fields.Many2One("clinic.doctor","Doctor"),
- "nurse_id" : fields.Many2One("clinic.nurse","Nurse"),
+ "doctor_id" : fields.Many2One("clinic.personal","Doctor",domain=[['type','=','doctor']]),
+ "nurse_id" : fields.Many2One("clinic.personal","Nurse",domain=[['type','=','nurse']]),
"date_from": fields.Date("From"),
"date_to": fields.Date("To"),
"cycle_id": fields.Many2One("clinic.cycle","Cycle"),
diff --git a/netforce_clinic/models/setting.py b/netforce_clinic/models/setting.py
index 543260a..8013d24 100644
--- a/netforce_clinic/models/setting.py
+++ b/netforce_clinic/models/setting.py
@@ -98,8 +98,8 @@ class ClinicSetting(Model):
print("="*50)
patients=get_model("clinic.patient").search_read([],['name','hn'])
visits=get_model("clinic.visit").search_read([],['number','time_start','cycle_id','state'])
- doctor_ids=[dt['id'] for dt in get_model("clinic.doctor").search_read([],['name'])]
- nurse_ids=[ns['id'] for ns in get_model("clinic.nurse").search_read([],['name'])]
+ doctor_ids=[dt['id'] for dt in get_model("clinic.personal").search_read([['type','=','doctor']],['name'])]
+ nurse_ids=[ns['id'] for ns in get_model("clinic.personal").search_read([['type','=','nurse']],['name'])]
cycle_ids=[cc['id'] for cc in get_model("clinic.cycle").search_read([],['name'])]
department_ids=[dp['id'] for dp in get_model("clinic.department").search_read([],['name'])]
#db=get_connection()
diff --git a/netforce_clinic/models/visit_line.py b/netforce_clinic/models/visit_line.py
deleted file mode 100644
index b79b967..0000000
--- a/netforce_clinic/models/visit_line.py
+++ /dev/null
@@ -1,15 +0,0 @@
-from netforce.model import Model, fields, get_model
-
-class VisitLine(Model):
- _name="clinic.visit.line"
- _string="Visit Line"
-
- _fields={
- 'visit_id': fields.Many2One("clinic.visit","Visit"),
- 'cycle_id': fields.Many2One("clinic.cycle","Cycle"),
- 'time_start': fields.DateTime("Time Start"),
- 'time_stop': fields.DateTime("Time Stop"),
- "state": fields.Selection([("pending","Pending"),("completed","Completed")],"Status"),
- }
-
-VisitLine.register()
diff --git a/netforce_clinic/models/visit_plan.py b/netforce_clinic/models/visit_plan.py
deleted file mode 100644
index 85b5c07..0000000
--- a/netforce_clinic/models/visit_plan.py
+++ /dev/null
@@ -1,22 +0,0 @@
-from netforce.model import Model, fields
-
-class VisitPlane(Model):
- _name="clinic.visit.plane"
- _string="Visit Plan"
- _fieldname="visit_id"
- _fields={
- 'visit_id': fields.Many2One("clinic.visit","Visit"),
- 'hd_case_id': fields.Many2One("clinic.hd.case","HD Case"),
- "date": fields.Date("Date"),
- "time_start": fields.DateTime("Time Start"),
- "time_stop": fields.DateTime("Time Stop"),
- "state": fields.Selection([("open","Open"),("close","Close")],"Status"),
- 'active': fields.Boolean("Active"), # to hide
- }
-
- _defaults={
- 'state': 'open',
- 'active': True,
- }
-
-VisitPlane.register()