|
@@ -674,6 +674,21 @@ WHERE measurement.label NOT IN ('SBP', 'DBP')
|
|
|
$pros->whereIn('id', $accessibleProIds);
|
|
|
}
|
|
|
$suggestedPros = $pros->orderBy('name_last')->orderBy('name_first')->get();
|
|
|
+
|
|
|
+ // for calendar select2
|
|
|
+ if($request->input('json')) {
|
|
|
+ $jsonPros = $suggestedPros->map(function($_pro) {
|
|
|
+ return [
|
|
|
+ "id" => $_pro->id,
|
|
|
+ "text" => $_pro->displayName(),
|
|
|
+ "initials" => $_pro->initials(),
|
|
|
+ ];
|
|
|
+ });
|
|
|
+ return json_encode([
|
|
|
+ "results" => $jsonPros
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+
|
|
|
return view('app/pro-suggest', compact('suggestedPros'));
|
|
|
}
|
|
|
|