Browse Source

Assessment v2 [wip #1]

Vijayakrishnan 4 years ago
parent
commit
57da52ba4f

+ 14 - 0
public/css/style.css

@@ -224,6 +224,12 @@ body>nav.navbar {
 .mcp-theme-1 .width-200px {
 .mcp-theme-1 .width-200px {
     width: 200px !important;
     width: 200px !important;
 }
 }
+.mcp-theme-1 .width-30px {
+    width: 30px !important;
+}
+.mcp-theme-1 .width-50px {
+    width: 50px !important;
+}
 .mcp-theme-1 .min-width-200px {
 .mcp-theme-1 .min-width-200px {
     min-width: 200px !important;
     min-width: 200px !important;
 }
 }
@@ -235,9 +241,17 @@ body>nav.navbar {
     min-width: unset !important;
     min-width: unset !important;
     max-width: unset !important;
     max-width: unset !important;
 }
 }
+.mcp-theme-1 .width-100pc {
+    width: 100% !important;
+    min-width: unset !important;
+}
 .mcp-theme-1 .max-width-300px {
 .mcp-theme-1 .max-width-300px {
     max-width: 300px;
     max-width: 300px;
 }
 }
+.mcp-theme-1 .outline-0 {
+    outline: none !important;
+    box-shadow: none !important;
+}
 .cancelled-item {
 .cancelled-item {
     opacity: 0.5;
     opacity: 0.5;
 }
 }

+ 68 - 0
storage/sections/assessment/actions.blade.php

@@ -1,3 +1,4 @@
+{{--
 <div class="position-relative d-none if-edit ml-3 pl-3 border-left">
 <div class="position-relative d-none if-edit ml-3 pl-3 border-left">
     <a href="#" onclick="$(this).siblings('.embed-section, .embed-mask').removeClass('d-none'); return false;">Include from Symptoms</a>
     <a href="#" onclick="$(this).siblings('.embed-section, .embed-mask').removeClass('d-none'); return false;">Include from Symptoms</a>
     <div class="embed-section min-width-300px bg-white position-absolute d-none current-symptoms-form">
     <div class="embed-section min-width-300px bg-white position-absolute d-none current-symptoms-form">
@@ -32,3 +33,70 @@
     }
     }
 </script>
 </script>
 
 
+--}}
+<div class="d-none if-edit pb-2">
+    <div class="d-flex align-items-center">
+        <span class="mx-2 text-secondary">|</span>
+        <div moe wide>
+            <a start show class="">Add</a>
+            <form url="/api/clientInfoLine/create">
+                <p class="text-left mb-1"><b>Note: This will add this entry to the patient's main Dx list</b></p>
+                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                <input type="hidden" name="category" value="dx">
+                <input type="hidden" name="IsCurrent" value="1">
+                <div class="mb-2">
+                    <label for="" class="control-label text-sm  mb-1" >ICD</label>
+                    <input type="text" class="form-control form-control-sm" name="ICD" value="">
+                </div>
+                <div class="mb-2">
+                    <label for="" class="control-label text-sm  mb-1" >Title</label>
+                    <input type="text" class="form-control form-control-sm" name="contentText" value="">
+                </div>
+                <div class="mb-2">
+                    <label for="" class="control-label text-sm  mb-1" >Chronic or Acute (select one)</label>
+                    <select name="Chronic or Acute" class="form-control form-control-sm pl-1">
+                        <option value="Chronic">Chronic</option>
+                        <option value="Acute">Acute</option>
+                    </select>
+                </div>
+                <div class="mb-2">
+                    <label for="" class="control-label text-sm  mb-1" >Prognosis</label>
+                    <input type="text" class="form-control form-control-sm" name="Prognosis" value="">
+                </div>
+                <div class="mb-2">
+                    <label for="" class="control-label text-sm  mb-1" >History</label>
+                    <textarea type="text" class="form-control form-control-sm" name="History" value="""></textarea>
+                </div>
+                <div class="mb-2">
+                    <label for="" class="control-label text-sm  mb-1" >Treatment Goal</label>
+                    <textarea type="text" class="form-control form-control-sm" name="Treatment Goal" value=""></textarea>
+                </div>
+                <div class="mb-2">
+                    <label for="" class="control-label text-sm  mb-1" >Treatment Plan</label>
+                    <textarea type="text" class="form-control form-control-sm" name="Treatment Plan" value="" ></textarea>
+                </div>
+                <div class="d-flex align-items-center">
+                    <button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
+                    <button class="btn btn-sm btn-default mr-2 border" type="button" cancel>Cancel</button>
+                </div>
+            </form>
+        </div>
+        <span class="mx-2 text-secondary">|</span>
+        <div moe>
+            <a start show class="">Multi</a>
+            <form url="/api/clientInfoLine/createMultiple">
+                <p class="text-left mb-1"><b>Note: This will add these to the patient's main Dx list</b></p>
+                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                <input type="hidden" name="category" value="dx">
+                <input type="hidden" name="IsCurrent" value="1">
+                <div class="mb-2">
+                    <textarea class="form-control form-control-sm" rows="8" name="contentTexts" value="" placeholder="Dx & Focus Areas *" required></textarea>
+                </div>
+                <div class="d-flex align-items-center">
+                    <button class="btn btn-sm btn-primary mr-2" submit>Save</button>
+                    <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                </div>
+            </form>
+        </div>
+    </div>
+</div>

+ 217 - 0
storage/sections/assessment/form.blade.php

@@ -0,0 +1,217 @@
+<?php
+$contentData = false;
+if($section) {
+    $contentData = json_decode($section->content_data, true);
+}
+if(!$contentData) {
+    $contentData = [
+        "items" => []
+    ];
+}
+$formID = rand(0, 100000);
+?>
+<div id="assessment_{{ $formID }}"
+      onsubmit="return submitForm_NoteSection_{{ $formID }}(this);">
+    <input type="hidden" name="count">
+    <?php if($section): ?>
+    <input type="hidden" name="section_uid" value="<?= $section->uid?>">
+    <?php else: ?>
+    <input type="hidden" name="note_uid" value="<?= $note->uid?>">
+    <input type="hidden" name="section_template_uid" value="<?= $sectionTemplate->uid ?>">
+    <?php endif; ?>
+
+    <?php
+    $dxInfoLines = \App\Models\ClientInfoLine::where('client_id', $patient->id)
+        ->where('category', 'dx')
+        ->where('is_removed', false)
+        ->orderBy('content_text', 'asc')
+        ->get();
+    $dxRows = new \Illuminate\Support\Collection();
+    foreach($dxInfoLines as $line) {
+         if(@$line->contentDetail()->{"IsCurrent"} && intval($line->contentDetail()->{"IsCurrent"}) === 1) {
+            $dxRows->add($line);
+         }
+    }
+    ?>
+    <div class="mb-3">
+        <table class="bg-white table table-striped table-sm table-bordered mb-0" style="table-layout:fixed">
+            <thead>
+            <tr class="">
+                <th class="px-2 text-secondary width-50px">
+                    <label class="d-flex align-items-center c-pointer align-items-end m-0">
+                        <input type="checkbox" class="mr-1">
+                        <span>All</span>
+                    </label>
+                </th>
+                <th class="px-2 text-secondary w-50px">Title</th>
+                <th class="px-2 text-secondary">ICD</th>
+                <th class="px-2 text-secondary w-100px">Chr/Act</th>
+                <th class="px-2 text-secondary width-200px">Prognosis</th>
+                {{--<th class="px-2 text-secondary width-200px">History</th>--}}
+                <th class="px-2 text-secondary width-200px">Goal</th>
+                <th class="px-2 text-secondary width-200px">Plan</th>
+                <th class="px-2 text-secondary delete-column">&nbsp;</th>
+            </tr>
+            </thead>
+            <tbody>
+            @foreach($dxRows as $line)
+                <?php
+                $isCurrent = @$line->contentDetail()->{"IsCurrent"} && intval(@$line->contentDetail()->{"IsCurrent"}) === 1;
+                ?>
+                <tr>
+                    <td class="px-2">
+                        <label class="d-block c-pointer m-0">
+                            <input type="checkbox" class="mt-1" v-model="items['{{$line->uid}}'].included">
+                        </label>
+                    </td>
+                    <td class="px-2">{{$line->content_text}}</td>
+                    <td class="px-2">{{ @$line->contentDetail()->{"ICD"} }}</td>
+                    <td class="px-2">{{ @$line->contentDetail()->{"Chronic or Acute"} }}</td>
+                    <td class="px-1">
+                        <textarea rows="4" class="form-control form-control-sm outline-0 width-100pc outline-0">{{ @$line->contentDetail()->{"Prognosis"} }}</textarea>
+                    </td>
+                    {{--<td class="px-1"><pre class="m-0" style="white-space:pre-wrap">{{ @$line->contentDetail()->{"History"} }}</pre></td>--}}
+                    <td class="px-1">
+                        <textarea rows="4" class="form-control form-control-sm outline-0 width-100pc outline-0">{{ @$line->contentDetail()->{"Treatment Goal"} }}</textarea>
+                    </td>
+                    <td class="px-1">
+                        <textarea rows="4" class="form-control form-control-sm outline-0 width-100pc outline-0">{{ @$line->contentDetail()->{"Treatment Plan"} }}</textarea>
+                    </td>
+                    <td class="px-2 text-center delete-column">
+                        <span moe wide relative class="mr-1">
+                            <a class="on-hover-opaque" start show title="Edit">
+                                <i class="font-size-11 fa fa-edit"></i>
+                            </a>
+                            <form url="/api/clientInfoLine/updateContent" right>
+                                <p class="text-left mb-1"><b>Note: This will update this entry in the patient's main Dx list</b></p>
+                                <input type="hidden" name="uid" value="{{ $line->uid }}">
+                                <input type="hidden" name="clientUid" value="{{ $patient->uid }}">
+                                <input type="hidden" name="category" value="dx">
+                                <input type="hidden" name="IsCurrent" value="{{ $isCurrent ? 1 : 0 }}">
+                                <div class="mb-2">
+                                    <label for="" class="d-block text-sm mb-1 text-left">ICD</label>
+                                    <input type="text" class="form-control form-control-sm" name="ICD"
+                                           value="{{ @$line->contentDetail()->{"ICD"} }}" placeholder="">
+                                </div>
+                                <div class="mb-2">
+                                    <label for="" class="d-block text-sm mb-1 text-left">Title</label>
+                                    <input type="text" class="form-control form-control-sm" name="contentText"
+                                           value="{{$line->content_text}}" placeholder="Title">
+                                </div>
+                                <div class="mb-2">
+                                    <label for="" class="d-block text-sm mb-1 text-left">Chronic or Acute (select one)</label>
+                                    <select name="Chronic or Acute" class="form-control form-control-sm pl-1">
+                                        <option value="">Chronic or Acute (select one)</option>
+                                        <option
+                                            {{ @$line->contentDetail()->{"Chronic or Acute"} === 'Chronic' ? 'selected' : '' }} value="Chronic">Chronic</option>
+                                        <option
+                                            {{ @$line->contentDetail()->{"Chronic or Acute"} === 'Acute' ? 'selected' : '' }} value="Acute">Acute</option>
+                                    </select>
+                                </div>
+                                <div class="mb-2">
+                                    <label for="" class="d-block text-sm mb-1 text-left">Prognosis</label>
+                                    <input type="text" class="form-control form-control-sm" name="Prognosis"
+                                           value="{{ @$line->contentDetail()->{"Prognosis"} }}" placeholder="">
+                                </div>
+                                <div class="mb-2">
+                                    <label for="" class="d-block text-sm mb-1 text-left">History</label>
+                                    <textarea type="text" class="form-control form-control-sm" name="History"
+                                              placeholder="">{{ @$line->contentDetail()->{"History"} }}</textarea>
+                                </div>
+                                <div class="mb-2">
+                                    <label for="" class="d-block text-sm mb-1 text-left">Treatment Goal</label>
+                                    <textarea type="text" class="form-control form-control-sm" name="Treatment Goal"
+                                              placeholder="">{{ @$line->contentDetail()->{"Treatment Goal"} }}</textarea>
+                                </div>
+                                <div class="mb-2">
+                                    <label for="" class="d-block text-sm mb-1 text-left">Treatment Plan</label>
+                                    <textarea type="text" class="form-control form-control-sm" name="Treatment Plan"
+                                              placeholder="">{{ @$line->contentDetail()->{"Treatment Plan"} }}</textarea>
+                                </div>
+                                <div class="d-flex align-items-center">
+                                    <button class="btn btn-sm btn-primary mr-2" type="button" submit>Save</button>
+                                    <button class="btn btn-sm btn-default mr-2 border" type="button"
+                                            cancel>Cancel</button>
+                                </div>
+                            </form>
+                        </span>
+                        <span moe relative>
+                            <a start show class="on-hover-opaque"><i class="fa fa-trash-alt text-danger"></i></a>
+                            <form url="/api/clientInfoLine/remove" right>
+                                <input type="hidden" name="uid" value="{{ $line->uid }}">
+                                <p class="small text-left">Are you sure you want to delete this entry?</p>
+                                <p class="small text-left"><b>Note: This will delete this entry from the patient's main Dx list</b></p>
+                                <div class="d-flex align-items-center">
+                                    <button class="btn btn-sm btn-danger mr-2" submit>Delete</button>
+                                    <button class="btn btn-sm btn-default mr-2 border" cancel>Cancel</button>
+                                </div>
+                            </form>
+                        </span>
+                    </td>
+                </tr>
+            @endforeach
+
+            </tbody>
+        </table>
+    </div>
+
+</div>
+<script>
+
+    (function() {
+
+        function init() {
+
+            <?php
+            $plainRows = [];
+            foreach($dxRows as $line) {
+                $plainRows[$line->uid] = [
+                    "included" => false,
+                    "uid" => $line->uid,
+                    "title" => $line->content_text,
+                    "ico" => @$line->contentDetail()->{"ICD"},
+                    "coa" => @$line->contentDetail()->{"Chronic or Acute"},
+                    "prognosis" => @$line->contentDetail()->{"Prognosis"},
+                    "history" => @$line->contentDetail()->{"History"},
+                    "goal" => @$line->contentDetail()->{"Goal"},
+                    "plan" => @$line->contentDetail()->{"Plan"},
+                ];
+            }
+            ?>
+
+            window.assessmentApp = new Vue({
+                el: '#assessment_{{ $formID }}',
+                data: {
+                    items: {!! json_encode($plainRows)  !!}
+                },
+                methods: {
+
+                },
+                mounted: function() {
+                    $('input[type="text"][name="ICD"]').each(function() {
+                        var elem = this, dynID = 'icd-' + Math.ceil(Math.random() * 1000000);
+                        $(elem).attr('id', dynID);
+                        new window.Def.Autocompleter.Search(dynID,
+                            'https://clinicaltables.nlm.nih.gov/api/icd10cm/v3/search?sf=code,name&ef=name',
+                            {
+                                tableFormat: true,
+                                valueCols: [0],
+                                colHeaders: ['Code', 'Name'],
+                            }
+                        );
+                        window.Def.Autocompleter.Event.observeListSelections(dynID, function() {
+                            var autocomp = elem.autocomp;
+                            var name = autocomp.getSelectedItemData()[0].data['name'];
+                            $(elem).closest('form').find('[name="contentText"]').val(name);
+                            return false;
+                        });
+                    });
+                }
+            });
+
+        }
+        addMCInitializer('patient-dx-list', init);
+
+    })();
+
+</script>