|
@@ -1,13 +1,4 @@
|
|
<?php
|
|
<?php
|
|
-$contentData = false;
|
|
|
|
-if($section) {
|
|
|
|
- $contentData = json_decode($section->content_data, true);
|
|
|
|
-}
|
|
|
|
-if(!$contentData) {
|
|
|
|
- $contentData = [
|
|
|
|
- "items" => []
|
|
|
|
- ];
|
|
|
|
-}
|
|
|
|
$formID = rand(0, 100000);
|
|
$formID = rand(0, 100000);
|
|
?>
|
|
?>
|
|
<div id="assessment_{{ $formID }}"
|
|
<div id="assessment_{{ $formID }}"
|
|
@@ -73,17 +64,20 @@ $formID = rand(0, 100000);
|
|
<td class="px-1">
|
|
<td class="px-1">
|
|
<textarea rows="4"
|
|
<textarea rows="4"
|
|
v-model="items['{{$line->uid}}'].prognosis"
|
|
v-model="items['{{$line->uid}}'].prognosis"
|
|
|
|
+ v-on:change="generatePayload()"
|
|
class="form-control form-control-sm outline-0 width-100pc outline-0">
|
|
class="form-control form-control-sm outline-0 width-100pc outline-0">
|
|
</textarea>
|
|
</textarea>
|
|
</td>
|
|
</td>
|
|
<td class="px-1">
|
|
<td class="px-1">
|
|
<textarea rows="4"
|
|
<textarea rows="4"
|
|
v-model="items['{{$line->uid}}'].goal"
|
|
v-model="items['{{$line->uid}}'].goal"
|
|
|
|
+ v-on:change="generatePayload()"
|
|
class="form-control form-control-sm outline-0 width-100pc outline-0"></textarea>
|
|
class="form-control form-control-sm outline-0 width-100pc outline-0"></textarea>
|
|
</td>
|
|
</td>
|
|
<td class="px-1">
|
|
<td class="px-1">
|
|
<textarea rows="4"
|
|
<textarea rows="4"
|
|
v-model="items['{{$line->uid}}'].plan"
|
|
v-model="items['{{$line->uid}}'].plan"
|
|
|
|
+ v-on:change="generatePayload()"
|
|
class="form-control form-control-sm outline-0 width-100pc outline-0"></textarea>
|
|
class="form-control form-control-sm outline-0 width-100pc outline-0"></textarea>
|
|
</td>
|
|
</td>
|
|
<td class="px-2 text-center delete-column">
|
|
<td class="px-2 text-center delete-column">
|
|
@@ -163,7 +157,15 @@ $formID = rand(0, 100000);
|
|
</tbody>
|
|
</tbody>
|
|
</table>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
|
|
+ <form processed id="assessment_form_{{ $formID }}">
|
|
|
|
+ <?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; ?>
|
|
|
|
+ <input type="hidden" name="items" v-model="payload">
|
|
|
|
+ </form>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
<script>
|
|
|
|
|
|
@@ -172,27 +174,54 @@ $formID = rand(0, 100000);
|
|
function init() {
|
|
function init() {
|
|
|
|
|
|
<?php
|
|
<?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"},
|
|
|
|
- ];
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ $contentData = false;
|
|
|
|
+ if($section){
|
|
|
|
+ $contentData = json_decode($section->content_data, true);
|
|
|
|
+ }
|
|
|
|
+ if(!$contentData || !isset($contentData["items"])) {
|
|
|
|
+ $contentData = [
|
|
|
|
+ "items" => []
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ $contentData["items"] = json_decode($contentData["items"], true);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $plainRows = [];
|
|
|
|
+ foreach($dxRows as $line) {
|
|
|
|
+
|
|
|
|
+ // use main data by default
|
|
|
|
+ $plainRows[$line->uid] = [
|
|
|
|
+ "included" => false,
|
|
|
|
+ "uid" => $line->uid,
|
|
|
|
+ "title" => $line->content_text,
|
|
|
|
+ "icd" => @$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"},
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ // overwrite with data saved in section if available
|
|
|
|
+ if(isset($contentData["items"]) && isset($contentData["items"][$line->uid])) {
|
|
|
|
+ $plainRows[$line->uid]["included"] = $contentData["items"][$line->uid]["included"];
|
|
|
|
+ $plainRows[$line->uid]["prognosis"] = $contentData["items"][$line->uid]["prognosis"];
|
|
|
|
+ $plainRows[$line->uid]["history"] = $contentData["items"][$line->uid]["history"];
|
|
|
|
+ $plainRows[$line->uid]["goal"] = $contentData["items"][$line->uid]["goal"];
|
|
|
|
+ $plainRows[$line->uid]["plan"] = $contentData["items"][$line->uid]["plan"];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
?>
|
|
?>
|
|
|
|
|
|
window.assessmentApp = new Vue({
|
|
window.assessmentApp = new Vue({
|
|
el: '#assessment_{{ $formID }}',
|
|
el: '#assessment_{{ $formID }}',
|
|
data: {
|
|
data: {
|
|
includeAll: false,
|
|
includeAll: false,
|
|
- items: {!! json_encode($plainRows) !!}
|
|
|
|
|
|
+ items: {!! json_encode($plainRows) !!},
|
|
|
|
+ payload: '',
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
includeAllChanged: function() {
|
|
includeAllChanged: function() {
|
|
@@ -201,6 +230,7 @@ $formID = rand(0, 100000);
|
|
this.items[x].included = this.includeAll;
|
|
this.items[x].included = this.includeAll;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ this.generatePayload();
|
|
},
|
|
},
|
|
includeChanged: function() {
|
|
includeChanged: function() {
|
|
let all = true;
|
|
let all = true;
|
|
@@ -213,6 +243,26 @@ $formID = rand(0, 100000);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.includeAll = all;
|
|
this.includeAll = all;
|
|
|
|
+ this.generatePayload();
|
|
|
|
+ },
|
|
|
|
+ generatePayload: function() {
|
|
|
|
+ let payload = {};
|
|
|
|
+ for(let x in this.items) {
|
|
|
|
+ if(this.items.hasOwnProperty(x)) {
|
|
|
|
+ payload[x] = {
|
|
|
|
+ included: this.items[x].included,
|
|
|
|
+ uid: this.items[x].uid,
|
|
|
|
+ title: this.items[x].title,
|
|
|
|
+ icd: this.items[x].icd,
|
|
|
|
+ coa: this.items[x].coa,
|
|
|
|
+ prognosis: this.items[x].prognosis,
|
|
|
|
+ history: this.items[x].history,
|
|
|
|
+ goal: this.items[x].goal,
|
|
|
|
+ plan: this.items[x].plan,
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.payload = JSON.stringify(payload);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted: function() {
|
|
mounted: function() {
|
|
@@ -237,11 +287,13 @@ $formID = rand(0, 100000);
|
|
|
|
|
|
$('#assessment_{{ $formID }} [moe][initialized]').removeAttr('initialized');
|
|
$('#assessment_{{ $formID }} [moe][initialized]').removeAttr('initialized');
|
|
initMoes();
|
|
initMoes();
|
|
|
|
+ this.includeChanged();
|
|
|
|
+ this.generatePayload();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
}
|
|
}
|
|
- addMCInitializer('patient-dx-list', init);
|
|
|
|
|
|
+ addMCInitializer('assessment-section', init);
|
|
|
|
|
|
})();
|
|
})();
|
|
|
|
|