|
@@ -369,6 +369,47 @@ class Pro extends Model
|
|
|
->count();
|
|
|
}
|
|
|
|
|
|
+ function get_notes_pending_summary_suggestion_as_mcp_query(){
|
|
|
+ $segmentsWithProposedSummarySuggestion = Segment::whereNotNull('proposed_segment_summary_suggestion_id')->get();
|
|
|
+ $noteIDs = [];
|
|
|
+ foreach($segmentsWithProposedSummarySuggestion as $seg){
|
|
|
+ $noteIDs[] = $seg->note_id;
|
|
|
+ }
|
|
|
+ return Note::where('hcp_pro_id', $this->id)
|
|
|
+ ->where('is_cancelled', '<>', true)
|
|
|
+ ->where('is_core_note', '<>', true)
|
|
|
+ ->where('is_signed_by_hcp', true)
|
|
|
+ ->whereIn('id', $noteIDs);
|
|
|
+ }
|
|
|
+
|
|
|
+ function get_notes_pending_summary_suggestion_count_as_mcp(){
|
|
|
+ return $this->get_notes_pending_summary_suggestion_as_mcp_query()->count();
|
|
|
+ }
|
|
|
+
|
|
|
+ function get_notes_pending_summary_suggestion_as_mcp(){
|
|
|
+ return $this->get_notes_pending_summary_suggestion_as_mcp_query()->get();
|
|
|
+ }
|
|
|
+
|
|
|
+ function get_notes_pending_summary_suggestion_as_admin_query(){
|
|
|
+ $segmentsWithProposedSummarySuggestion = Segment::whereNotNull('proposed_segment_summary_suggestion_id')->get();
|
|
|
+ $noteIDs = [];
|
|
|
+ foreach($segmentsWithProposedSummarySuggestion as $seg){
|
|
|
+ $noteIDs[] = $seg->note_id;
|
|
|
+ }
|
|
|
+ return Note::where('is_cancelled', '<>', true)
|
|
|
+ ->where('is_core_note', '<>', true)
|
|
|
+ ->where('is_signed_by_hcp', true)
|
|
|
+ ->whereIn('id', $noteIDs);
|
|
|
+ }
|
|
|
+
|
|
|
+ function get_notes_pending_summary_suggestion_count_as_admin(){
|
|
|
+ return $this->get_notes_pending_summary_suggestion_as_admin_query()->count();
|
|
|
+ }
|
|
|
+
|
|
|
+ function get_notes_pending_summary_suggestion_as_admin(){
|
|
|
+ return $this->get_notes_pending_summary_suggestion_as_admin_query()->get();
|
|
|
+ }
|
|
|
+
|
|
|
function get_notes_pending_billing_count_as_mcp() {
|
|
|
return Note::where('hcp_pro_id', $this->id)
|
|
|
->where('is_cancelled', '<>', true)
|