widget
parent
6bdbe444b2
commit
806faec9cd
|
@ -1,6 +1,6 @@
|
||||||
<action>
|
<action>
|
||||||
<field name="name">clinic_board</field>
|
<field name="name">clinic_board</field>
|
||||||
<field name="string">Visit Board</field>
|
<field name="string">Clinic Board</field>
|
||||||
<field name="view_cls">board</field>
|
<field name="view_cls">board</field>
|
||||||
<field name="view_xml">clinic_board</field>
|
<field name="view_xml">clinic_board</field>
|
||||||
<field name="menu">clinic_menu</field>
|
<field name="menu">clinic_menu</field>
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
<action>
|
||||||
|
<field name="view_cls">chart_view</field>
|
||||||
|
<field name="model">clinic.report</field>
|
||||||
|
<field name="method">cycle_recent_widget</field>
|
||||||
|
<field name="chart_type">pie</field>
|
||||||
|
</action>
|
|
@ -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"]]],["Others",[["type","=","others"]]]]</field>
|
<field name="tabs">[["All",[]],["Archived",[["active","=",false]]],["Medical Goverment",[["type","=","mg"]]],["Social Security",[["type","=","sc"]]],["NHSO(30฿)",[["type","=","nhso"]]],["Personal",[["type","=","personal"]]],["Others",[["type","=","others"]]]]</field>
|
||||||
<field name="menu">clinic_menu</field>
|
<field name="menu">clinic_menu</field>
|
||||||
</action>
|
</action>
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<action>
|
||||||
|
<field name="view_cls">list_view</field>
|
||||||
|
<field name="model">clinic.patient</field>
|
||||||
|
<field name="order">write_time desc</field>
|
||||||
|
<field name="limit">5</field>
|
||||||
|
<field name="view_xml">clinic_recent_patient_widget</field>
|
||||||
|
</action>
|
|
@ -0,0 +1,7 @@
|
||||||
|
<action>
|
||||||
|
<field name="string">Schedules</field>
|
||||||
|
<field name="view_cls">multi_view</field>
|
||||||
|
<field name="model">clinic.schedule</field>
|
||||||
|
<field name="modes">calendar,list,page,form</field>
|
||||||
|
<field name="menu">clinic_menu</field>
|
||||||
|
</action>
|
|
@ -3,6 +3,6 @@
|
||||||
<field name="view_cls">multi_view</field>
|
<field name="view_cls">multi_view</field>
|
||||||
<field name="model">clinic.visit</field>
|
<field name="model">clinic.visit</field>
|
||||||
<field name="tabs">[["All",[]],["Draft",[["state","=","draft"]]],["Confirmed",[["state","=","confirmed"]]],["Cancelled",[["state","=","cancelled"]]]]</field>
|
<field name="tabs">[["All",[]],["Draft",[["state","=","draft"]]],["Confirmed",[["state","=","confirmed"]]],["Cancelled",[["state","=","cancelled"]]]]</field>
|
||||||
<field name="modes">list,calendar,form</field>
|
<field name="modes">calendar,list,form</field>
|
||||||
<field name="menu">clinic_menu</field>
|
<field name="menu">clinic_menu</field>
|
||||||
</action>
|
</action>
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
<board>
|
<board>
|
||||||
<hpanel>
|
<!--<hpanel>-->
|
||||||
<widget action="clinic_visit_cal_widget" string="Visits Calendar" span="12"/>
|
<!--<widget action="clinic_visit_cal_widget" string="Visits Calendar" span="12"/>-->
|
||||||
</hpanel>
|
<!--</hpanel>-->
|
||||||
|
<vpanel>
|
||||||
|
<widget action="clinic_cycle_widget" string="Average Cycle" span="12"/>
|
||||||
|
</vpanel>
|
||||||
|
<vpanel>
|
||||||
|
<widget action="clinic_recent_patient_widget" string="Recent Patient" span="12"/>
|
||||||
|
</vpanel>
|
||||||
</board>
|
</board>
|
||||||
|
|
|
@ -19,11 +19,12 @@
|
||||||
<item string="Comorbidities" action="clinic_comorbidity"/>
|
<item string="Comorbidities" action="clinic_comorbidity"/>
|
||||||
<item string="Morbidities" action="clinic_morbidity"/>
|
<item string="Morbidities" action="clinic_morbidity"/>
|
||||||
</item>
|
</item>
|
||||||
|
<item string="Schedules" action="clinic_schedule"/>
|
||||||
|
<item string="Visits" action="clinic_visit"/>
|
||||||
<item string="Cycles">
|
<item string="Cycles">
|
||||||
<item string="Cycles" action="clinic_cycle"/>
|
<item string="Cycles" action="clinic_cycle"/>
|
||||||
<item string="Cycle Items" action="clinic_cycle_item"/>
|
<item string="Cycle Items" action="clinic_cycle_item"/>
|
||||||
</item>
|
</item>
|
||||||
<item string="Visits" action="clinic_visit"/>
|
|
||||||
<item string="Treatments" action="clinic_hd_case"/>
|
<item string="Treatments" action="clinic_hd_case"/>
|
||||||
<item string="Reports">
|
<item string="Reports">
|
||||||
<header string="HD CASE"/>
|
<header string="HD CASE"/>
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
<field name="hn"/>
|
<field name="hn"/>
|
||||||
<field name="reg_date"/>
|
<field name="reg_date"/>
|
||||||
<field name="partner_id"/>
|
<field name="partner_id"/>
|
||||||
|
<field name="active"/>
|
||||||
<tabs>
|
<tabs>
|
||||||
<tab string="General Information">
|
<tab string="General Information">
|
||||||
<group span="6" columns="1">
|
<group span="6" columns="1">
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<list model="clinic.patient">
|
||||||
|
<!--<head>-->
|
||||||
|
<!--<button string="Add Product" icon="plus-sign" noselect="1" action="product" action_options="mode=form"/>-->
|
||||||
|
<!--</head>-->
|
||||||
|
<field name="number"/>
|
||||||
|
<field name="name"/>
|
||||||
|
<field name="type"/>
|
||||||
|
</list>
|
|
@ -0,0 +1,4 @@
|
||||||
|
<calendar model="clinic.schedule" start_field="time_start" end_field="time_stop">
|
||||||
|
<field name="name"/>
|
||||||
|
<field name="cycle_id"/>
|
||||||
|
</calendar>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<form model="clinic.schedule">
|
||||||
|
<head>
|
||||||
|
<button string="Options" dropdown="1">
|
||||||
|
<item string="Copy" method="copy"/>
|
||||||
|
</button>
|
||||||
|
</head>
|
||||||
|
<field name="time_start"/>
|
||||||
|
<field name="time_start"/>
|
||||||
|
<field name="cycle_id"/>
|
||||||
|
<field name="nurses"/>
|
||||||
|
</form>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<list model="clinic.schedule">
|
||||||
|
<field name="name"/>
|
||||||
|
<field name="time_start"/>
|
||||||
|
<field name="time_start"/>
|
||||||
|
</list>
|
|
@ -34,6 +34,7 @@ from . import report_hd_detail
|
||||||
from . import report_hd_summary
|
from . import report_hd_summary
|
||||||
from . import report_hd_medical
|
from . import report_hd_medical
|
||||||
from . import report_hd_payment
|
from . import report_hd_payment
|
||||||
|
from . import report_clinic
|
||||||
from . import fin_setting
|
from . import fin_setting
|
||||||
from . import import_data_mg
|
from . import import_data_mg
|
||||||
from . import import_data_nhso
|
from . import import_data_nhso
|
||||||
|
@ -43,3 +44,4 @@ from . import payment
|
||||||
from . import account_payment
|
from . import account_payment
|
||||||
from . import account_invoice
|
from . import account_invoice
|
||||||
from . import personal_categ
|
from . import personal_categ
|
||||||
|
from . import schedule
|
||||||
|
|
|
@ -76,6 +76,7 @@ class Patient(Model):
|
||||||
"hd_cases": fields.One2Many("clinic.hd.case","patient_id","HD Cases"),
|
"hd_cases": fields.One2Many("clinic.hd.case","patient_id","HD Cases"),
|
||||||
"partner_id": fields.Many2One("partner","Contact"),
|
"partner_id": fields.Many2One("partner","Contact"),
|
||||||
"dialyzers": fields.One2Many("clinic.dialyzer","patient_id","Dialyzers"),
|
"dialyzers": fields.One2Many("clinic.dialyzer","patient_id","Dialyzers"),
|
||||||
|
'active': fields.Boolean("Active"),
|
||||||
}
|
}
|
||||||
|
|
||||||
def _get_number(self,context={}):
|
def _get_number(self,context={}):
|
||||||
|
@ -92,16 +93,11 @@ class Patient(Model):
|
||||||
return num
|
return num
|
||||||
get_model("sequence").increment_number(seq_id,context=context)
|
get_model("sequence").increment_number(seq_id,context=context)
|
||||||
|
|
||||||
def _get_cause_line(self,context={}):
|
|
||||||
cause_ids=get_model("clinic.cause.chronic").search([])
|
|
||||||
return cause_ids
|
|
||||||
|
|
||||||
_defaults={
|
_defaults={
|
||||||
"type": "mg",
|
"type": "mg",
|
||||||
"reg_date": lambda *a: time.strftime("%Y-%m-%d"),
|
"reg_date": lambda *a: time.strftime("%Y-%m-%d"),
|
||||||
"number": _get_number,
|
"number": _get_number,
|
||||||
"company_id": lambda *a: get_active_company(),
|
"company_id": lambda *a: get_active_company(),
|
||||||
#'cause_lines': _get_cause_line,
|
|
||||||
}
|
}
|
||||||
_order="date desc,number desc"
|
_order="date desc,number desc"
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
from netforce.model import Model
|
||||||
|
from netforce.database import get_connection
|
||||||
|
|
||||||
|
class Report(Model):
|
||||||
|
_name="clinic.report"
|
||||||
|
_store=False
|
||||||
|
|
||||||
|
def cycle_recent_widget(self,context={}):
|
||||||
|
db=get_connection()
|
||||||
|
res=db.query("select count(cycle_id) as count, c.name from clinic_hd_case as hd inner join clinic_cycle as c on c.id=hd.cycle_id group by c.name;")
|
||||||
|
data=[]
|
||||||
|
for r in res:
|
||||||
|
data.append((r.name,r.count))
|
||||||
|
return {"value":data}
|
||||||
|
|
||||||
|
Report.register()
|
|
@ -0,0 +1,29 @@
|
||||||
|
from netforce.model import Model, fields
|
||||||
|
from netforce.access import get_active_company
|
||||||
|
|
||||||
|
class Schedule(Model):
|
||||||
|
_name="clinic.schedule"
|
||||||
|
_string="Schedule"
|
||||||
|
#_field_name="cycle_id"
|
||||||
|
|
||||||
|
def _get_name(self,ids,context={}):
|
||||||
|
res={}
|
||||||
|
for obj in self.browse(ids):
|
||||||
|
total_nurse=len(obj.nurses)
|
||||||
|
res[obj.id]='Cycle: %s, Nurse: %s'%(obj.cycle_id.name or "", total_nurse)
|
||||||
|
return res
|
||||||
|
|
||||||
|
_fields={
|
||||||
|
"name": fields.Char("Name",function="_get_name"),
|
||||||
|
'cycle_id': fields.Many2One("clinic.cycle","Cycle",required=True),
|
||||||
|
"time_start": fields.DateTime("Time Start",required=True),
|
||||||
|
"time_stop": fields.DateTime("Time Stop",required=True),
|
||||||
|
'company_id': fields.Many2One("company","Company"),
|
||||||
|
'nurses': fields.Many2Many('clinic.nurse','Nurses'),
|
||||||
|
}
|
||||||
|
|
||||||
|
_defaults={
|
||||||
|
"company_id": lambda *a: get_active_company(),
|
||||||
|
}
|
||||||
|
|
||||||
|
Schedule.register()
|
Loading…
Reference in New Issue