|
@@ -1111,45 +1111,51 @@ ORDER BY claim.created_at ASC
|
|
"bad" => Note::where('is_cancelled', false)
|
|
"bad" => Note::where('is_cancelled', false)
|
|
->whereRaw("(detail_json)::json->>'isBad' = 'true'")
|
|
->whereRaw("(detail_json)::json->>'isBad' = 'true'")
|
|
->count(),
|
|
->count(),
|
|
|
|
+ // not yet signed
|
|
"mode-1" => Note::where('is_cancelled', false)
|
|
"mode-1" => Note::where('is_cancelled', false)
|
|
->where('is_signed_by_hcp', false)
|
|
->where('is_signed_by_hcp', false)
|
|
->whereRaw("((detail_json)::json->>'isBad' is null OR ((detail_json)::json->>'isBad')::text != 'true')")
|
|
->whereRaw("((detail_json)::json->>'isBad' is null OR ((detail_json)::json->>'isBad')::text != 'true')")
|
|
- ->whereNull('current_note_pickup_for_processing_id')
|
|
|
|
|
|
+// ->whereNull('current_note_pickup_for_processing_id')
|
|
->count(),
|
|
->count(),
|
|
|
|
+ // billing not marked done
|
|
"mode-2" => Note::where('is_cancelled', false)
|
|
"mode-2" => Note::where('is_cancelled', false)
|
|
->where('is_signed_by_hcp', true)
|
|
->where('is_signed_by_hcp', true)
|
|
->whereRaw("((detail_json)::json->>'isBad' is null OR ((detail_json)::json->>'isBad')::text != 'true')")
|
|
->whereRaw("((detail_json)::json->>'isBad' is null OR ((detail_json)::json->>'isBad')::text != 'true')")
|
|
- ->whereNull('current_note_pickup_for_processing_id')
|
|
|
|
|
|
+// ->whereNull('current_note_pickup_for_processing_id')
|
|
->where('is_billing_marked_done', false)
|
|
->where('is_billing_marked_done', false)
|
|
->count(),
|
|
->count(),
|
|
|
|
+ // billing not closed
|
|
"mode-3" => Note::where('is_cancelled', false)
|
|
"mode-3" => Note::where('is_cancelled', false)
|
|
->where('is_signed_by_hcp', true)
|
|
->where('is_signed_by_hcp', true)
|
|
->whereRaw("((detail_json)::json->>'isBad' is null OR ((detail_json)::json->>'isBad')::text != 'true')")
|
|
->whereRaw("((detail_json)::json->>'isBad' is null OR ((detail_json)::json->>'isBad')::text != 'true')")
|
|
- ->whereNull('current_note_pickup_for_processing_id')
|
|
|
|
|
|
+// ->whereNull('current_note_pickup_for_processing_id')
|
|
->where('is_billing_marked_done', true)
|
|
->where('is_billing_marked_done', true)
|
|
->where('is_bill_closed', false)
|
|
->where('is_bill_closed', false)
|
|
->count(),
|
|
->count(),
|
|
|
|
+ // claiming not closed
|
|
"mode-4" => Note::where('is_cancelled', false)
|
|
"mode-4" => Note::where('is_cancelled', false)
|
|
->where('is_signed_by_hcp', true)
|
|
->where('is_signed_by_hcp', true)
|
|
->whereRaw("((detail_json)::json->>'isBad' is null OR ((detail_json)::json->>'isBad')::text != 'true')")
|
|
->whereRaw("((detail_json)::json->>'isBad' is null OR ((detail_json)::json->>'isBad')::text != 'true')")
|
|
- ->whereNull('current_note_pickup_for_processing_id')
|
|
|
|
|
|
+// ->whereNull('current_note_pickup_for_processing_id')
|
|
->where('is_billing_marked_done', true)
|
|
->where('is_billing_marked_done', true)
|
|
->where('is_bill_closed', true)
|
|
->where('is_bill_closed', true)
|
|
->where('is_claim_closed', false)
|
|
->where('is_claim_closed', false)
|
|
->count(),
|
|
->count(),
|
|
|
|
+ // has unsubmitted claims
|
|
"mode-5" => Note::where('is_cancelled', false)
|
|
"mode-5" => Note::where('is_cancelled', false)
|
|
->where('is_signed_by_hcp', true)
|
|
->where('is_signed_by_hcp', true)
|
|
->whereRaw("((detail_json)::json->>'isBad' is null OR ((detail_json)::json->>'isBad')::text != 'true')")
|
|
->whereRaw("((detail_json)::json->>'isBad' is null OR ((detail_json)::json->>'isBad')::text != 'true')")
|
|
- ->whereNull('current_note_pickup_for_processing_id')
|
|
|
|
|
|
+// ->whereNull('current_note_pickup_for_processing_id')
|
|
->where('is_billing_marked_done', true)
|
|
->where('is_billing_marked_done', true)
|
|
->where('is_bill_closed', true)
|
|
->where('is_bill_closed', true)
|
|
->where('is_claim_closed', true)
|
|
->where('is_claim_closed', true)
|
|
->whereRaw("(SELECT count(id) FROM claim WHERE note_id = note.id AND is_cancelled IS FALSE AND status != 'CANCELLED' AND status != 'SUBMITTED') > 0")
|
|
->whereRaw("(SELECT count(id) FROM claim WHERE note_id = note.id AND is_cancelled IS FALSE AND status != 'CANCELLED' AND status != 'SUBMITTED') > 0")
|
|
->count(),
|
|
->count(),
|
|
|
|
+ // all good
|
|
"mode-6" => Note::where('is_cancelled', false)
|
|
"mode-6" => Note::where('is_cancelled', false)
|
|
->where('is_signed_by_hcp', true)
|
|
->where('is_signed_by_hcp', true)
|
|
->whereRaw("((detail_json)::json->>'isBad' is null OR ((detail_json)::json->>'isBad')::text != 'true')")
|
|
->whereRaw("((detail_json)::json->>'isBad' is null OR ((detail_json)::json->>'isBad')::text != 'true')")
|
|
- ->whereNull('current_note_pickup_for_processing_id')
|
|
|
|
|
|
+// ->whereNull('current_note_pickup_for_processing_id')
|
|
->where('is_billing_marked_done', true)
|
|
->where('is_billing_marked_done', true)
|
|
->where('is_bill_closed', true)
|
|
->where('is_bill_closed', true)
|
|
->where('is_claim_closed', true)
|
|
->where('is_claim_closed', true)
|