report
parent
927dfc4fa4
commit
f84e2337e4
|
@ -1,11 +1,7 @@
|
|||
<board>
|
||||
<vpanel>
|
||||
<hpanel>
|
||||
<widget action="clinic_visit_widget" string="Current Visit" span="12"/>
|
||||
</vpanel>
|
||||
<vpanel>
|
||||
<widget action="clinic_recent_patient_widget" string="Recent Patient" span="12"/>
|
||||
</vpanel>
|
||||
<vpanel>
|
||||
<widget action="clinic_cycle_widget" string="Average Cycle" span="12"/>
|
||||
</vpanel>
|
||||
<widget action="clinic_recent_patient_widget" string="Recent Patient"/>
|
||||
<widget action="clinic_cycle_widget" string="Average Cycle"/>
|
||||
</hpanel>
|
||||
</board>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<item string="Schedules" action="clinic_schedule"/>
|
||||
<item string="Visits">
|
||||
<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>
|
||||
<item string="HD Cases" action="clinic_hd_case"/>
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
<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>
|
||||
|
|
|
@ -15,6 +15,7 @@ from . import patient_comorbidity
|
|||
from . import patient_morbidity
|
||||
from . import race
|
||||
from . import visit
|
||||
from . import visit_dialy
|
||||
from . import hd_case
|
||||
from . import hd_case_line
|
||||
from . import hd_case_personal
|
||||
|
|
|
@ -12,25 +12,47 @@ class ReportMedicalSummary(Model):
|
|||
|
||||
_fields={
|
||||
"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={
|
||||
'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={}):
|
||||
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')
|
||||
if defaults:
|
||||
date=defaults['date']
|
||||
year=int(date[0:4])
|
||||
month=int(date[5:7])
|
||||
weekday, total_day=monthrange(year, month)
|
||||
year,month,total_day=defaults['date'].split("-")
|
||||
time_start='%s-%s-01'%(year,str(month).zfill(2))
|
||||
time_stop='%s-%s-%s'%(year,str(month).zfill(2),total_day)
|
||||
|
||||
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.append([['state','=','completed']])
|
||||
dom.append([['time_start','>=','%s-%s-01 00:00:00'%(year,month)]])
|
||||
dom.append([['time_stop','<=','%s-%s-%s 23:59:59'%(year,month,total_day)]])
|
||||
#dom.append([['state','=','completed']])
|
||||
dom.append(['time_start','>=','%s 00:00:00'%time_start])
|
||||
dom.append(['time_stop','<=','%s 23:59:59'%time_stop])
|
||||
|
||||
products={}
|
||||
for prod in get_model("product").search_browse([['type','=','stock']]):
|
||||
|
@ -73,7 +95,7 @@ class ReportMedicalSummary(Model):
|
|||
|
||||
company_id=get_active_company()
|
||||
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'])
|
||||
titles={
|
||||
|
@ -94,4 +116,13 @@ class ReportMedicalSummary(Model):
|
|||
|
||||
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()
|
||||
|
|
|
@ -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 @@
|
|||
======
|
||||
design visit
|
||||
design cycle item
|
||||
|
||||
======
|
||||
flow:
|
||||
planing schedule
|
||||
plaining visit
|
||||
- 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
|
||||
cycle dialy
|
||||
cycle_id, date,
|
||||
-list of cycle items
|
||||
-list
|
||||
visit dialy
|
||||
list of visits
|
||||
import payment
|
||||
- error report
|
||||
|
|
Loading…
Reference in New Issue