|
@@ -392,6 +392,11 @@ class Client extends Model
|
|
|
return $this->hasOne(Appointment::class, 'id', 'previous_mcp_appointment_id');
|
|
|
}
|
|
|
|
|
|
+ public function mostRecentCompletedMcpNote()
|
|
|
+ {
|
|
|
+ return $this->hasOne(Note::class, 'id', 'most_recent_completed_mcp_note_id');
|
|
|
+ }
|
|
|
+
|
|
|
public function lastMeasurementOfType($_type) {
|
|
|
return Measurement::where('client_id', $this->id)
|
|
|
->whereNotNull('bdt_measurement_id')
|
|
@@ -942,11 +947,6 @@ ORDER BY m.ts DESC
|
|
|
return $this->hasOne(Note::class, 'id', 'core_note_id');
|
|
|
}
|
|
|
|
|
|
- public function mostRecentCompletedMcpNote(){
|
|
|
- return $this->hasOne(Note::class, 'id', 'most_recent_completed_mcp_note_id');
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
public function nonCoreVisitNotes() {
|
|
|
return $this->hasMany(Note::class, 'client_id', 'id')
|
|
|
->where('id', '<>', $this->core_note_id)
|