|
vertical-align: middle;
"
>
- {{ component?.componentName }}
+ {{ component?.componentName }}
|
- {{ component?.testResultValue }}
+ {{ component?.testResultValue }}
|
- {{ component?.testResultUnit }}
+ {{ component?.testResultUnit }}
|
|
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) => {
- 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);
+ }
+ );
}
showSign(blob: any) {
const reader = new FileReader();
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 c0786a6..5936a31 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
@@ -29,6 +29,7 @@ import { RegistrarService } from 'src/app/app-modules/registrar/shared/services/
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',
@@ -100,6 +101,7 @@ export class DoctorDiagnosisCaseSheetComponent
serviceList = '';
referralReasonList = '';
isCovidVaccinationStatusVisible = false;
+ userName: any;
constructor(
private doctorService: DoctorService,
@@ -122,6 +124,7 @@ export class DoctorDiagnosisCaseSheetComponent
ngDoCheck() {
this.assignSelectedLanguage();
}
+
assignSelectedLanguage() {
const getLanguageJson = new SetLanguageComponent(this.httpServiceService);
getLanguageJson.setLanguage();
@@ -129,10 +132,10 @@ export class DoctorDiagnosisCaseSheetComponent
}
ngOnChanges() {
+
this.ncdScreeningCondition = null;
if (this.casesheetData) {
- console.log('cases');
- console.log(this.casesheetData);
+ this.userName = this.casesheetData?.doctorData?.diagnosis?.createdBy;
const temp2 = this.casesheetData.nurseData.covidDetails;
if (this.casesheetData.doctorData.diagnosis.doctorDiagnonsis) {
this.doctorDiagnosis =
@@ -379,22 +382,30 @@ export class DoctorDiagnosisCaseSheetComponent
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) => {
+
+ downloadSign() {
+ this.getUserId().subscribe((userId) => {
+ const tcSpecId = this.beneficiaryDetails?.tCSpecialistUserID;
+ const userIdToUse = tcSpecId && tcSpecId !== 0 ? tcSpecId : 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 {
+ return this.doctorService
+ .getUserId(this.userName)
+ .pipe(map((res: any) => res?.userId || null));
}
+
showSign(blob: any) {
const reader = new FileReader();
reader.readAsDataURL(blob);
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 fd44873..046841e 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
@@ -2843,10 +2843,16 @@ export class DoctorService {
}
/* Doctor Signature download */
downloadSign(userID: any) {
- return this.http
- .get(environment.downloadSignUrl + userID, { responseType: 'blob' })
- .pipe(map((res: any) => res.blob()));
+ return this.http.get(environment.downloadSignUrl + userID, {
+ responseType: 'blob' as 'json',
+ });
+ }
+
+ /* Get UserID using UserName */
+ getUserId(userName: any) {
+ return this.http.get(environment.getUserId + userName);
}
+
getIDRSDetails(beneficiaryID: string, visitID: string): Observable {
const visitCategory = this.sessionstorage.getItem('visitCategory');
const otherDetails = 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 79bb379..558c691 100644
--- a/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts
+++ b/src/app/app-modules/nurse-doctor/workarea/workarea.component.ts
@@ -1679,6 +1679,11 @@ export class WorkareaComponent
);
const diagForm3 = diagForm2.controls[0];
+ if (diagForm3.controls['viewProvisionalDiagnosisProvided'].errors) {
+ required.push(
+ this.current_language_set.DiagnosisDetails.provisionaldiagnosis
+ );
+ }
if (!diagForm3.controls['viewProvisionalDiagnosisProvided'].errors) {
diagForm2.value.filter((item: any) => {
diff --git a/src/environments/environment.ci.ts.template b/src/environments/environment.ci.ts.template
index 3f1c0f4..46b043a 100644
--- a/src/environments/environment.ci.ts.template
+++ b/src/environments/environment.ci.ts.template
@@ -38,7 +38,7 @@ const ADMIN_API = '<%= ADMIN_API_BASE %>';
const biologicalScreeningDeviceAPI = `${ADMIN_API}/diagnostics/biologicalScreeningDevice`;
const IOT_API = '<%= IOT_API_BASE %>';
const FHIR_API = '<%= FHIR_API_BASE %>';
-const mmuUICasesheet = '<%= TM_API_BASE %>';
+const mmuUICasesheet = '<%= TM_UI %>';
const SCHEDULER_UI = '<%= SCHEDULER_UI_BASE %>';
const INVENTORY_UI = '<%= INVENTORY_UI %>';
const IDENTITY_API = `<%= IDENTITY_API_BASE %>`;
@@ -495,4 +495,6 @@ export const environment = {
siteKey: siteKey,
captchaChallengeURL: captchaChallengeURL,
enableCaptcha: enableCaptcha,
+
+ getUserId: `${COMMON_API}user/userName/`,
};
|