|
@@ -0,0 +1,150 @@
|
|
|
+<?php
|
|
|
+/** @var \App\Models\Pro $sectionPro */
|
|
|
+/** @var \App\Models\Pro $pro */
|
|
|
+/** @var \App\Models\Note $note */
|
|
|
+
|
|
|
+if(!@$sectionPro) {
|
|
|
+ if(@$note) {
|
|
|
+ $sectionPro = $note->hcpPro;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $sectionPro = $pro; // should never get here
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+if(!$contentData) $contentData = [];
|
|
|
+if(!isset($contentData[$sectionPro->uid])) {
|
|
|
+ $contentData[$sectionPro->uid] = [
|
|
|
+ 'physical_activity' => [
|
|
|
+ 'type' => '',
|
|
|
+ 'frequency' => '',
|
|
|
+ 'time' => '',
|
|
|
+ 'intensity' => '',
|
|
|
+ 'enjoyment' => '',
|
|
|
+ ],
|
|
|
+ 'barriers' => '', // free text
|
|
|
+ 'assessment' => '', // Inactive, Insufficiently Active, Active, Highly Active
|
|
|
+ ];
|
|
|
+}
|
|
|
+
|
|
|
+$formID = rand(0, 100000);
|
|
|
+?>
|
|
|
+
|
|
|
+<div id="parSection_{{$formID}}">
|
|
|
+ <h3 class="stag-popup-title mb-3 border-bottom pb-1 hide-if-note pt-1 pb-2">
|
|
|
+ <span>Lifestyle Rx Update</span>
|
|
|
+ <a href="#" onclick="return closeStagPopup()"
|
|
|
+ class="ml-auto text-secondary">
|
|
|
+ <i class="fa fa-times-circle"></i>
|
|
|
+ </a>
|
|
|
+ </h3>
|
|
|
+
|
|
|
+ <p class="font-weight-bold my-2">Physical Activity History</p>
|
|
|
+
|
|
|
+ <div class="pl-3 border-left mb-3">
|
|
|
+
|
|
|
+ <p class="font-weight-bold text-secondary my-2">Current Physical Activity</p>
|
|
|
+
|
|
|
+ <input type="hidden" name="data" value="{{json_encode($contentData)}}">
|
|
|
+
|
|
|
+ <div class="border p-2 mb-3">
|
|
|
+ <div class="row mb-2">
|
|
|
+ <div class="col-4">
|
|
|
+ <label class="mb-1 text-secondary text-sm">Type:</label>
|
|
|
+ <input type="text" v-model="data['{{$sectionPro->uid}}']['physical_activity']['type']" class="form-control form-control-sm">
|
|
|
+ </div>
|
|
|
+ <div class="col-4">
|
|
|
+ <label class="mb-1 text-secondary text-sm">Frequency:</label>
|
|
|
+ <input type="text" v-model="data['{{$sectionPro->uid}}']['physical_activity']['frequency']" class="form-control form-control-sm">
|
|
|
+ </div>
|
|
|
+ <div class="col-4">
|
|
|
+ <label class="mb-1 text-secondary text-sm">Time:</label>
|
|
|
+ <input type="text" v-model="data['{{$sectionPro->uid}}']['physical_activity']['time']" class="form-control form-control-sm">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="row mb-2">
|
|
|
+ <div class="col-4">
|
|
|
+ <label class="mb-1 text-secondary text-sm">Intensity:</label>
|
|
|
+ <input type="text" v-model="data['{{$sectionPro->uid}}']['physical_activity']['intensity']" class="form-control form-control-sm">
|
|
|
+ </div>
|
|
|
+ <div class="col-8">
|
|
|
+ <label class="mb-1 text-secondary text-sm">Enjoyment:</label>
|
|
|
+ <input type="text" v-model="data['{{$sectionPro->uid}}']['physical_activity']['enjoyment']" class="form-control form-control-sm">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <p class="font-weight-bold text-secondary mt-2 mb-1">Barriers To Physical Activity</p>
|
|
|
+ <input type="text" v-model="data['{{$sectionPro->uid}}']['physical_activity']['barriers']" class="form-control form-control-sm">
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="row mb-3">
|
|
|
+ <div class="col-4">
|
|
|
+ <p class="font-weight-bold mb-1">Assessment of Physical Activity Level</p>
|
|
|
+ <select v-model="data['{{$sectionPro->uid}}']['physical_activity']['assessment']" class="form-control form-control-sm" required>
|
|
|
+ <option value="">-- select --</option>
|
|
|
+ <option value="Inactive">Inactive</option>
|
|
|
+ <option value="Insufficiently Active">Insufficiently Active</option>
|
|
|
+ <option value="Active">Active</option>
|
|
|
+ <option value="Highly Active">Highly Active</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+</div>
|
|
|
+<script>
|
|
|
+ (function() {
|
|
|
+ function init() {
|
|
|
+ window.clientPAUApp_{{$formID}} = new Vue({
|
|
|
+ el: '#parSection_{{$formID}}',
|
|
|
+ data: {
|
|
|
+ data: <?= json_encode($contentData) ?>,
|
|
|
+ },
|
|
|
+ mounted: function() {
|
|
|
+ $('#parSection_{{$formID}} [moe][initialized]').removeAttr('initialized');
|
|
|
+ initMoes();
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ $data: {
|
|
|
+ handler: function(val, oldVal) {
|
|
|
+ $(this.$el).closest('#parSection_{{$formID}}').find('[name="data"]').val(JSON.stringify(this.data));
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ addItem: function() {
|
|
|
+ this.data['{{$sectionPro->uid}}']['current_cch']['list'].push({
|
|
|
+ "category": '',
|
|
|
+ "name": '',
|
|
|
+ "icd": '',
|
|
|
+ "memo": '',
|
|
|
+ "hpi": {
|
|
|
+ "free_text": ''
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ removeItem: function(_index) {
|
|
|
+ this.data['{{$sectionPro->uid}}']['current_cch']['list'].splice(_index, 1);
|
|
|
+ },
|
|
|
+ cleanArray: function(_source) {
|
|
|
+ let plItems = [], plObject = {};
|
|
|
+ for (let x=0; x<_source.length; x++) {
|
|
|
+ plObject = {};
|
|
|
+ for (let y in _source[x]) {
|
|
|
+ if(_source[x].hasOwnProperty(y)) {
|
|
|
+ plObject[y] = _source[x][y];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ plItems.push(plObject);
|
|
|
+ }
|
|
|
+ return plItems;
|
|
|
+ },
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ addMCInitializer('client-par{{$formID}}', init, '#parSection_{{$formID}}');
|
|
|
+ })();
|
|
|
+</script>
|