|
@@ -375,6 +375,11 @@
|
|
|
@include('app.patient.prescriptions.pro-status-form')
|
|
|
@include('app.patient.prescriptions.client-status-form')
|
|
|
@include('app.patient.prescriptions.transmit-form')
|
|
|
+
|
|
|
+ @include('app.patient.prescriptions.new-lab-form')
|
|
|
+ @include('app.patient.prescriptions.new-imaging-form')
|
|
|
+ @include('app.patient.prescriptions.new-referral-form')
|
|
|
+ @include('app.patient.prescriptions.new-other-form')
|
|
|
</div>
|
|
|
<?php
|
|
|
$uCounts = [];
|
|
@@ -503,6 +508,30 @@ GROUP BY erx_category");
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
+ newPrescription_LAB: {
|
|
|
+ noteUid: '{{ @$note ? $note->uid : '' }}',
|
|
|
+ clientUid: '{{ $patient->uid }}',
|
|
|
+ replacesCancelledErxUid: null, // TODO: step-2 support UI to mark a new one as replacing a cancelled one
|
|
|
+ hcpProUid: '{{$pro->uid}}',
|
|
|
+ erxCategory: 'LAB',
|
|
|
+ clinicalDetailJson: {
|
|
|
+ items: [
|
|
|
+ {
|
|
|
+ tests: [
|
|
|
+ {
|
|
|
+ desc: '',
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ icds: [
|
|
|
+ {
|
|
|
+ code: '',
|
|
|
+ desc: '',
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
currentPrescription_IMAGING: {
|
|
|
noteUid: '{{ @$note ? $note->uid : '' }}',
|
|
|
clientUid: '{{ $patient->uid }}',
|
|
@@ -527,6 +556,30 @@ GROUP BY erx_category");
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
+ newPrescription_IMAGING: {
|
|
|
+ noteUid: '{{ @$note ? $note->uid : '' }}',
|
|
|
+ clientUid: '{{ $patient->uid }}',
|
|
|
+ replacesCancelledErxUid: null, // TODO: step-2 support UI to mark a new one as replacing a cancelled one
|
|
|
+ hcpProUid: '{{$pro->uid}}',
|
|
|
+ erxCategory: 'IMAGING',
|
|
|
+ clinicalDetailJson: {
|
|
|
+ items: [
|
|
|
+ {
|
|
|
+ tests: [
|
|
|
+ {
|
|
|
+ desc: '',
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ icds: [
|
|
|
+ {
|
|
|
+ code: '',
|
|
|
+ desc: '',
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
currentPrescription_REFERRAL: {
|
|
|
noteUid: '{{ @$note ? $note->uid : '' }}',
|
|
|
clientUid: '{{ $patient->uid }}',
|
|
@@ -538,6 +591,17 @@ GROUP BY erx_category");
|
|
|
memo: '',
|
|
|
}
|
|
|
},
|
|
|
+ newPrescription_REFERRAL: {
|
|
|
+ noteUid: '{{ @$note ? $note->uid : '' }}',
|
|
|
+ clientUid: '{{ $patient->uid }}',
|
|
|
+ replacesCancelledErxUid: null, // TODO: step-2 support UI to mark a new one as replacing a cancelled one
|
|
|
+ hcpProUid: '{{$pro->uid}}',
|
|
|
+ erxCategory: 'REFERRAL',
|
|
|
+ clinicalDetailJson: {
|
|
|
+ to: '',
|
|
|
+ memo: '',
|
|
|
+ }
|
|
|
+ },
|
|
|
currentPrescription_OTHER: {
|
|
|
noteUid: '{{ @$note ? $note->uid : '' }}',
|
|
|
clientUid: '{{ $patient->uid }}',
|
|
@@ -549,6 +613,17 @@ GROUP BY erx_category");
|
|
|
memo: '',
|
|
|
}
|
|
|
},
|
|
|
+ newPrescription_OTHER: {
|
|
|
+ noteUid: '{{ @$note ? $note->uid : '' }}',
|
|
|
+ clientUid: '{{ $patient->uid }}',
|
|
|
+ replacesCancelledErxUid: null, // TODO: step-2 support UI to mark a new one as replacing a cancelled one
|
|
|
+ hcpProUid: '{{$pro->uid}}',
|
|
|
+ erxCategory: 'OTHER',
|
|
|
+ clinicalDetailJson: {
|
|
|
+ title: '',
|
|
|
+ memo: '',
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
// for editing logistics - common
|
|
|
currentPrescriptionLogistics: {
|
|
@@ -564,6 +639,19 @@ GROUP BY erx_category");
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ newPrescriptionLogistics: {
|
|
|
+ uid: '',
|
|
|
+ logisticsDetailJson: {
|
|
|
+ facilityName: '',
|
|
|
+ facilityCity: '',
|
|
|
+ facilityState: '',
|
|
|
+ facilityAddressMemo: '',
|
|
|
+ facilityPhone: '',
|
|
|
+ facilityFax: '',
|
|
|
+ facilityZip: '',
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
// for editing hcp, sign, pro status & client status - common
|
|
|
currentPrescriptionHcpPro: {
|
|
|
uid: '',
|
|
@@ -618,22 +706,99 @@ GROUP BY erx_category");
|
|
|
toastr.error('There is already an unsigned ERx of type ' + _type + ' in this note.');
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
- let payload = {
|
|
|
- noteUid: '{{ @$note ? $note->uid : '' }}',
|
|
|
- clientUid: '{{$patient->uid}}',
|
|
|
- hcpProUid: '{{$patient->mcp->uid}}',
|
|
|
- erxCategory: _type
|
|
|
- };
|
|
|
- $.post('/api/erx/create', payload, _data => {
|
|
|
- if(!hasResponseError(_data)) {
|
|
|
- fastReload();
|
|
|
+ if(_type === 'DRUG') {
|
|
|
+ let payload = {
|
|
|
+ noteUid: '{{ @$note ? $note->uid : '' }}',
|
|
|
+ clientUid: '{{$patient->uid}}',
|
|
|
+ hcpProUid: '{{$patient->mcp->uid}}',
|
|
|
+ erxCategory: _type
|
|
|
+ };
|
|
|
+ $.post('/api/erx/create', payload, _data => {
|
|
|
+ if(!hasResponseError(_data)) {
|
|
|
+ fastReload();
|
|
|
+ }
|
|
|
+ }, 'json');
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ // show popup for all others
|
|
|
+ switch (_type) {
|
|
|
+ case 'LAB':
|
|
|
+ case 'IMAGING':
|
|
|
+ this['newPrescription_' + _type] = {
|
|
|
+ noteUid: '{{ @$note ? $note->uid : '' }}',
|
|
|
+ clientUid: '{{ $patient->uid }}',
|
|
|
+ replacesCancelledErxUid: null, // TODO: step-2 support UI to mark a new one as replacing a cancelled one
|
|
|
+ hcpProUid: '{{$pro->uid}}',
|
|
|
+ erxCategory: _type,
|
|
|
+ clinicalDetailJson: {
|
|
|
+ items: [
|
|
|
+ {
|
|
|
+ tests: [
|
|
|
+ {
|
|
|
+ desc: '',
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ icds: [
|
|
|
+ {
|
|
|
+ code: '',
|
|
|
+ desc: '',
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ };
|
|
|
+ break;
|
|
|
+ case 'REFERRAL':
|
|
|
+ this.newPrescription_REFERRAL = {
|
|
|
+ noteUid: '{{ @$note ? $note->uid : '' }}',
|
|
|
+ clientUid: '{{ $patient->uid }}',
|
|
|
+ replacesCancelledErxUid: null, // TODO: step-2 support UI to mark a new one as replacing a cancelled one
|
|
|
+ hcpProUid: '{{$pro->uid}}',
|
|
|
+ erxCategory: 'REFERRAL',
|
|
|
+ clinicalDetailJson: {
|
|
|
+ to: '',
|
|
|
+ memo: '',
|
|
|
+ }
|
|
|
+ };
|
|
|
+ break;
|
|
|
+ case 'OTHER':
|
|
|
+ newPrescription_OTHER = {
|
|
|
+ noteUid: '{{ @$note ? $note->uid : '' }}',
|
|
|
+ clientUid: '{{ $patient->uid }}',
|
|
|
+ replacesCancelledErxUid: null, // TODO: step-2 support UI to mark a new one as replacing a cancelled one
|
|
|
+ hcpProUid: '{{$pro->uid}}',
|
|
|
+ erxCategory: 'OTHER',
|
|
|
+ clinicalDetailJson: {
|
|
|
+ title: '',
|
|
|
+ memo: '',
|
|
|
+ }
|
|
|
+ };
|
|
|
+ break;
|
|
|
}
|
|
|
- }, 'json');
|
|
|
+ this.newPrescriptionLogistics = {
|
|
|
+ uid: '',
|
|
|
+ logisticsDetailJson: {
|
|
|
+ facilityName: '',
|
|
|
+ facilityCity: '',
|
|
|
+ facilityState: '',
|
|
|
+ facilityAddressMemo: '',
|
|
|
+ facilityPhone: '',
|
|
|
+ facilityFax: '',
|
|
|
+ facilityZip: '',
|
|
|
+ }
|
|
|
+ };
|
|
|
+ this.currentPrescriptionType = _type;
|
|
|
+ Vue.nextTick(() => {
|
|
|
+ showStagPopup('new-prescription-popup-' + _type, true);
|
|
|
+ $('[stag-popup-key="new-prescription-popup-' + _type + '"] [stag-suggest-initialized]').removeAttr('stag-suggest-initialized');
|
|
|
+ initStagSuggest();
|
|
|
+ });
|
|
|
+ }
|
|
|
return false;
|
|
|
},
|
|
|
- addTestSet: function() {
|
|
|
- this['currentPrescription_' + this.currentPrescriptionType].clinicalDetailJson.items.push({
|
|
|
+ addTestSet: function(_new = false) {
|
|
|
+ this[(_new ? 'new' : 'current') + 'Prescription_' + this.currentPrescriptionType].clinicalDetailJson.items.push({
|
|
|
tests: [
|
|
|
{
|
|
|
desc: '',
|
|
@@ -895,6 +1060,19 @@ GROUP BY erx_category");
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ saveNewPrescription: function() {
|
|
|
+ let payload = JSON.parse(JSON.stringify(this['newPrescription_' + this.currentPrescriptionType]));
|
|
|
+ payload.clinicalDetailJson = JSON.stringify(payload.clinicalDetailJson);
|
|
|
+ payload.logisticsDetailJson = JSON.stringify(this.newPrescriptionLogistics.logisticsDetailJson);
|
|
|
+ $.post('/api/erx/create', payload, _data => {
|
|
|
+ if(!hasResponseError(_data)) {
|
|
|
+ toastr.success('Prescription added');
|
|
|
+ closeStagPopup();
|
|
|
+ fastReload();
|
|
|
+ }
|
|
|
+ }, 'json');
|
|
|
+ },
|
|
|
+
|
|
|
// edit logistics
|
|
|
editLogisticsDetails: function(_prescription) {
|
|
|
this.currentPrescriptionAction = 'EDIT_LOGISTICS';
|
|
@@ -1380,6 +1558,30 @@ GROUP BY erx_category");
|
|
|
self.currentPrescriptionLogistics.logisticsDetailJson.facilityFax = _data.fax;
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ $('[stag-popup-key="new-prescription-popup-LAB"] .facility-search').off('stag-suggest-selected');
|
|
|
+ $('[stag-popup-key="new-prescription-popup-LAB"] .facility-search').on('stag-suggest-selected', (_e, _input, _data) => {
|
|
|
+ if(self.newPrescriptionLogistics && self.newPrescriptionLogistics.logisticsDetailJson) {
|
|
|
+ self.newPrescriptionLogistics.logisticsDetailJson.facilityName = _data.name;
|
|
|
+ self.newPrescriptionLogistics.logisticsDetailJson.facilityCity = _data.city;
|
|
|
+ self.newPrescriptionLogistics.logisticsDetailJson.facilityState = _data.state;
|
|
|
+ self.newPrescriptionLogistics.logisticsDetailJson.facilityZip = _data.zip;
|
|
|
+ self.newPrescriptionLogistics.logisticsDetailJson.facilityPhone = _data.phone;
|
|
|
+ self.newPrescriptionLogistics.logisticsDetailJson.facilityFax = _data.fax;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $('[stag-popup-key="new-prescription-popup-IMAGING"] .facility-search').off('stag-suggest-selected');
|
|
|
+ $('[stag-popup-key="new-prescription-popup-IMAGING"] .facility-search').on('stag-suggest-selected', (_e, _input, _data) => {
|
|
|
+ if(self.newPrescriptionLogistics && self.newPrescriptionLogistics.logisticsDetailJson) {
|
|
|
+ self.newPrescriptionLogistics.logisticsDetailJson.facilityName = _data.name;
|
|
|
+ self.newPrescriptionLogistics.logisticsDetailJson.facilityCity = _data.city;
|
|
|
+ self.newPrescriptionLogistics.logisticsDetailJson.facilityState = _data.state;
|
|
|
+ self.newPrescriptionLogistics.logisticsDetailJson.facilityZip = _data.zip;
|
|
|
+ self.newPrescriptionLogistics.logisticsDetailJson.facilityPhone = _data.phone;
|
|
|
+ self.newPrescriptionLogistics.logisticsDetailJson.facilityFax = _data.fax;
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
|