|
@@ -376,6 +376,19 @@
|
|
@include('app.patient.prescriptions.client-status-form')
|
|
@include('app.patient.prescriptions.client-status-form')
|
|
@include('app.patient.prescriptions.transmit-form')
|
|
@include('app.patient.prescriptions.transmit-form')
|
|
</div>
|
|
</div>
|
|
|
|
+<?php
|
|
|
|
+if (@$note) {
|
|
|
|
+ $unsignedCounts = DB::select("SELECT erx_Category, count(id) FROM erx
|
|
|
|
+WHERE (has_hcp_pro_signed IS NULL OR has_hcp_pro_signed = FALSE) AND
|
|
|
|
+ note_id = {$note->id} AND
|
|
|
|
+ (pro_declared_status <> 'CANCELLED' OR pro_declared_status IS NULL)
|
|
|
|
+GROUP BY erx_category");
|
|
|
|
+ $uCounts = [];
|
|
|
|
+ foreach ($unsignedCounts as $c) {
|
|
|
|
+ $uCounts[$c->erx_category] = $c->count;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+?>
|
|
<script>
|
|
<script>
|
|
(function() {
|
|
(function() {
|
|
|
|
|
|
@@ -429,6 +442,8 @@
|
|
|
|
|
|
prescriptions: <?= json_encode($prescriptions) ?>,
|
|
prescriptions: <?= json_encode($prescriptions) ?>,
|
|
|
|
|
|
|
|
+ numUnsigned: <?= json_encode($uCounts) ?>,
|
|
|
|
+
|
|
currentPrescriptionAction: '',
|
|
currentPrescriptionAction: '',
|
|
currentPrescriptionType: '',
|
|
currentPrescriptionType: '',
|
|
|
|
|
|
@@ -581,6 +596,11 @@
|
|
|
|
|
|
// new eRx (only for popup-list)
|
|
// new eRx (only for popup-list)
|
|
newERx: function(_type) {
|
|
newERx: function(_type) {
|
|
|
|
+ if(!!this.numUnsigned[_type]) {
|
|
|
|
+ toastr.error('There is already an unsigned ERx of type ' + _type + ' in this note.');
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
let payload = {
|
|
let payload = {
|
|
noteUid: '{{ @$note ? $note->uid : '' }}',
|
|
noteUid: '{{ @$note ? $note->uid : '' }}',
|
|
clientUid: '{{$patient->uid}}',
|
|
clientUid: '{{$patient->uid}}',
|