From 2d1b3e0bbaa3b8df64dc245dc903c3b7aed94c97 Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Sun, 4 Jun 2017 23:40:06 +0700 Subject: [PATCH] keep old patient name, report hdcase summary get data from patient move --- .../actions/clinic_patient_move.xml | 6 + .../actions/report_hdcase_summary.xml | 9 + .../layouts/clinic_hd_case_form.xml | 1 + .../layouts/clinic_hd_case_list.xml | 2 +- .../layouts/clinic_hd_case_search.xml | 1 + netforce_clinic/layouts/clinic_menu.xml | 2 + netforce_clinic/layouts/clinic_shop_list.xml | 5 +- netforce_clinic/layouts/clinic_visit_form.xml | 1 + netforce_clinic/layouts/clinic_visit_list.xml | 2 +- .../layouts/clinic_visit_search.xml | 1 + netforce_clinic/layouts/patient_move_form.xml | 8 + netforce_clinic/layouts/patient_move_list.xml | 8 + .../layouts/report_hdcase_summary.xml | 5 + netforce_clinic/migrations/__init__.py | 4 +- netforce_clinic/migrations/patient_move.py | 23 +++ .../migrations/store_patient_name.py | 26 +++ netforce_clinic/models/__init__.py | 1 + netforce_clinic/models/account_invoice.py | 8 + netforce_clinic/models/hd_case.py | 8 + netforce_clinic/models/patient_move.py | 172 +++++++++++++++++- .../models/report_hdcase_summary.py | 95 ++++++++++ netforce_clinic/models/shop.py | 8 + netforce_clinic/models/visit.py | 8 + .../reports/report_hdcase_summary.xlsx | Bin 0 -> 6630 bytes .../templates/report_hdcase_summary.hbs | 86 +++++++++ 25 files changed, 479 insertions(+), 11 deletions(-) create mode 100644 netforce_clinic/actions/clinic_patient_move.xml create mode 100644 netforce_clinic/actions/report_hdcase_summary.xml create mode 100644 netforce_clinic/layouts/patient_move_form.xml create mode 100644 netforce_clinic/layouts/patient_move_list.xml create mode 100644 netforce_clinic/layouts/report_hdcase_summary.xml create mode 100644 netforce_clinic/migrations/patient_move.py create mode 100644 netforce_clinic/migrations/store_patient_name.py create mode 100644 netforce_clinic/models/report_hdcase_summary.py create mode 100644 netforce_clinic/reports/report_hdcase_summary.xlsx create mode 100644 netforce_clinic/templates/report_hdcase_summary.hbs diff --git a/netforce_clinic/actions/clinic_patient_move.xml b/netforce_clinic/actions/clinic_patient_move.xml new file mode 100644 index 0000000..4200bed --- /dev/null +++ b/netforce_clinic/actions/clinic_patient_move.xml @@ -0,0 +1,6 @@ + + Patient Movement + multi_view + clinic.patient.move + clinic_menu + diff --git a/netforce_clinic/actions/report_hdcase_summary.xml b/netforce_clinic/actions/report_hdcase_summary.xml new file mode 100644 index 0000000..9b44bff --- /dev/null +++ b/netforce_clinic/actions/report_hdcase_summary.xml @@ -0,0 +1,9 @@ + + HDCase Summary(v2) + report + report.hdcase.summary + report_hdcase_summary + report_hdcase_summary + 1 + clinic_menu + diff --git a/netforce_clinic/layouts/clinic_hd_case_form.xml b/netforce_clinic/layouts/clinic_hd_case_form.xml index 7eddc49..295163e 100644 --- a/netforce_clinic/layouts/clinic_hd_case_form.xml +++ b/netforce_clinic/layouts/clinic_hd_case_form.xml @@ -23,6 +23,7 @@ + diff --git a/netforce_clinic/layouts/clinic_hd_case_list.xml b/netforce_clinic/layouts/clinic_hd_case_list.xml index 92bb743..bc97346 100644 --- a/netforce_clinic/layouts/clinic_hd_case_list.xml +++ b/netforce_clinic/layouts/clinic_hd_case_list.xml @@ -2,7 +2,7 @@ - + diff --git a/netforce_clinic/layouts/clinic_hd_case_search.xml b/netforce_clinic/layouts/clinic_hd_case_search.xml index 5acd5a9..5fca032 100644 --- a/netforce_clinic/layouts/clinic_hd_case_search.xml +++ b/netforce_clinic/layouts/clinic_hd_case_search.xml @@ -3,6 +3,7 @@ + diff --git a/netforce_clinic/layouts/clinic_menu.xml b/netforce_clinic/layouts/clinic_menu.xml index 875bc87..a4ec7a4 100644 --- a/netforce_clinic/layouts/clinic_menu.xml +++ b/netforce_clinic/layouts/clinic_menu.xml @@ -12,6 +12,7 @@ +
@@ -45,6 +46,7 @@ + diff --git a/netforce_clinic/layouts/clinic_shop_list.xml b/netforce_clinic/layouts/clinic_shop_list.xml index 9e3ed09..7efc4e0 100644 --- a/netforce_clinic/layouts/clinic_shop_list.xml +++ b/netforce_clinic/layouts/clinic_shop_list.xml @@ -4,9 +4,8 @@ - - - + + diff --git a/netforce_clinic/layouts/clinic_visit_form.xml b/netforce_clinic/layouts/clinic_visit_form.xml index a6c7967..dcc2949 100644 --- a/netforce_clinic/layouts/clinic_visit_form.xml +++ b/netforce_clinic/layouts/clinic_visit_form.xml @@ -22,6 +22,7 @@ + diff --git a/netforce_clinic/layouts/clinic_visit_list.xml b/netforce_clinic/layouts/clinic_visit_list.xml index a10b8f5..85eb20b 100644 --- a/netforce_clinic/layouts/clinic_visit_list.xml +++ b/netforce_clinic/layouts/clinic_visit_list.xml @@ -5,7 +5,7 @@ - + diff --git a/netforce_clinic/layouts/clinic_visit_search.xml b/netforce_clinic/layouts/clinic_visit_search.xml index 0f28c42..c86b6fa 100644 --- a/netforce_clinic/layouts/clinic_visit_search.xml +++ b/netforce_clinic/layouts/clinic_visit_search.xml @@ -2,6 +2,7 @@ + diff --git a/netforce_clinic/layouts/patient_move_form.xml b/netforce_clinic/layouts/patient_move_form.xml new file mode 100644 index 0000000..7c470f2 --- /dev/null +++ b/netforce_clinic/layouts/patient_move_form.xml @@ -0,0 +1,8 @@ +
+ + + + + + + diff --git a/netforce_clinic/layouts/patient_move_list.xml b/netforce_clinic/layouts/patient_move_list.xml new file mode 100644 index 0000000..65bd5ad --- /dev/null +++ b/netforce_clinic/layouts/patient_move_list.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/netforce_clinic/layouts/report_hdcase_summary.xml b/netforce_clinic/layouts/report_hdcase_summary.xml new file mode 100644 index 0000000..1698705 --- /dev/null +++ b/netforce_clinic/layouts/report_hdcase_summary.xml @@ -0,0 +1,5 @@ +
+ + + + diff --git a/netforce_clinic/migrations/__init__.py b/netforce_clinic/migrations/__init__.py index d5e40e0..7dbe024 100644 --- a/netforce_clinic/migrations/__init__.py +++ b/netforce_clinic/migrations/__init__.py @@ -15,4 +15,6 @@ from . import clinic_setting #from . import reimport10to15 #from . import add_missing_dlz # pending #from . import validate_cycle_item -from . import update_line_amount +#from . import update_line_amount +#from . import store_patient_name +from . import patient_move diff --git a/netforce_clinic/migrations/patient_move.py b/netforce_clinic/migrations/patient_move.py new file mode 100644 index 0000000..12ac1f3 --- /dev/null +++ b/netforce_clinic/migrations/patient_move.py @@ -0,0 +1,23 @@ +import time +import csv +import xlrd + +from netforce.model import get_model +from netforce import migration +from netforce.access import set_active_user, set_active_company +from netforce.database import get_connection + +class PatientMove(migration.Migration): + _name="clinic.patient.move" + _version="2.12.6" + + def migrate(self): + set_active_company(1) + set_active_user(1) + datenow=time.strftime("%Y-%m-%d") + datenow='2017-05-01' + get_model('clinic.patient.move').auto_get_data(context={'date': datenow}) + #for patient in get_model("clinic.patient").search_browse([],order="department_id"): + #print(patient.name, patient.location, patient.department_id.name) + +PatientMove.register() diff --git a/netforce_clinic/migrations/store_patient_name.py b/netforce_clinic/migrations/store_patient_name.py new file mode 100644 index 0000000..d18ca5c --- /dev/null +++ b/netforce_clinic/migrations/store_patient_name.py @@ -0,0 +1,26 @@ +import csv +import xlrd + +from netforce.model import get_model +from netforce import migration +from netforce.access import set_active_user, set_active_company +from netforce.database import get_connection + +class Migration(migration.Migration): + _name="clinic.store.patient.name" + _version="2.12.6" + + def migrate(self): + set_active_company(1) + set_active_user(1) + + #ids=get_model("clinic.hd.case").search([]) + #get_model("clinic.hd.case").function_store(ids) + + ids=get_model("clinic.visit").search([]) + get_model("clinic.visit").function_store(ids) + + ids=get_model("clinic.shop").search([]) + get_model("clinic.shop").function_store(ids) + +Migration.register() diff --git a/netforce_clinic/models/__init__.py b/netforce_clinic/models/__init__.py index 37b40fe..6835288 100644 --- a/netforce_clinic/models/__init__.py +++ b/netforce_clinic/models/__init__.py @@ -148,3 +148,4 @@ from . import payment_matching from . import create_invoice_payment from . import report_stock_card from . import report_receipt_summary +from . import report_hdcase_summary diff --git a/netforce_clinic/models/account_invoice.py b/netforce_clinic/models/account_invoice.py index fccc873..9051976 100644 --- a/netforce_clinic/models/account_invoice.py +++ b/netforce_clinic/models/account_invoice.py @@ -31,8 +31,16 @@ class AccountInvoice(Model): 'patient_id': fields.Many2One("clinic.patient","Patient",function="_get_patient", function_multi=True,store=True,search=True), 'patient_type_id': fields.Many2One("clinic.patient.type","Patient Type",function="_get_patient", function_multi=True,store=True,search=True), 'create_invoice_id': fields.Many2One("create.invoice.payment","Create Invoice Payment"), + 'patient_name': fields.Char("Patient Name", function="_get_patient_name", store=True), } + def _get_patient_name(self, ids, context={}): + res={} + for obj in self.browse(ids): + patient=obj.patient_id + res[obj.id]=patient.name + return res + def _get_number(self,context={}): defaults=context.get("defaults") if defaults: # XXX diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py index 1d65184..332c0a1 100644 --- a/netforce_clinic/models/hd_case.py +++ b/netforce_clinic/models/hd_case.py @@ -298,8 +298,16 @@ class HDCase(Model): 'company_id': fields.Many2One("company","Company"), 'branch_id': fields.Many2One("clinic.branch","Branch"), 'check_dlz': fields.Boolean("Check Dialyzer"), + 'patient_name': fields.Char("Patient Name", function="_get_patient_name", store=True, search=True), } + def _get_patient_name(self, ids, context={}): + res={} + for obj in self.browse(ids): + patient=obj.patient_id + res[obj.id]=patient.name + return res + def _get_number(self,context={}): while 1: seq_id=get_model("sequence").find_sequence(type="clinic_hdcase",context=context) diff --git a/netforce_clinic/models/patient_move.py b/netforce_clinic/models/patient_move.py index 992c736..84722a3 100644 --- a/netforce_clinic/models/patient_move.py +++ b/netforce_clinic/models/patient_move.py @@ -1,17 +1,179 @@ import time +from datetime import datetime +from calendar import monthrange -from netforce.model import Model, fields +from netforce.model import Model, fields, get_model +from netforce.access import get_active_user, set_active_user + +from . import utils class PatientMove(Model): _name="clinic.patient.move" + + def get_all(self, ids, context={}): + res={} + for obj in self.browse(ids): + res[obj.id]={ + 'date_move': obj.date.split(" ")[0], + } + return res + + _fields={ - 'patient_id': fields.Many2One('clinic.patient','Patient'), - 'date': fields.DateTime("Date"), - 'location_id': fields.Many2One("clinic.department","Department"), + 'patient_id': fields.Many2One('clinic.patient','Patient',search=True), + 'date': fields.DateTime("Date", required=True,search=True), + 'date_move': fields.Date("Date Move", function="get_all", function_multi=True, store=True), + 'location_from_id': fields.Many2One("clinic.department","Location From",search=True), + 'location_to_id': fields.Many2One("clinic.department","Location To",search=True), + "state": fields.Selection([['normal','Normal'],['new','New'],['dispose','Dispose']], "State"), + 'note': fields.Text("Note",search=True), } _defaults={ 'date': lambda *a: time.strftime("%Y-%m-%d %H:%M:%S"), + 'state': 'normal', } -PatientMove() + def get_data(self, date, department_id, context={}): + if not date: + raise Exception("Missing date!") + y,m,d=date.split("-") + y=int(y) + m=int(m) + weekday, day_month=monthrange(y, m) + + cond1=[ + ['date','>=','%s-%s-01 00:00:00'%(y,str(m).zfill(2))], + ['date','<=','%s-%s-%s 23:59:59'%(y,str(m).zfill(2),day_month)], + ['location_to_id','=', department_id], + ] + cond=cond1+[['state','=','normal']] + ids=self.search(cond) + prev_month=len(ids) + + cond=cond1+[['state','=','new']] + ids=self.search(cond) + current_month=len(ids) + current_items=[] + for index, val in enumerate(self.read(ids)): + val['no']=index+1 + current_items.append(val) + + + cond=cond1+[['state','=','dispose']] + ids=self.search(cond) + dispose_month=len(ids) + dispose_items=[] + for index, val in enumerate(self.read(ids)): + val['no']=index+1 + dispose_items.append(val) + + next_month=prev_month+current_month-dispose_month + + prev_m=m-1 + if prev_m <= 0: + prev_m=1 + next_m=m+1 + if next_m > 12: + next_m=1 + + prev_month_thai=utils.MONTHS['th_TH'][prev_m] + current_month_thai=utils.MONTHS['th_TH'][m] + dispose_month_thai=utils.MONTHS['th_TH'][m] + next_month_thai=utils.MONTHS['th_TH'][next_m] + + res={ + 'prev_month': prev_month, + 'prev_month_thai': prev_month_thai, + + 'current_month': current_month, + 'current_month_thai': current_month_thai, + 'current_items': current_items, + + 'dispose_month': dispose_month, + 'dispose_month_thai': dispose_month_thai, + 'dispose_items': dispose_items, + + 'next_month': next_month, + 'next_month_thai': next_month_thai, + } + return res + + def auto_get_data(self, context={}): + user_id=get_active_user() + set_active_user(1) + + date=context.get("date") + if not date: + raise Exception("Missing date!") + y,m,d=date.split("-") + weekday, day_month=monthrange(int(y), int(m)) + cond=[ + ['date','>=','%s-%s-01 00:00:00'%(y,m)], + ['date','<=','%s-%s-%s 23:59:59'%(y,m,day_month)], + ] + res=self.search(cond) + + # copy data from previous month + if not res: + y=int(y) + m=int(m)-1 + if m<=0: + m=1 + y-=1 + + weekday, day_month=monthrange(int(y), int(m)) + cond=[ + ['date','>=','%s-%s-01 00:00:00'%(y,m)], + ['date','<=','%s-%s-%s 23:59:59'%(y,m,day_month)], + ] + res=self.search_browse(cond) + for obj in res: + if obj.state=='dispose': + continue + vals={ + 'location_from_id': obj.location_from_id.id, + 'location_to_id': obj.location_to_id.id, + 'patient_id': obj.patient_id.id, + 'date': date, + } + self.create(vals) + # copy from patient + if not res: + cond=[ + ['walkin','=','no'], + ['dispose','=',False], + ] + locations={ + 'LS-FL1': 1, + 'LS-FL2': 2, + 'LS-FL3': 3, + 'SS-FL3': 4, + 'SS-FL4': 5, + } + for obj in get_model("clinic.patient").search_browse(cond): + if not obj.location: + continue + locs=obj.location.split(",") + vals={ + 'location_from_id': locations[locs[0]], #first + 'location_to_id': locations[locs[-1]], #last + 'patient_id': obj.id, + 'note': obj.note, + 'date': date, + } + self.create(vals) + + set_active_user(user_id) + + def create(self, vals, **kw): + new_id=super().create(vals,**kw) + self.function_store([new_id]) + return new_id + + def write(self, ids, vals, **kw): + super().write(ids, vals, **kw) + self.function_store(ids) + + +PatientMove.register() diff --git a/netforce_clinic/models/report_hdcase_summary.py b/netforce_clinic/models/report_hdcase_summary.py new file mode 100644 index 0000000..3b989b8 --- /dev/null +++ b/netforce_clinic/models/report_hdcase_summary.py @@ -0,0 +1,95 @@ +import time +from calendar import monthrange + +from netforce.model import Model, fields, get_model +from netforce.access import get_active_company + +from . import utils + +class ReportHDCaseSummaryV2(Model): + _name="report.hdcase.summary" + _trasient=True + + _fields={ + "month": fields.Date("Month"), + "branch_id": fields.Many2One("clinic.branch","Branch"), + "department_id": fields.Many2One("clinic.department","Department"), + } + + def default_get(self,field_names=None,context={},**kw): + vals={ + "month": time.strftime("%Y-%m-%d"), + } + select_dpt=get_model('select.company').get_select() + if select_dpt: + vals.update({ + "branch_id": select_dpt['branch_id'], + "department_id": select_dpt['department_id'], + }) + return vals + + def get_report_data(self, ids, context={}): + defaults=self.default_get(context=context) + + month=defaults.get("month") + + + y,m,d=month.split("-") + + branch_id=defaults.get("branch_id") + department_id=defaults.get("department_id") + + if ids: + obj=self.browse(ids)[0] + branch_id=obj.branch_id.id + department_id=obj.department_id.id + month=obj.month + y,m,d=month.split("-") + + #auto gen at the fist time of that month + get_model("clinic.patient.move").auto_get_data(context={'date': month}) + + crr_month=m + weekday, total_day=monthrange(int(y), int(m)) + date_from="-".join([y,m,"01"]) + date_to="-".join([y,m,str(total_day)]) + + cond=[ + ['date','>=',date_from], + ['date','<=',date_to], + ['state','in',["waiting_payment","paid"]], + + ] + #if branch_id: + #cond.append([ + #'branch_id','=',branch_id, + #]) + if department_id: + cond.append([ + 'department_id','=',department_id, + ]) + + hdcase_ids=get_model("clinic.hd.case").search(cond) + + company_id=get_active_company() + company=get_model("company").browse(company_id) + department=get_model("clinic.department").browse(department_id) + + year_thai=utils.date2thai(month, lang='th_TH').split("-")[0] + month_thai=utils.MONTHS['th_TH'][int(crr_month)] + + data={ + 'company_name': company.name, + 'department_name': department.name, + 'month_thai': month_thai, + 'year_thai': year_thai, + 'total_hdcase': len(hdcase_ids), + } + data2=get_model("clinic.patient.move").get_data(date=month, department_id=department_id) + data.update(data2) + + from pprint import pprint + pprint(data) + return data + +ReportHDCaseSummaryV2.register() diff --git a/netforce_clinic/models/shop.py b/netforce_clinic/models/shop.py index bd57718..e22ddbd 100644 --- a/netforce_clinic/models/shop.py +++ b/netforce_clinic/models/shop.py @@ -62,10 +62,18 @@ class Shop(Model): 'hd_case_call': fields.Boolean("HD Case Call"), 'note': fields.Text("Note"), "payment_lines": fields.One2Many("clinic.shop.payment","shop_id","Payment Lines"), + 'patient_name': fields.Char("Patient Name", function="_get_patient_name", store=True, search=True), } _order="date desc" + def _get_patient_name(self, ids, context={}): + res={} + for obj in self.browse(ids): + patient=obj.patient_id + res[obj.id]=patient.name + return res + def _get_related(self,context={}): related_id=None if context.get('refer_id'): diff --git a/netforce_clinic/models/visit.py b/netforce_clinic/models/visit.py index 074fb11..ea401a0 100644 --- a/netforce_clinic/models/visit.py +++ b/netforce_clinic/models/visit.py @@ -54,8 +54,16 @@ class Visit(Model): 'note': fields.Text('Note'), 'branch_id': fields.Many2One("clinic.branch","Branch"), 'manual': fields.Boolean("Manual Tempolary Visit"), + 'patient_name': fields.Char("Patient Name", function="_get_patient_name", store=True, search=True), } + def _get_patient_name(self, ids, context={}): + res={} + for obj in self.browse(ids): + patient=obj.patient_id + res[obj.id]=patient.name + return res + def _get_number(self,context={}): while 1: seq_type='clinic_visit' diff --git a/netforce_clinic/reports/report_hdcase_summary.xlsx b/netforce_clinic/reports/report_hdcase_summary.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..8a209fd55d6548cb32641d0617e570f026640103 GIT binary patch literal 6630 zcmaKw1yoes7RP}>Lb|(=?x9n=6tkWfI78VRLSx`&dI?i56c2k(3D z>2tmJ?OE&0+*$X;{hz(}-RGyF3_!$(LqS1-TM@-mg!|3V?th!P+c$;Yxu^ffK;LM?03xO;y60bo2P!z+m666F$$l0)fboL^y?YEd* z`4~BHxgl$8{57$EQ9kD79$AZ%{xIE$o)SHl)j;`FxAQr5vMYQo8P}|_W+%v0_^Wvd zc~hkIqP2gRi-{TF&U*VIs_bIPe(7hNUgTw1Ms?YqT%^ysDT18P_*ebHMD|N2IZj|R zj{2yKwr&Bb+9zjDpDTYg6egHa%}Ug>SB*M#v6*dNqD_(RuO#rc!rtF{2sNU}CEPYA ztL_ZiPq&XV+DpJ`C?li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F}g&T;VW z9mhx-?CNRb>S?Cq=Vs$!@^Fl7NmWd}@UU(ccM))!#EYa^sAPc!{EA-$ch79i#pYs5#Ua+<)S%d5B;OXmTo3puMQ&)hw z^^fq>9Z}KxmD5Nn^re zcQg&{GkxR6idOt=dT!JbvoKO<&gJ@LZldERCG0oyQq!z3>KRrD2)Ir}6#YL$i5E~? zfm&MRht5c%4S zH*mfwt@q$6#W0qtXCLoD^w#{vF5Y|5_3tBALm3_cAMO{D|D8!cAo>5c-vIre9e)S4 z56JqLk=#%9C&2!*_wU^B0p|WPv3tt!pWgpQyMK279o9U+#b366?^yo}HU2rm?@;3b z>in{Lq<@a^e-O`~O_&$j~JkNiMy+6DD z9#Ibo_m{2Rhta_ A_5c6? literal 0 HcmV?d00001 diff --git a/netforce_clinic/templates/report_hdcase_summary.hbs b/netforce_clinic/templates/report_hdcase_summary.hbs new file mode 100644 index 0000000..e7c4af2 --- /dev/null +++ b/netforce_clinic/templates/report_hdcase_summary.hbs @@ -0,0 +1,86 @@ + +
+

+ HDCase Summary (V2) +

+

+ {{company_name}} + {{department_name}} +

+

+ ประจำเดือน {{month_thai}} {{year_thai}} +

+
+ + + + + + + + + + + + + + + + + + + + + + + +
จำนวนครั้งการทำ Hemodialysis{{month_thai}}เท่ากับ{{total_hdcase}}ครั้ง
จำนวนผู้ป่วยยกมาจากเดือน{{prev_month_thai}}เท่ากับ{{prev_month}}ครั้ง
จำนวนผู้ป่วยรับใหม่เดือน{{current_month_thai}}เท่ากับ{{current_month}}ครั้ง
จำนวนผู้ป่วยจำหน่ายเดือน{{dispose_month_thai}}เท่ากับ{{dispose_month}}ครั้ง
จำนวนผู้ป่วยยกไปเดือน{{next_month_thai}}เท่ากับ{{next_month}}ครั้ง
+ +
+
+

รายชื่อผู้ป่วยรับใหม่

+ + + + + + + + {{#each current_items}} + + + + + + {{/each}} + +
No.วันที่ชื่อ
{{no}}{{date_move}}{{patient_id.1.}}
+
+
+

รายชื่อผู้ป่วยจำหน่าย

+ + + + + + + + {{#each dispose_items}} + + + + + + {{/each}} + +
No.วันที่ชื่อ
{{no}}{{date_move}}{{patient_id.1.}}
+
+