From 8dc569179f3b8cb09b34716432176be7a92910bd Mon Sep 17 00:00:00 2001 From: SnehaRH Date: Thu, 12 Feb 2026 16:47:22 +0530 Subject: [PATCH 1/3] fix: aam-2159 changed text from advancesearch to advanced search --- src/assets/English.json | 2 +- src/assets/language.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/assets/English.json b/src/assets/English.json index 21231850..76c6748a 100644 --- a/src/assets/English.json +++ b/src/assets/English.json @@ -113,7 +113,7 @@ "district": "District / Village", "registrationDate": "Registration Date", "image": "Image", - "advanceSearch": "Advance Search", + "advanceSearch": "Advanced Search", "externalSearch": "Higher Health Facility Search", "status": "Status", "visitCategory": "Visit Category / Visit No", diff --git a/src/assets/language.json b/src/assets/language.json index 57a0d1f9..5723cbdb 100644 --- a/src/assets/language.json +++ b/src/assets/language.json @@ -87,7 +87,7 @@ "district": "District / Village", "registrationDate": "Registration Date", "image": "Image", - "advanceSearch": "Advance Search", + "advanceSearch": "Advanced Search", "status": "Status", "visitCategory": "Visit Category / Visit No", "tcDate": "TC Date", From 212a1b17cec25c0fcc8415f84809c3a1a08c1261 Mon Sep 17 00:00:00 2001 From: 5Amogh Date: Fri, 13 Feb 2026 14:19:35 +0530 Subject: [PATCH 2/3] fix: amm-1979 validation for prescription --- .../prescription/prescription.component.ts | 51 ++++++++++++++++++ .../workarea/workarea.component.ts | 52 +++++++++++++++++++ 2 files changed, 103 insertions(+) diff --git a/src/app/app-modules/nurse-doctor/case-record/general-case-record/prescription/prescription.component.ts b/src/app/app-modules/nurse-doctor/case-record/general-case-record/prescription/prescription.component.ts index 88ffbeeb..9a007bcf 100644 --- a/src/app/app-modules/nurse-doctor/case-record/general-case-record/prescription/prescription.component.ts +++ b/src/app/app-modules/nurse-doctor/case-record/general-case-record/prescription/prescription.component.ts @@ -390,10 +390,61 @@ export class PrescriptionComponent implements OnInit, DoCheck, OnDestroy { } submitForUpload() { + const validationErrors = this.validateCurrentPrescription(); + + if (validationErrors.length > 0) { + const errorMessage = + 'Please fill the following required fields:\n' + + validationErrors.map((e, i) => `${i + 1}. ${e}`).join('\n'); + this.confirmationService.alert(errorMessage, 'error'); + return; + } + this.addMedicine(); this.clearCurrentaddDetails(); } + validateCurrentPrescription(): string[] { + const errors: string[] = []; + + if (!this.currentPrescription.formName) { + errors.push('Medicine Form'); + } + if (!this.currentPrescription.drugName || !this.tempDrugName) { + errors.push('Medicine Name'); + } + if (!this.currentPrescription.dose) { + errors.push('Dosage'); + } + if (!this.currentPrescription.frequency) { + errors.push('Frequency'); + } + + // Conditional validations + if ( + this.currentPrescription.frequency && + this.currentPrescription.frequency !== 'SOS' + ) { + if (!this.currentPrescription.duration) { + errors.push('Duration'); + } + if (!this.currentPrescription.unit) { + errors.push('Unit'); + } + } + + // Quantity required for non-liquid forms + if ( + this.currentPrescription.formID && + this.currentPrescription.formID > 2 && + !this.currentPrescription.qtyPrescribed + ) { + errors.push('Quantity'); + } + + return errors; + } + addMedicine() { const medicine: FormArray = ( this.drugPrescriptionForm.controls['prescribedDrugs'] diff --git a/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts b/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts index fbba9152..9de001b2 100644 --- a/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts +++ b/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts @@ -2930,6 +2930,33 @@ export class WorkareaComponent } } } + // Ensure doctor has added at least one prescription + if (this.attendant === 'doctor') { + try { + const drugPrescriptionForm = ( + (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, @@ -3723,6 +3750,31 @@ export class WorkareaComponent } } } + // For quick consult doctor flow, ensure at least one prescription exists + if (this.attendant === 'doctor') { + try { + const prescription = + form && form.controls ? form.controls['prescription'] : 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( From c46343896af76040511097c4c14ff1d2f6aeeda8 Mon Sep 17 00:00:00 2001 From: SnehaRH <77656297+snehar-nd@users.noreply.github.com> Date: Wed, 18 Feb 2026 13:05:29 +0530 Subject: [PATCH 3/3] Correct spelling in 'advanceBeneficiarySearch' --- src/assets/English.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/assets/English.json b/src/assets/English.json index 76c6748a..c3961778 100644 --- a/src/assets/English.json +++ b/src/assets/English.json @@ -308,7 +308,7 @@ "toTime": "To Time", "Kindlyuploadthefiles": "Kindly upload the files", "clearslots":"Clear Slot", - "advanceBeneficiarySearch": "Advance Beneficiary Search", + "advanceBeneficiarySearch": "Advanced Beneficiary Search", "externalBeneficiarySearch": "External Beneficiary Search", "firstNameisrequired": "First Name is required", "pleaseprovideatleast2character": "Please provide atleast 2 character", @@ -2145,4 +2145,4 @@ } -} \ No newline at end of file +}