-
Notifications
You must be signed in to change notification settings - Fork 16
Release 3.6.0 into main #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fix: amm-1668 beneficiary details addition
* fix: changed build version to 3.4.0 * fix: common ui cahanges
amm-1785 Doctor sign issue in casesheet
3.4.0 to 3.4.1
fix: update pom.xml
…om beneficiry details
feat: amm-1337 Feedback module integration and 1668 removal of PII from beneficiary details
fix: 1857 Signature in casesheet enhancement
📝 WalkthroughWalkthroughThis 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
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
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom Pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
|
There was a problem hiding this 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.logstatements 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
getSpecialistWorklistandgetSpecialistFutureWorklistis currently malformed and will not compile or will generate an invalid URL.You likely intended to drop the
userIDsegment but keepproviderServiceID/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 uninitializedcurrentLanguageSet— will crash on any HTTP error
currentLanguageSetis declared but never initialized, yet thecatchErrorblock dereferences it on lines 90, 94, 99, and 104 (this.currentLanguageSet.sessionExpiredPleaseLogin,.accessDenied,.internaleServerError,.somethingWentWrong). Additionally, it's accessed instartTimer()at lines 156 and 166. On any HTTP error, this will throw a TypeError and mask the original error.Lazy-load
currentLanguageSetfromlocalStorage['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 thatthrowError(error.error)passes only the error payload to subscribers, not the fullHttpErrorResponse—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
caseRecordModeis already typed asstring(line 63), the explicitString()cast appears unnecessary. A direct comparisonthis.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 verifiesres.data.diagnosisexists.🔎 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 returnundefined, causing a runtime error on.patchValue().Consider checking and adding rows before patching to make the intent explicit and avoid potential
undefinedaccess.🔎 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 ensuresconfirmatoryDiagnosisList.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
trackingPlatformandplatformare 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 errorsThe overall flow (gated by
doctorSignatureFlagand falling back totCSpecialistUserID) is sound, but a couple of defensive tweaks would avoid noisy failures:
- If
getUserIdfails or returnsnull,userIdToUsemay be falsy and you’ll still calldownloadSign(userIdToUse).- Errors from
getUserIdcurrently 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 explicitlyThe new
doctorSignatureFlagis:
- Initialized once in
ngOnInitviacheckUsersignatureExist(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
checkUsersignatureExistsubscription 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 neededObservations:
- All major doctor submission/update methods now accept and embed
doctorSignatureFlaginto their payloads:
postDoctorNCDScreeningDetailspostDoctorCancerVisitDetailspostQuickConsultDetails/updateQuickConsultDetailspostDoctorANCDetailspostDoctorGeneralOPDDetailspostDoctorNCDCareDetailspostDoctorPNCDetailsupdateDoctorDiagnosisDetailssaveSpecialistCancerObservation- New helpers:
downloadSign(userID)usesenvironment.downloadSignUrl + userIDwithresponseType: 'blob', matching how components consume it.getUserId(userName)andcheckUsersignatureExist(userID)are thin GET wrappers suitable for use from components andWorkareaComponent.This wiring matches how the flag is passed from
WorkareaComponentand 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
postDoctorCovidDetailsand 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 inlocalStorageis 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 tonull/default language on failure.- You’re injecting
HttpClienttwice (_httpandhttp) 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 consistentThe
isPlatformFeedbackbranch that stripsAuthorizationand forcesContent-Type: application/json, and the FormData vs non‑FormData handling for other requests, are logically consistent with typical API expectations. Just ensure the/platform-feedbackendpoints 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 duplicateRouterModulefrom CoreModule imports
RouterModuleis listed twice in theimportsarray (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>withrouterLinkinstead of a semantic<a>tag. Whilerole="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
📒 Files selected for processing (31)
Common-UIpom.xmlsrc/app/app-modules/core/components/app-footer/app-footer.component.htmlsrc/app/app-modules/core/components/app-header/app-header.component.tssrc/app/app-modules/core/components/beneficiary-details/beneficiary-details.component.htmlsrc/app/app-modules/core/core.module.tssrc/app/app-modules/core/services/http-interceptor.service.tssrc/app/app-modules/core/services/http-service.service.tssrc/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/general-opd-diagnosis/general-opd-diagnosis.component.tssrc/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-care-diagnosis/ncd-care-diagnosis.component.htmlsrc/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-care-diagnosis/ncd-care-diagnosis.component.tssrc/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-screening-diagnosis/ncd-screening-diagnosis.component.htmlsrc/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-screening-diagnosis/ncd-screening-diagnosis.component.tssrc/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/pnc-diagnosis/pnc-diagnosis.component.tssrc/app/app-modules/nurse-doctor/case-record/general-case-record/findings/findings.component.tssrc/app/app-modules/nurse-doctor/case-record/general-case-record/test-and-radiology/test-and-radiology.component.htmlsrc/app/app-modules/nurse-doctor/case-sheet/cancer-case-sheet/cancer-doctor-diagnosis-case-sheet/cancer-doctor-diagnosis-case-sheet.component.tssrc/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.tssrc/app/app-modules/nurse-doctor/shared/services/doctor.service.tssrc/app/app-modules/nurse-doctor/workarea/workarea.component.tssrc/app/app-modules/service-point/service-point-resolve.service.tssrc/app/app-modules/service-point/service-point.service.tssrc/app/app-routing.module.tssrc/assets/Assamese.jsonsrc/assets/English.jsonsrc/assets/Hindi.jsonsrc/environments/environment.ci.ts.templatesrc/environments/environment.dev.tssrc/environments/environment.development.tssrc/environments/environment.local.tssrc/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.tssrc/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.tssrc/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-care-diagnosis/ncd-care-diagnosis.component.tssrc/app/app-modules/nurse-doctor/case-record/general-case-record/findings/findings.component.tssrc/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-screening-diagnosis/ncd-screening-diagnosis.component.htmlsrc/app/app-modules/nurse-doctor/case-sheet/cancer-case-sheet/cancer-doctor-diagnosis-case-sheet/cancer-doctor-diagnosis-case-sheet.component.tssrc/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/pnc-diagnosis/pnc-diagnosis.component.tssrc/app/app-modules/nurse-doctor/case-record/general-case-record/test-and-radiology/test-and-radiology.component.htmlsrc/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.tssrc/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-care-diagnosis/ncd-care-diagnosis.component.htmlsrc/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/general-opd-diagnosis/general-opd-diagnosis.component.tssrc/app/app-modules/nurse-doctor/workarea/workarea.component.tssrc/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.tssrc/app/app-modules/nurse-doctor/case-record/general-case-record/findings/findings.component.tssrc/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-screening-diagnosis/ncd-screening-diagnosis.component.htmlsrc/app/app-modules/nurse-doctor/case-sheet/cancer-case-sheet/cancer-doctor-diagnosis-case-sheet/cancer-doctor-diagnosis-case-sheet.component.tssrc/app/app-modules/nurse-doctor/case-record/general-case-record/test-and-radiology/test-and-radiology.component.htmlsrc/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.tssrc/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/ncd-care-diagnosis/ncd-care-diagnosis.component.htmlsrc/app/app-modules/nurse-doctor/case-record/general-case-record/diagnosis/general-opd-diagnosis/general-opd-diagnosis.component.tssrc/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.tssrc/app/app-modules/nurse-doctor/case-sheet/cancer-case-sheet/cancer-doctor-diagnosis-case-sheet/cancer-doctor-diagnosis-case-sheet.component.tssrc/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.tssrc/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.tssrc/app/app-modules/nurse-doctor/case-sheet/cancer-case-sheet/cancer-doctor-diagnosis-case-sheet/cancer-doctor-diagnosis-case-sheet.component.tssrc/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.tssrc/app/app-modules/nurse-doctor/workarea/workarea.component.tssrc/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 (inservice-point-resolve.service.tsline 42), and it correctly passes onlyserviceProviderIdwithout the removeduserIdparameter. 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'andnullis 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) andcurrentLabActivePage(initialized to 1)NgxPaginationModuleis properly imported in thenurse-doctor.module.ts- The old
pageChanged()method has been removedNo 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
requiredattribute allows users to skip provisional diagnosis entirely. The field validation is still enforced throughcheckProvisionalDiagnosisValidity()(which requires bothtermandconceptIDif 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
requiredattribute allows doctors to skip provisional diagnosis when not applicable, whilecheckProvisionalDiagnosisValidity()still ensures any entered diagnosis data is complete (bothtermandconceptIDpresent).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
provisionalDiagnosisto 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 usernamecheckUsersignExistUrl: Checks if user signature existsThese additions align with the PR's objective to track doctor digital signatures. Both endpoints are properly consumed in the application:
getUserIdis used indoctor-diagnosis-case-sheet.component.tsfor retrieving user IDs, andcheckUsersignExistUrlis used inworkarea.component.tsto 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 bynewTaburlin all environment configurations and correctly used inbeneficiary-platform-history.component.tsfor opening the print URL.Verify that
TM_UIis 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 patternsThe new PNC doctor/TCS-specific checks for:
- Missing
viewProvisionalDiagnosisProvidedin 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 correctPersisting
appLanguageinlocalStorageand emitting throughappCurrentLanguge.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 usageThe new
platform_feedbackblock 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 flowsThe added
platform_feedbacksection 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 intentRouting logout to
/feedbackwithsl=TMand, 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-4tocol-3properly 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-4tocol-3correctly positions the status indicator in the new 4-column layout.
| console.log("provisionalDiagnosisDataList dia", diagnosis.provisionalDiagnosisList); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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); | ||
| } | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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.
| { | ||
| path: 'feedback', | ||
| loadChildren: () => | ||
| import('Common-UI/src/feedback/feedback.module').then( | ||
| (m) => m.FeedbackModule, | ||
| ), | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 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/nullRepository: 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.tsRepository: 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.
| "platform_feedback": { | ||
| "feedback": "প্ৰতিক্ৰিয়া", | ||
| "weValueYourFeedback": "আপোনাৰ প্ৰতিক্ৰিয়া আমাক মূল্যবান", | ||
| "youHaveLoggedOut": "আপুনি সেশনৰ পৰা লগ আউট কৰিছে", | ||
| "subtitle": "আমাক আপোনাৰ অভিজ্ঞতা জনাওক (ঐচ্ছিক)", | ||
| "category": "শ্ৰেণী", | ||
| "selectCategory": "শ্ৰেণী নিৰ্বাচন কৰক", | ||
| "loggedInConsent": "গোপনীয়ভাৱে জমা দিয়ক (যদি আনচেক থাকে, তেন্তে ফ'ল'আপৰ বাবে আমি আপোনাৰ ইউজাৰ আইডি সংৰক্ষণ কৰিম)", | ||
| "anonymousInfo": "আপুনি লগ ইন কৰা নাই, এই প্ৰতিক্ৰিয়া গোপনীয়ভাৱে জমা হ'ব।", | ||
| "okay": "ঠিক আছে", | ||
| "thankYou": "ধন্যবাদ, আপোনাৰ প্ৰতিক্ৰিয়া আমাৰ বাবে মূল্যবান!" | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assamese resources: overall good, but fix a small text artifact
- The new
platform_feedbacksection 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
issuesInGettingLocationTryToReLoginends 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).
| tracking: { | ||
| enabled: true, | ||
| trackingPlatform: 'matomo', | ||
| platform: 'matomo', | ||
| siteId: 3, // The new Site ID from Matomo | ||
| trackerUrl: 'https://matomo.piramalswasthya.org/', | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 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 -30Repository: PSMRI/TM-UI
Length of output: 37
🏁 Script executed:
rg -n "matomo|Matomo" --type=ts src/ | grep -v "src/environments/" | head -30Repository: PSMRI/TM-UI
Length of output: 37
🏁 Script executed:
rg -n "from.*environment|import.*environment" --type=ts src/ | head -20Repository: PSMRI/TM-UI
Length of output: 2826
🏁 Script executed:
rg -n "environment\[" --type=ts src/ | head -20Repository: PSMRI/TM-UI
Length of output: 37
🏁 Script executed:
cat -n src/main.tsRepository: PSMRI/TM-UI
Length of output: 467
🏁 Script executed:
rg -n "environment\.tracking|environment\[.tracking" --type=tsRepository: PSMRI/TM-UI
Length of output: 37
🏁 Script executed:
rg -n "analytics|Analytics|tracker|Tracker" --type=ts src/app/ | head -20Repository: 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:
-
Site ID:
siteId: 3is identical across all environments (local, dev, development, prod). Separate Matomo site IDs should be configured for different environments to isolate analytics data. -
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.


Summary by CodeRabbit
New Features
Bug Fixes
UI/UX
Chores
✏️ Tip: You can customize this high-level summary in your review settings.