1. Ticket Details

FieldDescription
Ticket IDAMM-2228
SeverityHigher
CategoryBug
Affected Module / FeatureTM

2. Issue Description

Doctor unable to search for a second diagnosis after adding the first one for a beneficiary.


3. Root Cause Analysis (RCA)


Technique Used: Log/Trace Review

 The onDiagnosisInputKeyup() method in the diagnosis components was passing the .FormArray row index as the pageNo parameter to the SNOMED CT search API.
The API searchDiagnosisBasedOnPageNo(term, pageNo) expects a pagination page number, not a row identifier.

 onDiagnosisInputKeyup(value: string, index: number) {
      this.masterdataService
          .searchDiagnosisBasedOnPageNo(value, index)  // index used as pageNo
          .subscribe((results) => {
              this.suggestedDiagnosisList[index] = results?.data?.sctMaster;
          });
  }

Impact

  - Affected all 4 diagnosis components: General OPD, PNC, NCD Care, NCD Screening
  - Doctors could only add 1 diagnosis per beneficiary via inline search
  - The dialog-based search (via Enter key/directive) was not affected as it manages pagination independently






4. Corrective Actions (Fixes for this instance)

ActionOwnerTarget DateStatus

Changed all 4 components to always pass pageNo: 0 to fetch the first page of results
  regardless of which row the user is searching in:

  // After fix
  this.masterdataService.searchDiagnosisBasedOnPageNo(value, 0)

  The index continues to be used correctly for storing results per-row in
  suggestedDiagnosisList[index].

  Files Changed

  - general-opd-diagnosis.component.ts
  - pnc-diagnosis.component.ts
  - ncd-care-diagnosis.component.ts
  - ncd-screening-diagnosis.component.ts



Developer

 

Completed



5. Preventive Actions (To prevent recurrence)

ActionOwnerTarget DateStatus







6. Verification of Effectiveness


7. Lessons Learned



8. CAPA Review & Closure

Reviewed ByDateRemarks