Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
name="form"
[(ngModel)]="currentPrescription.formName"
(selectionChange)="getFormValueChanged()"
required
>
<mat-option
*ngFor="let item of drugFormMaster"
Expand All @@ -70,7 +69,6 @@
[(ngModel)]="tempDrugName"
(keyup)="filterMedicine(tempDrugName)"
(blur)="reEnterMedicine()"
required
[matAutocomplete]="autoGroup"
/>
<mat-autocomplete
Expand All @@ -94,7 +92,6 @@
name="dose"
[(ngModel)]="currentPrescription.dose"
[disabled]="!currentPrescription.drugID"
required
>
<mat-option
*ngFor="let item of filteredDrugDoseMaster"
Expand All @@ -116,7 +113,6 @@
name="frequency"
[(ngModel)]="currentPrescription.frequency"
[disabled]="!currentPrescription.drugID"
required
>
<mat-option
*ngFor="let item of drugFrequencyMaster"
Expand All @@ -140,7 +136,6 @@
name="duration"
[(ngModel)]="currentPrescription.duration"
[disabled]="!currentPrescription.drugID"
required
>
<mat-option *ngFor="let item of drugDurationMaster" [value]="item">
{{ item }}
Expand All @@ -157,7 +152,6 @@
name="unit"
[(ngModel)]="currentPrescription.unit"
[disabled]="!currentPrescription.drugID"
required
>
<mat-option
*ngFor="let item of drugDurationUnitMaster"
Expand Down Expand Up @@ -186,7 +180,6 @@
name="quantity"
[(ngModel)]="currentPrescription.qtyPrescribed"
[disabled]="!currentPrescription.drugID"
required
>
<mat-option
*ngFor="let item of drugDurationMaster | slice: 0 : 5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ <h4>
name="form"
[(ngModel)]="tempform"
(selectionChange)="getFormValueChanged()"
required

>
<mat-option
*ngFor="let item of drugFormMaster"
Expand All @@ -811,7 +811,6 @@ <h4>
[(ngModel)]="tempDrugName"
(keyup)="filterMedicine(tempDrugName)"
(blur)="reEnterMedicine()"
required
[matAutocomplete]="autoGroup"
/>
<mat-autocomplete
Expand Down Expand Up @@ -844,7 +843,6 @@ <h4>
name="dose"
[(ngModel)]="currentPrescription.dose"
[disabled]="!currentPrescription.drugID"
required
>
<mat-option
*ngFor="let item of filteredDrugDoseMaster"
Expand All @@ -865,7 +863,6 @@ <h4>
name="frequency"
[(ngModel)]="currentPrescription.frequency"
[disabled]="!currentPrescription.drugID"
required
>
<mat-option
*ngFor="let item of drugFrequencyMaster"
Expand All @@ -889,7 +886,6 @@ <h4>
name="duration"
[(ngModel)]="currentPrescription.duration"
[disabled]="!currentPrescription.drugID"
required
>
<mat-option
*ngFor="let item of drugDurationMaster"
Expand All @@ -910,7 +906,6 @@ <h4>
name="unit"
[(ngModel)]="currentPrescription.unit"
[disabled]="!currentPrescription.drugID"
required
>
<mat-option
*ngFor="let item of drugDurationUnitMaster"
Expand Down Expand Up @@ -938,7 +933,6 @@ <h4>
name="quantity"
[(ngModel)]="currentPrescription.qtyPrescribed"
[disabled]="!currentPrescription.drugID"
required
>
<mat-option
*ngFor="let item of drugDurationMaster | slice: 0 : 5"
Expand Down
59 changes: 1 addition & 58 deletions src/app/app-modules/nurse-doctor/workarea/workarea.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2123,33 +2123,7 @@ export class WorkareaComponent
}
}

// Ensure doctor has added at least one prescription
if (this.attendant === 'doctor') {
try {
const drugPrescriptionForm = <FormGroup>(
(caseRecordForm && caseRecordForm.controls
? caseRecordForm.controls['drugPrescriptionForm']
: null)
);
if (drugPrescriptionForm) {
let prescribedDrugs =
drugPrescriptionForm.value &&
drugPrescriptionForm.value.prescribedDrugs
? drugPrescriptionForm.value.prescribedDrugs
: [];
prescribedDrugs = prescribedDrugs.filter((d: any) => !!d.createdBy);
if (!prescribedDrugs || prescribedDrugs.length === 0) {
required.push(
this.current_language_set?.Prescription?.prescriptionRequired ||
'Please add at least one prescription',
);
}
}
} catch (err) {
console.warn('Error validating prescription presence', err);
}
}


if (required.length) {
this.confirmationService.notify(
this.current_language_set.alerts.info.belowFields,
Expand Down Expand Up @@ -2708,37 +2682,6 @@ export class WorkareaComponent
}
}

// For quick consult doctor flow, ensure at least one prescription exists
if (this.attendant === 'doctor') {
try {
const caseRecordForm = <FormGroup>(
this.patientMedicalForm.controls['patientCaseRecordForm']
);
const prescription =
caseRecordForm && caseRecordForm.controls
? caseRecordForm.controls['drugPrescriptionForm']
: null;
if (prescription) {
let prescribedDrugs =
prescription.value && prescription.value.prescribedDrugs
? prescription.value.prescribedDrugs
: [];
prescribedDrugs = prescribedDrugs.filter((d: any) => !!d.createdBy);
if (!prescribedDrugs || prescribedDrugs.length === 0) {
required.push(
this.current_language_set?.Prescription?.prescriptionRequired ||
'Please add at least one prescription',
);
}
}
} catch (err) {
console.warn(
'Error validating quick consult prescription presence',
err,
);
}
}

if (required.length) {
this.confirmationService.notify(
this.current_language_set.alerts.info.belowFields,
Expand Down
Loading