Skip to content

Conversation

@5Amogh
Copy link
Member

@5Amogh 5Amogh commented Jan 7, 2026

Summary by CodeRabbit

  • New Features

    • Added feedback functionality accessible from logout flow
    • Enabled doctor signature tracking for medical records
  • Bug Fixes

    • Fixed duplicate diagnosis entries appearing in forms
    • Improved HTTP error handling and session expiration alerts
    • Fixed language preference persistence across sessions
  • UI/UX

    • Redesigned footer layout with additional columns
    • Removed unnecessary beneficiary detail fields
    • Enhanced pagination for test and radiology results
  • Chores

    • Version updated to 3.6.0
    • Updated localization strings for multiple languages
    • Added analytics tracking configuration

✏️ Tip: You can customize this high-level summary in your review settings.

5Amogh and others added 30 commits July 21, 2025 11:57
fix: amm-1668 beneficiary details addition
* fix: changed build version to 3.4.0

* fix: common ui cahanges
* fix:not able to view case sheet in previous history module

* fix: amm-1478 previous visit casesheet keys are not loading issue
3.4.0 to 3.4.1
feat: amm-1337 Feedback module integration and 1668 removal of PII from beneficiary details
fix: 1857 Signature in casesheet enhancement
snehar-nd and others added 25 commits October 16, 2025 15:25
AAM-1898 in reports section next button not working.
Fix the WASA Issue: IDOR Vulnerability
fix: amm-1931 handling session expiry
Signature enhancement for casesheet
@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

📝 Walkthrough

Walkthrough

This update introduces doctor digital signature tracking across case record submissions, adds a feedback module with navigation integration, enhances HTTP error handling with centralized logic, refines diagnosis form validation to prevent duplicate entries, persists user language preferences via localStorage, and updates localization strings and environment configuration.

Changes

Cohort / File(s) Summary
Signature Tracking Infrastructure
src/app/app-modules/nurse-doctor/shared/services/doctor.service.ts, src/app/app-modules/nurse-doctor/workarea/workarea.component.ts, src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts, src/app/app-modules/nurse-doctor/case-sheet/cancer-case-sheet/cancer-doctor-diagnosis-case-sheet/cancer-doctor-diagnosis-case-sheet.component.ts
Added doctorSignatureFlag parameter to numerous doctor service methods; workarea component fetches signature status via checkUsersignatureExist() and propagates flag to submissions; case sheet components refactored to support asynchronous user ID retrieval for signature downloads.
Feedback Module Integration
src/app/app-modules/core/components/app-header/app-header.component.ts, src/app/app-modules/core/components/app-footer/app-footer.component.html, src/app/app-routing.module.ts
Header logout redirects to /feedback route with query parameter; footer layout expanded from three 4-unit columns to four 3-unit columns, adding new interactive feedback link; app routing adds lazy-loaded feedback module.
HTTP Interceptor & Language Persistence
src/app/app-modules/core/services/http-interceptor.service.ts, src/app/app-modules/core/services/http-service.service.ts
Interceptor adds specialized handling for platform-feedback requests, centralized error handling (401/403/500), and conditional header management based on request type; HTTP service now persists language preference to localStorage and initializes from it on startup.
Diagnosis Form Validation Refinements
src/app/app-modules/nurse-doctor/case-record/.../general-opd-diagnosis/general-opd-diagnosis.component.ts, src/app/app-modules/nurse-doctor/case-record/.../ncd-care-diagnosis/ncd-care-diagnosis.component.*, src/app/app-modules/nurse-doctor/case-record/.../ncd-screening-diagnosis/ncd-screening-diagnosis.component.*, src/app/app-modules/nurse-doctor/case-record/.../pnc-diagnosis/pnc-diagnosis.component.ts
Added conditional guards to prevent duplicate diagnosis entries; refactored PNC diagnosis to use full diagnosis object; removed required attribute from provisional diagnosis fields; improved diagnosis population logic across multiple diagnosis component types.
UI Display & Data Handling
src/app/app-modules/core/components/beneficiary-details/beneficiary-details.component.html, src/app/app-modules/nurse-doctor/case-record/.../test-and-radiology/test-and-radiology.component.html, src/app/app-modules/nurse-doctor/case-record/.../findings/findings.component.ts
Removed three optional beneficiary fields (fatherName, lastName, preferredPhoneNum); replaced lab pagination source with client-side paginate pipe on filtered results; added caseRecordMode string casting and referredVisitCode empty-string handling.
Service & Core Module Updates
src/app/app-modules/service-point/service-point.service.ts, src/app/app-modules/service-point/service-point-resolve.service.ts, src/app/app-modules/core/core.module.ts
Removed userId parameter from getServicePoints() method signature and payload; added RouterModule import to CoreModule (duplicate entry).
Localization & Build Configuration
src/assets/English.json, src/assets/Hindi.json, src/assets/Assamese.json, src/environments/environment*.ts*, pom.xml
Added platform feedback translation keys across three languages; updated Assamese translations for consistency; added Matomo tracking configuration to all environment files; added getUserId and checkUsersignExistUrl endpoints to CI template; bumped project version from 3.4.0 to 3.6.0.
Submodule Update
Common-UI
Updated Common-UI submodule pointer (metadata only, no functional changes).

Sequence Diagram(s)

sequenceDiagram
    participant Doctor
    participant Workarea as Workarea<br/>Component
    participant DoctorSvc as Doctor<br/>Service
    participant Backend as Backend<br/>API
    participant SessionSvc as Session<br/>Storage

    Doctor->>Workarea: Initializes component
    activate Workarea
    
    rect rgb(200, 220, 255)
    Note over Workarea,Backend: Signature Status Retrieval (on init)
    Workarea->>Workarea: Get userID from session
    Workarea->>DoctorSvc: checkUsersignatureExist(userID)
    activate DoctorSvc
    DoctorSvc->>Backend: GET /signature/signexist/{userID}
    activate Backend
    Backend-->>DoctorSvc: {statusCode: 200, data: {...}}
    deactivate Backend
    DoctorSvc-->>Workarea: signature response
    deactivate DoctorSvc
    Workarea->>Workarea: Set doctorSignatureFlag = true
    end
    
    rect rgb(220, 255, 220)
    Note over Workarea,Backend: Case Record Submission with Signature Flag
    Doctor->>Workarea: Submit case record
    Workarea->>Workarea: Prepare payload with<br/>doctorSignatureFlag
    Workarea->>DoctorSvc: postDoctorNCDScreeningDetails(...,<br/>doctorSignatureFlag)
    activate DoctorSvc
    DoctorSvc->>DoctorSvc: Attach doctorSignatureFlag<br/>to request payload
    DoctorSvc->>Backend: POST case record data
    activate Backend
    Backend-->>DoctorSvc: Success response
    deactivate Backend
    DoctorSvc-->>Workarea: Response
    deactivate DoctorSvc
    Workarea->>Workarea: Mark submission complete
    end
    
    deactivate Workarea
Loading
sequenceDiagram
    participant Client as Client<br/>Application
    participant HttpInt as HTTP<br/>Interceptor
    participant Http as HTTP<br/>Client
    participant Backend as Backend<br/>API
    participant Alert as Alert<br/>Service

    Client->>Http: Make HTTP request
    Http->>HttpInt: Intercept request
    activate HttpInt
    
    rect rgb(255, 240, 200)
    Note over HttpInt,Http: Request Processing
    alt Is platform-feedback request?
    HttpInt->>HttpInt: Remove Authorization<br/>Set Content-Type: application/json
    else FormData body?
    HttpInt->>HttpInt: Set Authorization header<br/>based on stored key
    else Regular request
    HttpInt->>HttpInt: Set Authorization & Content-Type<br/>if key exists
    end
    end
    
    HttpInt->>Http: Forward modified request
    Http->>Backend: Send HTTP request
    activate Backend
    
    rect rgb(255, 220, 220)
    Note over Backend,Alert: Response/Error Handling
    alt Status 401 (Unauthorized)
    Backend-->>Http: 401 Unauthorized
    Http-->>HttpInt: Error response
    HttpInt->>HttpInt: Clear session storage
    HttpInt->>Alert: Show "Login Expired" alert
    HttpInt->>Client: Navigate to /login
    else Status 403 (Forbidden)
    Backend-->>Http: 403 Forbidden
    Http-->>HttpInt: Error response
    HttpInt->>Alert: Show "Access Denied" alert
    else Status 500 (Server Error)
    Backend-->>Http: 500 Internal Server Error
    Http-->>HttpInt: Error response
    HttpInt->>Alert: Show "Server Error" alert
    else Success (2xx)
    Backend-->>Http: Success response
    Http-->>HttpInt: Response data
    HttpInt-->>Client: Response
    end
    end
    
    deactivate Backend
    deactivate HttpInt
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

🐰 A digital mark upon each case so true,
Feedback echoes flow, and routes made new,
Diagnosis rows no longer multiply,
Error handlers catch what once slipped by,
Languages persist through browser sleep,
Signatures tracked, data we keep! 🖋️

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Release 3.6.0 into main' accurately reflects the primary intent of this pull request, which is to merge the release-3.6.0 branch into the main branch. The changeset confirms a version bump from 3.4.0 to 3.6.0 in pom.xml, and the title concisely captures this release merge objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom Pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 7, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
8.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
src/app/app-modules/nurse-doctor/case-record/general-case-record/findings/findings.component.ts (2)

259-259: Remove debug console.log statements.

The console.log statements at lines 259 and 271 appear to be debug artifacts. Please remove them before merging to production.

🔎 Proposed fix
  getSCTid(event: any, index: any) {
-   console.log('called', index, event);
    this.masterdataService.getSnomedCTRecord(event.chiefComplaint).subscribe(
  loadConceptID(data: any, index: any) {
-   console.log(this.generalFindingsForm.value, data);
    const id = <FormArray>this.generalFindingsForm.controls['complaints'];

Also applies to: 271-271


260-268: Improve error handling for SNOMED CT record lookup.

The empty error handler (error) => {} silently suppresses failures when fetching SNOMED CT records. Consider logging the error or notifying the user when the lookup fails, as this could help with debugging and improve user experience.

🔎 Suggested improvement
    this.masterdataService.getSnomedCTRecord(event.chiefComplaint).subscribe(
      (res: any) => {
        if (res && res.statusCode === 200) {
          this.loadConceptID(res.data, index);
        }
      },
-     (error) => {},
+     (error) => {
+       console.error('Failed to fetch SNOMED CT record:', error);
+       // Optionally notify user via confirmationService
+     },
    );
src/app/app-modules/nurse-doctor/shared/services/doctor.service.ts (1)

146-152: Fix malformed template literal in specialist worklist URLs (syntax/runtime bug)

The string-building for getSpecialistWorklist and getSpecialistFutureWorklist is currently malformed and will not compile or will generate an invalid URL.

You likely intended to drop the userID segment but keep providerServiceID/serviceID,:

Proposed fix
  getSpecialistWorklist() {
-    return this.http.get(
-      environment.specialistWorkListURL +
-        this.sessionstorage.getItem('providerServiceID') +
-        `/${this.sessionstorage.getItem('serviceID')},
-        )}`,
-    );
+    const providerServiceID = this.sessionstorage.getItem('providerServiceID');
+    const serviceID = this.sessionstorage.getItem('serviceID');
+    return this.http.get(
+      `${environment.specialistWorkListURL}${providerServiceID}/${serviceID},`,
+    );
  }

  getSpecialistFutureWorklist() {
-    return this.http.get(
-      environment.specialistFutureWorkListURL +
-        this.sessionstorage.getItem('providerServiceID') +
-        `/${this.sessionstorage.getItem('serviceID')},
-        )}`,
-    );
+    const providerServiceID = this.sessionstorage.getItem('providerServiceID');
+    const serviceID = this.sessionstorage.getItem('serviceID');
+    return this.http.get(
+      `${environment.specialistFutureWorkListURL}${providerServiceID}/${serviceID},`,
+    );
  }

Adjust the trailing comma in the path if the backend expects a different format.

Also applies to: 165-171

src/app/app-modules/core/services/http-interceptor.service.ts (1)

26-27: Fix uninitialized currentLanguageSet — will crash on any HTTP error

currentLanguageSet is declared but never initialized, yet the catchError block dereferences it on lines 90, 94, 99, and 104 (this.currentLanguageSet.sessionExpiredPleaseLogin, .accessDenied, .internaleServerError, .somethingWentWrong). Additionally, it's accessed in startTimer() at lines 156 and 166. On any HTTP error, this will throw a TypeError and mask the original error.

Lazy-load currentLanguageSet from localStorage['appLanguage'] on first error with safe fallbacks:

Proposed fix
      catchError((error: HttpErrorResponse) => {
        console.error(error);
        this.spinnerService.setLoading(false);
+       
+       if (!this.currentLanguageSet) {
+         try {
+           const storedLang = localStorage.getItem('appLanguage');
+           this.currentLanguageSet = storedLang ? JSON.parse(storedLang) : {};
+         } catch {
+           this.currentLanguageSet = {};
+         }
+       }

-       if(error.status === 401){
+       if (error.status === 401) {
          this.sessionstorage.clear();
-         this.confirmationService.alert(this.currentLanguageSet.sessionExpiredPleaseLogin, 'error');
+         this.confirmationService.alert(
+           this.currentLanguageSet.sessionExpiredPleaseLogin ||
+             'Session expired, please login again.',
+           'error',
+         );
          setTimeout(() => this.router.navigate(['/login']), 0);
        } else if (error.status === 403) {
          this.confirmationService.alert(
-           this.currentLanguageSet.accessDenied,
+           this.currentLanguageSet.accessDenied || 'Access denied.',
            'error',
          );
        } else if (error.status === 500) {
          this.confirmationService.alert(
-           this.currentLanguageSet.internaleServerError,
+           this.currentLanguageSet.internaleServerError ||
+             'Internal server error.',
            'error',
          );
        } else {
          this.confirmationService.alert(
-           error.message || this.currentLanguageSet.somethingWentWrong,
+           error.message ||
+             this.currentLanguageSet.somethingWentWrong ||
+             'Something went wrong.',
            'error',
          );
        }
        return throwError(error.error);
      }),

Also applies to lines 156 and 166 in startTimer(). Note that throwError(error.error) passes only the error payload to subscribers, not the full HttpErrorResponse—verify this is intentional.

🤖 Fix all issues with AI agents
In
@src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/pnc-diagnosis/pnc-diagnosis.component.ts:
- Around line 300-301: Remove the debug console.log statements from
PncDiagnosisComponent: delete the console.log calls that print
"provisionalDiagnosisDataList dia" (logging diagnosis.provisionalDiagnosisList),
the subsequent console.log that prints provisionalDiagnosisList, and the
console.log that prints provisionalDiagnosisData; ensure these are removed from
pnc-diagnosis.component.ts (inside the PncDiagnosisComponent
methods/initialization code) and run a grep for any remaining console.* usages
in that file to avoid leaving other debug logs.

In
@src/app/app-modules/nurse-doctor/case-sheet/cancer-case-sheet/cancer-doctor-diagnosis-case-sheet/cancer-doctor-diagnosis-case-sheet.component.ts:
- Around line 179-192: The downloadSign method can call
doctorService.downloadSign with an undefined userId when both
beneficiaryDetails?.tCSpecialistUserID and sessionstorage.getItem('userID') are
missing; add a guard at the start of downloadSign to check for a truthy userId
(derived from beneficiaryDetails?.tCSpecialistUserID ||
this.sessionstorage.getItem('userID')), and if missing, short-circuit (return)
after logging or showing a user-friendly message instead of invoking
doctorService.downloadSign; keep references to the same symbols (downloadSign,
beneficiaryDetails.tCSpecialistUserID, this.sessionstorage.getItem('userID'),
doctorService.downloadSign, showSign) so the change is localized and avoids
calling the API with undefined.

In @src/app/app-routing.module.ts:
- Around line 112-118: The feedback route definition for path 'feedback' is
missing the AuthGuard like other lazy routes; update the route object that uses
loadChildren importing 'Common-UI/src/feedback/feedback.module' so it includes
canActivate: [AuthGuard] (or add a clear comment explaining why anonymous access
is intentional), and ensure you import/refer to the existing AuthGuard symbol
used by other routes; also verify that the external package exports
FeedbackModule (the module name FeedbackModule in
Common-UI/src/feedback/feedback.module) and update the import path or package if
the module or name differs.

In @src/assets/Assamese.json:
- Around line 7-18: The Assamese locale has a stray suffix ":n." in the value
for the key issuesInGettingLocationTryToReLogin; locate the key
issuesInGettingLocationTryToReLogin in src/assets/Assamese.json (and the
duplicate occurrences referenced around lines 1507 and 1741–1745) and remove the
":n." artifact so the string ends cleanly (trim the trailing characters and
ensure punctuation/spacing matches other locale entries).
🧹 Nitpick comments (14)
src/app/app-modules/service-point/service-point-resolve.service.ts (1)

42-42: Minor: Remove extra whitespace after opening parenthesis.

There's an extra space after the opening parenthesis in the method call.

🔎 Proposed fix
-      .getServicePoints( serviceProviderId)
+      .getServicePoints(serviceProviderId)
src/app/app-modules/nurse-doctor/case-record/general-case-record/findings/findings.component.ts (1)

215-215: Consider removing the redundant String() cast.

Since caseRecordMode is already typed as string (line 63), the explicit String() cast appears unnecessary. A direct comparison this.caseRecordMode === 'view' should suffice.

🔎 Proposed refactor
-          if (String(this.caseRecordMode) === 'view') {
+          if (this.caseRecordMode === 'view') {
src/app/app-modules/nurse-doctor/case-record/general-case-record/test-and-radiology/test-and-radiology.component.html (1)

90-90: Consider applying consistent indentation across the file.

Minor indentation adjustments were made to these interpolation expressions. While these changes improve consistency, consider running a template formatter across the entire file to ensure uniform formatting throughout all similar constructs.

Also applies to: 95-95, 100-100

src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/pnc-diagnosis/pnc-diagnosis.component.ts (3)

281-290: Redundant null check.

The condition at line 284 if (res.data.diagnosis) is redundant since the outer condition at line 282 already verifies res.data.diagnosis exists.

🔎 Suggested simplification
       .subscribe((res: any) => {
         if (res && res.statusCode === 200 && res.data && res.data.diagnosis) {
           this.generalDiagnosisForm.patchValue(res.data.diagnosis);
-          if (res.data.diagnosis) {
-            this.patchDiagnosisDetails(
-              res.data.diagnosis
-            );
-          }
+          this.patchDiagnosisDetails(res.data.diagnosis);
         }
       });

324-336: Loop logic is fragile—add row before patching for clarity and safety.

The current logic adds a new diagnosis row at the end of each iteration, relying on it being available for the next iteration. While this works if the FormArray starts with at least one element, it's error-prone. If the FormArray is ever empty, provisionalDiagnosisList.at(0) would return undefined, causing a runtime error on .patchValue().

Consider checking and adding rows before patching to make the intent explicit and avoid potential undefined access.

🔎 Suggested fix
     for (let i = 0; i < provisionalDiagnosisDataList.length; i++) {
+      if (i >= provisionalDiagnosisList.length) {
+        this.addProvisionalDiagnosis();
+      }
       provisionalDiagnosisList.at(i).patchValue({
         provisionalDiagnosis: provisionalDiagnosisDataList[i].term,
         viewProvisionalDiagnosisProvided: provisionalDiagnosisDataList[i].term,
         term: provisionalDiagnosisDataList[i].term,
         conceptID: provisionalDiagnosisDataList[i].conceptID,
       });
       (<FormGroup>provisionalDiagnosisList.at(i)).controls[
         'viewProvisionalDiagnosisProvided'
       ].disable();
-      if (provisionalDiagnosisList.length < provisionalDiagnosisDataList.length)
-        this.addProvisionalDiagnosis();
      }

345-357: Same fragile loop pattern—add row before patching.

This loop has the same issue as handleProvisionalDiagnosisData. Adding the row before patching ensures confirmatoryDiagnosisList.at(i) always returns a valid form group.

🔎 Suggested fix
     for (let i = 0; i < confirmatoryDiagnosisDataList.length; i++) {
+      if (i >= confirmatoryDiagnosisList.length) {
+        this.addConfirmatoryDiagnosis();
+      }
       confirmatoryDiagnosisList.at(i).patchValue({
         viewConfirmatoryDiagnosisProvided:
           confirmatoryDiagnosisDataList[i].term,
         term: confirmatoryDiagnosisDataList[i].term,
         conceptID: confirmatoryDiagnosisDataList[i].conceptID,
       });
       (<FormGroup>confirmatoryDiagnosisList.at(i)).controls[
         'viewConfirmatoryDiagnosisProvided'
       ].disable();
-      if (confirmatoryDiagnosisList.length < confirmatoryDiagnosisDataList.length)
-        this.addConfirmatoryDiagnosis();
     }
src/environments/environment.local.ts (1)

75-76: Consider removing duplicate platform field.

Both trackingPlatform and platform are set to 'matomo'. This appears redundant unless there's a specific reason to maintain both fields.

Proposed refactor to remove duplication
  tracking: {
    enabled: true,
-   trackingPlatform: 'matomo',
    platform: 'matomo',
    siteId: 3, // The new Site ID from Matomo
    trackerUrl: 'https://matomo.piramalswasthya.org/',
  },
src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts (1)

372-408: Harden the signature download flow for missing userId and HTTP errors

The overall flow (gated by doctorSignatureFlag and falling back to tCSpecialistUserID) is sound, but a couple of defensive tweaks would avoid noisy failures:

  • If getUserId fails or returns null, userIdToUse may be falsy and you’ll still call downloadSign(userIdToUse).
  • Errors from getUserId currently bubble to the global error handler.

Consider:

Proposed change
-  downloadSign() {
-
-    this.getUserId().subscribe((userId) => {
-      const userIdToUse = this.beneficiaryDetails?.tCSpecialistUserID ?? userId;
-      console.log("User", userIdToUse);
-      
-      this.doctorService.downloadSign(userIdToUse).subscribe(
-        (response: any) => {
+  downloadSign() {
+    this.getUserId().subscribe(
+      (userId) => {
+        const userIdToUse =
+          this.beneficiaryDetails?.tCSpecialistUserID ?? userId;
+
+        if (!userIdToUse) {
+          console.warn('No userId found for signature download');
+          return;
+        }
+
+        this.doctorService.downloadSign(userIdToUse).subscribe(
+          (response: any) => {
             const blob = new Blob([response], { type: response.type });
             this.showSign(blob);
-        },
-        (err: any) => {
-          console.error('Error downloading signature:', err);
-        },
-      );
-    });
+          },
+          (err: any) => {
+            console.error('Error downloading signature:', err);
+          },
+        );
+      },
+      (err: any) => {
+        console.error('Error fetching userId for signature:', err);
+      },
+    );
   }

This keeps the UI behavior the same when things succeed while avoiding spurious calls with invalid IDs and capturing both stages’ failures explicitly.

src/app/app-modules/nurse-doctor/workarea/workarea.component.ts (1)

159-160: Signature flag wiring looks consistent; consider handling initialization failures explicitly

The new doctorSignatureFlag is:

  • Initialized once in ngOnInit via checkUsersignatureExist(userID).
  • Passed through to all doctor submit/update flows (NCD screening, ANC, General OPD, NCD care, PNC, Cancer, QC).

This is a good, centralized approach. The only behavioral edge case is when the first submit happens before the check returns or when the check errors; in both cases the flag silently stays false.

If it’s important that the backend receives an accurate signature status for compliance/audit, you might:

  • Track a “signatureLoaded” state and disable doctor submit buttons until that check completes, or
  • At least log errors in the checkUsersignatureExist subscription so issues are traceable.

Also applies to: 263-269, 1059-1077, 1157-1193, 1258-1265, 1428-1437, 2979-2996, 3189-3206, 3417-3436, 3464-3481, 2698-2830

src/app/app-modules/nurse-doctor/shared/services/doctor.service.ts (1)

63-121: Signature flag propagation and helpers look correct; consider extending to Covid flow if needed

Observations:

  • All major doctor submission/update methods now accept and embed doctorSignatureFlag into their payloads:
    • postDoctorNCDScreeningDetails
    • postDoctorCancerVisitDetails
    • postQuickConsultDetails / updateQuickConsultDetails
    • postDoctorANCDetails
    • postDoctorGeneralOPDDetails
    • postDoctorNCDCareDetails
    • postDoctorPNCDetails
    • updateDoctorDiagnosisDetails
    • saveSpecialistCancerObservation
  • New helpers:
    • downloadSign(userID) uses environment.downloadSignUrl + userID with responseType: 'blob', matching how components consume it.
    • getUserId(userName) and checkUsersignatureExist(userID) are thin GET wrappers suitable for use from components and WorkareaComponent.

This wiring matches how the flag is passed from WorkareaComponent and should make the signature status available to all these back-end APIs.

If the product requirement is that Covid diagnosis submissions should also carry the signature state, you might similarly extend postDoctorCovidDetails and its call sites; otherwise, the current scope is internally consistent.

Also applies to: 232-283, 562-601, 603-631, 746-801, 881-939, 960-1017, 1083-1085, 1110-1208, 1233-1267, 231-237, 2816-2833, 2864-2873, 3022-3024

src/app/app-modules/core/services/http-service.service.ts (1)

19-32: Strengthen language bootstrap robustness and tidy constructor

  • JSON.parse(storedLang) in Line 28 will throw if the value in localStorage is malformed (e.g., env change, manual tampering), which will break service construction and app bootstrap. Wrap this in a try/catch (or a small helper) and fall back to null/default language on failure.
  • You’re injecting HttpClient twice (_http and http) and using them interchangeably. This is redundant and can be simplified to a single injected instance to reduce noise.
  • Lint is currently failing on constructor formatting (trailing comma / brace layout). Running the formatter (or adjusting ) { onto one line with the expected trailing comma style) will clear the pipeline error.
src/app/app-modules/core/services/http-interceptor.service.ts (1)

45-72: Platform-feedback header handling and FormData branches look consistent

The isPlatformFeedback branch that strips Authorization and forces Content-Type: application/json, and the FormData vs non‑FormData handling for other requests, are logically consistent with typical API expectations. Just ensure the /platform-feedback endpoints indeed expect JSON bodies (not FormData), as they will always be sent with an explicit JSON content-type from here.

src/app/app-modules/core/core.module.ts (1)

81-94: Remove duplicate RouterModule from CoreModule imports

RouterModule is listed twice in the imports array (Lines 86 and 93). Angular tolerates this, but it’s redundant and can be confusing. You can safely drop the second entry.

src/app/app-modules/core/components/app-footer/app-footer.component.html (1)

29-42: Verify keyboard accessibility for the feedback link.

The feedback link uses a <div> with routerLink instead of a semantic <a> tag. While role="link" is present, please verify that:

  • Keyboard users can navigate to and activate this link using Tab and Enter keys
  • Focus indicators are visible when the link receives keyboard focus
  • Screen readers properly announce this as a clickable link

Additionally, consider moving the inline styles to the component's CSS file for better maintainability:

🔎 Optional refactor to externalize styles

Move inline styles to CSS:

.feedback-link {
  cursor: pointer;
}

.feedback-link mat-icon {
  vertical-align: top;
  font-size: medium;
  margin-right: 2%;
}

Then update the template:

-    <div
-      class="col-3 text-end"
-      style="cursor: pointer"
+    <div
+      class="col-3 text-end feedback-link"
       [routerLink]="['/feedback']"
       [queryParams]="{ sl: 'TM' }"
       role="link"
     >
-      <mat-icon style="vertical-align: top; font-size: medium; margin-right: 2%"
+      <mat-icon
         >mail</mat-icon
       >
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 73af2f6 and d5ec325.

📒 Files selected for processing (31)
  • Common-UI
  • pom.xml
  • src/app/app-modules/core/components/app-footer/app-footer.component.html
  • src/app/app-modules/core/components/app-header/app-header.component.ts
  • src/app/app-modules/core/components/beneficiary-details/beneficiary-details.component.html
  • src/app/app-modules/core/core.module.ts
  • src/app/app-modules/core/services/http-interceptor.service.ts
  • src/app/app-modules/core/services/http-service.service.ts
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/general-opd-diagnosis/general-opd-diagnosis.component.ts
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-care-diagnosis/ncd-care-diagnosis.component.html
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-care-diagnosis/ncd-care-diagnosis.component.ts
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-screening-diagnosis/ncd-screening-diagnosis.component.html
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-screening-diagnosis/ncd-screening-diagnosis.component.ts
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/pnc-diagnosis/pnc-diagnosis.component.ts
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/findings/findings.component.ts
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/test-and-radiology/test-and-radiology.component.html
  • src/app/app-modules/nurse-doctor/case-sheet/cancer-case-sheet/cancer-doctor-diagnosis-case-sheet/cancer-doctor-diagnosis-case-sheet.component.ts
  • src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts
  • src/app/app-modules/nurse-doctor/shared/services/doctor.service.ts
  • src/app/app-modules/nurse-doctor/workarea/workarea.component.ts
  • src/app/app-modules/service-point/service-point-resolve.service.ts
  • src/app/app-modules/service-point/service-point.service.ts
  • src/app/app-routing.module.ts
  • src/assets/Assamese.json
  • src/assets/English.json
  • src/assets/Hindi.json
  • src/environments/environment.ci.ts.template
  • src/environments/environment.dev.ts
  • src/environments/environment.development.ts
  • src/environments/environment.local.ts
  • src/environments/environment.prod.ts
💤 Files with no reviewable changes (1)
  • src/app/app-modules/core/components/beneficiary-details/beneficiary-details.component.html
🧰 Additional context used
🧠 Learnings (5)
📚 Learning: 2024-12-16T11:10:14.700Z
Learnt from: helenKaryamsetty
Repo: PSMRI/TM-UI PR: 52
File: src/environments/environment.dev.ts:69-69
Timestamp: 2024-12-16T11:10:14.700Z
Learning: In the `environment` files of the project, the `abhaExtension` configuration is intentionally set to `sbx` in development environments (e.g., `src/environments/environment.dev.ts`, `src/environments/environment.development.ts`) and to `abdm` in production environments (e.g., `src/environments/environment.prod.ts`). This setup differentiates between sandbox and production environments.

Applied to files:

  • src/environments/environment.prod.ts
  • src/environments/environment.development.ts
📚 Learning: 2024-12-04T10:56:48.977Z
Learnt from: devikasuresh20
Repo: PSMRI/TM-UI PR: 51
File: src/app/app-modules/nurse-doctor/vitals/general-patient-vitals/general-patient-vitals.component.html:645-650
Timestamp: 2024-12-04T10:56:48.977Z
Learning: In `src/app/app-modules/nurse-doctor/vitals/general-patient-vitals/general-patient-vitals.component.html`, the development team prefers to keep explicit and detailed conditional logic in the Angular template's `required` attributes to enhance readability and provide explicit clarity, even if it results in redundant code.

Applied to files:

  • src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-screening-diagnosis/ncd-screening-diagnosis.component.ts
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-care-diagnosis/ncd-care-diagnosis.component.ts
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/findings/findings.component.ts
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-screening-diagnosis/ncd-screening-diagnosis.component.html
  • src/app/app-modules/nurse-doctor/case-sheet/cancer-case-sheet/cancer-doctor-diagnosis-case-sheet/cancer-doctor-diagnosis-case-sheet.component.ts
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/pnc-diagnosis/pnc-diagnosis.component.ts
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/test-and-radiology/test-and-radiology.component.html
  • src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-care-diagnosis/ncd-care-diagnosis.component.html
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/general-opd-diagnosis/general-opd-diagnosis.component.ts
  • src/app/app-modules/nurse-doctor/workarea/workarea.component.ts
  • src/app/app-modules/nurse-doctor/shared/services/doctor.service.ts
📚 Learning: 2024-12-04T10:57:51.584Z
Learnt from: devikasuresh20
Repo: PSMRI/TM-UI PR: 51
File: src/app/app-modules/nurse-doctor/vitals/general-patient-vitals/general-patient-vitals.component.html:696-701
Timestamp: 2024-12-04T10:57:51.584Z
Learning: In `src/app/app-modules/nurse-doctor/vitals/general-patient-vitals/general-patient-vitals.component.html`, when implementing `required` attribute conditions in Angular templates, prefer explicit and detailed logic for better clarity, even if it results in redundant expressions.

Applied to files:

  • src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-care-diagnosis/ncd-care-diagnosis.component.ts
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/findings/findings.component.ts
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-screening-diagnosis/ncd-screening-diagnosis.component.html
  • src/app/app-modules/nurse-doctor/case-sheet/cancer-case-sheet/cancer-doctor-diagnosis-case-sheet/cancer-doctor-diagnosis-case-sheet.component.ts
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/test-and-radiology/test-and-radiology.component.html
  • src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-care-diagnosis/ncd-care-diagnosis.component.html
  • src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/general-opd-diagnosis/general-opd-diagnosis.component.ts
  • src/app/app-modules/nurse-doctor/workarea/workarea.component.ts
📚 Learning: 2024-12-16T11:11:54.770Z
Learnt from: helenKaryamsetty
Repo: PSMRI/TM-UI PR: 52
File: src/app/app-modules/nurse-doctor/workarea/workarea.component.ts:3244-3255
Timestamp: 2024-12-16T11:11:54.770Z
Learning: In `src/app/app-modules/nurse-doctor/workarea/workarea.component.ts`, the developer prefers to use the `find()` method without explicitly returning a boolean in the callback function.

Applied to files:

  • src/app/app-modules/nurse-doctor/case-record/general-case-record/findings/findings.component.ts
  • src/app/app-modules/nurse-doctor/case-sheet/cancer-case-sheet/cancer-doctor-diagnosis-case-sheet/cancer-doctor-diagnosis-case-sheet.component.ts
  • src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts
  • src/app/app-modules/nurse-doctor/workarea/workarea.component.ts
📚 Learning: 2024-12-16T11:12:21.417Z
Learnt from: helenKaryamsetty
Repo: PSMRI/TM-UI PR: 52
File: src/app/app-modules/nurse-doctor/workarea/workarea.component.ts:181-182
Timestamp: 2024-12-16T11:12:21.417Z
Learning: In the `src/app/app-modules/nurse-doctor/workarea/workarea.component.ts` file, and throughout the Angular project, class properties are declared without explicit type annotations to maintain consistency.

Applied to files:

  • src/app/app-modules/nurse-doctor/case-record/general-case-record/findings/findings.component.ts
  • src/app/app-modules/nurse-doctor/case-sheet/cancer-case-sheet/cancer-doctor-diagnosis-case-sheet/cancer-doctor-diagnosis-case-sheet.component.ts
  • src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts
  • src/app/app-modules/nurse-doctor/workarea/workarea.component.ts
  • src/app/app-modules/nurse-doctor/shared/services/doctor.service.ts
🧬 Code graph analysis (1)
src/app/app-modules/nurse-doctor/shared/services/doctor.service.ts (1)
src/environments/environment.prod.ts (1)
  • environment (66-514)
🪛 GitHub Actions: ESLint and NPM Audit
src/app/app-modules/core/services/http-interceptor.service.ts

[error] 88-88: Prettier formatting issue detected. Replace '(error.status === 401)' with ' (error.status === 401) ' to satisfy prettier.

🪛 GitHub Check: lint-and-audit / lint-and-audit
src/app/app-modules/core/services/http-interceptor.service.ts

[failure] 111-111:
Delete


[failure] 90-90:
Replace this.currentLanguageSet.sessionExpiredPleaseLogin,·'error' with ⏎············this.currentLanguageSet.sessionExpiredPleaseLogin,⏎············'error',⏎··········


[failure] 88-88:
Replace (error.status·===·401) with ·(error.status·===·401)·

src/app/app-modules/core/services/http-service.service.ts

[failure] 25-25:
Delete ·⏎·


[failure] 24-24:
Insert ,

🔇 Additional comments (20)
src/app/app-modules/service-point/service-point.service.ts (1)

35-39: All callers have been properly updated to match the new signature.

The search found only one caller of getServicePoints() in the codebase (in service-point-resolve.service.ts line 42), and it correctly passes only serviceProviderId without the removed userId parameter. The breaking API change has been consistently implemented throughout the codebase.

src/app/app-modules/nurse-doctor/case-record/general-case-record/findings/findings.component.ts (1)

224-229: Good defensive programming with the empty string check.

Extending the validation to include empty string ('') alongside 'undefined' and null is a solid improvement. This ensures the code handles all possible absent/empty values from session storage correctly.

src/app/app-modules/nurse-doctor/case-record/general-case-record/test-and-radiology/test-and-radiology.component.html (1)

55-56: Pagination implementation is correctly configured.

Verified that:

  • Component defines currentLabRowsPerPage (initialized to 5) and currentLabActivePage (initialized to 1)
  • NgxPaginationModule is properly imported in the nurse-doctor.module.ts
  • The old pageChanged() method has been removed

No action required—the implementation is complete and correct.

src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/general-opd-diagnosis/general-opd-diagnosis.component.ts (1)

192-195: LGTM! Conditional logic prevents duplicate diagnosis entries.

The guard ensures addDiagnosis() is only called when additional form controls are needed to accommodate saved data, preventing unnecessary blank entries from being added during patch operations. This aligns with similar patterns implemented across other diagnosis components in this PR.

src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-care-diagnosis/ncd-care-diagnosis.component.html (1)

132-132: Validation behavior changed: provisional diagnosis is now optional.

Removing the required attribute allows users to skip provisional diagnosis entirely. The field validation is still enforced through checkProvisionalDiagnosisValidity() (which requires both term and conceptID if any data is entered), preventing partially completed entries while allowing the field to remain empty.

src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-care-diagnosis/ncd-care-diagnosis.component.ts (1)

184-186: LGTM! Consistent with diagnosis entry guard pattern.

The conditional logic correctly prevents adding unnecessary form controls when the array already accommodates all saved provisional diagnoses, matching the implementation in other diagnosis components.

src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-screening-diagnosis/ncd-screening-diagnosis.component.ts (1)

223-225: LGTM! Diagnosis entry guard correctly implemented.

The conditional check ensures the form array grows only as needed to match saved diagnosis data, preventing extra blank entries. This maintains consistency with the broader pattern established across diagnosis components in this PR.

src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-screening-diagnosis/ncd-screening-diagnosis.component.html (1)

25-25: Validation behavior updated: provisional diagnosis is now optional.

Consistent with the NCD Care diagnosis template, removing the required attribute allows doctors to skip provisional diagnosis when not applicable, while checkProvisionalDiagnosisValidity() still ensures any entered diagnosis data is complete (both term and conceptID present).

src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/pnc-diagnosis/pnc-diagnosis.component.ts (1)

450-464: LGTM!

The addition of provisionalDiagnosis to the patched values ensures consistency when a diagnosis is selected. The use of optional chaining (selected?.term) provides appropriate null safety.

src/environments/environment.ci.ts.template (2)

505-506: New user-related endpoints added.

Two new environment properties have been added:

  • getUserId: Fetches user ID by username
  • checkUsersignExistUrl: Checks if user signature exists

These additions align with the PR's objective to track doctor digital signatures. Both endpoints are properly consumed in the application: getUserId is used in doctor-diagnosis-case-sheet.component.ts for retrieving user IDs, and checkUsersignExistUrl is used in workarea.component.ts to verify user signature existence. The URL construction is correct.


41-41: Ensure TM_UI template variable is defined in CI/deployment pipeline.

The change from <%= TM_API_BASE %> to <%= TM_UI %> is semantically correct—the casesheet URL should reference the UI endpoint rather than the API endpoint. The variable is properly consumed by newTaburl in all environment configurations and correctly used in beneficiary-platform-history.component.ts for opening the print URL.

Verify that TM_UI is populated during your CI/deployment build process to avoid undefined template variables at runtime.

src/app/app-modules/nurse-doctor/workarea/workarea.component.ts (1)

1688-1733: PNC provisional and confirmatory diagnosis validation matches existing patterns

The new PNC doctor/TCS-specific checks for:

  • Missing viewProvisionalDiagnosisProvided in the first entry.
  • Entries with a description but no conceptID.
  • Confirmatory diagnoses without a mapped conceptID.

are consistent with the General OPD and NCD care logic above and should prevent incomplete SNOMED mapping for PNC flows as well. No issues spotted.

pom.xml (1)

8-8: LGTM! Version bump aligns with release objectives.

The version update from 3.4.0 to 3.6.0 is consistent with the PR title and the feature additions described in the AI summary.

Common-UI (1)

1-1: Verify the submodule changes align with PR objectives.

The Common-UI submodule is properly configured and the new commit is the current pointer. The CI workflow includes explicit submodule handling and will test the build with the updated submodule. However, review the changes in the Common-UI commit (93c915707165d8ebeefa5c62cc087b08184b261a) to confirm they align with the stated PR objectives: doctor digital signature tracking, feedback module, HTTP error handling, diagnosis form validation, language persistence, and localization updates.

src/app/app-modules/core/services/http-service.service.ts (1)

41-49: LocalStorage persistence of current language looks correct

Persisting appLanguage in localStorage and emitting through appCurrentLanguge.next(response) correctly aligns with the new initialization logic in the constructor and supports cross-reload language retention.

src/assets/Hindi.json (1)

7-18: Hindi feedback and error strings align with interceptor usage

The new platform_feedback block and the added error strings (verify, accessDenied, internaleServerError, somethingWentWrong, sessionExpiredPleaseLogin) are structurally correct and match the keys used in the interceptor, so they should localize the new flows cleanly.

Also applies to: 1746-1750

src/assets/English.json (1)

7-18: English feedback and error resources correctly wired for new flows

The added platform_feedback section and the new error/status strings at the bottom match the keys used in the header/logout and interceptor logic, so they should localize the feedback and HTTP error flows as intended.

Also applies to: 1750-1754

src/app/app-modules/core/components/app-header/app-header.component.ts (1)

162-173: Logout → feedback flow looks consistent; confirm language reset intent

Routing logout to /feedback with sl=TM and, on successful navigation, resetting language to English and clearing both session stores is logically consistent and should cleanly hand off to the feedback module.

One behavioral change to be aware of: users who were on a non‑English locale will now always see the feedback flow in English. If that’s the intended UX, this implementation is fine; if not, you may want to carry the previously selected language into the feedback route instead of hard‑coding 'English'.

src/app/app-modules/core/components/app-footer/app-footer.component.html (2)

3-3: LGTM: Layout rebalancing to accommodate new feedback column.

The column width adjustments from col-4 to col-3 properly rebalance the footer to support the new 4-column layout while maintaining the Bootstrap 12-column grid.

Also applies to: 15-15


43-43: LGTM: Column width adjustment for status indicator.

The width change from col-4 to col-3 correctly positions the status indicator in the new 4-column layout.

Comment on lines +300 to +301
console.log("provisionalDiagnosisDataList dia", diagnosis.provisionalDiagnosisList);

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove debug console.log statements.

Multiple debug logging statements are present at lines 300, 321, and 343. These should be removed before merging to main, as they clutter the console and may expose diagnostic data in production.

🔎 Suggested fix

Remove lines 300-301:

   handleDiagnosisData(diagnosis: any) {
-        console.log("provisionalDiagnosisDataList dia", diagnosis.provisionalDiagnosisList);
-
     if (

Remove lines 320-323:

   handleProvisionalDiagnosisData(provisionalDiagnosisDataList: any) {
     const provisionalDiagnosisList = this.generalDiagnosisForm.controls[
       'provisionalDiagnosisList'
     ] as FormArray;
-
-    console.log("provisionalDiagnosisDataList", provisionalDiagnosisDataList);
-    
-
     for (let i = 0; i < provisionalDiagnosisDataList.length; i++) {

Remove lines 343-344:

     const confirmatoryDiagnosisList = this.generalDiagnosisForm.controls[
       'confirmatoryDiagnosisList'
     ] as FormArray;
-        console.log("confirmatoryDiagnosisDataList", confirmatoryDiagnosisDataList);
-
     for (let i = 0; i < confirmatoryDiagnosisDataList.length; i++) {

Also applies to: 321-323, 343-344

🤖 Prompt for AI Agents
In
@src/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/pnc-diagnosis/pnc-diagnosis.component.ts
around lines 300 - 301, Remove the debug console.log statements from
PncDiagnosisComponent: delete the console.log calls that print
"provisionalDiagnosisDataList dia" (logging diagnosis.provisionalDiagnosisList),
the subsequent console.log that prints provisionalDiagnosisList, and the
console.log that prints provisionalDiagnosisData; ensure these are removed from
pnc-diagnosis.component.ts (inside the PncDiagnosisComponent
methods/initialization code) and run a grep for any remaining console.* usages
in that file to avoid leaving other debug logs.

Comment on lines 179 to +192
downloadSign() {
if (this.beneficiaryDetails && this.beneficiaryDetails.tCSpecialistUserID) {
const tCSpecialistUserID = this.beneficiaryDetails.tCSpecialistUserID;
this.doctorService.downloadSign(tCSpecialistUserID).subscribe(
(response) => {
const blob = new Blob([response], { type: response.type });
this.showSign(blob);
},
(err) => {
console.log('error');
},
);
} else {
console.log('No tCSpecialistUserID found');
}
const userId =
this.beneficiaryDetails?.tCSpecialistUserID ??
this.sessionstorage.getItem('userID');

this.doctorService.downloadSign(userId).subscribe(
(response: any) => {
const blob = new Blob([response], { type: response.type });
this.showSign(blob);
},
(err: any) => {
console.error('Error downloading signature:', err);
}
);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Guard against missing userId before calling downloadSign

If both beneficiaryDetails.tCSpecialistUserID and session userID are missing, this will still call the API with undefined, causing avoidable errors/noise. A simple guard would make this more robust:

Proposed change
  downloadSign() {
-   const userId =
-      this.beneficiaryDetails?.tCSpecialistUserID ??
-      this.sessionstorage.getItem('userID');
-
-    this.doctorService.downloadSign(userId).subscribe(
+   const userId =
+      this.beneficiaryDetails?.tCSpecialistUserID ??
+      this.sessionstorage.getItem('userID');
+
+    if (!userId) {
+      console.warn('No userId found for signature download');
+      return;
+    }
+
+    this.doctorService.downloadSign(userId).subscribe(
       (response: any) => {
         const blob = new Blob([response], { type: response.type });
         this.showSign(blob);
       },
       (err: any) => {
         console.error('Error downloading signature:', err);
       }
     );
  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
downloadSign() {
if (this.beneficiaryDetails && this.beneficiaryDetails.tCSpecialistUserID) {
const tCSpecialistUserID = this.beneficiaryDetails.tCSpecialistUserID;
this.doctorService.downloadSign(tCSpecialistUserID).subscribe(
(response) => {
const blob = new Blob([response], { type: response.type });
this.showSign(blob);
},
(err) => {
console.log('error');
},
);
} else {
console.log('No tCSpecialistUserID found');
}
const userId =
this.beneficiaryDetails?.tCSpecialistUserID ??
this.sessionstorage.getItem('userID');
this.doctorService.downloadSign(userId).subscribe(
(response: any) => {
const blob = new Blob([response], { type: response.type });
this.showSign(blob);
},
(err: any) => {
console.error('Error downloading signature:', err);
}
);
downloadSign() {
const userId =
this.beneficiaryDetails?.tCSpecialistUserID ??
this.sessionstorage.getItem('userID');
if (!userId) {
console.warn('No userId found for signature download');
return;
}
this.doctorService.downloadSign(userId).subscribe(
(response: any) => {
const blob = new Blob([response], { type: response.type });
this.showSign(blob);
},
(err: any) => {
console.error('Error downloading signature:', err);
}
);
}
🤖 Prompt for AI Agents
In
@src/app/app-modules/nurse-doctor/case-sheet/cancer-case-sheet/cancer-doctor-diagnosis-case-sheet/cancer-doctor-diagnosis-case-sheet.component.ts
around lines 179 - 192, The downloadSign method can call
doctorService.downloadSign with an undefined userId when both
beneficiaryDetails?.tCSpecialistUserID and sessionstorage.getItem('userID') are
missing; add a guard at the start of downloadSign to check for a truthy userId
(derived from beneficiaryDetails?.tCSpecialistUserID ||
this.sessionstorage.getItem('userID')), and if missing, short-circuit (return)
after logging or showing a user-friendly message instead of invoking
doctorService.downloadSign; keep references to the same symbols (downloadSign,
beneficiaryDetails.tCSpecialistUserID, this.sessionstorage.getItem('userID'),
doctorService.downloadSign, showSign) so the change is localized and avoids
calling the API with undefined.

Comment on lines +112 to +118
{
path: 'feedback',
loadChildren: () =>
import('Common-UI/src/feedback/feedback.module').then(
(m) => m.FeedbackModule,
),
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if the Common-UI feedback module exists
echo "=== Searching for feedback.module.ts files ==="
fd -t f "feedback.module.ts" 2>/dev/null | head -20

# Search for FeedbackModule export
echo -e "\n=== Searching for FeedbackModule export ==="
rg "export\s+(class|const)\s+FeedbackModule" --type=ts 2>/dev/null

# Check the routing module for guard patterns
echo -e "\n=== Routes with AuthGuard in app-routing.module.ts ==="
rg "canActivate.*AuthGuard" src/app/app-routing.module.ts 2>/dev/null

# List all routes with loadChildren for comparison
echo -e "\n=== All loadChildren routes with context ==="
rg "path:.*loadChildren" src/app/app-routing.module.ts -A 4 2>/dev/null

Repository: PSMRI/TM-UI

Length of output: 458


🏁 Script executed:

#!/bin/bash
# Read the actual app-routing.module.ts file around lines 112-118
echo "=== Content of app-routing.module.ts (lines 100-130) ==="
sed -n '100,130p' src/app/app-routing.module.ts

# Check if Common-UI is a dependency
echo -e "\n=== Checking for Common-UI in package.json ==="
cat package.json | jq '.dependencies, .devDependencies' 2>/dev/null | grep -i "common\|UI" || echo "Common-UI not found in dependencies"

# Check if Common-UI directory exists
echo -e "\n=== Checking for Common-UI directory ==="
ls -la Common-UI 2>/dev/null || echo "Common-UI directory not found"

# See the full routing configuration to understand the pattern
echo -e "\n=== Full app-routing.module.ts ==="
cat -n src/app/app-routing.module.ts

Repository: PSMRI/TM-UI

Length of output: 5748


Add missing AuthGuard to the feedback route.

The feedback route lacks canActivate: [AuthGuard], while all other lazy-loaded routes in this file (registrar, nurse-doctor, lab, pharmacist, datasync) include it. Either add the guard or explicitly document why feedback is accessible without authentication.

Additionally, verify that Common-UI/src/feedback/feedback.module and FeedbackModule exist in the external Common-UI package, as they are not present in this repository.

🤖 Prompt for AI Agents
In @src/app/app-routing.module.ts around lines 112 - 118, The feedback route
definition for path 'feedback' is missing the AuthGuard like other lazy routes;
update the route object that uses loadChildren importing
'Common-UI/src/feedback/feedback.module' so it includes canActivate: [AuthGuard]
(or add a clear comment explaining why anonymous access is intentional), and
ensure you import/refer to the existing AuthGuard symbol used by other routes;
also verify that the external package exports FeedbackModule (the module name
FeedbackModule in Common-UI/src/feedback/feedback.module) and update the import
path or package if the module or name differs.

Comment on lines +7 to +18
"platform_feedback": {
"feedback": "প্ৰতিক্ৰিয়া",
"weValueYourFeedback": "আপোনাৰ প্ৰতিক্ৰিয়া আমাক মূল্যবান",
"youHaveLoggedOut": "আপুনি সেশনৰ পৰা লগ আউট কৰিছে",
"subtitle": "আমাক আপোনাৰ অভিজ্ঞতা জনাওক (ঐচ্ছিক)",
"category": "শ্ৰেণী",
"selectCategory": "শ্ৰেণী নিৰ্বাচন কৰক",
"loggedInConsent": "গোপনীয়ভাৱে জমা দিয়ক (যদি আনচেক থাকে, তেন্তে ফ'ল'আপৰ বাবে আমি আপোনাৰ ইউজাৰ আইডি সংৰক্ষণ কৰিম)",
"anonymousInfo": "আপুনি লগ ইন কৰা নাই, এই প্ৰতিক্ৰিয়া গোপনীয়ভাৱে জমা হ'ব।",
"okay": "ঠিক আছে",
"thankYou": "ধন্যবাদ, আপোনাৰ প্ৰতিক্ৰিয়া আমাৰ বাবে মূল্যবান!"
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Assamese resources: overall good, but fix a small text artifact

  • The new platform_feedback section and the additional error strings (verify, accessDenied, internaleServerError, somethingWentWrong, sessionExpiredPleaseLogin) look consistent with other locales and with the interceptor’s expectations.
  • Minor nit: the value for issuesInGettingLocationTryToReLogin ends with :n. which looks like a stray artifact and will likely show up in the UI. Consider trimming that suffix.

Also applies to: 1507-1507, 1741-1745

🤖 Prompt for AI Agents
In @src/assets/Assamese.json around lines 7 - 18, The Assamese locale has a
stray suffix ":n." in the value for the key issuesInGettingLocationTryToReLogin;
locate the key issuesInGettingLocationTryToReLogin in src/assets/Assamese.json
(and the duplicate occurrences referenced around lines 1507 and 1741–1745) and
remove the ":n." artifact so the string ends cleanly (trim the trailing
characters and ensure punctuation/spacing matches other locale entries).

Comment on lines +73 to +79
tracking: {
enabled: true,
trackingPlatform: 'matomo',
platform: 'matomo',
siteId: 3, // The new Site ID from Matomo
trackerUrl: 'https://matomo.piramalswasthya.org/',
},
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

git ls-files src/environments/

Repository: PSMRI/TM-UI

Length of output: 290


🏁 Script executed:

cat -n src/environments/environment.local.ts | grep -A 10 "tracking:"

Repository: PSMRI/TM-UI

Length of output: 443


🏁 Script executed:

cat -n src/environments/environment.dev.ts | grep -A 10 "tracking:"

Repository: PSMRI/TM-UI

Length of output: 444


🏁 Script executed:

cat -n src/environments/environment.prod.ts | grep -A 10 "tracking:"

Repository: PSMRI/TM-UI

Length of output: 444


🏁 Script executed:

cat -n src/environments/environment.development.ts | grep -A 10 "tracking:"

Repository: PSMRI/TM-UI

Length of output: 444


🏁 Script executed:

cat -n src/environments/environment.test.ts | grep -A 10 "tracking:"

Repository: PSMRI/TM-UI

Length of output: 37


🏁 Script executed:

cat -n src/environments/environment.ci.ts.template | grep -A 10 "tracking:"

Repository: PSMRI/TM-UI

Length of output: 443


🏁 Script executed:

rg -n "environment\.tracking|trackingPlatform|siteId" --type=ts --max-count=20 src/ | grep -v "src/environments/"

Repository: PSMRI/TM-UI

Length of output: 37


🏁 Script executed:

rg -n "tracking\." --type=ts src/ | grep -v "src/environments/" | head -30

Repository: PSMRI/TM-UI

Length of output: 37


🏁 Script executed:

rg -n "matomo|Matomo" --type=ts src/ | grep -v "src/environments/" | head -30

Repository: PSMRI/TM-UI

Length of output: 37


🏁 Script executed:

rg -n "from.*environment|import.*environment" --type=ts src/ | head -20

Repository: PSMRI/TM-UI

Length of output: 2826


🏁 Script executed:

rg -n "environment\[" --type=ts src/ | head -20

Repository: PSMRI/TM-UI

Length of output: 37


🏁 Script executed:

cat -n src/main.ts

Repository: PSMRI/TM-UI

Length of output: 467


🏁 Script executed:

rg -n "environment\.tracking|environment\[.tracking" --type=ts

Repository: PSMRI/TM-UI

Length of output: 37


🏁 Script executed:

rg -n "analytics|Analytics|tracker|Tracker" --type=ts src/app/ | head -20

Repository: PSMRI/TM-UI

Length of output: 37


🏁 Script executed:

cat -n package.json | grep -i "matomo\|analytics\|tracker"

Repository: PSMRI/TM-UI

Length of output: 37


Site ID and tracker URL configuration requires environment-specific values.

Both concerns are confirmed:

  1. Site ID: siteId: 3 is identical across all environments (local, dev, development, prod). Separate Matomo site IDs should be configured for different environments to isolate analytics data.

  2. Tracker URL: All environments point to the production Matomo instance (https://matomo.piramalswasthya.org/), including local and dev. This will cause development and local testing data to be sent to production analytics.

Note: The tracking configuration is currently not consumed by the application code, but these issues should be addressed before tracking integration is implemented. Consider environment-specific overrides or separate Matomo instances for non-production environments.

@5Amogh 5Amogh merged commit 633f9b4 into main Jan 7, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants