diff --git a/netforce_clinic/models/report_visit.py b/netforce_clinic/models/report_visit.py index 9ee2155..868cd25 100644 --- a/netforce_clinic/models/report_visit.py +++ b/netforce_clinic/models/report_visit.py @@ -69,13 +69,14 @@ class ReportVisit(Model): records=get_model('clinic.visit').search_browse(dom) lines=[] no=1 - for record in records: + for record in sorted(records,key=lambda x: (x.patient_id.id,x.visit_date)): lines.append({ 'no': no, 'vid': record.id, 'cid': record.cycle_id.id, 'cname': record.cycle_id.name or "", 'pid': record.patient_id.id or '', + 'hn': record.patient_id.hn_no or '', 'pname': record.patient_id.name or '', 'tname': record.patient_id.type_id.name or '', 'tid': record.patient_id.type_id.id or '', diff --git a/netforce_clinic/reports/report_visit.xlsx b/netforce_clinic/reports/report_visit.xlsx index 879078a..a18be86 100644 Binary files a/netforce_clinic/reports/report_visit.xlsx and b/netforce_clinic/reports/report_visit.xlsx differ diff --git a/netforce_clinic/templates/report_visit.hbs b/netforce_clinic/templates/report_visit.hbs index 0063263..e70c58e 100644 --- a/netforce_clinic/templates/report_visit.hbs +++ b/netforce_clinic/templates/report_visit.hbs @@ -18,6 +18,7 @@ # วันที่ รอบ + HN ผู้ป่วย สิทธ์ แพทย์ @@ -29,6 +30,7 @@ {{no}} {{date}} {{cname}} + {{hn}} {{pname}} {{tname}} {{dname}}