Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import { NurseService, MasterdataService } from '../../../shared/services';
import * as moment from 'moment';
import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service';
import { map, Observable } from 'rxjs';

@Component({
selector: 'app-doctor-diagnosis-case-sheet',
Expand Down Expand Up @@ -100,6 +101,7 @@
serviceList = '';
referralReasonList = '';
isCovidVaccinationStatusVisible = false;
userName: any;

constructor(
private doctorService: DoctorService,
Expand Down Expand Up @@ -379,22 +381,28 @@
const len = String(10).length - String(this).length + 1;
return len > 0 ? new Array(len).join('0') + this : this;
}
downloadSign() {
if (this.beneficiaryDetails && this.beneficiaryDetails.tCSpecialistUserID) {
const tCSpecialistUserID = this.beneficiaryDetails.tCSpecialistUserID;
this.doctorService.downloadSign(tCSpecialistUserID).subscribe(
(response) => {

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

View workflow job for this annotation

GitHub Actions / lint-and-audit / lint-and-audit

Delete `Β·`
downloadSign() {

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

View workflow job for this annotation

GitHub Actions / lint-and-audit / lint-and-audit

Delete `Β·`
this.getUserId().subscribe((userId) => {
const userIdToUse = this.beneficiaryDetails?.tCSpecialistUserID ?? userId;
this.doctorService.downloadSign(userIdToUse).subscribe(
(response: any) => {
const blob = new Blob([response], { type: response.type });
this.showSign(blob);
},
(err) => {
console.log('error');
(err: any) => {
console.error('Error downloading signature:', err);
},
);
} else {
console.log('No tCSpecialistUserID found');
}
});
}

getUserId(): Observable<any> {
return this.doctorService
.getUserId(this.userName)
.pipe(map((res: any) => res?.userId || null));
}

showSign(blob: any) {
const reader = new FileReader();
reader.readAsDataURL(blob);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2847,6 +2847,12 @@
.get(environment.downloadSignUrl + userID, { responseType: 'blob' })
.pipe(map((res: any) => <Blob>res.blob()));
}

/* Get UserID using UserName */
getUserId(userName: any) {
return this.http.get(environment.getUserId + userName);
}

Check failure on line 2855 in src/app/app-modules/nurse-doctor/shared/services/doctor.service.ts

View workflow job for this annotation

GitHub Actions / lint-and-audit / lint-and-audit

Delete `Β·Β·`
getIDRSDetails(beneficiaryID: string, visitID: string): Observable<any> {
const visitCategory = this.sessionstorage.getItem('visitCategory');
const otherDetails = Object.assign({
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 @@ -495,4 +495,6 @@ export const environment = {
siteKey: siteKey,
captchaChallengeURL: captchaChallengeURL,
enableCaptcha: enableCaptcha,

getUserId: `${COMMON_API}user/userName/`,
};
Loading