-
Notifications
You must be signed in to change notification settings - Fork 16
Move code from 3.4.0 to main #81
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
Changes from all commits
1bae0c4
6b4ee4e
772ee84
11b80e7
40c4725
511d78f
1354eed
6aafc83
066574c
ec4d310
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -47,6 +47,7 @@ | |||||||||||||||||||||||||||||||||
| implements OnInit, OnChanges, DoCheck | ||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||
| utils = new GeneralUtils(this.fb, this.sessionstorage); | ||||||||||||||||||||||||||||||||||
| suggestedDiagnosisList: any = []; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| @Input() | ||||||||||||||||||||||||||||||||||
| generalDiagnosisForm!: FormGroup; | ||||||||||||||||||||||||||||||||||
|
|
@@ -56,12 +57,14 @@ | |||||||||||||||||||||||||||||||||
| current_language_set: any; | ||||||||||||||||||||||||||||||||||
| designation: any; | ||||||||||||||||||||||||||||||||||
| specialist!: boolean; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| constructor( | ||||||||||||||||||||||||||||||||||
| private fb: FormBuilder, | ||||||||||||||||||||||||||||||||||
| public httpServiceService: HttpServiceService, | ||||||||||||||||||||||||||||||||||
| private doctorService: DoctorService, | ||||||||||||||||||||||||||||||||||
| private confirmationService: ConfirmationService, | ||||||||||||||||||||||||||||||||||
| readonly sessionstorage: SessionStorageService, | ||||||||||||||||||||||||||||||||||
| private masterdataService: MasterdataService | ||||||||||||||||||||||||||||||||||
| ) {} | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
Comment on lines
61
to
69
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prettier failure: trailing comma in constructor params CI flagged βInsert ,β at line 67. Add a trailing comma after the last constructor param in multiline form. constructor(
private fb: FormBuilder,
public httpServiceService: HttpServiceService,
private doctorService: DoctorService,
private confirmationService: ConfirmationService,
readonly sessionstorage: SessionStorageService,
- private masterdataService: MasterdataService
+ private masterdataService: MasterdataService,
) {}π Committable suggestion
Suggested change
π§° Toolsπͺ GitHub Check: lint-and-audit / lint-and-audit[failure] 67-67: πͺ GitHub Actions: ESLint and NPM Audit[error] 67-67: prettier/prettier: Insert π€ Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| ngOnInit() { | ||||||||||||||||||||||||||||||||||
|
|
@@ -186,8 +189,7 @@ | |||||||||||||||||||||||||||||||||
| (<FormGroup>diagnosisArrayList.at(i)).controls[ | ||||||||||||||||||||||||||||||||||
| 'viewProvisionalDiagnosisProvided' | ||||||||||||||||||||||||||||||||||
| ].disable(); | ||||||||||||||||||||||||||||||||||
| if (diagnosisArrayList.length < savedDiagnosisData.length) | ||||||||||||||||||||||||||||||||||
| this.addDiagnosis(); | ||||||||||||||||||||||||||||||||||
| this.addDiagnosis(); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
@@ -204,13 +206,11 @@ | |||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| getProvisionalDiagnosisList(): AbstractControl[] | null { | ||||||||||||||||||||||||||||||||||
| const provisionalDiagnosisListControl = this.generalDiagnosisForm.get( | ||||||||||||||||||||||||||||||||||
| 'provisionalDiagnosisList', | ||||||||||||||||||||||||||||||||||
| get provisionalDiagnosisControls(): AbstractControl[] { | ||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||
| (this.generalDiagnosisForm.get('provisionalDiagnosisList') as FormArray) | ||||||||||||||||||||||||||||||||||
| ?.controls || [] | ||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||
| return provisionalDiagnosisListControl instanceof FormArray | ||||||||||||||||||||||||||||||||||
| ? provisionalDiagnosisListControl.controls | ||||||||||||||||||||||||||||||||||
| : null; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| removeDiagnosisFromList( | ||||||||||||||||||||||||||||||||||
|
|
@@ -252,4 +252,35 @@ | |||||||||||||||||||||||||||||||||
| return true; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| onDiagnosisInputKeyup(value: string, index: number) { | ||||||||||||||||||||||||||||||||||
| if (value.length >= 3) { | ||||||||||||||||||||||||||||||||||
| this.masterdataService | ||||||||||||||||||||||||||||||||||
| .searchDiagnosisBasedOnPageNo(value, index) | ||||||||||||||||||||||||||||||||||
| .subscribe((results: any) => { | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+256
to
+260
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π‘ Verification agent π§© Analysis chainConfirm MasterdataService signature for searchDiagnosisBasedOnPageNo As with NCD care, verify the second argument is intended to be row index. π Script executed: #!/bin/bash
# Inspect MasterdataService signature
fd 'masterdata\.service\.(ts|js)$' src | xargs -I{} rg -n 'searchDiagnosisBasedOnPageNo\s*\(' {}Length of output: 169 Ensure correct usage of page number in searchDiagnosisBasedOnPageNo(searchTerm: any, pageNo: any) { β¦ }(confirmed by the output of your inspection at line 166 of In your component call: onDiagnosisInputKeyup(value: string, index: number) {
if (value.length >= 3) {
this.masterdataService
.searchDiagnosisBasedOnPageNo(value, index)
.subscribe(β¦);the second argument (
This change will prevent confusion about what the method expects and ensure pagination behaves as intended. π€ Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| this.suggestedDiagnosisList[index] = results?.data?.sctMaster; | ||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||
| this.suggestedDiagnosisList[index] = []; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| displayDiagnosis(diagnosis: any): string { | ||||||||||||||||||||||||||||||||||
| return typeof diagnosis === 'string' ? diagnosis : diagnosis?.term || ''; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| onDiagnosisSelected(selected: any, index: number) { | ||||||||||||||||||||||||||||||||||
| // this.patientQuickConsultForm.get(['provisionalDiagnosisList', index])?.setValue(selected); | ||||||||||||||||||||||||||||||||||
| const diagnosisFormArray = this.generalDiagnosisForm.get( | ||||||||||||||||||||||||||||||||||
| 'provisionalDiagnosisList' | ||||||||||||||||||||||||||||||||||
| ) as FormArray; | ||||||||||||||||||||||||||||||||||
| const diagnosisFormGroup = diagnosisFormArray.at(index) as FormGroup; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| // Set the nested and top-level fields | ||||||||||||||||||||||||||||||||||
| diagnosisFormGroup.patchValue({ | ||||||||||||||||||||||||||||||||||
| viewProvisionalDiagnosisProvided: selected, | ||||||||||||||||||||||||||||||||||
| conceptID: selected?.conceptID || null, | ||||||||||||||||||||||||||||||||||
| term: selected?.term || null, | ||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,6 +59,9 @@ | |
| visitCategory: any; | ||
| attendantType: any; | ||
| enableNCDCondition = false; | ||
| suggestedDiagnosisList: any = []; | ||
|
|
||
|
|
||
| constructor( | ||
| private fb: FormBuilder, | ||
| private masterdataService: MasterdataService, | ||
|
|
@@ -178,8 +181,7 @@ | |
| (<FormGroup>diagnosisArrayList.at(i)).controls[ | ||
| 'viewProvisionalDiagnosisProvided' | ||
| ].disable(); | ||
| if (diagnosisArrayList.length < savedDiagnosisData.length) | ||
| this.addDiagnosis(); | ||
| this.addDiagnosis(); | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -197,13 +199,11 @@ | |
| } | ||
| } | ||
|
|
||
| getProvisionalDiagnosisList(): AbstractControl[] | null { | ||
| const provisionalDiagnosisListControl = this.generalDiagnosisForm.get( | ||
| 'provisionalDiagnosisList', | ||
| get provisionalDiagnosisControls(): AbstractControl[] { | ||
| return ( | ||
| (this.generalDiagnosisForm.get('provisionalDiagnosisList') as FormArray) | ||
| ?.controls || [] | ||
| ); | ||
| return provisionalDiagnosisListControl instanceof FormArray | ||
| ? provisionalDiagnosisListControl.controls | ||
| : null; | ||
| } | ||
|
|
||
| removeDiagnosisFromList( | ||
|
|
@@ -268,4 +268,35 @@ | |
| value, | ||
| ); | ||
| } | ||
|
|
||
| onDiagnosisInputKeyup(value: string, index: number) { | ||
| if (value.length >= 3) { | ||
| this.masterdataService | ||
| .searchDiagnosisBasedOnPageNo(value, index) | ||
| .subscribe((results: any) => { | ||
|
Comment on lines
+272
to
+276
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π‘ Verification agent π§© Analysis chainConfirm MasterdataService signature for searchDiagnosisBasedOnPageNo Second argument reads like a page number; here itβs the row index. Ensure the method expects row index (or ignores it). Otherwise, pass an actual pageNo and track row index locally. π Script executed: #!/bin/bash
# Inspect MasterdataService signature and param names
fd 'masterdata\.service\.(ts|js)$' src | xargs -I{} rg -n 'searchDiagnosisBasedOnPageNo\s*\(' {}Length of output: 169 Fix incorrect argument usage for The searchDiagnosisBasedOnPageNo(searchTerm: any, pageNo: any) { β¦ }but here youβre passing the row Please update the component to:
Example diff in onDiagnosisInputKeyup(value: string, index: number) {
if (value.length >= 3) {
- this.masterdataService
- .searchDiagnosisBasedOnPageNo(value, index)
+ // Use the actual page number (e.g. this.currentPage), not the row index
+ this.masterdataService
+ .searchDiagnosisBasedOnPageNo(value, this.currentPage)
.subscribe((results: any) => {
// handle results; use `index` only for row-specific logicπ€ Prompt for AI Agents |
||
| this.suggestedDiagnosisList[index] = results?.data?.sctMaster; | ||
| }); | ||
| } else { | ||
| this.suggestedDiagnosisList[index] = []; | ||
| } | ||
| } | ||
|
|
||
| displayDiagnosis(diagnosis: any): string { | ||
| return typeof diagnosis === 'string' ? diagnosis : diagnosis?.term || ''; | ||
| } | ||
|
|
||
| onDiagnosisSelected(selected: any, index: number) { | ||
| // this.patientQuickConsultForm.get(['provisionalDiagnosisList', index])?.setValue(selected); | ||
| const diagnosisFormArray = this.generalDiagnosisForm.get( | ||
| 'provisionalDiagnosisList' | ||
| ) as FormArray; | ||
| const diagnosisFormGroup = diagnosisFormArray.at(index) as FormGroup; | ||
|
|
||
| // Set the nested and top-level fields | ||
| diagnosisFormGroup.patchValue({ | ||
| viewProvisionalDiagnosisProvided: selected, | ||
| conceptID: selected?.conceptID || null, | ||
| term: selected?.term || null, | ||
| }); | ||
| } | ||
| } | ||
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.
π‘ Verification agent
π§© Analysis chain
Confirm i18n key availability for bendetails.lastName across all locales
Template references current_language_set?.bendetails?.lastName. Please verify corresponding entries exist in all shipped locale JSONs to avoid a blank header at runtime.
Run this to confirm:
π Script executed:
Length of output: 98
π Script executed:
Length of output: 481
π Script executed:
Length of output: 172
π Script executed:
Length of output: 173
Add missing
bendetails.lastNametranslation to locale filesWe ran a validation across all JSON assets and found that the key
bendetails.lastNameis missing in the following file, which will lead to a blank header at runtime:src/assets/language.json: missingbendetails.lastNamePlease add the appropriate translation entry under the
bendetailsobject in this file (and any other locales as needed) to ensure the label renders correctly.π€ Prompt for AI Agents