From a84ddd9f0384fb23d5a3941fab4062c7a21f4679 Mon Sep 17 00:00:00 2001 From: Sk Shaifat Murshed Date: Tue, 4 Feb 2025 19:04:22 +0530 Subject: [PATCH] View and add Appointment Fixes --- .../view-appointment.component.html | 65 +- .../view-appointment.component.ts | 187 +++--- .../all-patients/all-patients.component.ts | 4 +- .../patient-record.component.ts | 4 +- .../src/app/proxy/abp/application/index.ts | 2 + .../abp/application/services/dto/index.ts | 1 + .../abp/application/services/dto/models.ts | 8 + .../proxy/abp/application/services/index.ts | 2 + angular/src/app/proxy/abp/index.ts | 2 + .../src/app/proxy/appoinments/dto/index.ts | 1 + .../src/app/proxy/appoinments/dto/models.ts | 33 ++ angular/src/app/proxy/appoinments/index.ts | 2 + .../proxy/appointments/appointment.service.ts | 31 + angular/src/app/proxy/dto/models.ts | 2 +- angular/src/app/proxy/generate-proxy.json | 557 +++++++++++++++++- angular/src/app/proxy/index.ts | 4 +- angular/src/app/proxy/patients/dto/models.ts | 64 +- .../src/app/proxy/patients/patient.service.ts | 6 +- .../Appointments/AppointmentAppService.cs | 5 +- 19 files changed, 819 insertions(+), 161 deletions(-) create mode 100644 angular/src/app/proxy/abp/application/index.ts create mode 100644 angular/src/app/proxy/abp/application/services/dto/index.ts create mode 100644 angular/src/app/proxy/abp/application/services/dto/models.ts create mode 100644 angular/src/app/proxy/abp/application/services/index.ts create mode 100644 angular/src/app/proxy/abp/index.ts create mode 100644 angular/src/app/proxy/appoinments/dto/index.ts create mode 100644 angular/src/app/proxy/appoinments/dto/models.ts create mode 100644 angular/src/app/proxy/appoinments/index.ts diff --git a/angular/src/app/appointment/view-appointment/view-appointment.component.html b/angular/src/app/appointment/view-appointment/view-appointment.component.html index 500d51c..965d5f1 100644 --- a/angular/src/app/appointment/view-appointment/view-appointment.component.html +++ b/angular/src/app/appointment/view-appointment/view-appointment.component.html @@ -1,11 +1,8 @@
-
@@ -14,7 +11,7 @@
- +
- -
+ +
- Name + Name Doctor - Date - Time - Mobile No + gender + Date + Time + Mobile No + Email Appointment Status Visit Type Actions @@ -58,11 +61,13 @@ - {{ appointment.name }} + {{ appointment.firstName }} {{ appointment.lastName }} {{ appointment.doctor }} - {{ appointment.date | date }} - {{ appointment.time }} + + {{ appointment.dateOfAppointment | date }} + {{ appointment.timeOfAppointment }} {{ appointment.mobile }} + {{ appointment.email }} {{ appointment.status }} {{ appointment.visitType }} @@ -89,7 +94,7 @@ - +
@@ -98,7 +103,7 @@ - + @@ -117,15 +122,15 @@ - + - Enter a valid 10-digit mobile number + Mobile number Required
- +
@@ -133,9 +138,9 @@ - + - Enter a valid email address + Email address Required
@@ -148,20 +153,20 @@
- +
- +
- +
@@ -171,7 +176,7 @@ - +
- +
diff --git a/angular/src/app/appointment/view-appointment/view-appointment.component.ts b/angular/src/app/appointment/view-appointment/view-appointment.component.ts index c5881ff..9592289 100644 --- a/angular/src/app/appointment/view-appointment/view-appointment.component.ts +++ b/angular/src/app/appointment/view-appointment/view-appointment.component.ts @@ -1,6 +1,11 @@ +import { ConfirmationService, ToasterService } from '@abp/ng.theme.shared'; +import { HttpClient } from '@angular/common/http'; import { Component } from '@angular/core'; import { NgForm } from '@angular/forms'; +import { AppointmentDto } from '@proxy/appoinments/dto'; +import { AppointmentService } from '@proxy/appointments'; import { DoctorService } from '@proxy/doctors'; +import { PagingSortResultDto } from '@proxy/dto'; import { Gender } from '@proxy/global-enum'; @Component({ @@ -17,69 +22,28 @@ export class ViewAppointmentComponent { appointmentDialog = false; genders = Gender; isEditMode: boolean = false; + loading: boolean = false; + params: PagingSortResultDto; - appointment = { - firstname: '', - lastname: '', + appointment: AppointmentDto = { + id: '', + firstName: '', + lastName: '', email: '', gender: Gender.Male, - date: '', - dob:'', - time: '', mobile: '', - injury: '', - insuranceProvider: '', - notes: '', - doctor: '', - status: '', - visitType: '', - paymentStatus: '', - Address:'' + address: '', + dob: '', + doctorId: '', + dateOfAppointment: '', + timeOfAppointment: '', + injuryORContion: '', + note: '', }; - appointments = [ - { - id: 1, - firstname: 'John', - lastname: 'Doe', - doctor: 'Dr. Smith', - gender: 1, - date: new Date(), - time: '10:00 AM', - mobile: '1234567890', - email: 'john@example.com', - status: 1, - visitType: 'Consultation', - }, - { - id: 2, - firstname: 'Jane', - lastname: 'Smith', - doctor: 'Dr. Johnson', - gender: 0, - date: new Date(), - time: '2:00 PM', - mobile: '0987654321', - email: 'jane@example.com', - status: 2, - visitType: 'Follow-up', - }, - { - id: 3, - firstname: 'Mike', - lastname: 'Johnson', - doctor: 'Dr. Brown', - gender: 1, - date: new Date(), - time: '4:30 PM', - mobile: '1112223333', - email: 'mike@example.com', - status: 1, - visitType: 'Surgery', - }, - ]; + + appointments = []; // status = { 1: 'Scheduled', 2: 'Completed', 3: 'Canceled' }; - - + doctors = []; doctorOptions = []; appointmentStatuses = [ @@ -100,32 +64,59 @@ export class ViewAppointmentComponent { createPermission = true; editPermission = true; deletePermission = true; - constructor(private DoctorService: DoctorService) {} + constructor( + private DoctorService: DoctorService, + private AppointmentService: AppointmentService, + private http: HttpClient, + private confirmation: ConfirmationService, + private toaster: ToasterService + ) {} ngOnInit(): void { this.getdoctorlist(); - } + this.loadappointments({ + first: 0, + rows: 10, + sortField: 'id', + sortOrder: 1, + globalFilter: null, + }); + } + loadappointments(event: any) { + this.loading = true; + let order = event.sortOrder == 1 ? ' asc' : ' desc'; + event.sortField = event.sortField == undefined ? 'id' : event.sortField; + this.params = { + skipCount: event.first, + maxResultCount: event.rows, + sorting: event.sortField + order, + search: event.globalFilter == null ? '' : event.globalFilter, + }; + + this.AppointmentService.getAppointmentList(this.params).subscribe(data => { + this.appointments = data.items; + debugger + this.totalRecords = data.totalCount; + this.loading = false; + }); + } openNewAppointmentDialog() { this.isEditing = false; this.appointmentDialog = true; this.appointment = { - firstname: '', - lastname: '', + firstName: '', + lastName: '', email: '', gender: Gender.Male, - date: '', - dob:'', - time: '', + dateOfAppointment: '', + dob: '', + timeOfAppointment: '', mobile: '', - injury: '', - insuranceProvider: '', - notes: '', - doctor: '', - status: '', - visitType: '', - paymentStatus: '', - Address:'' + injuryORContion: '', + note: '', + doctorId: '', + address: '', }; } @@ -141,14 +132,50 @@ export class ViewAppointmentComponent { console.log('Deleting appointment with ID', id); } saveAppointment(form: NgForm) { - debugger - console.log(form.controls); - if (form.invalid) { - Object.values(form.controls).forEach(control => control.markAsTouched()); - return; - } - - } + debugger; + console.log(form.controls); + if (form.invalid) { + Object.values(form.controls).forEach(control => control.markAsTouched()); + return; + } + if (this.isEditMode) { + this.AppointmentService.createAppointment(this.appointment).subscribe( + () => { + this.toaster.success('Appointment updated successfully', 'Success'); + this.AppointmentDialog = false; + // this.loadPatient({ + // first: 0, + // rows: 10, + // sortField: 'id', + // sortOrder: 1, + // globalFilter: null, + // }); + }, + error => { + console.log(error); + this.closeDialog(); + } + ); + } else { + this.AppointmentService.createAppointment(this.appointment).subscribe( + () => { + this.toaster.success('Appointment created successfully', 'Success'); + this.AppointmentDialog = false; + // this.loadPatient({ + // first: 0, + // rows: 10, + // sortField: 'id', + // sortOrder: 1, + // globalFilter: null, + // }); + }, + error => { + console.log(error); + this.closeDialog(); + } + ); + } + } closeDialog() { this.appointmentDialog = false; 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 b9cbffb..ad9ba7d 100644 --- a/angular/src/app/patients/all-patients/all-patients.component.ts +++ b/angular/src/app/patients/all-patients/all-patients.component.ts @@ -4,7 +4,7 @@ import { HttpClient } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; import { NgForm } from '@angular/forms'; import { Router } from '@angular/router'; -import { PagingSortPatientResultDto } from '@proxy/dto'; +import { PagingSortResultDto } from '@proxy/dto'; import { Gender, Status } from '@proxy/global-enum'; import { PatientService } from '@proxy/patients'; import { PatientDto, CreateUpdatePatientDto } from '@proxy/patients/dto'; @@ -24,7 +24,7 @@ export class AllPatientsComponent implements OnInit { selectedPatient: CreateUpdatePatientDto; isEditMode: boolean = false; patientDialogTitle: string = ''; - params: PagingSortPatientResultDto; + params: PagingSortResultDto; status: any; gender: any; statuslist: any; 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 49358ae..d9e488c 100644 --- a/angular/src/app/patients/patient-record/patient-record.component.ts +++ b/angular/src/app/patients/patient-record/patient-record.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { NgForm } from '@angular/forms'; -import { PagingSortPatientResultDto } from '@proxy/dto'; +import { PagingSortResultDto } from '@proxy/dto'; import { Gender, Status } from '@proxy/global-enum'; import { PatientService } from '@proxy/patients'; import { CreateUpdatePatientRecordDto, PatientDto, PatientRecordDto } from '@proxy/patients/dto'; @@ -25,7 +25,7 @@ export class PatientRecordComponent implements OnInit { patientdto: PatientDto; isEditMode: boolean = false; patientDialogTitle: string = ''; - params: PagingSortPatientResultDto; + params: PagingSortResultDto; status: any; gender: any; statuslist: any; diff --git a/angular/src/app/proxy/abp/application/index.ts b/angular/src/app/proxy/abp/application/index.ts new file mode 100644 index 0000000..5a55278 --- /dev/null +++ b/angular/src/app/proxy/abp/application/index.ts @@ -0,0 +1,2 @@ +import * as Services from './services'; +export { Services }; diff --git a/angular/src/app/proxy/abp/application/services/dto/index.ts b/angular/src/app/proxy/abp/application/services/dto/index.ts new file mode 100644 index 0000000..e9644da --- /dev/null +++ b/angular/src/app/proxy/abp/application/services/dto/index.ts @@ -0,0 +1 @@ +export * from './models'; diff --git a/angular/src/app/proxy/abp/application/services/dto/models.ts b/angular/src/app/proxy/abp/application/services/dto/models.ts new file mode 100644 index 0000000..eb7f937 --- /dev/null +++ b/angular/src/app/proxy/abp/application/services/dto/models.ts @@ -0,0 +1,8 @@ + +export interface ListResultDto { + items: T[]; +} + +export interface PagedResultDto extends ListResultDto { + totalCount: number; +} diff --git a/angular/src/app/proxy/abp/application/services/index.ts b/angular/src/app/proxy/abp/application/services/index.ts new file mode 100644 index 0000000..8b5f6ac --- /dev/null +++ b/angular/src/app/proxy/abp/application/services/index.ts @@ -0,0 +1,2 @@ +import * as Dto from './dto'; +export { Dto }; diff --git a/angular/src/app/proxy/abp/index.ts b/angular/src/app/proxy/abp/index.ts new file mode 100644 index 0000000..1ee7c8f --- /dev/null +++ b/angular/src/app/proxy/abp/index.ts @@ -0,0 +1,2 @@ +import * as Application from './application'; +export { Application }; diff --git a/angular/src/app/proxy/appoinments/dto/index.ts b/angular/src/app/proxy/appoinments/dto/index.ts new file mode 100644 index 0000000..e9644da --- /dev/null +++ b/angular/src/app/proxy/appoinments/dto/index.ts @@ -0,0 +1 @@ +export * from './models'; diff --git a/angular/src/app/proxy/appoinments/dto/models.ts b/angular/src/app/proxy/appoinments/dto/models.ts new file mode 100644 index 0000000..d34ae49 --- /dev/null +++ b/angular/src/app/proxy/appoinments/dto/models.ts @@ -0,0 +1,33 @@ +import type { Gender } from '../../global-enum/gender.enum'; + +export interface AppointmentDto { + id?: string; + firstName?: string; + lastName?: string; + gender: Gender; + mobile?: string; + address?: string; + email?: string; + dob?: string; + doctorId?: string; + dateOfAppointment?: string; + timeOfAppointment?: string; + injuryORContion?: string; + note?: string; +} + +export interface CreateOrUpdateAppointmentDto { + id?: string; + firstName?: string; + lastName?: string; + gender: Gender; + mobile?: string; + address?: string; + email?: string; + dob?: string; + doctorId?: string; + dateOfAppointment?: string; + timeOfAppointment?: string; + injuryORContion?: string; + note?: string; +} diff --git a/angular/src/app/proxy/appoinments/index.ts b/angular/src/app/proxy/appoinments/index.ts new file mode 100644 index 0000000..8b5f6ac --- /dev/null +++ b/angular/src/app/proxy/appoinments/index.ts @@ -0,0 +1,2 @@ +import * as Dto from './dto'; +export { Dto }; diff --git a/angular/src/app/proxy/appointments/appointment.service.ts b/angular/src/app/proxy/appointments/appointment.service.ts index ad53fe4..617804a 100644 --- a/angular/src/app/proxy/appointments/appointment.service.ts +++ b/angular/src/app/proxy/appointments/appointment.service.ts @@ -1,5 +1,9 @@ import { RestService, Rest } from '@abp/ng.core'; import { Injectable } from '@angular/core'; +import type { PagedResultDto } from '../abp/application/services/dto/models'; +import type { AppointmentDto, CreateOrUpdateAppointmentDto } from '../appoinments/dto/models'; +import type { PagingSortResultDto } from '../dto/models'; +import type { PatientRecordDto } from '../patients/dto/models'; @Injectable({ providedIn: 'root', @@ -8,6 +12,15 @@ export class AppointmentService { apiName = 'Default'; + createAppointment = (input: CreateOrUpdateAppointmentDto, config?: Partial) => + this.restService.request({ + method: 'POST', + url: '/api/app/appointment/appointment', + body: input, + }, + { apiName: this.apiName,...config }); + + get = (config?: Partial) => this.restService.request({ method: 'GET', @@ -15,6 +28,24 @@ export class AppointmentService { url: '/api/app/appointment', }, { apiName: this.apiName,...config }); + + + getAppointmentList = (input: PagingSortResultDto, config?: Partial) => + this.restService.request>({ + method: 'GET', + url: '/api/app/appointment/appointment-list', + params: { search: input.search, sorting: input.sorting, skipCount: input.skipCount, maxResultCount: input.maxResultCount }, + }, + { apiName: this.apiName,...config }); + + + updateAppointment = (id: string, input: CreateOrUpdateAppointmentDto, config?: Partial) => + this.restService.request({ + method: 'PUT', + url: `/api/app/appointment/${id}/appointment`, + body: input, + }, + { apiName: this.apiName,...config }); constructor(private restService: RestService) {} } diff --git a/angular/src/app/proxy/dto/models.ts b/angular/src/app/proxy/dto/models.ts index aaaaf4d..afb2568 100644 --- a/angular/src/app/proxy/dto/models.ts +++ b/angular/src/app/proxy/dto/models.ts @@ -10,6 +10,6 @@ export interface FileDownloadDto { fileContent?: string; } -export interface PagingSortPatientResultDto extends PagedAndSortedResultRequestDto { +export interface PagingSortResultDto extends PagedAndSortedResultRequestDto { search?: string; } diff --git a/angular/src/app/proxy/generate-proxy.json b/angular/src/app/proxy/generate-proxy.json index 45d3f24..56e8925 100644 --- a/angular/src/app/proxy/generate-proxy.json +++ b/angular/src/app/proxy/generate-proxy.json @@ -911,6 +911,173 @@ }, "allowAnonymous": null, "implementFrom": "HospitalManagementSystem.Appointments.IAppointmentAppService" + }, + "GetAppointmentListAsyncByInput": { + "uniqueName": "GetAppointmentListAsyncByInput", + "name": "GetAppointmentListAsync", + "httpMethod": "GET", + "url": "api/app/appointment/appointment-list", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "HospitalManagementSystem.Dto.PagingSortResultDto, HospitalManagementSystem.Domain.Shared", + "type": "HospitalManagementSystem.Dto.PagingSortResultDto", + "typeSimple": "HospitalManagementSystem.Dto.PagingSortResultDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Search", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Sorting", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "SkipCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "MaxResultCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "Abp.Application.Services.Dto.PagedResultDto", + "typeSimple": "Abp.Application.Services.Dto.PagedResultDto" + }, + "allowAnonymous": null, + "implementFrom": "HospitalManagementSystem.Appointments.AppointmentAppService" + }, + "CreateAppointmentAsyncByInput": { + "uniqueName": "CreateAppointmentAsyncByInput", + "name": "CreateAppointmentAsync", + "httpMethod": "POST", + "url": "api/app/appointment/appointment", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "HospitalManagementSystem.Appoinments.Dto.CreateOrUpdateAppointmentDto, HospitalManagementSystem.Application.Contracts", + "type": "HospitalManagementSystem.Appoinments.Dto.CreateOrUpdateAppointmentDto", + "typeSimple": "HospitalManagementSystem.Appoinments.Dto.CreateOrUpdateAppointmentDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "jsonName": null, + "type": "HospitalManagementSystem.Appoinments.Dto.CreateOrUpdateAppointmentDto", + "typeSimple": "HospitalManagementSystem.Appoinments.Dto.CreateOrUpdateAppointmentDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "HospitalManagementSystem.Appoinments.Dto.AppointmentDto", + "typeSimple": "HospitalManagementSystem.Appoinments.Dto.AppointmentDto" + }, + "allowAnonymous": null, + "implementFrom": "HospitalManagementSystem.Appointments.AppointmentAppService" + }, + "UpdateAppointmentAsyncByIdAndInput": { + "uniqueName": "UpdateAppointmentAsyncByIdAndInput", + "name": "UpdateAppointmentAsync", + "httpMethod": "PUT", + "url": "api/app/appointment/{id}/appointment", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "HospitalManagementSystem.Appoinments.Dto.CreateOrUpdateAppointmentDto, HospitalManagementSystem.Application.Contracts", + "type": "HospitalManagementSystem.Appoinments.Dto.CreateOrUpdateAppointmentDto", + "typeSimple": "HospitalManagementSystem.Appoinments.Dto.CreateOrUpdateAppointmentDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "jsonName": null, + "type": "HospitalManagementSystem.Appoinments.Dto.CreateOrUpdateAppointmentDto", + "typeSimple": "HospitalManagementSystem.Appoinments.Dto.CreateOrUpdateAppointmentDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "HospitalManagementSystem.Patients.Dto.PatientRecordDto", + "typeSimple": "HospitalManagementSystem.Patients.Dto.PatientRecordDto" + }, + "allowAnonymous": null, + "implementFrom": "HospitalManagementSystem.Appointments.AppointmentAppService" } } }, @@ -1105,9 +1272,9 @@ "parametersOnMethod": [ { "name": "input", - "typeAsString": "HospitalManagementSystem.Dto.PagingSortPatientResultDto, HospitalManagementSystem.Domain.Shared", - "type": "HospitalManagementSystem.Dto.PagingSortPatientResultDto", - "typeSimple": "HospitalManagementSystem.Dto.PagingSortPatientResultDto", + "typeAsString": "HospitalManagementSystem.Dto.PagingSortResultDto, HospitalManagementSystem.Domain.Shared", + "type": "HospitalManagementSystem.Dto.PagingSortResultDto", + "typeSimple": "HospitalManagementSystem.Dto.PagingSortResultDto", "isOptional": false, "defaultValue": null }, @@ -1381,9 +1548,9 @@ "parametersOnMethod": [ { "name": "input", - "typeAsString": "HospitalManagementSystem.Dto.PagingSortPatientResultDto, HospitalManagementSystem.Domain.Shared", - "type": "HospitalManagementSystem.Dto.PagingSortPatientResultDto", - "typeSimple": "HospitalManagementSystem.Dto.PagingSortPatientResultDto", + "typeAsString": "HospitalManagementSystem.Dto.PagingSortResultDto, HospitalManagementSystem.Domain.Shared", + "type": "HospitalManagementSystem.Dto.PagingSortResultDto", + "typeSimple": "HospitalManagementSystem.Dto.PagingSortResultDto", "isOptional": false, "defaultValue": null } @@ -4424,6 +4591,382 @@ } }, "types": { + "Abp.Application.Services.Dto.ListResultDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": [ + "T" + ], + "properties": [ + { + "name": "Items", + "jsonName": null, + "type": "[T]", + "typeSimple": "[T]", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + } + ] + }, + "Abp.Application.Services.Dto.PagedResultDto": { + "baseType": "Abp.Application.Services.Dto.ListResultDto", + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": [ + "T" + ], + "properties": [ + { + "name": "TotalCount", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + } + ] + }, + "HospitalManagementSystem.Appoinments.Dto.AppointmentDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Id", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "FirstName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "LastName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "Gender", + "jsonName": null, + "type": "HospitalManagementSystem.GlobalEnum.Gender", + "typeSimple": "HospitalManagementSystem.GlobalEnum.Gender", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "Mobile", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "Address", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "Email", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "DOB", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "DoctorId", + "jsonName": null, + "type": "System.Guid?", + "typeSimple": "string?", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "DateOfAppointment", + "jsonName": null, + "type": "System.DateTime?", + "typeSimple": "string?", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "TimeOfAppointment", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "InjuryORContion", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "Note", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + } + ] + }, + "HospitalManagementSystem.Appoinments.Dto.CreateOrUpdateAppointmentDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "name": "Id", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "FirstName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "LastName", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "Gender", + "jsonName": null, + "type": "HospitalManagementSystem.GlobalEnum.Gender", + "typeSimple": "HospitalManagementSystem.GlobalEnum.Gender", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "Mobile", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "Address", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "Email", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "DOB", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "DoctorId", + "jsonName": null, + "type": "System.Guid?", + "typeSimple": "string?", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "DateOfAppointment", + "jsonName": null, + "type": "System.DateTime?", + "typeSimple": "string?", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "TimeOfAppointment", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "InjuryORContion", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "Note", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + } + ] + }, "HospitalManagementSystem.Documents.EntityDocument": { "baseType": "Volo.Abp.Domain.Entities.Auditing.AuditedAggregateRoot", "isEnum": false, @@ -4583,7 +5126,7 @@ } ] }, - "HospitalManagementSystem.Dto.PagingSortPatientResultDto": { + "HospitalManagementSystem.Dto.PagingSortResultDto": { "baseType": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", "isEnum": false, "enumNames": null, diff --git a/angular/src/app/proxy/index.ts b/angular/src/app/proxy/index.ts index ea1a4ef..e87af84 100644 --- a/angular/src/app/proxy/index.ts +++ b/angular/src/app/proxy/index.ts @@ -1,3 +1,5 @@ +import * as Abp from './abp'; +import * as Appoinments from './appoinments'; import * as Appointments from './appointments'; import * as Departments from './departments'; import * as Doctors from './doctors'; @@ -7,4 +9,4 @@ import * as Dtos from './dtos'; import * as GlobalEnum from './global-enum'; import * as Patients from './patients'; import * as Volo from './volo'; -export { Appointments, Departments, Doctors, Documents, Dto, Dtos, GlobalEnum, Patients, Volo }; +export { Abp, Appoinments, Appointments, Departments, Doctors, Documents, Dto, Dtos, GlobalEnum, Patients, Volo }; diff --git a/angular/src/app/proxy/patients/dto/models.ts b/angular/src/app/proxy/patients/dto/models.ts index 1ce7102..46e0dd7 100644 --- a/angular/src/app/proxy/patients/dto/models.ts +++ b/angular/src/app/proxy/patients/dto/models.ts @@ -1,38 +1,6 @@ import type { Gender } from '../../global-enum/gender.enum'; import type { Status } from '../../global-enum/status.enum'; -export interface CreateUpdatePatientDto { - id?: string; - name?: string; - gender: Gender; - mobile?: string; - email?: string; - age: number; - treatment?: string; - doctorAssigned?: string; - address?: string; - bloodGroup?: string; - admissionDate?: string; - dischargeDate?: string; - status: Status; - imageID?: string; -} - -export interface CreateUpdatePatientRecordDto { - id?: string; - patientId?: string; - dateOfAdmission?: string; - labReportUrlID?: string; - medicationUrlID?: string; - medicationHistoryUrlID?: string; - nextFollowUp?: string; - diagnosis?: string; - treatmentPlan?: string; - doctorNotes?: string; - insuranceProvider?: string; - status: Status; -} - export interface PatientDto { id?: string; name?: string; @@ -65,3 +33,35 @@ export interface PatientRecordDto { insuranceProvider?: string; status: Status; } + +export interface CreateUpdatePatientDto { + id?: string; + name?: string; + gender: Gender; + mobile?: string; + email?: string; + age: number; + treatment?: string; + doctorAssigned?: string; + address?: string; + bloodGroup?: string; + admissionDate?: string; + dischargeDate?: string; + status: Status; + imageID?: string; +} + +export interface CreateUpdatePatientRecordDto { + id?: string; + patientId?: string; + dateOfAdmission?: string; + labReportUrlID?: string; + medicationUrlID?: string; + medicationHistoryUrlID?: string; + nextFollowUp?: string; + diagnosis?: string; + treatmentPlan?: string; + doctorNotes?: string; + insuranceProvider?: string; + status: Status; +} diff --git a/angular/src/app/proxy/patients/patient.service.ts b/angular/src/app/proxy/patients/patient.service.ts index 76b2462..4d79776 100644 --- a/angular/src/app/proxy/patients/patient.service.ts +++ b/angular/src/app/proxy/patients/patient.service.ts @@ -4,7 +4,7 @@ import { RestService, Rest } from '@abp/ng.core'; import type { PagedResultDto } from '@abp/ng.core'; import { Injectable } from '@angular/core'; import type { EntityDocument } from '../documents/models'; -import type { DropDownItems, FileDownloadDto, PagingSortPatientResultDto } from '../dto/models'; +import type { DropDownItems, FileDownloadDto, PagingSortResultDto } from '../dto/models'; @Injectable({ providedIn: 'root', @@ -71,7 +71,7 @@ export class PatientService { { apiName: this.apiName,...config }); - getPatientList = (input: PagingSortPatientResultDto, config?: Partial) => + getPatientList = (input: PagingSortResultDto, config?: Partial) => this.restService.request>({ method: 'GET', url: '/api/app/patient/patient-list', @@ -88,7 +88,7 @@ export class PatientService { { apiName: this.apiName,...config }); - getPatientRecordList = (input: PagingSortPatientResultDto, Id: string, config?: Partial) => + getPatientRecordList = (input: PagingSortResultDto, Id: string, config?: Partial) => this.restService.request>({ method: 'GET', url: `/api/app/patient/patient-record-list/${Id}`, diff --git a/aspnet-core/src/HospitalManagementSystem.Application/Appointments/AppointmentAppService.cs b/aspnet-core/src/HospitalManagementSystem.Application/Appointments/AppointmentAppService.cs index 412494c..110b5d9 100644 --- a/aspnet-core/src/HospitalManagementSystem.Application/Appointments/AppointmentAppService.cs +++ b/aspnet-core/src/HospitalManagementSystem.Application/Appointments/AppointmentAppService.cs @@ -39,13 +39,12 @@ namespace HospitalManagementSystem.Appointments return _currentUser.Name + " checking done."; } #region Get Patient List with Paging and Searching - public async Task> GetAppointmentListAsync(PagingSortResultDto input, Guid Id) + public async Task> GetAppointmentListAsync(PagingSortResultDto input) { var queryable = await _appointmentsRepository.GetQueryableAsync(); var filteredQuery = queryable - .WhereIf(!string.IsNullOrEmpty(input.Search), x => x.FirstName.ToLower().Contains(input.Search.ToLower()) || x.LastName.ToLower().Contains(input.Search.ToLower())) - .Where(x => x.Id == Id); + .WhereIf(!string.IsNullOrEmpty(input.Search), x => x.FirstName.ToLower().Contains(input.Search.ToLower()) || x.LastName.ToLower().Contains(input.Search.ToLower())); var totalCount = await filteredQuery.CountAsync();