|
@@ -232,7 +232,7 @@
|
|
|
<a native target="_blank"
|
|
|
:href="'/prescription-download-as-pdf/' + currentPrescription.uid">Download</a>
|
|
|
<span class="mx-2 text-secondary">|</span>
|
|
|
- <a href="#" v-on:click.prevent="sendFax(currentPrescription)">Send Fax</a>
|
|
|
+ <a href="#" v-on:click.prevent="transmit(currentPrescription)">Transmit</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -248,13 +248,14 @@
|
|
|
@include('app.patient.prescriptions.sign-as-hcp-form')
|
|
|
@include('app.patient.prescriptions.pro-status-form')
|
|
|
@include('app.patient.prescriptions.client-status-form')
|
|
|
- @include('app.patient.prescriptions.send-fax-form')
|
|
|
+ @include('app.patient.prescriptions.transmit-form')
|
|
|
</div>
|
|
|
<script>
|
|
|
(function() {
|
|
|
|
|
|
<?php
|
|
|
$prescriptions = $patient->prescriptions;
|
|
|
+ $currentPrescription = null;
|
|
|
foreach ($prescriptions as $prescription) {
|
|
|
if($prescription->clinical_detail_json) {
|
|
|
$prescription->clinical_detail_json = json_decode($prescription->clinical_detail_json);
|
|
@@ -266,6 +267,10 @@
|
|
|
$prescription->created_at_friendly_short = friendlier_date_time($prescription->created_at, false);
|
|
|
$prescription->hcpProDisplayName = $prescription->hcpPro ? $prescription->hcpPro->displayName() : '-';
|
|
|
$prescription->hcpProUid = $prescription->hcpPro ? $prescription->hcpPro->uid : '';
|
|
|
+
|
|
|
+// if(!!@$currentErx && $currentErx->uid === $prescription->uid) {
|
|
|
+//
|
|
|
+// }
|
|
|
}
|
|
|
?>
|
|
|
|
|
@@ -393,11 +398,18 @@
|
|
|
status: '',
|
|
|
memo: '',
|
|
|
},
|
|
|
- currentPrescriptionFax: {
|
|
|
+ currentPrescriptionTransmit: {
|
|
|
uid: '',
|
|
|
- faxNumber: '',
|
|
|
+ logistics: '',
|
|
|
+ toWho: '',
|
|
|
+ toEmail: '',
|
|
|
+ toFaxNumber: '',
|
|
|
+ toFaxNumberAttentionLine: '',
|
|
|
+ toFaxNumberCoverSheetMemo: '',
|
|
|
+ copyToPatient: false,
|
|
|
+ copyToPatientFaxNumber: '',
|
|
|
+ copyToPatientEmail: '',
|
|
|
},
|
|
|
-
|
|
|
},
|
|
|
methods: {
|
|
|
|
|
@@ -655,19 +667,26 @@
|
|
|
return _s;
|
|
|
},
|
|
|
|
|
|
- // send fax
|
|
|
- sendFax: function(_prescription) {
|
|
|
- this.currentPrescriptionFax = {
|
|
|
+ // transmit
|
|
|
+ transmit: function(_prescription) {
|
|
|
+ this.currentPrescriptionTransmit = {
|
|
|
uid: _prescription.uid,
|
|
|
- faxNumber: _prescription.logistics_detail_json && _prescription.logistics_detail_json.facilityFax ?
|
|
|
- _prescription.logistics_detail_json.facilityFax : '',
|
|
|
+ toWho: _prescription.logistics_detail_json ? _prescription.logistics_detail_json.facilityName : '',
|
|
|
+ toEmail: '',
|
|
|
+ toFaxNumber: _prescription.logistics_detail_json ? _prescription.logistics_detail_json.facilityFax : '',
|
|
|
+ toFaxNumberAttentionLine: '',
|
|
|
+ toFaxNumberCoverSheetMemo: '',
|
|
|
+ copyToPatient: false,
|
|
|
+ copyToPatientFaxNumber: '{{$patient->cell_number}}',
|
|
|
+ copyToPatientEmail: '{{$patient->email_address}}',
|
|
|
+ _token: '{{csrf_token()}}'
|
|
|
};
|
|
|
Vue.nextTick(() => {
|
|
|
- showStagPopup('send-fax-popup');
|
|
|
- this.sendFaxModalPDFPreview();
|
|
|
+ showStagPopup('transmit-popup');
|
|
|
+ this.transmitModalPDFPreview();
|
|
|
});
|
|
|
},
|
|
|
- sendFaxModalPDFPreview: function() {
|
|
|
+ transmitModalPDFPreview: function() {
|
|
|
|
|
|
let _loadedPDF = null, _numPages = 1, _page = 1;
|
|
|
|
|
@@ -677,7 +696,7 @@
|
|
|
_numPages = 1;
|
|
|
_page = 1;
|
|
|
|
|
|
- $('#send-fax-pdf-preview>canvas').remove();
|
|
|
+ $('#transmit-pdf-preview>canvas').remove();
|
|
|
|
|
|
let url = _url;
|
|
|
let pdfjsLib = window['pdfjs-dist/build/pdf'];
|
|
@@ -699,7 +718,7 @@
|
|
|
// create canvas
|
|
|
let canvasElement = $('<canvas/>')
|
|
|
.addClass('pdf-viewer-page pdf-preview-page')
|
|
|
- .appendTo('#send-fax-pdf-preview');
|
|
|
+ .appendTo('#transmit-pdf-preview');
|
|
|
|
|
|
let canvas = canvasElement[0];
|
|
|
let viewport = page.getViewport({scale: 0.75});
|
|
@@ -721,19 +740,17 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- _load('/prescription-download-as-pdf/' + this.currentPrescriptionFax.uid);
|
|
|
+ _load('/prescription-download-as-pdf/' + this.currentPrescriptionTransmit.uid);
|
|
|
},
|
|
|
- doSendFax: function (_item) {
|
|
|
- /*$.post('/api/ticketFax/create', {
|
|
|
- faxNumber: this.faxNumber,
|
|
|
- ticketUid: this[this.currentCategory + 'PopupItem'].uid
|
|
|
- },
|
|
|
- (_data) => {
|
|
|
- this.reloadPopupItem(this.currentCategory);
|
|
|
+ doTransmit: function (_item) {
|
|
|
+ let payload = JSON.parse(JSON.stringify(this.currentPrescriptionTransmit));
|
|
|
+ $.post('/prescription-transmit/' + payload.uid, payload, _data => {
|
|
|
+ if(!hasResponseError(_data)) {
|
|
|
+ toastr.success('Transmission initiated');
|
|
|
closeStagPopup();
|
|
|
- },
|
|
|
- 'json');*/
|
|
|
- alert(1);
|
|
|
+ fastReload();
|
|
|
+ }
|
|
|
+ }, 'json');
|
|
|
closeStagPopup();
|
|
|
},
|
|
|
|