|
@@ -33,24 +33,30 @@
|
|
|
<tr>
|
|
|
<th class="border-0 text-secondary width-150px">Created</th>
|
|
|
<th class="border-0 text-secondary" :class="currentPrescription ? 'width-200px' : ''">Clinical</th>
|
|
|
+ <th v-if="!currentPrescription">Prescriber</th>
|
|
|
+ <th v-if="!currentPrescription">Status</th>
|
|
|
+ <th v-if="!currentPrescription">Sign</th>
|
|
|
+ <th v-if="!currentPrescription">Client Status</th>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
<tr v-for="(prescription, index) in prescriptions" :class="currentPrescription && currentPrescription.id === prescription.id ? 'bg-aliceblue' : ''">
|
|
|
<td class="width-150px" :class="currentPrescription && currentPrescription.id === prescription.id ? 'row-selection-highlight' : ''">
|
|
|
- <a href="#" v-on:click.prevent="currentPrescription=prescription; setAddMode('')"
|
|
|
- class="text-nowrap"
|
|
|
- :class="currentPrescription && currentPrescription.id === prescription.id ? 'font-weight-bold' : ''">
|
|
|
- @{{prescription.created_at_friendly_short}}
|
|
|
- </a>
|
|
|
- <div class="mt-1">
|
|
|
- <b class="text-sm">@{{prescription.erx_category}}</b>
|
|
|
- /
|
|
|
- <span class="text-sm">@{{prescription.hcpProDisplayName}}</span>
|
|
|
+ <div :class="prescription.pro_declared_status === 'CANCELLED' ? 'on-hover-opaque' : ''">
|
|
|
+ <a href="#" v-on:click.prevent="setCurrentPrescription(prescription, '');"
|
|
|
+ class="text-nowrap"
|
|
|
+ :class="currentPrescription && currentPrescription.id === prescription.id ? 'font-weight-bold' : ''">
|
|
|
+ @{{prescription.created_at_friendly_short}}
|
|
|
+ </a>
|
|
|
+ <div class="mt-1">
|
|
|
+ <b class="text-sm">@{{prescription.erx_category}}</b>
|
|
|
+ /
|
|
|
+ <span class="text-sm">@{{prescription.hcpProDisplayName}}</span>
|
|
|
+ </div>
|
|
|
+ @if(@$note)
|
|
|
+ <div v-if="prescription.note_id === {{$note->id}}" class="text-sm text-info mt-1 text-nowrap">* From this note</div>
|
|
|
+ @endif
|
|
|
</div>
|
|
|
- @if(@$note)
|
|
|
- <div v-if="prescription.note_id === {{$note->id}}" class="text-sm text-info mt-1 text-nowrap">* From this note</div>
|
|
|
- @endif
|
|
|
<div v-if="prescription.pro_declared_status === 'CANCELLED'" class="text-sm text-secondary font-weight-bold mt-1 text-sm d-flex align-items-baseline">
|
|
|
<i class="fa fa-ban mr-1 text-sm"></i>
|
|
|
CANCELLED
|
|
@@ -62,7 +68,7 @@
|
|
|
<a v-if="!prescription.has_hcp_pro_signed" class="mr-2" href="#" v-on:click.prevent="editClinicalDetails(prescription)"><i class="fa fa-edit on-hover-opaque"></i></a>
|
|
|
<span v-else class="mr-2" title="Cannot edit. Prescription already signed."><i class="fa fa-edit on-hover-opaque text-secondary"></i></span>
|
|
|
--}}
|
|
|
- <div v-if="prescription.clinical_detail_json" class="d-inline-flex align-items-baseline">
|
|
|
+ <div v-if="prescription.clinical_detail_json" class="d-inline-flex align-items-baseline" :class="prescription.pro_declared_status === 'CANCELLED' ? 'on-hover-opaque' : ''">
|
|
|
<div class="" v-if="prescription.erx_category === 'DRUG'">
|
|
|
<div class="d-flex align-items-baseline mb-1" v-for="drug in prescription.clinical_detail_json.items">
|
|
|
<span class="mr-2">@{{drug.medication ?? '-'}}</span>
|
|
@@ -96,6 +102,32 @@
|
|
|
<div v-else>-</div>
|
|
|
</div>
|
|
|
</td>
|
|
|
+ <td v-if="!currentPrescription">
|
|
|
+ <div :class="prescription.pro_declared_status === 'CANCELLED' ? 'on-hover-opaque' : ''">
|
|
|
+ @{{ prescription.hcpProDisplayName }}
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ <td v-if="!currentPrescription">
|
|
|
+ <div :class="prescription.pro_declared_status === 'CANCELLED' ? 'on-hover-opaque' : ''">
|
|
|
+ @{{ sanitizeStatus(prescription.pro_declared_status) }}
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ <td v-if="!currentPrescription">
|
|
|
+ <div :class="prescription.pro_declared_status === 'CANCELLED' ? 'on-hover-opaque' : ''">
|
|
|
+ <div v-if="prescription.has_hcp_pro_signed" class="d-inline-flex align-items-baseline">
|
|
|
+ <i class="text-secondary fa fa-check mr-1"></i>
|
|
|
+ <span class="text-secondary">Signed</span>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ -
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ <td v-if="!currentPrescription">
|
|
|
+ <div :class="prescription.pro_declared_status === 'CANCELLED' ? 'on-hover-opaque' : ''">
|
|
|
+ @{{ sanitizeStatus(prescription.client_declared_status) }}
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
@@ -105,7 +137,7 @@
|
|
|
<h3 class="font-size-16 m-0">
|
|
|
<b class="mr-1 font-size-16">@{{ currentPrescription.erx_category }} ERx <span class="ml-2">@{{ currentPrescription.created_at_friendly_short }}</span></b>
|
|
|
</h3>
|
|
|
- <a class="ml-auto" href="#" v-on:click.prevent="currentPrescription=null">
|
|
|
+ <a class="ml-auto" href="#" v-on:click.prevent="setCurrentPrescription(null);">
|
|
|
<i class="fa fa-times-circle on-hover-opaque"></i>
|
|
|
</a>
|
|
|
</div>
|
|
@@ -192,8 +224,8 @@
|
|
|
</div>
|
|
|
|
|
|
@if(@$note)
|
|
|
- <div class="" v-if="!currentPrescription.has_hcp_pro_signed">
|
|
|
- <a href="#" class="d-block mb-1" v-on:click.prevent="setAddMode('existing')">+ Existing</a>
|
|
|
+ <div class="d-flex align-items-center mt-3" v-if="!currentPrescription.has_hcp_pro_signed">
|
|
|
+ <a href="#" class="d-block mb-1 mr-2" v-on:click.prevent="setAddMode('existing')">+ Existing</a>
|
|
|
<a href="#" class="d-block mb-1" v-on:click.prevent="setAddMode('new')">+ New</a>
|
|
|
</div>
|
|
|
@endif
|
|
@@ -374,11 +406,13 @@
|
|
|
</div>
|
|
|
<div class="pb-2 d-flex align-items-start" v-if="currentPrescription.has_hcp_pro_signed">
|
|
|
<span class="min-width-140px text-secondary text-sm">PDF</span>
|
|
|
- <div class="">
|
|
|
+ <div class="d-flex align-items-baseline">
|
|
|
<a class="pdf-viewer-trigger d-block mb-1" native target="_blank"
|
|
|
:href="'/prescription-download-as-pdf/' + currentPrescription.uid">View</a>
|
|
|
+ <span class="mx-2 text-sm text-secondary">|</span>
|
|
|
<a native target="_blank" class="d-block mb-1"
|
|
|
:href="'/prescription-download-as-pdf/' + currentPrescription.uid">Download</a>
|
|
|
+ <span class="mx-2 text-sm text-secondary">|</span>
|
|
|
<a href="#" class="d-block mb-1"
|
|
|
v-on:click.prevent="transmit(currentPrescription)">Transmit</a>
|
|
|
</div>
|
|
@@ -726,7 +760,6 @@ GROUP BY erx_category");
|
|
|
}, 'json');
|
|
|
},
|
|
|
|
|
|
- // new eRx (only for popup-list)
|
|
|
newERx: function(_type) {
|
|
|
if(!!this.numUnsigned[_type]) {
|
|
|
toastr.error('There is already an unsigned ERx of type ' + _type + ' in this note.');
|
|
@@ -820,6 +853,7 @@ GROUP BY erx_category");
|
|
|
showStagPopup('new-prescription-popup-' + _type, true);
|
|
|
$('[stag-popup-key="new-prescription-popup-' + _type + '"] [stag-suggest-initialized]').removeAttr('stag-suggest-initialized');
|
|
|
initStagSuggest();
|
|
|
+ this.initICDAutoSuggest();
|
|
|
});
|
|
|
}
|
|
|
return false;
|
|
@@ -840,6 +874,12 @@ GROUP BY erx_category");
|
|
|
});
|
|
|
},
|
|
|
addTest: function(_item) {
|
|
|
+ for (let i = 0; i < _item.tests.length; i++) {
|
|
|
+ if(!_item.tests[i].desc) {
|
|
|
+ toastr.error('One or more existing tests are empty/invalid!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
_item.tests.push({
|
|
|
desc: ''
|
|
|
});
|
|
@@ -848,7 +888,14 @@ GROUP BY erx_category");
|
|
|
});
|
|
|
},
|
|
|
addICD: function(_item) {
|
|
|
+ for (let i = 0; i < _item.icds.length; i++) {
|
|
|
+ if(!_item.icds[i].code) {
|
|
|
+ toastr.error('One or more existing icds are empty/invalid!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
_item.icds.push({
|
|
|
+ code: '',
|
|
|
desc: ''
|
|
|
});
|
|
|
Vue.nextTick(() => {
|
|
@@ -1231,6 +1278,7 @@ GROUP BY erx_category");
|
|
|
|
|
|
// sane display status
|
|
|
sanitizeStatus: function(_s) {
|
|
|
+ if(!_s) return '-';
|
|
|
_s = _s.toLowerCase().replaceAll('_', ' ');
|
|
|
_s = _s[0].toUpperCase() + _s.substr(1);
|
|
|
return _s;
|
|
@@ -1388,6 +1436,8 @@ GROUP BY erx_category");
|
|
|
this.currentPrescription = temp;
|
|
|
this.setCurrentPrescription(temp);
|
|
|
|
|
|
+ showMask();
|
|
|
+
|
|
|
// save erx
|
|
|
$.post('/api/erx/updateClinicalDetail', {
|
|
|
uid: this.currentPrescription.uid,
|
|
@@ -1418,8 +1468,15 @@ GROUP BY erx_category");
|
|
|
}
|
|
|
}, 'json');
|
|
|
},
|
|
|
- setCurrentPrescription: function(_prescription) {
|
|
|
+ setCurrentPrescription: function(_prescription, _addMode = false) {
|
|
|
this.currentPrescription = _prescription;
|
|
|
+ if(_addMode !== false) {
|
|
|
+ this.setAddMode(_addMode);
|
|
|
+ }
|
|
|
+
|
|
|
+ @if(@$note)
|
|
|
+ localStorage['currentErx_{{$note->id}}'] = _prescription ? _prescription.id : -1;
|
|
|
+ @endif
|
|
|
},
|
|
|
setAddMode: function(_mode) {
|
|
|
let self = this;
|
|
@@ -1492,6 +1549,8 @@ GROUP BY erx_category");
|
|
|
refills: form.find('[name="refills"]').val(),
|
|
|
};
|
|
|
|
|
|
+ showMask();
|
|
|
+
|
|
|
$.post(form.attr('action'), form.serialize(), _data => {
|
|
|
if (!hasResponseError(_data)) {
|
|
|
hideMask();
|
|
@@ -1539,7 +1598,8 @@ GROUP BY erx_category");
|
|
|
dynID = 'icd-' + Math.ceil(Math.random() * 1000000),
|
|
|
itemIndex = $(this).attr('data-item-index'),
|
|
|
icdIndex = $(this).attr('data-icd-index'),
|
|
|
- category = $(this).attr('data-category');
|
|
|
+ category = $(this).attr('data-category'),
|
|
|
+ existing = $(this).closest('[stag-popup-key]').length === 0;
|
|
|
$(elem).attr('id', dynID);
|
|
|
new window.Def.Autocompleter.Search(dynID,
|
|
|
'https://clinicaltables.nlm.nih.gov/api/icd10cm/v3/search?sf=code,name&ef=name', {
|
|
@@ -1550,8 +1610,14 @@ GROUP BY erx_category");
|
|
|
);
|
|
|
window.Def.Autocompleter.Event.observeListSelections(dynID, function() {
|
|
|
let autocomp = elem.autocomp, acData = autocomp.getSelectedItemData();
|
|
|
- self['currentPrescription_' + category].clinicalDetailJson.items[itemIndex].icds[icdIndex].code = acData[0].code;
|
|
|
- self['currentPrescription_' + category].clinicalDetailJson.items[itemIndex].icds[icdIndex].desc = acData[0].data['name'];
|
|
|
+ if(existing) {
|
|
|
+ self['currentPrescription_' + category].clinicalDetailJson.items[itemIndex].icds[icdIndex].code = acData[0].code;
|
|
|
+ self['currentPrescription_' + category].clinicalDetailJson.items[itemIndex].icds[icdIndex].desc = acData[0].data['name'];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ self['newPrescription_' + category].clinicalDetailJson.items[itemIndex].icds[icdIndex].code = acData[0].code;
|
|
|
+ self['newPrescription_' + category].clinicalDetailJson.items[itemIndex].icds[icdIndex].desc = acData[0].data['name'];
|
|
|
+ }
|
|
|
return false;
|
|
|
});
|
|
|
$(elem).attr('ac-initialized', 1);
|
|
@@ -1577,6 +1643,17 @@ GROUP BY erx_category");
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ @if(@$note)
|
|
|
+ if(!!localStorage['currentErx_{{$note->id}}']) {
|
|
|
+ for(let x in this.prescriptions) {
|
|
|
+ if(this.prescriptions[x].id === +(localStorage['currentErx_{{$note->id}}'])) {
|
|
|
+ this.currentPrescription = this.prescriptions[x];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ @endif
|
|
|
+
|
|
|
$('[stag-popup-key="logistics-popup"] .facility-search').off('stag-suggest-selected');
|
|
|
$('[stag-popup-key="logistics-popup"] .facility-search').on('stag-suggest-selected', (_e, _input, _data) => {
|
|
|
if(self.currentPrescriptionLogistics && self.currentPrescriptionLogistics.logisticsDetailJson) {
|