add description petial and hd case

conv_bal
Phongsan.b 2014-08-28 18:20:49 +07:00
parent 829441339e
commit d28d602018
12 changed files with 74 additions and 8 deletions

View File

@ -7,6 +7,7 @@ clinic.egg-info/dependency_links.txt
clinic.egg-info/top_level.txt clinic.egg-info/top_level.txt
clinic/controllers/__init__.py clinic/controllers/__init__.py
clinic/models/__init__.py clinic/models/__init__.py
clinic/models/clinic_dialyzer.py
clinic/models/clinic_doctor.py clinic/models/clinic_doctor.py
clinic/models/clinic_hd_case.py clinic/models/clinic_hd_case.py
clinic/models/clinic_hd_case_line.py clinic/models/clinic_hd_case_line.py

View File

@ -11,6 +11,10 @@
<field name="max_use_time"/> <field name="max_use_time"/>
<field name="date"/> <field name="date"/>
<field name="exp_date"/> <field name="exp_date"/>
<field name="member_type"/>
<field name="bid_flow_rate"/>
<field name="dialyzer_type"/>
<field name="ultrafittration"/>
<field name="patient_id"/> <field name="patient_id"/>
<field name="state"/> <field name="state"/>
</form> </form>

View File

@ -7,20 +7,41 @@
</head> </head>
<separator string="HD Case Info"/> <separator string="HD Case Info"/>
<field name="number"/> <field name="number"/>
<field name="date"/>
<field name="patient_id"/> <field name="patient_id"/>
<field name="date_start"/>
<field name="date_stop"/>
<field name="wh_start"/>
<field name="wh_stop"/>
<field name="bp_start"/>
<field name="per_bp_start"/>
<field name="bp_stop"/>
<field name="per_bp_stop"/>
<field name="hct"/>
<field name="doctor_id"/> <field name="doctor_id"/>
<field name="nurse_id"/> <field name="nurse_id"/>
<field name="department"/> <field name="department"/>
<field name="lines" nolabel="1"> <field name="lines" nolabel="1">
<list> <list>
<field name="dialzer_id" onchange="onchange_product"/> <field name="dialzer_id" onchange="onchange_dialyzer"/>
<field name="detail"/> <field name="detail"/>
<field name="member_type"/>
<field name="bid_flow_rate"/>
<field name="dialyzer_type"/>
<field name="ultrafittration"/>
<field name="use_time"/> <field name="use_time"/>
<field name="max_use_time"/> <field name="max_use_time"/>
<field name="state"/> <field name="state"/>
</list> </list>
</field> </field>
<field name="lines_detail" nolabel="1">
<list>
<field name="product_id" onchange="onchange_product"/>
<field name="detail"/>
<field name="qty"/>
<field name="uom_id"/>
<field name="price"/>
</list>
</field>
<related> <related>
<field name="comments"/> <field name="comments"/>
</related> </related>

View File

@ -1,7 +1,9 @@
<list model="clinic.hd.case"> <list model="clinic.hd.case">
<field name="number"/> <field name="number"/>
<field name="date"/> <field name="date_start"/>
<field name="date_stop"/>
<field name="patient_id"/> <field name="patient_id"/>
<field name="hct"/>
<field name="doctor_id"/> <field name="doctor_id"/>
<field name="nurse_id"/> <field name="nurse_id"/>
<field name="state"/> <field name="state"/>

View File

@ -9,6 +9,7 @@
<tab string="Patient"> <tab string="Patient">
<separator string="Patient Info"/> <separator string="Patient Info"/>
<field name="number"/> <field name="number"/>
<field name="type"/>
<field name="name"/> <field name="name"/>
<field name="date"/> <field name="date"/>
<field name="birthday"/> <field name="birthday"/>

View File

@ -4,4 +4,5 @@ from . import clinic_nurse
from . import clinic_visit from . import clinic_visit
from . import clinic_hd_case from . import clinic_hd_case
from . import clinic_hd_case_line from . import clinic_hd_case_line
from . import clinic_hd_case_line_detail
from . import clinic_dialyzer from . import clinic_dialyzer

View File

@ -18,7 +18,11 @@ class Dialyzer(Model):
"max_use_time": fields.Integer("Max Use Time"), "max_use_time": fields.Integer("Max Use Time"),
"exp_date": fields.Date("Expire Date",search=True), "exp_date": fields.Date("Expire Date",search=True),
"patient_id": fields.Many2One("clinic.patient","Patient"), "patient_id": fields.Many2One("clinic.patient","Patient"),
"state": fields.Selection([("draft","Draft"),("active","Active"),("drop","Drop")],"Status",required=True), "member_type": fields.Selection([("unsub","Unsub cellul"),("sub","Sub cellul"),("synthetic","Synthetic")],"Member Type",required=True),
"dialyzer_type": fields.Selection([("low","low flux"),("high","high flux"),("dbl","dbl hifulx")],"Member Type",required=True),
"bid_flow_rate": fields.Integer("Bid Flow Rate (ml/min)",required=True,search=True),
"ultrafittration": fields.Float("Ultrafittration Kg.",required=True,search=True),
"state": fields.Selection([("draft","New"),("active","Active"),("drop","Drop")],"Status",required=True),
"comments": fields.One2Many("message","related_id","Comments"), "comments": fields.One2Many("message","related_id","Comments"),
"company_id": fields.Many2One("company","Company"), "company_id": fields.Many2One("company","Company"),
} }

View File

@ -15,10 +15,19 @@ class Hdcase(Model):
"patient_id": fields.Many2One("clinic.patient","Patients",required=True,search=True), "patient_id": fields.Many2One("clinic.patient","Patients",required=True,search=True),
"doctor_id": fields.Many2One("clinic.doctor","Doctor",search=True), "doctor_id": fields.Many2One("clinic.doctor","Doctor",search=True),
"nurse_id": fields.Many2One("clinic.nurse","Nurse",search=True), "nurse_id": fields.Many2One("clinic.nurse","Nurse",search=True),
"date": fields.Date("Create Date",required=True,search=True), "date_start": fields.DateTime("Date start",required=True,search=True),
"department": fields.Char("Department",required=True,search=True), "date_stop": fields.DateTime("Date stop",required=True,search=True),
"department": fields.Char("Department",required=False,search=True),
"wh_start": fields.Float("Wt.Kg start",required=True,search=True),
"wh_stop": fields.Float("Wt.Kg stop",required=True,search=True),
"bp_start": fields.Integer("BP mmHG start",required=True,search=True),
"per_bp_start": fields.Integer("/Per start",required=True,search=True),
"bp_stop": fields.Integer("BP mmHG stop",required=True,search=True),
"per_bp_stop": fields.Integer("/Per stop",required=True,search=True),
"hct": fields.Integer("HCT %",required=True,search=True),
"state": fields.Selection([("draft","Draft"),("pending","Pending"),("confirmed","Confirmed"),("canceled","Canceled")],"Status",required=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"), "lines": fields.One2Many("clinic.hd.case.line","hd_case_id","Details"),
"lines_detail": fields.One2Many("clinic.hd.case.line.detail","hd_case_id","Detail"),
"comments": fields.One2Many("message","related_id","Comments"), "comments": fields.One2Many("message","related_id","Comments"),
"company_id": fields.Many2One("company","Company"), "company_id": fields.Many2One("company","Company"),
} }
@ -33,10 +42,28 @@ class Hdcase(Model):
return num return num
get_model("sequence").increment("sale_order") get_model("sequence").increment("sale_order")
def onchange_dialyzer(self,context={}):
data=context["data"]
path=context["path"]
line=get_data_path(data,path,parent=True)
dialyzer_id=line.get("dialzer_id")
if not dialyzer_id:
return {}
dialyzer=get_model("clinic.dialyzer").browse(dialyzer_id)
line["detail"]=dialyzer.detail
line["use_time"]=dialyzer.use_time
line["max_use_time"]=dialyzer.max_use_time
line["member_type"]=dialyzer.member_type
line["dialyzer_type"]=dialyzer.dialyzer_type
line["bid_flow_rate"]=dialyzer.bid_flow_rate
line["ultrafittration"]=dialyzer.ultrafittration
line["state"]=dialyzer.state
return data
_defaults={ _defaults={
"state": "draft", "state": "draft",
"date": lambda *a: time.strftime("%Y-%m-%d"), "date_start": lambda *a: time.strftime("%Y-%m-%d %H:%M:%S"),
"date_stop": lambda *a: time.strftime("%Y-%m-%d %H:%M:%S"),
"number": _get_number, "number": _get_number,
"company_id": lambda *a: get_active_company(), "company_id": lambda *a: get_active_company(),
} }

View File

@ -12,7 +12,11 @@ class Hdcaseline(Model):
"detail": fields.Char("description",search=True), "detail": fields.Char("description",search=True),
"use_time":fields.Integer("Use time"), "use_time":fields.Integer("Use time"),
"max_use_time":fields.Integer("Max use time"), "max_use_time":fields.Integer("Max use time"),
"state":fields.Selection([("active","Active"),("drop","Drop")],"Status DZ"), "member_type": fields.Selection([("unsub","Unsub cellul"),("sub","Sub cellul"),("synthetic","Synthetic")],"Member Type",required=True),
"dialyzer_type": fields.Selection([("low","low flux"),("high","high flux"),("dbl","dbl hifulx")],"Member Type",required=True),
"bid_flow_rate": fields.Integer("Bid Flow Rate (ml/min)",required=True,search=True),
"ultrafittration": fields.Float("Ultrafittration Kg.",required=True,search=True),
"state":fields.Selection([("draft","New"),("active","Active"),("drop","Drop")],"Status DZ"),
} }
Hdcaseline.register() Hdcaseline.register()

View File

@ -21,6 +21,7 @@ class Patient(Model):
"age": fields.Integer("Age"), "age": fields.Integer("Age"),
"weight": fields.Integer("Weight (cm)"), "weight": fields.Integer("Weight (cm)"),
"height": fields.Integer("Height (Kg)"), "height": fields.Integer("Height (Kg)"),
"type": fields.Selection([("mg","Medical Govement"),("sc","Social Security"),("nhso","NHSO (30฿)"),("personal","Personal"),("other","Other")],"Type",required=True),
"card_type": fields.Selection([("iden_id","Identity Card"),("passport","Passport")],"ID From",required=True), "card_type": fields.Selection([("iden_id","Identity Card"),("passport","Passport")],"ID From",required=True),
'iden_id' : fields.Char("Identity ID"), 'iden_id' : fields.Char("Identity ID"),
"app_no": fields.Char("Application No."), "app_no": fields.Char("Application No."),