conv_bal
watcha.h 2014-10-01 23:14:52 +07:00
parent f54fa28c75
commit 1ee80f051a
24 changed files with 269 additions and 125 deletions

View File

@ -0,0 +1,6 @@
<action>
<field name="string">Graduations</field>
<field name="view_cls">multi_view</field>
<field name="model">clinic.graduation</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -0,0 +1,6 @@
<action>
<field name="string">Nationalities</field>
<field name="view_cls">multi_view</field>
<field name="model">clinic.nation</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -2,6 +2,6 @@
<field name="string">Patients</field> <field name="string">Patients</field>
<field name="view_cls">multi_view</field> <field name="view_cls">multi_view</field>
<field name="model">clinic.patient</field> <field name="model">clinic.patient</field>
<field name="tabs">[["All",[]],["Medical Goverment",[["type","=","mg"]]],["Social Security",[["type","=","sc"]]],["NHSO(30$)",[["type","=","nhso"]]],["Personal",[["type","=","personal"]]],["Other",[["type","=","other"]]]]</field> <field name="tabs">[["All",[]],["Medical Goverment",[["type","=","mg"]]],["Social Security",[["type","=","sc"]]],["NHSO(30฿)",[["type","=","nhso"]]],["Personal",[["type","=","personal"]]],["Others",[["type","=","other"]]]]</field>
<field name="menu">clinic_menu</field> <field name="menu">clinic_menu</field>
</action> </action>

View File

@ -0,0 +1,6 @@
<action>
<field name="string">Races</field>
<field name="view_cls">multi_view</field>
<field name="model">clinic.race</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -2,22 +2,36 @@
<head> <head>
<field name="type"/> <field name="type"/>
<button string="Options" dropdown="1"> <button string="Options" dropdown="1">
<item string="Item1"/> <item string="Copy"/>
</button> </button>
</head> </head>
<field name="number"/> <tabs>
<field name="name"/> <tab string="General">
<field name="card_id"/> <group span="6" columns="1">
<field name="card_expire"/> <field name="type" required="1"/>
<field name="cert_no"/> <field name="name"/>
<field name="cert_date"/> <field name="number"/>
<field name="birthday"/> <field name="identification"/>
<field name="department_id"/> <field name="expiry_card"/>
<field name="telephone"/> <field name="department_id"/>
<field name="mobile"/> <field name="birthday"/>
<field name="type"/> </group>
<group span="6" columns="1">
<field name="picture"/>
<field name="user_id"/>
<field name="email"/>
<field name="mobile"/>
<field name="phone"/>
</group>
<separator string="Address Information"/>
<field name="addresses" view="form_list"/>
</tab>
<tab string="Professional Information">
<field name="prof_license"/>
<field name="prof_license_date"/>
</tab>
</tabs>
<related> <related>
<field name="addresses"/>
<field name="visits"/> <field name="visits"/>
<field name="hd_cases"/> <field name="hd_cases"/>
<field name="patients"/> <field name="patients"/>

View File

@ -0,0 +1,3 @@
<form model="clinic.education">
<field name="name"/>
</form>

View File

@ -0,0 +1,3 @@
<list model="clinic.education">
<field name="name"/>
</list>

View File

@ -0,0 +1,3 @@
<form model="clinic.graduation">
<field name="name"/>
</form>

View File

@ -0,0 +1,3 @@
<list model="clinic.graduation">
<field name="name"/>
</list>

View File

@ -10,6 +10,9 @@
</item> </item>
<item string="Settings"> <item string="Settings">
<item string="Departments" action="clinic_department"/> <item string="Departments" action="clinic_department"/>
<item string="Graduations" action="clinic_grade"/>
<item string="Nationalities" action="clinic_nation"/>
<item string="Races" action="clinic_race"/>
<item string="Clinic Setting" action="clinic_setting"/> <item string="Clinic Setting" action="clinic_setting"/>
</item> </item>
</menu> </menu>

View File

@ -0,0 +1,3 @@
<form model="clinic.nation">
<field name="name"/>
</form>

View File

@ -0,0 +1,3 @@
<list model="clinic.nation">
<field name="name"/>
</list>

View File

@ -2,22 +2,36 @@
<head> <head>
<field name="type"/> <field name="type"/>
<button string="Options" dropdown="1"> <button string="Options" dropdown="1">
<item string="Item1"/> <item string="Copy"/>
</button> </button>
</head> </head>
<field name="number"/> <tabs>
<field name="name"/> <tab string="General">
<field name="card_id"/> <group span="6" columns="1">
<field name="card_expire"/> <field name="type" required="1"/>
<field name="cert_no"/> <field name="name"/>
<field name="cert_date"/> <field name="number"/>
<field name="birthday"/> <field name="identification"/>
<field name="department_id"/> <field name="expiry_card"/>
<field name="telephone"/> <field name="department_id"/>
<field name="mobile"/> <field name="birthday"/>
<field name="type"/> </group>
<group span="6" columns="1">
<field name="picture"/>
<field name="user_id"/>
<field name="email"/>
<field name="mobile"/>
<field name="phone"/>
</group>
<separator string="Address Information"/>
<field name="addresses" view="form_list"/>
</tab>
<tab string="Professional Information">
<field name="prof_license"/>
<field name="prof_license_date"/>
</tab>
</tabs>
<related> <related>
<field name="addresses"/>
<field name="visits"/> <field name="visits"/>
<field name="hd_cases"/> <field name="hd_cases"/>
<field name="patients"/> <field name="patients"/>

View File

@ -1,69 +1,72 @@
<form model="clinic.patient"> <form model="clinic.patient">
<head> <head>
<field name="state"/> <field name="type"/>
<button string="Options" dropdown="1"> <button string="Options" dropdown="1">
<item string="Send Confirm visit"/> <item string="Send Confirm visit"/>
</button> </button>
</head> </head>
<field name="number"/>
<field name="type"/>
<field name="name"/>
<field name="reg_date"/>
<field name="job"/>
<field name="salary"/>
<field name="gender"/>
<field name="marital_status"/>
<tabs> <tabs>
<tab string="Personal Info"> <tab string="General Information">
<field name="number"/> <group span="6" columns="1">
<field name="name"/> <field name="birthday"/>
<field name="type"/> <field name="age"/>
<field name="reg_date"/> <field name="card_type"/>
<field name="birthday"/> <field name="card_no"/>
<field name="age"/> <field name="exp_date"/>
<field name="card_type"/> <field name="picture"/>
<field name="card_no"/> <field name="phone"/>
<field name="exp_date"/> <field name="email"/>
<field name="tel"/> </group>
<field name="mobile"/> <group span="6" columns="1">
<field name="gender"/> <field name="nation_id"/>
<field name="marital_status"/> <field name="race_id"/>
<field name="nationality"/> <field name="grad_id"/>
<field name="race"/> <field name="weight"/>
<field name="graduation"/> <field name="height"/>
<field name="job"/> <field name="mobile"/>
<field name="weight"/> </group>
<field name="height"/> <separator string="Address Information"/>
<field name="addresses" view="form_list"/>
</tab> </tab>
<tab string="Health Info"> <tab string="Health Information">
<field name="smoke" span="12"/> <field name="smoke"/>
<field name="salary" span="12"/> <field name="withdrawal"/>
<field name="withdrawal" span="12"/> <field name="first_hemodialysis"/>
<group span="12" colunm="2"> <field name="hemodialysis"/>
<field name="first_hemodialysis"/> <field name="first_treatment"/>
<field name="hemodialysis"/> <field name="clinic_after"/>
</group> <field name="clinic_after_name"/>
<field name="first_treatment" span="12"/> <field name="first_permanent_vascular_access"/>
<group span="12" colunm="2"> <field name="first_tenckhoff_catheters"/>
<field name="clinic_after"/> <field name="start_date_clinic"/>
<field name="clinic_after_name"/> <field name="waiting_transplantation"/>
</group> <field name="who_transplantation"/>
<field name="first_permanent_vascular_access" span="12"/> <field name="reason_of_chronic_renal_failure"/>
<field name="first_tenckhoff_catheters" span="12"/> </tab>
<field name="start_date_clinic" span="12"/> <tab string="Cause Of Chronic Renal Failure">
<field name="waiting_transplantation" span="12"/> <field name="ac_mi"/>
<field name="who_transplantation"/> <field name="co_an"/>
<field name="reason_of_chronic_renal_failure"/> <field name="ce_ac"/>
<separator string="Cause of chronic renal failure"/> <field name="hypertnsion"/>
<group span="12" colunm="3"> <field name="dia"/>
<field name="ac_mi"/> <field name="copd"/>
<field name="co_an"/> <field name="asthma"/>
<field name="ce_ac"/> <field name="pul_tub"/>
<field name="hypertnsion"/> <field name="cancer"/>
<field name="dia"/> <field name="cirrhosis"/>
<field name="copd"/> <field name="dyslip"/>
<field name="asthma"/> <field name="prca"/>
<field name="pul_tub"/> <field name="hyperucemia"/>
<field name="cancer"/> <field name="cga"/>
<field name="cirrhosis"/> <field name="parathy"/>
<field name="dyslip"/>
<field name="prca"/>
<field name="hyperucemia"/>
<field name="cga"/>
<field name="parathy"/>
</group>
</tab> </tab>
<tab string="Co-marbid"> <tab string="Co-marbid">
<separator string="Co-morbidity, before RRT"/> <separator string="Co-morbidity, before RRT"/>
@ -94,7 +97,6 @@
</tab> </tab>
</tabs> </tabs>
<related> <related>
<field name="addresses"/>
<field name="hd_cases"/> <field name="hd_cases"/>
<field name="visits"/> <field name="visits"/>
<field name="comments"/> <field name="comments"/>

View File

@ -0,0 +1,3 @@
<form model="clinic.race">
<field name="name"/>
</form>

View File

@ -0,0 +1,3 @@
<list model="clinic.race">
<field name="name"/>
</list>

View File

@ -7,4 +7,8 @@ from . import clinic_hd_case_line
from . import clinic_hd_case_line_detail from . import clinic_hd_case_line_detail
from . import clinic_dialyzer from . import clinic_dialyzer
from . import clinic_department from . import clinic_department
from . import clinic_education
from . import clinic_setting from . import clinic_setting
from . import clinic_graduation
from . import clinic_nation
from . import clinic_race

View File

@ -8,28 +8,41 @@ class Doctor(Model):
_string="Doctor" _string="Doctor"
_audit_log=True _audit_log=True
_multi_company=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={ _fields={
"number": fields.Char("Doctor No.",required=True,search=True), "number": fields.Char("Doctor No.",required=True,search=True),
"name": fields.Char("Name",required=True,search=True), "name": fields.Char("Name",required=True,search=True),
"card_id" : fields.Char("Identity ID"), "identification" : fields.Char("Identification"),
"card_expire" : fields.Date("Expire Date"), "expiry_card" : fields.Date("Expiry Card"),
"birthday": fields.Date("Date of Birth",search=True), "birthday": fields.Date("Birthday",search=True),
"telephone": fields.Char("Telephone",search=True), "age": fields.Integer("Age", function="_get_age"),
"type": fields.Selection([("temporary","Temporary"),("permanent","Permanent")],"Type"), "type": fields.Selection([["temporary","Temporary"],["permanent","Permanent"]],"Type"),
"mobile": fields.Char("Mobile",required=False,search=True), "mobile": fields.Char("Mobile",required=False,search=True),
"cert_no" : fields.Char("Certificate No."), "phone": fields.Char("Phone",search=True),
"cert_date" : fields.Date("Certificate Date"), 'email': fields.Char("Email"),
"prof_license" : fields.Char("Professional License."),
"prof_license_date" : fields.Date("Professional License Date"),
"birthday": fields.Date("BirthDay",search=True), "birthday": fields.Date("BirthDay",search=True),
"telephone": fields.Char("Telephone",search=True),
"department_id": fields.Many2One("clinic.department", "Department",search=True), "department_id": fields.Many2One("clinic.department", "Department",search=True),
"mobile": fields.Char("Mobile",search=True), "patients": fields.Many2Many("clinic.patient","Patients"),
"state": fields.Selection([("draft","Draft"),("active","Active"),("deactive","Deactive")],"Status"),
"addresses": fields.One2Many("address","related_id","Addresses"), "addresses": fields.One2Many("address","related_id","Addresses"),
"comments": fields.One2Many("message","related_id","Comments"), "comments": fields.One2Many("message","related_id","Comments"),
"patients": fields.Many2Many("clinic.patient","Patients"),
"visits": fields.One2Many("clinic.visit","nurse_id","Visits"), "visits": fields.One2Many("clinic.visit","nurse_id","Visits"),
"hd_cases": fields.One2Many("clinic.hd.case","nurse_id","HD cases"), "hd_cases": fields.One2Many("clinic.hd.case","nurse_id","HD Cases"),
"company_id": fields.Many2One("company","Company"), "company_id": fields.Many2One("company","Company"),
"user_id": fields.Many2One("base.user","User"),
'picture': fields.File("Picture"),
} }
def _get_number(self,context={}): def _get_number(self,context={}):

View File

@ -0,0 +1,11 @@
from netforce.model import Model, fields
class Education(Model):
_name="clinic.education"
_string="Education"
_fields={
"name": fields.Char("Name",required=True,search=True),
}
Education.register()

View File

@ -0,0 +1,11 @@
from netforce.model import Model, fields
class Graduation(Model):
_name="clinic.graduation"
_string="Graduation"
_fields={
"name": fields.Char("Name",required=True,search=True),
}
Graduation.register()

View File

@ -0,0 +1,11 @@
from netforce.model import Model, fields
class Nation(Model):
_name="clinic.nation"
_string="Nationality"
_fields={
"name": fields.Char("Name",required=True,search=True),
}
Nation.register()

View File

@ -7,30 +7,42 @@ class Nurse(Model):
_name="clinic.nurse" _name="clinic.nurse"
_string="Nurse" _string="Nurse"
_audit_log=True _audit_log=True
_name_field="name"
_multi_company=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={ _fields={
"number": fields.Char("Nurse No.",required=True,search=True), "number": fields.Char("Doctor No.",required=True,search=True),
"name": fields.Char("Name",required=True,search=True), "name": fields.Char("Name",required=True,search=True),
"card_id" : fields.Char("Identity ID"), "identification" : fields.Char("Identification"),
"card_expire" : fields.Date("Expire Date"), "expiry_card" : fields.Date("Expiry Card"),
"birthday": fields.Date("Date of Birth",search=True), "birthday": fields.Date("Birthday",search=True),
"telephone": fields.Char("Telephone",search=True), "age": fields.Integer("Age", function="_get_age"),
"type": fields.Selection([("temporary","Temporary"),("permanent","Permanent")],"Type"), "type": fields.Selection([["temporary","Temporary"],["permanent","Permanent"]],"Type"),
"mobile": fields.Char("Mobile",required=False,search=True), "mobile": fields.Char("Mobile",required=False,search=True),
"cert_no" : fields.Char("Certificate No."), "phone": fields.Char("Phone",search=True),
"cert_date" : fields.Date("Certificate Date"), 'email': fields.Char("Email"),
"prof_license" : fields.Char("Professional License."),
"prof_license_date" : fields.Date("Professional License Date"),
"birthday": fields.Date("BirthDay",search=True), "birthday": fields.Date("BirthDay",search=True),
"telephone": fields.Char("Telephone",search=True),
"department_id": fields.Many2One("clinic.department", "Department",search=True), "department_id": fields.Many2One("clinic.department", "Department",search=True),
"mobile": fields.Char("Mobile",search=True), "patients": fields.Many2Many("clinic.patient","Patients"),
"state": fields.Selection([("draft","Draft"),("active","Active"),("deactive","Deactive")],"Status"),
"addresses": fields.One2Many("address","related_id","Addresses"), "addresses": fields.One2Many("address","related_id","Addresses"),
"comments": fields.One2Many("message","related_id","Comments"), "comments": fields.One2Many("message","related_id","Comments"),
"patients": fields.Many2Many("clinic.patient","Patients"),
"visits": fields.One2Many("clinic.visit","nurse_id","Visits"), "visits": fields.One2Many("clinic.visit","nurse_id","Visits"),
"hd_cases": fields.One2Many("clinic.hd.case","nurse_id","HD cases"), "hd_cases": fields.One2Many("clinic.hd.case","nurse_id","HD Cases"),
"company_id": fields.Many2One("company","Company"), "company_id": fields.Many2One("company","Company"),
"user_id": fields.Many2One("base.user","User"),
'picture': fields.File("Picture"),
} }
def _get_number(self,context={}): def _get_number(self,context={}):
@ -53,10 +65,4 @@ class Nurse(Model):
_order="date desc,number desc" _order="date desc,number desc"
def void(self,ids,context={}):
obj=self.browse(ids)[0]
obj.write({"state":"voided"})
Nurse.register() Nurse.register()

View File

@ -21,19 +21,20 @@ class Patient(Model):
return res # -> {1: 30, 2: 45,.....} return res # -> {1: 30, 2: 45,.....}
_fields={ _fields={
"type": fields.Selection([("mg","Medical Govement"),("sc","Social Security"),("nhso","NHSO (30฿)"),("personal","Personal"),("other","Other")],"Patient Type",required=False),
"number": fields.Char("Patient No.",required=True,search=True), "number": fields.Char("Patient No.",required=True,search=True),
"name": fields.Char("Name",required=True,search=True), "name": fields.Char("Name",required=True,search=True),
"reg_date": fields.Date("Register Date",required=False,search=True), "reg_date": fields.Date("Register Date",required=False,search=True),
"birthday": fields.Date("Date of Birth",required=False,search=True), "birthday": fields.Date("Birthday",required=False,search=True),
"tel": fields.Char("Tel.",required=False,search=True), "phone": fields.Char("Phone",required=False,search=True),
"mobile": fields.Char("Mobile",required=False,search=True), "mobile": fields.Char("Mobile",required=False,search=True),
"job": fields.Char("Job/Position"), "job": fields.Char("Job/Position"),
"graduation": fields.Selection([("junior_high_school", "Junior High School"),("senior_hish_school","Senior High School"),("vocational_certificate", "Vocational Certificate"),("High_vocational_certificate", "High Vocational Certificate"),("ba", "B.A.(Bachelor of Arts)"),("ma","M.A.(Master of Arts)"),("phd","Ph.D.(Doctor of Philosophy)")],"Graduation"),
"age": fields.Integer("Age", function="_get_age"), "age": fields.Integer("Age", function="_get_age"),
'picture': fields.File("Picture"),
'email': fields.Char("Email"),
"weight": fields.Float("Weight (cm)"), "weight": fields.Float("Weight (cm)"),
"height": fields.Float("Height (Kg)"), "height": fields.Float("Height (Kg)"),
"type": fields.Selection([("mg","Medical Govement"),("sc","Social Security"),("nhso","NHSO (30฿)"),("personal","Personal"),("other","Other")],"Type of Treatment",required=False), "card_type": fields.Selection([("identification","Identification"),("passport","Passport")],"Card Type",required=True),
"card_type": fields.Selection([("iden_id","Identity Card"),("passport","Passport")],"Card Type",required=True),
'card_no' : fields.Char("Card No."), 'card_no' : fields.Char("Card No."),
"app_no": fields.Char("Application No."), "app_no": fields.Char("Application No."),
"salary": fields.Selection([["20000","5,001-20,000"],["50000","20,001-50,000"],["100000","50,001-100,000"],["100001","100,000+"]], "Salary"), "salary": fields.Selection([["20000","5,001-20,000"],["50000","20,001-50,000"],["100000","50,001-100,000"],["100001","100,000+"]], "Salary"),
@ -41,8 +42,9 @@ class Patient(Model):
"addresses": fields.One2Many("address","related_id","Addresses"), "addresses": fields.One2Many("address","related_id","Addresses"),
"gender": fields.Selection([("male","Male"),("female","Female")],"Gender",required=False), "gender": fields.Selection([("male","Male"),("female","Female")],"Gender",required=False),
"marital_status": fields.Selection([("single","Single"),("marry","Marry"),("divorce","Divorce"),("separated","Saparated"),("widowed","Widowed")],"Marital Status",required=False), "marital_status": fields.Selection([("single","Single"),("marry","Marry"),("divorce","Divorce"),("separated","Saparated"),("widowed","Widowed")],"Marital Status",required=False),
"nationality": fields.Char("Nationality",search=True), "nation_id": fields.Many2One("clinic.nation","Nationality"),
"race": fields.Char("Race",search=True), "race_id": fields.Many2One("clinic.race","Race"),
"grad_id": fields.Many2One("clinic.graduation","Graduation"),
#Patient's + #Patient's +
"smoke": fields.Selection([("never","Never"),("stopped","Stopped"),("smoked","Smoked")],"Smoking"), "smoke": fields.Selection([("never","Never"),("stopped","Stopped"),("smoked","Smoked")],"Smoking"),
"withdrawal" : fields.Selection([("social_security","Social Security"),("health_insurance","Health Insurance"),("etc","ETC.")],"Right of withdrawal"), "withdrawal" : fields.Selection([("social_security","Social Security"),("health_insurance","Health Insurance"),("etc","ETC.")],"Right of withdrawal"),

View File

@ -0,0 +1,11 @@
from netforce.model import Model, fields
class Race(Model):
_name="clinic.race"
_string="Race"
_fields={
"name": fields.Char("Name",required=True,search=True),
}
Race.register()