Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/app/app-modules/core/services/http-interceptor.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ 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');
Expand All @@ -109,6 +110,7 @@ export class HttpInterceptorService implements HttpInterceptor {
);
}


private onSuccess(url: string, response: any): void {
if (this.timerRef) clearTimeout(this.timerRef);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,25 +355,24 @@
}
}
}
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()),
].join('/');

Check warning on line 369 in src/app/app-modules/nurse-doctor/case-sheet/general-case-sheet/doctor-diagnosis-case-sheet/doctor-diagnosis-case-sheet.component.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using `join()` for [ this.padLeft.apply(sDate.getDate()), this.padLeft.apply(sDate.getMonth() + 1), this.padLeft.apply(sDate.getFullYear()), ] may use Object's default stringification format ('[object Object]') when stringified.

See more on https://sonarcloud.io/project/issues?id=PSMRI_TM-UI&issues=AZpOhOXQLai5DoKKLUN5&open=AZpOhOXQLai5DoKKLUN5&pullRequest=107
}

this.downloadSign();
if (this.casesheetData?.BeneficiaryData?.doctorSignatureFlag) {

this.downloadSign();
}
this.getVaccinationTypeAndDoseMaster();
}
}
Expand All @@ -384,9 +383,11 @@
}

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 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export class DoctorService {
otherDetails: any,
tcRequest: any,
isSpecialist: any,
doctorSignatureFlag: any,
) {
const serviceLineDetails: any =
this.sessionstorage.getItem('serviceLineDetails');
Expand Down Expand Up @@ -115,6 +116,7 @@ export class DoctorService {
createdBy: this.sessionstorage.getItem('userName'),
tcRequest: tcRequest,
isSpecialist: isSpecialist,
doctorSignatureFlag: doctorSignatureFlag,
};

console.log(
Expand Down Expand Up @@ -231,6 +233,7 @@ export class DoctorService {
cancerForm: any,
tcRequest: any,
isSpecialist: any,
doctorSignatureFlag: any,
) {
const serviceLineDetails: any =
this.sessionstorage.getItem('serviceLineDetails');
Expand Down Expand Up @@ -261,7 +264,9 @@ export class DoctorService {
diagnosisDetails,
referDetails,
otherDetails,
{ isSpecialist: isSpecialist },
{ isSpecialist: isSpecialist,
doctorSignatureFlag: doctorSignatureFlag
},
);
const cancerRequest = Object.assign({
tcRequest: tcRequest,
Expand Down Expand Up @@ -558,6 +563,7 @@ export class DoctorService {
consultationData: any,
tcRequest: any,
isSpecialist: any,
doctorSignatureFlag: any,
) {
const serviceLineDetails: any =
this.sessionstorage.getItem('serviceLineDetails');
Expand All @@ -580,6 +586,7 @@ export class DoctorService {
vanID: vanID,
tcRequest: tcRequest,
isSpecialist: isSpecialist,
doctorSignatureFlag: doctorSignatureFlag,
};
const quickConsultation = Object.assign(
{},
Expand All @@ -597,6 +604,7 @@ export class DoctorService {
consultationData: any,
tcRequest: any,
isSpecialist: any,
doctorSignatureFlag: any
) {
const serviceLineDetails: any =
this.sessionstorage.getItem('serviceLineDetails');
Expand All @@ -619,6 +627,7 @@ export class DoctorService {
vanID: vanID,
tcRequest: tcRequest,
isSpecialist: isSpecialist,
doctorSignatureFlag: doctorSignatureFlag
};
const quickConsultation = Object.assign(
{},
Expand Down Expand Up @@ -739,6 +748,7 @@ export class DoctorService {
otherDetails: any,
tcRequest: any,
isSpecialist: any,
doctorSignatureFlag: any
) {
const serviceLineDetails: any =
this.sessionstorage.getItem('serviceLineDetails');
Expand Down Expand Up @@ -787,6 +797,7 @@ export class DoctorService {
createdBy: this.sessionstorage.getItem('userName'),
tcRequest: tcRequest,
isSpecialist: isSpecialist,
doctorSignatureFlag: doctorSignatureFlag
};

console.log(
Expand Down Expand Up @@ -872,6 +883,7 @@ export class DoctorService {
otherDetails: any,
tcRequest: any,
isSpecialist: any,
doctorSignatureFlag: any
) {
const serviceLineDetails: any =
this.sessionstorage.getItem('serviceLineDetails');
Expand Down Expand Up @@ -923,6 +935,7 @@ export class DoctorService {
createdBy: this.sessionstorage.getItem('userName'),
tcRequest: tcRequest,
isSpecialist: isSpecialist,
doctorSignatureFlag: doctorSignatureFlag
};

console.log(
Expand All @@ -949,6 +962,7 @@ export class DoctorService {
otherDetails: any,
tcRequest: any,
isSpecialist: any,
doctorSignatureFlag: any
) {
const serviceLineDetails: any =
this.sessionstorage.getItem('serviceLineDetails');
Expand Down Expand Up @@ -999,6 +1013,7 @@ export class DoctorService {
createdBy: this.sessionstorage.getItem('userName'),
tcRequest: tcRequest,
isSpecialist: isSpecialist,
doctorSignatureFlag: doctorSignatureFlag
};

console.log(
Expand Down Expand Up @@ -2318,6 +2333,7 @@ export class DoctorService {
otherDetails: any,
tcRequest: any,
isSpecialist: any,
doctorSignatureFlag: any,
) {
const serviceLineDetails: any =
this.sessionstorage.getItem('serviceLineDetails');
Expand Down Expand Up @@ -2365,6 +2381,7 @@ export class DoctorService {
createdBy: this.sessionstorage.getItem('userName'),
tcRequest: tcRequest,
isSpecialist: isSpecialist,
doctorSignatureFlag: doctorSignatureFlag,
};

console.log(
Expand Down Expand Up @@ -2593,6 +2610,7 @@ export class DoctorService {
visitCategory: any,
otherDetails: any,
tcRequest: any,
doctorSignatureFlag: any
): Observable<object> {
const serviceLineDetails: any =
this.sessionstorage.getItem('serviceLineDetails');
Expand Down Expand Up @@ -2644,6 +2662,7 @@ export class DoctorService {
createdBy: this.sessionstorage.getItem('userName'),
tcRequest: tcRequest,
isSpecialist: otherDetails.isSpecialist,
doctorSignatureFlag: doctorSignatureFlag
};

console.log(
Expand Down Expand Up @@ -2797,6 +2816,7 @@ export class DoctorService {
saveSpecialistCancerObservation(
specialistDiagonosis: any,
otherDetails: any,
doctorSignatureFlag: any,
) {
const diagnosisDetails =
specialistDiagonosis.controls.patientCaseRecordForm.value;
Expand All @@ -2809,6 +2829,7 @@ export class DoctorService {
referDetails,
diagnosisDetails,
otherDetails,
{ doctorSignatureFlag: doctorSignatureFlag },
);
console.log(
'saveSpecialistCancerObservation',
Expand Down Expand Up @@ -2997,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);
}
}
22 changes: 22 additions & 0 deletions src/app/app-modules/nurse-doctor/workarea/workarea.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export class WorkareaComponent
idrsScreeningForm!: FormGroup;
patientCaseRecordForm!: FormGroup;
patientReferForm!: FormGroup;
doctorSignatureFlag = false;

constructor(
private router: Router,
Expand Down Expand Up @@ -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) =>
Expand Down Expand Up @@ -1063,6 +1073,7 @@ export class WorkareaComponent
temp,
this.schedulerData,
this.isSpecialist,
this.doctorSignatureFlag
)
.subscribe(
(res: any) => {
Expand Down Expand Up @@ -1149,6 +1160,7 @@ export class WorkareaComponent
.saveSpecialistCancerObservation(
this.patientMedicalForm,
otherDetails,
this.doctorSignatureFlag
)
.subscribe(
(res: any) => {
Expand Down Expand Up @@ -1177,6 +1189,7 @@ export class WorkareaComponent
visitCategory,
otherDetails,
this.schedulerData,
this.doctorSignatureFlag
)
.subscribe(
(res: any) => {
Expand Down Expand Up @@ -1248,6 +1261,7 @@ export class WorkareaComponent
visitCategory,
otherDetails,
this.schedulerData,
this.doctorSignatureFlag
)
.subscribe(
(res: any) => {
Expand Down Expand Up @@ -1419,6 +1433,7 @@ export class WorkareaComponent
this.patientMedicalForm,
this.schedulerData,
this.isSpecialist,
this.doctorSignatureFlag
)
.subscribe(
(res: any) => {
Expand Down Expand Up @@ -2747,6 +2762,8 @@ export class WorkareaComponent
{ quickConsultation: patientQuickConsultFormValue },
this.schedulerData,
this.isSpecialist,
this.doctorSignatureFlag

)
.subscribe(
(res: any) => {
Expand Down Expand Up @@ -2809,6 +2826,7 @@ export class WorkareaComponent
{ quickConsultation: patientQuickConsultDetails },
this.schedulerData,
this.isSpecialist,
this.doctorSignatureFlag,
)
.subscribe(
(res: any) => {
Expand Down Expand Up @@ -2974,6 +2992,7 @@ export class WorkareaComponent
temp,
this.schedulerData,
this.isSpecialist,
this.doctorSignatureFlag,
)
.subscribe(
(res: any) => {
Expand Down Expand Up @@ -3183,6 +3202,7 @@ export class WorkareaComponent
temp,
this.schedulerData,
this.isSpecialist,
this.doctorSignatureFlag
)
.subscribe(
(res: any) => {
Expand Down Expand Up @@ -3412,6 +3432,7 @@ export class WorkareaComponent
temp,
this.schedulerData,
this.isSpecialist,
this.doctorSignatureFlag
)
.subscribe(
(res: any) => {
Expand Down Expand Up @@ -3456,6 +3477,7 @@ export class WorkareaComponent
temp,
this.schedulerData,
this.isSpecialist,
this.doctorSignatureFlag
)
.subscribe(
(res: any) => {
Expand Down
2 changes: 2 additions & 0 deletions src/environments/environment.ci.ts.template
Original file line number Diff line number Diff line change
Expand Up @@ -503,4 +503,6 @@ export const environment = {
enableCaptcha: enableCaptcha,

getUserId: `${COMMON_API}user/userName/`,
checkUsersignExistUrl: `${ADMIN_API}signature1/signexist/`,

};