|
@@ -370,7 +370,24 @@ class Pro extends Model
|
|
|
}
|
|
|
|
|
|
function get_notes_pending_summary_suggestion_as_mcp_query(){
|
|
|
- $segmentsWithProposedSummarySuggestion = Segment::whereNotNull('proposed_segment_summary_suggestion_id')->get();
|
|
|
+ $segmentsWithProposedSummarySuggestion = Segment::whereHas('proposedSegmentSummarySuggestion', function($sugQuery){
|
|
|
+ return $sugQuery->where('status', '=', 'PENDING');
|
|
|
+ })->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_rejected_summary_suggestion_as_mcp_query(){
|
|
|
+ $segmentsWithProposedSummarySuggestion = Segment::whereHas('proposedSegmentSummarySuggestion', function($sugQuery){
|
|
|
+ return $sugQuery->where('status', '=', 'REJECTED');
|
|
|
+ })->get();
|
|
|
$noteIDs = [];
|
|
|
foreach($segmentsWithProposedSummarySuggestion as $seg){
|
|
|
$noteIDs[] = $seg->note_id;
|
|
@@ -390,8 +407,32 @@ class Pro extends Model
|
|
|
return $this->get_notes_pending_summary_suggestion_as_mcp_query()->get();
|
|
|
}
|
|
|
|
|
|
+ function get_notes_rejected_summary_suggestion_count_as_mcp(){
|
|
|
+ return $this->get_notes_rejected_summary_suggestion_as_mcp_query()->count();
|
|
|
+ }
|
|
|
+
|
|
|
+ function get_notes_rejected_summary_suggestion_as_mcp(){
|
|
|
+ return $this->get_notes_rejected_summary_suggestion_as_mcp_query()->get();
|
|
|
+ }
|
|
|
+
|
|
|
function get_notes_pending_summary_suggestion_as_admin_query(){
|
|
|
- $segmentsWithProposedSummarySuggestion = Segment::whereNotNull('proposed_segment_summary_suggestion_id')->get();
|
|
|
+ $segmentsWithProposedSummarySuggestion = Segment::whereHas('proposedSegmentSummarySuggestion', function($sugQuery){
|
|
|
+ return $sugQuery->where('status', '=', 'PENDING');
|
|
|
+ })->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_rejected_summary_suggestion_as_admin_query(){
|
|
|
+ $segmentsWithProposedSummarySuggestion = Segment::whereHas('proposedSegmentSummarySuggestion', function($sugQuery){
|
|
|
+ return $sugQuery->where('status', '=', 'REJECTED');
|
|
|
+ })->get();
|
|
|
$noteIDs = [];
|
|
|
foreach($segmentsWithProposedSummarySuggestion as $seg){
|
|
|
$noteIDs[] = $seg->note_id;
|
|
@@ -410,6 +451,14 @@ class Pro extends Model
|
|
|
return $this->get_notes_pending_summary_suggestion_as_admin_query()->get();
|
|
|
}
|
|
|
|
|
|
+ function get_notes_rejected_summary_suggestion_count_as_admin(){
|
|
|
+ return $this->get_notes_rejected_summary_suggestion_as_admin_query()->count();
|
|
|
+ }
|
|
|
+
|
|
|
+ function get_notes_rejected_summary_suggestion_as_admin(){
|
|
|
+ return $this->get_notes_rejected_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)
|