|
@@ -43,9 +43,14 @@ $customFields = $pro->canvasCustomItems('pmhx');
|
|
|
|
|
|
if(!$customFields) $customFields = [];
|
|
|
|
|
|
-$point = Point::getGlobalSingletonOfCategory($patient, 'PAST_MEDICAL_HISTORY', true);
|
|
|
+$point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, 'PAST_MEDICAL_HISTORY', $sessionKey, true);
|
|
|
|
|
|
-$contentData = $parsed = @$point && @$point->data ? $point->data : false;
|
|
|
+$contentData = $parsed = false;
|
|
|
+
|
|
|
+if ($point->lastChildReview && $point->lastChildReview->data) {
|
|
|
+ $point->lastChildReview->data = json_decode($point->lastChildReview->data, true);
|
|
|
+ $contentData = $parsed = $point->lastChildReview->data;
|
|
|
+}
|
|
|
|
|
|
if(!$contentData) {
|
|
|
$contentData = [
|
|
@@ -69,14 +74,13 @@ for ($i = 0; $i < count($fields); $i++) {
|
|
|
<hr class="hide-outside-popup mt-3 mb-0">
|
|
|
<div class="p-3 mcp-theme-1">
|
|
|
<div {{!!$segment ? 'visit-moe' : 'moe'}} close-on-save close-on-cancel class="d-block">
|
|
|
- <form show url="/api/visitPoint/upsertGlobalSingleton" class="mcp-theme-1"
|
|
|
+ <form show url="/api/visitPoint/upsertChildReview" class="mcp-theme-1"
|
|
|
{{!$segment ? 'hook=onHxPopupClosure' : ''}}>
|
|
|
@if(!!@$segment)
|
|
|
<input type="hidden" name="segmentUid" value="<?= $segment->uid ?>">
|
|
|
- @else
|
|
|
- <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
|
|
|
@endif
|
|
|
- <input type="hidden" name="category" value="PAST_MEDICAL_HISTORY">
|
|
|
+ <input type="hidden" name="uid" value="<?= $point->uid ?>">
|
|
|
+ <input type="hidden" name="noteUid" value="<?= $note->uid ?>">
|
|
|
<input type="hidden" name="data">
|
|
|
|
|
|
<div id="edit-univ_history_past_medical-container">
|
|
@@ -118,7 +122,7 @@ for ($i = 0; $i < count($fields); $i++) {
|
|
|
<a href="#" start show>
|
|
|
<i class="fa-comment" :class="common['{{$fName}}__comments'] ? 'fas' : 'far'"></i>
|
|
|
</a>
|
|
|
- <div url="/nop" right>
|
|
|
+ <div url="/nop">
|
|
|
<div class="mb-2">
|
|
|
<textarea class="form-control form-control-sm ns-custom-comment min-width-200px"
|
|
|
v-model="common['{{$fName}}__comments']"></textarea>
|