2014-10-13 08:10:20 +00:00
|
|
|
import time
|
|
|
|
|
|
|
|
from netforce.model import Model, fields, get_model
|
|
|
|
|
|
|
|
class DialyzerDrop(Model):
|
|
|
|
_name="report.dialyzer.drop"
|
|
|
|
_string="Dialyzer [Drop]"
|
|
|
|
_transient=True
|
|
|
|
|
|
|
|
_fields={
|
|
|
|
"date": fields.Date("Date"),
|
|
|
|
}
|
|
|
|
|
|
|
|
_defaults={
|
|
|
|
'date': lambda *a: time.strftime("%Y-%m-%d"),
|
|
|
|
}
|
|
|
|
|
|
|
|
def get_report_data(self,ids,context={}):
|
|
|
|
lines=[]
|
|
|
|
|
2014-10-14 11:42:21 +00:00
|
|
|
hd_cases=get_model("clinic.dialyzer").search_browse(['state','=','drop'])
|
2014-10-13 08:10:20 +00:00
|
|
|
for dialyzer_ids in hd_cases:
|
|
|
|
lines.append({
|
|
|
|
'number' : dialyzer_ids.number,
|
|
|
|
'usetime': dialyzer_ids.use_time,
|
|
|
|
'maxuse' : dialyzer_ids.max_use_time,
|
|
|
|
'createdate' : dialyzer_ids.date,
|
|
|
|
'expdate' : dialyzer_ids.exp_date,
|
|
|
|
'patient' : dialyzer_ids.patient_id.name,
|
|
|
|
})
|
|
|
|
|
|
|
|
data={
|
|
|
|
'lines': lines or "Dialyzer Drop [Empty]",
|
|
|
|
}
|
|
|
|
return data
|
|
|
|
|
|
|
|
DialyzerDrop.register()
|