Fix IPD bill print showing blank bed number and doctor name
- Add bed_master join to fetch current bed assignment via current_ipd_id - Add ipd_master_doc_list and doctor_master joins to fetch assigned doctors - Use GROUP_CONCAT to handle multiple doctors in single query - Fixes bill print displaying empty Bed No and Doctor Name fields
This commit is contained in:
parent
bb95756700
commit
7cf13bffd1
|
|
@ -159,9 +159,15 @@ class IpdBillingModel extends Model
|
|||
->select("o.final_bill_send as final_bill_send", false)
|
||||
->select("o.org_approved_status as org_approved_status", false)
|
||||
->select("o.remark as remark", false)
|
||||
->select("bm.bed_number as bed_no", false)
|
||||
->select("group_concat(distinct concat_ws(' ', 'Dr.', d.p_fname, d.p_mname, d.p_lname) separator ', ') as r_doc_name", false)
|
||||
->join('organization_case_master o', 'i.case_id = o.id', 'left')
|
||||
->join('hc_insurance in_master', 'in_master.id = o.insurance_id', 'left')
|
||||
->join('bed_master bm', 'bm.current_ipd_id = i.id', 'left')
|
||||
->join('ipd_master_doc_list imdl', 'imdl.ipd_id = i.id', 'left')
|
||||
->join('doctor_master d', 'd.id = imdl.doc_id', 'left')
|
||||
->where('i.id', $ipdId)
|
||||
->groupBy('i.id')
|
||||
->get()
|
||||
->getRow();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user