Parcourir la source

updated covid follow up note

= il y a 3 ans
Parent
commit
0453d5120e

+ 9 - 6
resources/views/app/patient/segment-templates/covid_follow-up/edit.blade.php

@@ -3,9 +3,9 @@
 use App\Models\Point;
 
 $category = 'COVID_FOLLOW-UP';
-$endPoint = 'upsertNoteSingleton';
 
-$point = Point::getGlobalSingletonOfCategory($patient, $category, true);
+$point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, $category, $sessionKey, true);
+
 $contentData = [
         "ans_has_received_printed_cdc_covid_matrials" => null, // yes/no
         "ans_has_signed_up_for_gvt_covid_kit" => null, // yes/no/not_sure
@@ -42,13 +42,16 @@ $contentData = [
 	"follow_up_for" => null
 ];
 
-if (!!@$point->data) {
-        $contentData = $point->data;
+if ($point->lastChildReview && $point->lastChildReview->data) {
+        $point->lastChildReview->data = json_decode($point->lastChildReview->data, true);
+        $contentData = $point->lastChildReview->data;
 }
 
 ?>
-<div visit-moe close-on-save close-on-cancel class="d-block p-3">
-        <form id="visitNoteForm" show url="/api/visitPoint/<?= $endPoint ?>" class="mcp-theme-1">
+<div visit-moe close-on-save close-on-cancel class="d-block p-3">       
+        <form id="visitNoteForm" show url="/api/visitPoint/upsertChildReview" class="mcp-theme-1">
+                <input type="hidden" name="uid" value="<?= $point->uid ?>">
+                <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
                 <input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
                 <input type="hidden" name="category" value="<?= $category ?>">
                 <input id="mainData" type="hidden" name="data" value="{{json_encode($contentData)}}">

+ 5 - 4
resources/views/app/patient/segment-templates/covid_follow-up/summary.blade.php

@@ -3,9 +3,8 @@
 use App\Models\Point;
 
 $category = 'COVID_FOLLOW-UP';
-$endPoint = 'upsertNoteSingleton';
 
-$point = Point::getGlobalSingletonOfCategory($patient, $category, true);
+$point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, $category, $sessionKey, true);
 
 $contentData = [
     "ans_has_received_printed_cdc_covid_matrials" => null, // yes/no
@@ -39,8 +38,10 @@ $contentData = [
     "ans_hypertension_rpm_education" => null,
 
 ];
-if (!!@$point->data) {
-    $contentData = $point->data;
+
+if ($point->lastChildReview && $point->lastChildReview->data) {
+    $point->lastChildReview->data = json_decode($point->lastChildReview->data, true);
+    $contentData = $point->lastChildReview->data;
 }
 
 ?>