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

    •    General OPD flow: Login as Doctor, open a beneficiary, add 1st diagnosis via search, 
        click "+" and search for a 2nd diagnosis — verify search results appear for both rows

    •  Multiple rows: Add 3rd, 4th, 5th diagnosis in subsequent rows — verify all rows      
        return search results regardless of row position          

    •  PNC visit: Repeat multi-diagnosis search in PNC visit category — verify results
        appear for all rows                                                                  

    • NCD Care visit: Repeat multi-diagnosis search in NCD Care visit category — verify
        results appear for all rows                                                            

    • NCD Screening visit: Repeat multi-diagnosis search in NCD Screening visit category —
        verify results appear for all row

    •  No regression on 1st row: Verify the first diagnosis row still returns search results
         as before

    •  Save and view: Save the case record with multiple diagnoses and reopen in view mode —
         verify all added diagnoses are displayed correctly  

    • API verification: Check DevTools → Network tab and confirm all search requests send
        pageNo: 0 in the request payload, regardless of which row the search is triggered from 
        


7. Lessons Learned



8. CAPA Review & Closure

Reviewed ByDateRemarks





  • No labels