From d28d602018caa44e818e93bedaab2ce7c6b12bcf Mon Sep 17 00:00:00 2001 From: "Phongsan.b" Date: Thu, 28 Aug 2014 18:20:49 +0700 Subject: [PATCH] add description petial and hd case --- clinic.egg-info/SOURCES.txt | 1 + clinic/layouts/clinic_dialyzer_form.xml | 4 +++ clinic/layouts/clinic_hd_case_form.xml | 25 +++++++++++-- clinic/layouts/clinic_hd_case_list.xml | 4 ++- clinic/layouts/clinic_patient_form.xml | 1 + clinic/models/__init__.py | 1 + .../__pycache__/__init__.cpython-32.pyc | Bin 580 -> 665 bytes .../__pycache__/clinic_patient.cpython-32.pyc | Bin 6253 -> 6592 bytes clinic/models/clinic_dialyzer.py | 6 +++- clinic/models/clinic_hd_case.py | 33 ++++++++++++++++-- clinic/models/clinic_hd_case_line.py | 6 +++- clinic/models/clinic_patient.py | 1 + 12 files changed, 74 insertions(+), 8 deletions(-) diff --git a/clinic.egg-info/SOURCES.txt b/clinic.egg-info/SOURCES.txt index ae6f6a2..0790ecb 100644 --- a/clinic.egg-info/SOURCES.txt +++ b/clinic.egg-info/SOURCES.txt @@ -7,6 +7,7 @@ clinic.egg-info/dependency_links.txt clinic.egg-info/top_level.txt clinic/controllers/__init__.py clinic/models/__init__.py +clinic/models/clinic_dialyzer.py clinic/models/clinic_doctor.py clinic/models/clinic_hd_case.py clinic/models/clinic_hd_case_line.py diff --git a/clinic/layouts/clinic_dialyzer_form.xml b/clinic/layouts/clinic_dialyzer_form.xml index 2219db9..e9e78af 100644 --- a/clinic/layouts/clinic_dialyzer_form.xml +++ b/clinic/layouts/clinic_dialyzer_form.xml @@ -11,6 +11,10 @@ + + + + diff --git a/clinic/layouts/clinic_hd_case_form.xml b/clinic/layouts/clinic_hd_case_form.xml index 897829a..e215b9f 100644 --- a/clinic/layouts/clinic_hd_case_form.xml +++ b/clinic/layouts/clinic_hd_case_form.xml @@ -7,20 +7,41 @@ - + + + + + + + + + - + + + + + + + + + + + + + + diff --git a/clinic/layouts/clinic_hd_case_list.xml b/clinic/layouts/clinic_hd_case_list.xml index 9a65cb9..95ccdf2 100644 --- a/clinic/layouts/clinic_hd_case_list.xml +++ b/clinic/layouts/clinic_hd_case_list.xml @@ -1,7 +1,9 @@ - + + + diff --git a/clinic/layouts/clinic_patient_form.xml b/clinic/layouts/clinic_patient_form.xml index 2591afe..b4468be 100644 --- a/clinic/layouts/clinic_patient_form.xml +++ b/clinic/layouts/clinic_patient_form.xml @@ -9,6 +9,7 @@ + diff --git a/clinic/models/__init__.py b/clinic/models/__init__.py index 487c30a..27cbf6e 100644 --- a/clinic/models/__init__.py +++ b/clinic/models/__init__.py @@ -4,4 +4,5 @@ from . import clinic_nurse from . import clinic_visit from . import clinic_hd_case from . import clinic_hd_case_line +from . import clinic_hd_case_line_detail from . import clinic_dialyzer diff --git a/clinic/models/__pycache__/__init__.cpython-32.pyc b/clinic/models/__pycache__/__init__.cpython-32.pyc index db918712f93e4170a469bf3024d79bb39997d474..dc1600bd00f053179a9cc8c6f7acd9d0947c4ded 100644 GIT binary patch delta 125 zcmX@YGLuz4hliI->)F5HWCkR_1Y|n^adFE;`4UkEh7=Bl90rD54u&WW2F4UlhF}e@ ti8JOgN=@FtD8?S2l3J3OnKRjdQJRr+vJYc5n)orsJRv@yVFHZE5CA<~81n!C delta 96 zcmbQqdW1zjhliJI&FZhg$qYz<3CMN;;^LBt@+GVs48aVa7=Dstez~zlqCiYSf?uAsd84gLUsV4~G^;nG1!I^Fl2Q&qQ4SKpp29WVDrvvaa0tNx65OH^ZV z8gLxgZUI3B;=2c=5KI9LBbWyAAeb&|FCvw&GSHFEhJSJlQ}gWiBfKyN`wgt@0>Q!zarMa4RkOTGiW zN0|NjU2=&jyo!y0mK(fU@EVPCKx+lB)0n$oFSrzOanAKWfIfmo5$4yk!L`Lkox+W8 z0#$-GqlY85XqNLnfj&!LTU|-pjQj=k74!}C9W*BPs$Fq4Q~UE&YRx#pty|DdDVwZVv{TJu-PQ!V#%FeN_g1O$L2khvk88fNr9PKfqg>$_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ic/models/clinic_dialyzer.py +++ b/clinic/models/clinic_dialyzer.py @@ -18,7 +18,11 @@ class Dialyzer(Model): "max_use_time": fields.Integer("Max Use Time"), "exp_date": fields.Date("Expire Date",search=True), "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"), "company_id": fields.Many2One("company","Company"), } diff --git a/clinic/models/clinic_hd_case.py b/clinic/models/clinic_hd_case.py index 3d2567f..9b71dff 100644 --- a/clinic/models/clinic_hd_case.py +++ b/clinic/models/clinic_hd_case.py @@ -15,10 +15,19 @@ class Hdcase(Model): "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), + "date_start": fields.DateTime("Date start",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), "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"), "company_id": fields.Many2One("company","Company"), } @@ -33,10 +42,28 @@ class Hdcase(Model): return num 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={ "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, "company_id": lambda *a: get_active_company(), } diff --git a/clinic/models/clinic_hd_case_line.py b/clinic/models/clinic_hd_case_line.py index f71d03c..d731752 100644 --- a/clinic/models/clinic_hd_case_line.py +++ b/clinic/models/clinic_hd_case_line.py @@ -12,7 +12,11 @@ class Hdcaseline(Model): "detail": fields.Char("description",search=True), "use_time":fields.Integer("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() diff --git a/clinic/models/clinic_patient.py b/clinic/models/clinic_patient.py index 9bbef99..2e9dd66 100644 --- a/clinic/models/clinic_patient.py +++ b/clinic/models/clinic_patient.py @@ -21,6 +21,7 @@ class Patient(Model): "age": fields.Integer("Age"), "weight": fields.Integer("Weight (cm)"), "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), 'iden_id' : fields.Char("Identity ID"), "app_no": fields.Char("Application No."),