diff --git a/angular/src/app/patients/all-patients/all-patients.component.html b/angular/src/app/patients/all-patients/all-patients.component.html index b79aacd..3aadf3e 100644 --- a/angular/src/app/patients/all-patients/all-patients.component.html +++ b/angular/src/app/patients/all-patients/all-patients.component.html @@ -1,4 +1,4 @@ -
+ +
+
+
+

Patient List

+
+ + +
+ + +
+
+
+ + + + + + Patient ID + Full Name + Gender + Date of Admission + Blood Group + Mobile + Email + Status + Actions + + + + + + {{ patient.id }} + {{ patient.name }} + + + {{ gender[patient.gender] }} + + + {{ patient.admissionDate | date }} + {{ patient.bloodGroup }} + {{ patient.mobile }} + {{ patient.email }} + + + {{ status[patient.status] }} + + + + + + + + + + + + + No Patients found. + + + +
Total Records: {{ totalRecords }}
+
+
+ [closable]="true" [style]="{width: '80%', height: 'auto'}" class="modern-dialog">
-
-
- -
-
- - - Full Name is required -
-
- - -
- {{error}} - -
-

Uploading... {{ uploadProgress }}%

- -
- {{imgpath}} +
+ +
+
+ + + Full Name is required
- - -
-
- - - - Mobile is required and must be 10 digits - -
+
+ +
- - -
-
- - - Address is - required -
+ {{error}} +
+

Uploading... {{ uploadProgress }}%

+
+ {{imgpath}}
-
- -
-
- -
- - -
- Gender is required -
+ +
+
+ + + + Mobile is required and must be 10 digits +
- - -
-
- - - - Admission Date is required - -
-
-
-
- -
-
- - -
-
- - -
-
- - -
-
-
- -
- -
-
- - - Blood Group is - required -
-
- - -
-
- - - Enter a valid email - address -
-
-
- -
- -
-
- - - - Age is required and must be between 1 and 90 - -
-
- - -
-
- - - Status is required -
+
+ + + Address is required
-
+
+ +
+
+ +
+ + +
+ Gender is required +
+
+
+
+ + + + 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 c722433..54fcec2 100644 --- a/angular/src/app/patients/all-patients/all-patients.component.ts +++ b/angular/src/app/patients/all-patients/all-patients.component.ts @@ -158,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'; @@ -170,7 +171,6 @@ export class AllPatientsComponent implements OnInit { } } - UploadFileData(tag: string, formdata: FormData) { // this.patientService.uploadFile(tag, formdata).subscribe(result => { // this.selectedPatient.imageID = result; 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 630f94b..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 @@
-
- +
+ -
-

{{'::PatientHeader' | abpLocalization}}

-
- - - - - - - - + + + +
@@ -90,7 +87,7 @@ Lab Reports Medications Next Follow-Up - Status + Status Actions @@ -106,186 +103,141 @@ {{ patientrecord.dateOfAdmission | date }} {{ patientrecord.diagnosis }} - - + + {{ patientrecord.nextFollowUp | date }} - {{ status[patientrecord.patients.status] }} - - - + + + {{ status[patientrecord.patients.status] }} + + + + + + - No Patients found. + No Patients found.
- Total Records: {{totalRecords}} +
Total Records: {{totalRecords}}
+ [closable]="true" [style]="{width: '70%', height: 'auto'}">
-
-
- - -
+
-
-
- -
-
-
- - - - Admission Date is required. - -
+ +
+
+ + + + Admission Date is required. +
-
-
-
- - -
-
-

Uploading... {{ uploadProgress }}%

- -
- {{labReportUrlpath}} -
-
-
- - -
-
-

Uploading... {{ uploadProgress }}%

- -
- {{medicationUrlpath}} -
-
- -
-
-
- - -
-
-

Uploading... {{ uploadProgress }}%

- -
- {{medicationHistoryUrlpath}} -
-
-
- - - - Next Follow-Up Date is required. - -
-
-
- -
-
-
-
- -
- - - Diagnosis is required. - -
-
-
- -
-
-
- - - - Insurance is required. - -
-
-
- + +
+
+ + + + Next Follow-Up Date is required. +
-
- - + + +
+
+
+ + +
+

Uploading... {{ uploadProgress1 }}%

+ +
+ {{labReportUrlpath}} +
+
+ +
+
+ + +
+

Uploading... {{ uploadProgress2 }}%

+ +
+ {{medicationUrlpath}} +
+
+
+
+ + +
+

Uploading... {{ uploadProgress3 }}%

+ +
+ {{medicationHistoryUrlpath}} +
+
+
+ + +
+
+ + + + Diagnosis is required. + +
+
+ + +
+
+ + + + Insurance is required. + +
+
+ + + diff --git a/angular/src/app/patients/patient-record/patient-record.component.scss b/angular/src/app/patients/patient-record/patient-record.component.scss index 0bc5d64..049d143 100644 --- a/angular/src/app/patients/patient-record/patient-record.component.scss +++ b/angular/src/app/patients/patient-record/patient-record.component.scss @@ -18,7 +18,8 @@ } .female { - background-color: purple; + background-color: #ff4081 !important; + color: white; } .pdf-icon { diff --git a/angular/src/app/patients/patient-record/patient-record.component.ts b/angular/src/app/patients/patient-record/patient-record.component.ts index b3ee512..6916fc5 100644 --- a/angular/src/app/patients/patient-record/patient-record.component.ts +++ b/angular/src/app/patients/patient-record/patient-record.component.ts @@ -41,7 +41,9 @@ export class PatientRecordComponent implements OnInit { medicationHistoryUrlpath: string; medicationUrlpath: string; guid: string = '00000000-0000-0000-0000-000000000000'; - uploadProgress = 0; + uploadProgress1 = 0; + uploadProgress2 = 0; + uploadProgress3 = 0; constructor( private patientService: PatientService, @@ -94,6 +96,9 @@ export class PatientRecordComponent implements OnInit { this.medicationHistoryUrlpath = ''; this.selectdateOfAdmission = new Date(); this.selectnextFollowUp = new Date(); + this.uploadProgress1 = 0; + this.uploadProgress2 = 0; + this.uploadProgress3 = 0; } loadPatient(event: any, id: any) { @@ -198,7 +203,9 @@ export class PatientRecordComponent implements OnInit { formdata.append('file', input.files[0]); this.UploadFileData(tag, formdata); } else { - this.uploadProgress = 0; + this.uploadProgress1 = 0; + this.uploadProgress2 = 0; + this.uploadProgress3 = 0; return; } } @@ -260,18 +267,30 @@ export class PatientRecordComponent implements OnInit { 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.uploadProgress = Math.round((event.loaded / event.total!) * 100); switch (tag) { case 'Lab-Report': + this.uploadProgress1 = Math.round((event.loaded / event.total!) * 100); + break; + case 'Medication': + this.uploadProgress2 = Math.round((event.loaded / event.total!) * 100); + break; + case 'Medication-History': + this.uploadProgress3 = Math.round((event.loaded / event.total!) * 100); + break; + } + } else if (event.type === HttpEventType.Response) { + switch (tag) { + case 'Lab-Report': + this.uploadProgress1 = 100; this.selectedPatient.labReportUrlID = event.body.toString(); break; case 'Medication': + this.uploadProgress2 = 100; this.selectedPatient.medicationUrlID = event.body.toString(); break; case 'Medication-History': + this.uploadProgress3 = 100; this.selectedPatient.medicationHistoryUrlID = event.body.toString(); break; } @@ -279,7 +298,9 @@ export class PatientRecordComponent implements OnInit { }, error => { console.error('Upload failed', error); - this.uploadProgress = 0; + this.uploadProgress1 = 100; + this.uploadProgress2 = 100; + this.uploadProgress3 = 100; } ); } diff --git a/aspnet-core/src/HospitalManagementSystem.Application/Patients/PatientAppService.cs b/aspnet-core/src/HospitalManagementSystem.Application/Patients/PatientAppService.cs index cd53ffa..35acb19 100644 --- a/aspnet-core/src/HospitalManagementSystem.Application/Patients/PatientAppService.cs +++ b/aspnet-core/src/HospitalManagementSystem.Application/Patients/PatientAppService.cs @@ -54,7 +54,7 @@ namespace HospitalManagementSystem.Patients .Include(x => x.LabReportUrl) .Include(x => x.MedicationUrl) .Include(x => x.MedicationHistoryUrl) - .WhereIf(!string.IsNullOrEmpty(input.Search), x => x.Patients.Name.ToLower().Contains(input.Search.ToLower())) + .WhereIf(!string.IsNullOrEmpty(input.Search), x => x.Patients.Name.ToLower().Contains(input.Search.ToLower()) || x.Patients.Email.Contains(input.Search)) .Where(x => x.Patients.Id == Id); var totalCount = await filteredQuery.CountAsync(); @@ -270,7 +270,7 @@ namespace HospitalManagementSystem.Patients if (!string.IsNullOrEmpty(input.Search)) { query = _patientRepository.GetQueryableAsync().Result - .Where(x => x.Name.ToLower().Contains(input.Search.ToLower())) + .Where(x => x.Name.ToLower().Contains(input.Search.ToLower()) || x.Email.Contains(input.Search)) .OrderBy(input.Sorting ?? (nameof(Patient.Id) + " asc")) .Skip(input.SkipCount) .Take(input.MaxResultCount)