+
+
+
+
+
+
+
+
+ Admission Date is required
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Blood Group is
+ required
+
+
+
+
+
+
+ Enter a valid email
+ address
+
+
+
+
+
-
+ [disabled]="(patientrecord.invalid || selectedstatus === 0 || !selectedgender)">
+ Save
+
+
diff --git a/angular/src/app/patients/all-patients/all-patients.component.scss b/angular/src/app/patients/all-patients/all-patients.component.scss
index 9b907b1..cd3ef1e 100644
--- a/angular/src/app/patients/all-patients/all-patients.component.scss
+++ b/angular/src/app/patients/all-patients/all-patients.component.scss
@@ -25,4 +25,13 @@
color: red;
font-size: 1.2rem;
}
+
+ .bg-pink {
+ background-color: #ff4081 !important;
+ color: white;
+}
+
+.gap-1 {
+ gap: 5px;
+}
\ No newline at end of file
diff --git a/angular/src/app/patients/all-patients/all-patients.component.ts b/angular/src/app/patients/all-patients/all-patients.component.ts
index ad9ba7d..88d042d 100644
--- a/angular/src/app/patients/all-patients/all-patients.component.ts
+++ b/angular/src/app/patients/all-patients/all-patients.component.ts
@@ -1,6 +1,6 @@
import { PermissionService } from '@abp/ng.core';
import { Confirmation, ConfirmationService, ToasterService } from '@abp/ng.theme.shared';
-import { HttpClient } from '@angular/common/http';
+import { HttpClient, HttpEventType, HttpParams, HttpRequest } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { NgForm } from '@angular/forms';
import { Router } from '@angular/router';
@@ -8,6 +8,7 @@ import { PagingSortResultDto } from '@proxy/dto';
import { Gender, Status } from '@proxy/global-enum';
import { PatientService } from '@proxy/patients';
import { PatientDto, CreateUpdatePatientDto } from '@proxy/patients/dto';
+import { environment } from 'src/environments/environment';
@Component({
selector: 'app-all-patients',
@@ -38,18 +39,7 @@ export class AllPatientsComponent implements OnInit {
error: string = '';
imgpath: string = '';
guid: string = '00000000-0000-0000-0000-000000000000';
- options: Partial
= {
- hideCancelBtn: false,
- hideYesBtn: false,
- dismissible: false,
- cancelText: 'Close',
- // yesText: 'Confirm',
- messageLocalizationParams: ['Demo'],
- titleLocalizationParams: [],
- // You can customize icon
- // icon: 'fa fa-exclamation-triangle', // or
- // iconTemplate : '
'
- };
+ uploadProgress = 0;
constructor(
private patientService: PatientService,
@@ -103,6 +93,7 @@ export class AllPatientsComponent implements OnInit {
this.imgpath = '';
this.selectedgender = 0;
this.selectedstatus = 0;
+ this.uploadProgress = 0;
}
loadPatient(event: any) {
@@ -167,6 +158,7 @@ export class AllPatientsComponent implements OnInit {
this.error = 'Please Type a Name';
return;
}
+ this.error = '';
const input = event.target as HTMLInputElement;
if (input.files.length > 0) {
const tag = 'Image';
@@ -174,14 +166,40 @@ export class AllPatientsComponent implements OnInit {
formdata.append('file', input.files[0]);
this.UploadFileData(tag, formdata);
} else {
+ this.uploadProgress = 0;
return;
}
}
UploadFileData(tag: string, formdata: FormData) {
- this.patientService.uploadFile(tag, formdata).subscribe(result => {
- this.selectedPatient.imageID = result;
- });
+ // this.patientService.uploadFile(tag, formdata).subscribe(result => {
+ // this.selectedPatient.imageID = result;
+ // });
+ const req = new HttpRequest(
+ 'POST',
+ environment.apis.default.url + '/api/app/patient/upload-file',
+ formdata,
+ {
+ reportProgress: true,
+ responseType: 'text',
+ params: new HttpParams().set('tagName', tag),
+ }
+ );
+ this.http.request(req).subscribe(
+ event => {
+ if (event.type === HttpEventType.UploadProgress) {
+ this.uploadProgress = Math.round((event.loaded / event.total!) * 100);
+ console.log(event.type, this.uploadProgress);
+ } else if (event.type === HttpEventType.Response) {
+ this.uploadProgress = 100;
+ this.selectedPatient.imageID = event.body.toString();
+ }
+ },
+ error => {
+ console.error('Upload failed', error);
+ this.uploadProgress = 0;
+ }
+ );
}
editPatient(Patient: any) {
diff --git a/angular/src/app/patients/patient-record/patient-record.component.html b/angular/src/app/patients/patient-record/patient-record.component.html
index 44ff19f..1640b18 100644
--- a/angular/src/app/patients/patient-record/patient-record.component.html
+++ b/angular/src/app/patients/patient-record/patient-record.component.html
@@ -52,30 +52,27 @@