|
@@ -1371,9 +1371,13 @@ SELECT client.name_first, client.name_last,
|
|
|
care_month.most_recent_cellular_bp_sbp_mm_hg,
|
|
|
care_month.most_recent_cellular_bp_measurement_at,
|
|
|
care_month.most_recent_cellular_weight_value,
|
|
|
- care_month.most_recent_cellular_weight_measurement_at
|
|
|
+ care_month.most_recent_cellular_weight_measurement_at,
|
|
|
+ care_month.mcp_rm_generic_bill_id,
|
|
|
+ bill.uid as mcp_rm_generic_bill_uid,
|
|
|
+ bill.generic_pro_expected_payment_amount as mcp_rm_generic_bill_expected_payment_amount
|
|
|
FROM care_month join client on care_month.client_id = client.id join note mrnote on client.most_recent_completed_mcp_note_id = mrnote.id
|
|
|
- left join note mrmnote on mrmnote.id = (
|
|
|
+ left join bill on care_month.mcp_rm_generic_bill_id = bill.id
|
|
|
+ left join note mrmnote on mrmnote.id = (
|
|
|
select max(n.id) from note n
|
|
|
where
|
|
|
n.client_id = client.id AND
|