Pārlūkot izejas kodu

Merge branch 'dev' of rav.triplestart.com:jmudaka/stagfe2 into dev

Samson Mutunga 3 gadi atpakaļ
vecāks
revīzija
1338fcdbcf

+ 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;
 }
 
 ?>

+ 7 - 4
resources/views/app/patient/segment-templates/covid_intake/summary.blade.php

@@ -3,9 +3,9 @@
 use App\Models\Point;
 
 $category = 'COVID_INTAKE';
-$endPoint = 'upsertGlobalSingleton';
 
-$point = Point::getGlobalSingletonOfCategory($patient, 'COVID_INTAKE', true);
+$point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, 'COVID_INTAKE', $sessionKey, true);
+
 
 $contentData = [
     "ans_how_are_you" => '',
@@ -115,10 +115,13 @@ $contentData = [
     "ans_total_mins_spent" => ''
 
 ];
-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 class="events-none form-read-mode">
     <div class="mb-2">