Parcourir la source

addition and removal reason categories - make r/o beyond birth note

Vijayakrishnan il y a 3 ans
Parent
commit
92f96a6753

+ 46 - 24
resources/views/app/patient/wizard-partials/common-fields.blade.php

@@ -18,20 +18,31 @@
 
     <div class="mb-2">
         <span class="font-weight-bold">Is this pre-existing, or being {{@$addVerbPT ? strtolower($addVerbPT) : 'added'}} during this visit?</span>
-        <div class="d-flex align-items-baseline mt-1">
-            <label class="my-0 d-inline-flex align-items-center">
-                <input type="radio" name="additionReasonCategory" value="ON_INTAKE"
-                        {{$point && $point->addition_reason_category === 'ON_INTAKE' ? 'checked' : ''}}
-                        {{0 && $point && $point->added_in_note_id !== $note->id ? 'readonly disabled' : ''}}>
-                <span class="ml-1">Pre-existing</span>
-            </label>
-            <label class="ml-3 my-0 d-inline-flex align-items-center">
-                <input type="radio" name="additionReasonCategory" value="DURING_VISIT"
-                        {{$point && $point->addition_reason_category === 'DURING_VISIT' ? 'checked' : ''}}
-                        {{0 && $point && $point->added_in_note_id !== $note->id ? 'readonly disabled' : ''}}>
-                <span class="ml-1">{{@$addVerbPT ? ucwords($addVerbPT) : 'Added'}} during this visit (as part of my plan)</span>
-            </label>
-        </div>
+        @if($point && $point->added_in_note_id !== $note->id)
+            <div class="mt-1">
+                @if($point->addition_reason_category === 'ON_INTAKE')
+                    Added as pre-existing on {{friendly_date($point->note->effective_dateest)}}
+                @else
+                    Added during visit on {{friendly_date($point->note->effective_dateest)}}
+                @endif
+                <input type="radio" name="additionReasonCategory" value="{{$point->addition_reason_category}}" checked class="d-none">
+            </div>
+        @else
+            <div class="d-flex align-items-baseline mt-1">
+                <label class="my-0 d-inline-flex align-items-center">
+                    <input type="radio" name="additionReasonCategory" value="ON_INTAKE"
+                            {{$point && $point->addition_reason_category === 'ON_INTAKE' ? 'checked' : ''}}
+                            {{0 && $point && $point->added_in_note_id !== $note->id ? 'readonly disabled' : ''}}>
+                    <span class="ml-1">Pre-existing</span>
+                </label>
+                <label class="ml-3 my-0 d-inline-flex align-items-center">
+                    <input type="radio" name="additionReasonCategory" value="DURING_VISIT"
+                            {{$point && $point->addition_reason_category === 'DURING_VISIT' ? 'checked' : ''}}
+                            {{0 && $point && $point->added_in_note_id !== $note->id ? 'readonly disabled' : ''}}>
+                    <span class="ml-1">{{@$addVerbPT ? ucwords($addVerbPT) : 'Added'}} during this visit (as part of my plan)</span>
+                </label>
+            </div>
+        @endif
     </div>
 
 </div>
@@ -60,16 +71,27 @@
 
         <div class="mb-2">
             <span class="font-weight-bold">Was this {{$label}} removed PRIOR to this visit or DURING this visit?</span>
-            <div class="d-flex align-items-baseline mt-1">
-                <label class="my-0 d-inline-flex align-items-center">
-                    <input type="radio" name="removalReasonCategory" value="ON_INTAKE" {{$point && $point->removal_reason_category === 'ON_INTAKE' ? 'checked' : ''}}>
-                    <span class="ml-1">Prior to visit</span>
-                </label>
-                <label class="ml-3 my-0 d-inline-flex align-items-center">
-                    <input type="radio" name="removalReasonCategory" value="DURING_VISIT" {{$point && $point->removal_reason_category === 'DURING_VISIT' ? 'checked' : ''}}>
-                    <span class="ml-1">Removed during this visit (as part of my plan)</span>
-                </label>
-            </div>
+            @if($point && $point->added_in_note_id !== $note->id)
+                <div class="mt-1">
+                    @if($point->removal_reason_category === 'ON_INTAKE')
+                        Removed prior to the visit on {{friendly_date($point->note->effective_dateest)}}
+                    @else
+                        Removed during visit on {{friendly_date($point->note->effective_dateest)}}
+                    @endif
+                    <input type="radio" name="removalReasonCategory" value="{{$point->removal_reason_category}}" checked class="d-none">
+                </div>
+            @else
+                <div class="d-flex align-items-baseline mt-1">
+                    <label class="my-0 d-inline-flex align-items-center">
+                        <input type="radio" name="removalReasonCategory" value="ON_INTAKE" {{$point && $point->removal_reason_category === 'ON_INTAKE' ? 'checked' : ''}}>
+                        <span class="ml-1">Prior to visit</span>
+                    </label>
+                    <label class="ml-3 my-0 d-inline-flex align-items-center">
+                        <input type="radio" name="removalReasonCategory" value="DURING_VISIT" {{$point && $point->removal_reason_category === 'DURING_VISIT' ? 'checked' : ''}}>
+                        <span class="ml-1">Removed during this visit (as part of my plan)</span>
+                    </label>
+                </div>
+            @endif
         </div>
 
     </div>