report
parent
927dfc4fa4
commit
f84e2337e4
|
@ -1,11 +1,7 @@
|
||||||
<board>
|
<board>
|
||||||
<vpanel>
|
<hpanel>
|
||||||
<widget action="clinic_visit_widget" string="Current Visit" span="12"/>
|
<widget action="clinic_visit_widget" string="Current Visit" span="12"/>
|
||||||
</vpanel>
|
<widget action="clinic_recent_patient_widget" string="Recent Patient"/>
|
||||||
<vpanel>
|
<widget action="clinic_cycle_widget" string="Average Cycle"/>
|
||||||
<widget action="clinic_recent_patient_widget" string="Recent Patient" span="12"/>
|
</hpanel>
|
||||||
</vpanel>
|
|
||||||
<vpanel>
|
|
||||||
<widget action="clinic_cycle_widget" string="Average Cycle" span="12"/>
|
|
||||||
</vpanel>
|
|
||||||
</board>
|
</board>
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<item string="Schedules" action="clinic_schedule"/>
|
<item string="Schedules" action="clinic_schedule"/>
|
||||||
<item string="Visits">
|
<item string="Visits">
|
||||||
<item string="Visits" action="clinic_visit"/>
|
<item string="Visits" action="clinic_visit"/>
|
||||||
<item string="Visit Dialy" action="clinic_visit_dialy"/>
|
<!--<item string="Visit Dialy" action="clinic_visit_dialy"/>-->
|
||||||
<item string="Generate Visit" action="clinic_gen_visit_form"/>
|
<item string="Generate Visit" action="clinic_gen_visit_form"/>
|
||||||
</item>
|
</item>
|
||||||
<item string="HD Cases" action="clinic_hd_case"/>
|
<item string="HD Cases" action="clinic_hd_case"/>
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
<form model="clinic.report.medical.summary">
|
<form model="clinic.report.medical.summary">
|
||||||
<field name="date" mode="month" span="3"/>
|
<field name="date" span="3" mode="month" onchange="onchange_date"/>
|
||||||
|
<field name="date_from" span="3"/>
|
||||||
|
<field name="date_to" span="3"/>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -15,6 +15,7 @@ from . import patient_comorbidity
|
||||||
from . import patient_morbidity
|
from . import patient_morbidity
|
||||||
from . import race
|
from . import race
|
||||||
from . import visit
|
from . import visit
|
||||||
|
from . import visit_dialy
|
||||||
from . import hd_case
|
from . import hd_case
|
||||||
from . import hd_case_line
|
from . import hd_case_line
|
||||||
from . import hd_case_personal
|
from . import hd_case_personal
|
||||||
|
|
|
@ -12,25 +12,47 @@ class ReportMedicalSummary(Model):
|
||||||
|
|
||||||
_fields={
|
_fields={
|
||||||
"date": fields.Date("Month", required=True),
|
"date": fields.Date("Month", required=True),
|
||||||
|
"date_from": fields.Date("From", required=True),
|
||||||
|
"date_to": fields.Date("To", required=True),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def _get_date_from(self,context={}):
|
||||||
|
year,month=time.strftime("%Y-%m").split("-")
|
||||||
|
return '%s-%s-01'%(year,month)
|
||||||
|
|
||||||
|
def _get_date_to(self,context={}):
|
||||||
|
year,month,day=time.strftime("%Y-%m-%d").split("-")
|
||||||
|
weekday, total_day=monthrange(int(year), int(month))
|
||||||
|
return "%s-%s-%s"%(year,month,total_day)
|
||||||
|
|
||||||
_defaults={
|
_defaults={
|
||||||
'date': lambda *a: time.strftime("%Y-%m-%d"),
|
'date': lambda *a: time.strftime("%Y-%m-%d"),
|
||||||
|
'date_from': _get_date_from,
|
||||||
|
'date_to': _get_date_to,
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_report_data(self,ids,context={}):
|
def get_report_data(self,ids,context={}):
|
||||||
date=time.strftime("%Y-%m-%d")
|
year, month=time.strftime("%Y-%m").split("-")
|
||||||
|
weekday, total_day=monthrange(int(year), int(month))
|
||||||
|
time_start='%s-%s-01'%(year,str(month).zfill(2))
|
||||||
|
time_stop='%s-%s-%s'%(year,str(month).zfill(2),total_day)
|
||||||
|
|
||||||
defaults=context.get('defaults')
|
defaults=context.get('defaults')
|
||||||
if defaults:
|
if defaults:
|
||||||
date=defaults['date']
|
year,month,total_day=defaults['date'].split("-")
|
||||||
year=int(date[0:4])
|
time_start='%s-%s-01'%(year,str(month).zfill(2))
|
||||||
month=int(date[5:7])
|
time_stop='%s-%s-%s'%(year,str(month).zfill(2),total_day)
|
||||||
weekday, total_day=monthrange(year, month)
|
|
||||||
|
if ids:
|
||||||
|
obj=self.browse(ids)[0]
|
||||||
|
month=obj.date_from.split("-")[1]
|
||||||
|
time_start=obj.date_from
|
||||||
|
time_stop=obj.date_to
|
||||||
|
|
||||||
dom=[]
|
dom=[]
|
||||||
dom.append([['state','=','completed']])
|
#dom.append([['state','=','completed']])
|
||||||
dom.append([['time_start','>=','%s-%s-01 00:00:00'%(year,month)]])
|
dom.append(['time_start','>=','%s 00:00:00'%time_start])
|
||||||
dom.append([['time_stop','<=','%s-%s-%s 23:59:59'%(year,month,total_day)]])
|
dom.append(['time_stop','<=','%s 23:59:59'%time_stop])
|
||||||
|
|
||||||
products={}
|
products={}
|
||||||
for prod in get_model("product").search_browse([['type','=','stock']]):
|
for prod in get_model("product").search_browse([['type','=','stock']]):
|
||||||
|
@ -73,7 +95,7 @@ class ReportMedicalSummary(Model):
|
||||||
|
|
||||||
company_id=get_active_company()
|
company_id=get_active_company()
|
||||||
company=get_model('company').browse(company_id)
|
company=get_model('company').browse(company_id)
|
||||||
month_str=utils.MONTHS['th_TH'][month]
|
month_str=utils.MONTHS['th_TH'][int(month)]
|
||||||
|
|
||||||
lines=sorted(lines, key=lambda x: x['prod_name'])
|
lines=sorted(lines, key=lambda x: x['prod_name'])
|
||||||
titles={
|
titles={
|
||||||
|
@ -94,4 +116,13 @@ class ReportMedicalSummary(Model):
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
def onchange_date(self,context={}):
|
||||||
|
data=context['data']
|
||||||
|
date=data['date']
|
||||||
|
year,month,day=date.split("-")
|
||||||
|
weekday, total_day=monthrange(int(year), int(month))
|
||||||
|
data['date_from']="%s-%s-01"%(year,month)
|
||||||
|
data['date_to']="%s-%s-%s"%(year,month,total_day)
|
||||||
|
return data
|
||||||
|
|
||||||
ReportMedicalSummary.register()
|
ReportMedicalSummary.register()
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
from netforce.model import Model, fields
|
||||||
|
|
||||||
|
class VisitDialy(Model):
|
||||||
|
_name="clinic.visit.dialy"
|
||||||
|
_string="Visit Dialy"
|
||||||
|
_transient=True
|
||||||
|
|
||||||
|
_fields={
|
||||||
|
'date': fields.Date('Date'),
|
||||||
|
}
|
||||||
|
|
||||||
|
VisitDialy.register()
|
|
@ -1,54 +1,8 @@
|
||||||
======
|
cycle dialy
|
||||||
design visit
|
cycle_id, date,
|
||||||
design cycle item
|
-list of cycle items
|
||||||
|
-list
|
||||||
======
|
visit dialy
|
||||||
flow:
|
list of visits
|
||||||
planing schedule
|
import payment
|
||||||
plaining visit
|
- error report
|
||||||
- generate visit
|
|
||||||
hd case
|
|
||||||
- check list of personals -> popup
|
|
||||||
- nurse
|
|
||||||
- remove who
|
|
||||||
- doctor
|
|
||||||
======
|
|
||||||
missing:
|
|
||||||
- search calendar
|
|
||||||
- can not move schedule in calendar
|
|
||||||
- color calendar
|
|
||||||
- can not move calendar's schedule
|
|
||||||
- order's visit report dialy
|
|
||||||
- same model & mode (list) but use diffent target
|
|
||||||
|
|
||||||
dashboard
|
|
||||||
: hd summary report -> click and go direct
|
|
||||||
cycle item:
|
|
||||||
cycle_id
|
|
||||||
list's nurse
|
|
||||||
list's patient & doctor
|
|
||||||
|
|
||||||
idea:
|
|
||||||
show popup to complete hd case
|
|
||||||
approve by nurse
|
|
||||||
|
|
||||||
after finish hd case -> show popup to check nurse and doctor after finish
|
|
||||||
|
|
||||||
formalar
|
|
||||||
tick:
|
|
||||||
find all -> replace -> multiple x
|
|
||||||
|
|
||||||
order
|
|
||||||
- visit
|
|
||||||
- date, cycle (1, 2, 3), state
|
|
||||||
- by datenow, cycle sequence, state
|
|
||||||
- solution: maybe make some dashboard to that
|
|
||||||
- like a table treatment in 1 day
|
|
||||||
|
|
||||||
widget
|
|
||||||
-
|
|
||||||
- summary hd case for each month (see. account dashboard)
|
|
||||||
bar char
|
|
||||||
tick
|
|
||||||
many2many=> add, set
|
|
||||||
one2many=> create, write
|
|
||||||
|
|
Loading…
Reference in New Issue