From af16acb3e53bb3e70b5509b54cfda10411f0b077 Mon Sep 17 00:00:00 2001 From: SnehaRH Date: Thu, 30 Oct 2025 18:14:27 +0530 Subject: [PATCH 1/5] fix: 1899 signature enhancement --- .../doctor-diagnosis-case-sheet.component.ts | 4 ++- .../shared/services/doctor.service.ts | 25 ++++++++++++++++++- .../workarea/workarea.component.ts | 20 +++++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts b/src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts index 5936a31..b4c315e 100644 --- a/src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts +++ b/src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts @@ -373,7 +373,9 @@ export class DoctorDiagnosisCaseSheetComponent ].join('/'); } - this.downloadSign(); + if (this.casesheetData?.BeneficiaryData?.doctorSignatureFlag) { + this.downloadSign(); + } this.getVaccinationTypeAndDoseMaster(); } } diff --git a/src/app/app-modules/nurse-doctor/shared/services/doctor.service.ts b/src/app/app-modules/nurse-doctor/shared/services/doctor.service.ts index 046841e..599cddb 100644 --- a/src/app/app-modules/nurse-doctor/shared/services/doctor.service.ts +++ b/src/app/app-modules/nurse-doctor/shared/services/doctor.service.ts @@ -65,6 +65,7 @@ export class DoctorService { otherDetails: any, tcRequest: any, isSpecialist: any, + doctorSignatureFlag: any, ) { const serviceLineDetails: any = this.sessionstorage.getItem('serviceLineDetails'); @@ -115,6 +116,7 @@ export class DoctorService { createdBy: this.sessionstorage.getItem('userName'), tcRequest: tcRequest, isSpecialist: isSpecialist, + doctorSignatureFlag: doctorSignatureFlag, }; console.log( @@ -233,6 +235,7 @@ export class DoctorService { cancerForm: any, tcRequest: any, isSpecialist: any, + doctorSignatureFlag: any, ) { const serviceLineDetails: any = this.sessionstorage.getItem('serviceLineDetails'); @@ -263,7 +266,9 @@ export class DoctorService { diagnosisDetails, referDetails, otherDetails, - { isSpecialist: isSpecialist }, + { isSpecialist: isSpecialist, + doctorSignatureFlag: doctorSignatureFlag + }, ); const cancerRequest = Object.assign({ tcRequest: tcRequest, @@ -560,6 +565,7 @@ export class DoctorService { consultationData: any, tcRequest: any, isSpecialist: any, + doctorSignatureFlag: any, ) { const serviceLineDetails: any = this.sessionstorage.getItem('serviceLineDetails'); @@ -582,6 +588,7 @@ export class DoctorService { vanID: vanID, tcRequest: tcRequest, isSpecialist: isSpecialist, + doctorSignatureFlag: doctorSignatureFlag, }; const quickConsultation = Object.assign( {}, @@ -741,6 +748,7 @@ export class DoctorService { otherDetails: any, tcRequest: any, isSpecialist: any, + doctorSignatureFlag: any ) { const serviceLineDetails: any = this.sessionstorage.getItem('serviceLineDetails'); @@ -789,6 +797,7 @@ export class DoctorService { createdBy: this.sessionstorage.getItem('userName'), tcRequest: tcRequest, isSpecialist: isSpecialist, + doctorSignatureFlag: doctorSignatureFlag }; console.log( @@ -874,6 +883,7 @@ export class DoctorService { otherDetails: any, tcRequest: any, isSpecialist: any, + doctorSignatureFlag: any ) { const serviceLineDetails: any = this.sessionstorage.getItem('serviceLineDetails'); @@ -925,6 +935,7 @@ export class DoctorService { createdBy: this.sessionstorage.getItem('userName'), tcRequest: tcRequest, isSpecialist: isSpecialist, + doctorSignatureFlag: doctorSignatureFlag }; console.log( @@ -951,6 +962,7 @@ export class DoctorService { otherDetails: any, tcRequest: any, isSpecialist: any, + doctorSignatureFlag: any ) { const serviceLineDetails: any = this.sessionstorage.getItem('serviceLineDetails'); @@ -1001,6 +1013,7 @@ export class DoctorService { createdBy: this.sessionstorage.getItem('userName'), tcRequest: tcRequest, isSpecialist: isSpecialist, + doctorSignatureFlag: doctorSignatureFlag }; console.log( @@ -2320,6 +2333,7 @@ export class DoctorService { otherDetails: any, tcRequest: any, isSpecialist: any, + doctorSignatureFlag: any, ) { const serviceLineDetails: any = this.sessionstorage.getItem('serviceLineDetails'); @@ -2367,6 +2381,7 @@ export class DoctorService { createdBy: this.sessionstorage.getItem('userName'), tcRequest: tcRequest, isSpecialist: isSpecialist, + doctorSignatureFlag: doctorSignatureFlag, }; console.log( @@ -2595,6 +2610,7 @@ export class DoctorService { visitCategory: any, otherDetails: any, tcRequest: any, + doctorSignatureFlag: any ): Observable { const serviceLineDetails: any = this.sessionstorage.getItem('serviceLineDetails'); @@ -2646,6 +2662,7 @@ export class DoctorService { createdBy: this.sessionstorage.getItem('userName'), tcRequest: tcRequest, isSpecialist: otherDetails.isSpecialist, + doctorSignatureFlag: doctorSignatureFlag }; console.log( @@ -2799,6 +2816,7 @@ export class DoctorService { saveSpecialistCancerObservation( specialistDiagonosis: any, otherDetails: any, + doctorSignatureFlag: any, ) { const diagnosisDetails = specialistDiagonosis.controls.patientCaseRecordForm.value; @@ -2811,6 +2829,7 @@ export class DoctorService { referDetails, diagnosisDetails, otherDetails, + { doctorSignatureFlag: doctorSignatureFlag }, ); console.log( 'saveSpecialistCancerObservation', @@ -2999,4 +3018,8 @@ export class DoctorService { getAssessmentDet(assessmentId: any) { return this.http.get(environment.getAssessmentUrl + '/' + assessmentId); } + + checkUsersignatureExist(userID: any) { + return this.http.get(environment.checkUsersignExistUrl + userID); + } } diff --git a/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts b/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts index 558c691..28d2d74 100644 --- a/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts +++ b/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts @@ -156,6 +156,7 @@ export class WorkareaComponent idrsScreeningForm!: FormGroup; patientCaseRecordForm!: FormGroup; patientReferForm!: FormGroup; + doctorSignatureFlag = false; constructor( private router: Router, @@ -258,7 +259,16 @@ export class WorkareaComponent this.getVisitReasonAndCategory(); this.getVisitType(); this.getPregnancyStatus(); + + this.doctorService + .checkUsersignatureExist(this.sessionstorage.getItem('userID')) + .subscribe((res: any) => { + if (res.statusCode === 200 && res.data !== null) { + this.doctorSignatureFlag = res.data.signStatus; + } + }); } + setVitalsUpdateButtonValue() { this.enableVitalsButtonSubscription = this.doctorService.enableVitalsUpdateButton$.subscribe((response) => @@ -1063,6 +1073,7 @@ export class WorkareaComponent temp, this.schedulerData, this.isSpecialist, + this.doctorSignatureFlag ) .subscribe( (res: any) => { @@ -1149,6 +1160,7 @@ export class WorkareaComponent .saveSpecialistCancerObservation( this.patientMedicalForm, otherDetails, + this.doctorSignatureFlag ) .subscribe( (res: any) => { @@ -1177,6 +1189,7 @@ export class WorkareaComponent visitCategory, otherDetails, this.schedulerData, + this.doctorSignatureFlag ) .subscribe( (res: any) => { @@ -1419,6 +1432,7 @@ export class WorkareaComponent this.patientMedicalForm, this.schedulerData, this.isSpecialist, + this.doctorSignatureFlag ) .subscribe( (res: any) => { @@ -2747,6 +2761,8 @@ export class WorkareaComponent { quickConsultation: patientQuickConsultFormValue }, this.schedulerData, this.isSpecialist, + this.doctorSignatureFlag + ) .subscribe( (res: any) => { @@ -2974,6 +2990,7 @@ export class WorkareaComponent temp, this.schedulerData, this.isSpecialist, + this.doctorSignatureFlag, ) .subscribe( (res: any) => { @@ -3183,6 +3200,7 @@ export class WorkareaComponent temp, this.schedulerData, this.isSpecialist, + this.doctorSignatureFlag ) .subscribe( (res: any) => { @@ -3412,6 +3430,7 @@ export class WorkareaComponent temp, this.schedulerData, this.isSpecialist, + this.doctorSignatureFlag ) .subscribe( (res: any) => { @@ -3456,6 +3475,7 @@ export class WorkareaComponent temp, this.schedulerData, this.isSpecialist, + this.doctorSignatureFlag ) .subscribe( (res: any) => { From 5762852fe0c5dd82007373aa738ed1bc5a9f67cb Mon Sep 17 00:00:00 2001 From: SnehaRH Date: Thu, 30 Oct 2025 18:20:58 +0530 Subject: [PATCH 2/5] fix: 1899 added signexist apiendpoint for env --- src/environments/environment.ci.ts.template | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/environments/environment.ci.ts.template b/src/environments/environment.ci.ts.template index 46b043a..8bd2cf5 100644 --- a/src/environments/environment.ci.ts.template +++ b/src/environments/environment.ci.ts.template @@ -497,4 +497,6 @@ export const environment = { enableCaptcha: enableCaptcha, getUserId: `${COMMON_API}user/userName/`, + checkUsersignExistUrl: `${ADMIN_API}signature1/signexist/`, + }; From 83cc0d8beaf8819df0b5b481ad2a3ed1dcf0a00e Mon Sep 17 00:00:00 2001 From: SnehaRH Date: Tue, 4 Nov 2025 14:39:51 +0530 Subject: [PATCH 3/5] fix: signature case sheet fix --- src/app/app-modules/nurse-doctor/workarea/workarea.component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts b/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts index 28d2d74..db5998c 100644 --- a/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts +++ b/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts @@ -1261,6 +1261,7 @@ export class WorkareaComponent visitCategory, otherDetails, this.schedulerData, + this.doctorSignatureFlag ) .subscribe( (res: any) => { From 700fc7e77d5f17a9819ee61b56b83fbb47a782ce Mon Sep 17 00:00:00 2001 From: SnehaRH Date: Tue, 4 Nov 2025 16:27:12 +0530 Subject: [PATCH 4/5] fix: signature case sheet fix and revisit date was not able to access --- .../doctor-diagnosis-case-sheet.component.ts | 19 +++++++++---------- .../shared/services/doctor.service.ts | 2 ++ .../workarea/workarea.component.ts | 1 + 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts b/src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts index b4c315e..02c4975 100644 --- a/src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts +++ b/src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts @@ -355,18 +355,14 @@ export class DoctorDiagnosisCaseSheetComponent } } } - console.log( - 'referDetailsForRefer', - JSON.stringify(this.referDetails, null, 4), - ); if ( this.casesheetData && this.casesheetData.doctorData.Refer && - this.referDetails.revisitDate && - !moment(this.referDetails.revisitDate, 'DD/MM/YYYY', true).isValid() + this.casesheetData.doctorData.Refer.revisitDate && + !moment(this.casesheetData.doctorData.Refer.revisitDate, 'DD/MM/YYYY', true).isValid() ) { - const sDate = new Date(this.referDetails.revisitDate); - this.referDetails.revisitDate = [ + const sDate = new Date(this.casesheetData.doctorData.Refer.revisitDate); + this.casesheetData.doctorData.Refer.revisitDate = [ this.padLeft.apply(sDate.getDate()), this.padLeft.apply(sDate.getMonth() + 1), this.padLeft.apply(sDate.getFullYear()), @@ -374,6 +370,7 @@ export class DoctorDiagnosisCaseSheetComponent } if (this.casesheetData?.BeneficiaryData?.doctorSignatureFlag) { + this.downloadSign(); } this.getVaccinationTypeAndDoseMaster(); @@ -386,9 +383,11 @@ export class DoctorDiagnosisCaseSheetComponent } downloadSign() { + this.getUserId().subscribe((userId) => { - const tcSpecId = this.beneficiaryDetails?.tCSpecialistUserID; - const userIdToUse = tcSpecId && tcSpecId !== 0 ? tcSpecId : userId; + const userIdToUse = this.beneficiaryDetails?.tCSpecialistUserID ?? userId; + console.log("User", userIdToUse); + this.doctorService.downloadSign(userIdToUse).subscribe( (response: any) => { const blob = new Blob([response], { type: response.type }); diff --git a/src/app/app-modules/nurse-doctor/shared/services/doctor.service.ts b/src/app/app-modules/nurse-doctor/shared/services/doctor.service.ts index 599cddb..657c741 100644 --- a/src/app/app-modules/nurse-doctor/shared/services/doctor.service.ts +++ b/src/app/app-modules/nurse-doctor/shared/services/doctor.service.ts @@ -606,6 +606,7 @@ export class DoctorService { consultationData: any, tcRequest: any, isSpecialist: any, + doctorSignatureFlag: any ) { const serviceLineDetails: any = this.sessionstorage.getItem('serviceLineDetails'); @@ -628,6 +629,7 @@ export class DoctorService { vanID: vanID, tcRequest: tcRequest, isSpecialist: isSpecialist, + doctorSignatureFlag: doctorSignatureFlag }; const quickConsultation = Object.assign( {}, diff --git a/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts b/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts index db5998c..27773c0 100644 --- a/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts +++ b/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts @@ -2826,6 +2826,7 @@ export class WorkareaComponent { quickConsultation: patientQuickConsultDetails }, this.schedulerData, this.isSpecialist, + this.doctorSignatureFlag, ) .subscribe( (res: any) => { From db78b3e26fe90d802352a35fee3b3c4aa58e9c70 Mon Sep 17 00:00:00 2001 From: SnehaRH Date: Mon, 8 Dec 2025 16:26:17 +0530 Subject: [PATCH 5/5] fix: amm-1931 handling session expiry --- .../core/services/http-interceptor.service.ts | 21 +++++++++++++++++++ src/assets/Assamese.json | 6 +++++- src/assets/English.json | 8 ++++++- src/assets/Hindi.json | 6 +++++- 4 files changed, 38 insertions(+), 3 deletions(-) diff --git a/src/app/app-modules/core/services/http-interceptor.service.ts b/src/app/app-modules/core/services/http-interceptor.service.ts index bf42f9d..0611d12 100644 --- a/src/app/app-modules/core/services/http-interceptor.service.ts +++ b/src/app/app-modules/core/services/http-interceptor.service.ts @@ -73,11 +73,32 @@ export class HttpInterceptorService implements HttpInterceptor { catchError((error: HttpErrorResponse) => { console.error(error); this.spinnerService.setLoading(false); + if (error.status === 401) { + this.sessionstorage.clear(); + this.confirmationService.alert(this.currentLanguageSet.sessionExpiredPleaseLogin, 'error'); + setTimeout(() => this.router.navigate(['/login']), 0); + } else if (error.status === 403) { + this.confirmationService.alert( + this.currentLanguageSet.accessDenied, + 'error', + ); + } else if (error.status === 500) { + this.confirmationService.alert( + this.currentLanguageSet.internaleServerError, + 'error', + ); + } else { + this.confirmationService.alert( + error.message || this.currentLanguageSet.somethingWentWrong, + 'error', + ); + } return throwError(error.error); }), ); } + private onSuccess(url: string, response: any): void { if (this.timerRef) clearTimeout(this.timerRef); diff --git a/src/assets/Assamese.json b/src/assets/Assamese.json index e19837d..194ef16 100644 --- a/src/assets/Assamese.json +++ b/src/assets/Assamese.json @@ -1728,6 +1728,10 @@ "fileUploadedSuccessfully": "File Uploaded successfully", "verifyMobileOtp": "Verify Mobile OTP", "enterMobileOtp": "Enter Mobile OTP", - "verify": "Verify" + "verify": "Verify", + "accessDenied": "প্ৰৱেশ অধিকার নিষিদ্ধ", + "internaleServerError": "আভ্যন্তৰীণ চাৰ্ভাৰ ত্ৰুটি", + "somethingWentWrong": "কিবা ভুল হৈ গ'ল", + "sessionExpiredPleaseLogin": "আপোনাৰ ছেছন সমাপ্ত, অনুগ্ৰহ কৰি পুনৰ লগইন কৰক" } } diff --git a/src/assets/English.json b/src/assets/English.json index 82e4da1..be7c006 100644 --- a/src/assets/English.json +++ b/src/assets/English.json @@ -1735,7 +1735,13 @@ "fileUploadedSuccessfully": "File Uploaded successfully", "verifyMobileOtp": "Verify Mobile OTP", "enterMobileOtp": "Enter Mobile OTP", - "verify": "Verify" + "verify": "Verify", + "accessDenied": "Access Denied", + "internaleServerError": "Internal Server Error", + "somethingWentWrong": "Something went wrong", + "sessionExpiredPleaseLogin": "Session expired, Please login again to continue" + + } } \ No newline at end of file diff --git a/src/assets/Hindi.json b/src/assets/Hindi.json index b3576f9..7bf8911 100644 --- a/src/assets/Hindi.json +++ b/src/assets/Hindi.json @@ -1731,6 +1731,10 @@ "fileUploadedSuccessfully": "File Uploaded successfully", "verifyMobileOtp": "Verify Mobile OTP", "enterMobileOtp": "Enter Mobile OTP", - "verify": "Verify" + "verify": "Verify", + "accessDenied": "पहुंच अस्वीकृत", + "internaleServerError": "आंतरिक सर्वर त्रुटि", + "somethingWentWrong": "कुछ गलत हो गया", + "sessionExpiredPleaseLogin": "सत्र समाप्त हो गया, कृपया जारी रखने के लिए दोबारा लॉगिन करें" } }