From ba2f37030077e3b96f5e021a98e2eb8a183e975a Mon Sep 17 00:00:00 2001 From: Sk Shaifat Murshed Date: Tue, 4 Feb 2025 11:06:42 +0530 Subject: [PATCH] Added View Appointment,prime ng. --- angular/angular.json | 25 ++ angular/package-lock.json | 31 +++ angular/package.json | 3 + .../view-appointment.component.html | 203 ++++++++++++++- .../view-appointment.component.ts | 145 ++++++++++- .../view-appointment.module.ts | 32 ++- .../src/app/proxy/doctors/doctor.service.ts | 11 +- angular/src/app/proxy/dtos/models.ts | 17 +- .../src/app/proxy/enums/gender-enum.enum.ts | 9 - angular/src/app/proxy/enums/index.ts | 1 - angular/src/app/proxy/generate-proxy.json | 233 ++++++++++++++---- angular/src/app/proxy/index.ts | 3 +- .../proxy/volo/abp/domain/entities/models.ts | 2 +- 13 files changed, 637 insertions(+), 78 deletions(-) delete mode 100644 angular/src/app/proxy/enums/gender-enum.enum.ts delete mode 100644 angular/src/app/proxy/enums/index.ts diff --git a/angular/angular.json b/angular/angular.json index 10e8bad..d4b7ee0 100644 --- a/angular/angular.json +++ b/angular/angular.json @@ -30,6 +30,31 @@ "allowedCommonJsDependencies": ["chart.js", "js-sha256"], "assets": ["src/favicon.ico", "src/assets"], "styles": [ + { + "input": "node_modules/primeng/resources/themes/saga-blue/theme.css", + "inject": true, + "bundleName": "saga-blue" + }, + { + "input": "node_modules/primeflex/themes/primeone-dark.css", + "inject": true, + "bundleName": "primeone-dark" + }, + { + "input": "node_modules/primeng/resources/primeng.min.css", + "inject": true, + "bundleName": "primeng.min" + }, + { + "input": "node_modules/primeicons/primeicons.css", + "inject": true, + "bundleName": "primeicons" + }, + { + "input": "node_modules/primeflex/primeflex.min.css", + "inject": true, + "bundleName": "primeflex.min" + }, { "input": "node_modules/@volo/ngx-lepton-x.lite/assets/css/bootstrap-dim.css", "inject": false, diff --git a/angular/package-lock.json b/angular/package-lock.json index dafc023..c0a06b3 100644 --- a/angular/package-lock.json +++ b/angular/package-lock.json @@ -31,6 +31,9 @@ "@fullcalendar/daygrid": "^6.1.15", "@fullcalendar/interaction": "^6.1.15", "bootstrap-icons": "~1.8.0", + "primeflex": "^3.3.1", + "primeicons": "^6.0.1", + "primeng": "^17.18.0", "rxjs": "~7.8.0", "tslib": "^2.0.0", "zone.js": "~0.14.0" @@ -13070,6 +13073,34 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/primeflex": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/primeflex/-/primeflex-3.3.1.tgz", + "integrity": "sha512-zaOq3YvcOYytbAmKv3zYc+0VNS9Wg5d37dfxZnveKBFPr7vEIwfV5ydrpiouTft8MVW6qNjfkaQphHSnvgQbpQ==", + "license": "MIT" + }, + "node_modules/primeicons": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/primeicons/-/primeicons-6.0.1.tgz", + "integrity": "sha512-KDeO94CbWI4pKsPnYpA1FPjo79EsY9I+M8ywoPBSf9XMXoe/0crjbUK7jcQEDHuc0ZMRIZsxH3TYLv4TUtHmAA==", + "license": "MIT" + }, + "node_modules/primeng": { + "version": "17.18.0", + "resolved": "https://registry.npmjs.org/primeng/-/primeng-17.18.0.tgz", + "integrity": "sha512-EcvU/0Ex9QoBR6g6db9fDTCTAmzokW70TV5Oroy2gdvXRr3eqlflnOBoArQsmxTaw1oxSsu68YVj3RvcKYWhTg==", + "license": "MIT", + "dependencies": { + "tslib": "^2.3.0" + }, + "peerDependencies": { + "@angular/common": "^17.0.0 || ^18.0.0", + "@angular/core": "^17.0.0 || ^18.0.0", + "@angular/forms": "^17.0.0 || ^18.0.0", + "rxjs": "^6.0.0 || ^7.8.1", + "zone.js": "~0.14.0" + } + }, "node_modules/proc-log": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.2.0.tgz", diff --git a/angular/package.json b/angular/package.json index 83f334a..582b054 100644 --- a/angular/package.json +++ b/angular/package.json @@ -35,6 +35,9 @@ "@fullcalendar/daygrid": "^6.1.15", "@fullcalendar/interaction": "^6.1.15", "bootstrap-icons": "~1.8.0", + "primeflex": "^3.3.1", + "primeicons": "^6.0.1", + "primeng": "^17.18.0", "rxjs": "~7.8.0", "tslib": "^2.0.0", "zone.js": "~0.14.0" 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 f339693..be6879d 100644 --- a/angular/src/app/appointment/view-appointment/view-appointment.component.html +++ b/angular/src/app/appointment/view-appointment/view-appointment.component.html @@ -1 +1,202 @@ -

view-appointment works!

+
+ + + +
+ +

Appointment List

+ + +
+ + + + +
+ + +
+ +
+
+ + +
+ + + + Name + Doctor + Date + Time + Mobile No + Appointment Status + Visit Type + Actions + + + + + + {{ appointment.name }} + {{ appointment.doctor }} + {{ appointment.date | date }} + {{ appointment.time }} + {{ appointment.mobile }} + {{ appointment.status }} + {{ appointment.visitType }} + + + + + +
+
+ + + +
+
+ + +
+ + + + + + + First Name is required. + +
+ +
+ + + + + + + Last Name is required. + +
+ +
+ +
+ + + + + +
+
+ +
+ + + + + +
+ +
+ + + + + + + Valid email is required. + +
+
+ + +
+ +
+ + +
+ + +
+ + +
+ + +
+ + + + + +
+ + + + +
+ + + + + +
+ + +
+ + + + + +
+ + +
+ + + +
+ + + + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+
+
+
+ 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 ef53369..5ec24af 100644 --- a/angular/src/app/appointment/view-appointment/view-appointment.component.ts +++ b/angular/src/app/appointment/view-appointment/view-appointment.component.ts @@ -1,10 +1,153 @@ import { Component } from '@angular/core'; +import { DoctorService } from '@proxy/doctors'; @Component({ selector: 'app-view-appointment', templateUrl: './view-appointment.component.html', - styleUrl: './view-appointment.component.scss' + styleUrl: './view-appointment.component.scss', }) export class ViewAppointmentComponent { + totalRecords: number = 0; + AppointmentDialogTitle: string = ''; + AppointmentDialog: boolean = false; + patients: []; + isEditing = false; + appointmentDialog = false; + appointment = { + firstname: '', + lastname: '', + email: '', + gender: '', + date: '', + dob:'', + time: '', + mobile: '', + injury: '', + insuranceProvider: '', + notes: '', + doctor: '', + status: '', + visitType: '', + paymentStatus: '', + }; + appointments = [ + { + id: 1, + name: 'John 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, + name: 'Jane 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, + name: 'Mike Johnson', + doctor: 'Dr. Brown', + gender: 1, + date: new Date(), + time: '4:30 PM', + mobile: '1112223333', + email: 'mike@example.com', + status: 1, + visitType: 'Surgery', + }, + ]; + status = { 1: 'Scheduled', 2: 'Completed', 3: 'Canceled' }; + genders = [ + { label: 'Male', value: 'Male' }, + { label: 'Female', value: 'Female' }, + ]; + doctors = []; + doctorOptions = []; + appointmentStatuses = [ + { label: 'Scheduled', value: 'Scheduled' }, + { label: 'Completed', value: 'Completed' }, + ]; + visitTypes = [ + { label: 'Consultation', value: 'Consultation' }, + { label: 'Follow-up', value: 'Follow-up' }, + ]; + paymentStatuses = [ + { label: 'Pending', value: 'Pending' }, + { label: 'Paid', value: 'Paid' }, + ]; + + createPermission = true; + editPermission = true; + deletePermission = true; + constructor(private DoctorService: DoctorService) {} + + ngOnInit(): void { + this.getdoctorlist(); + } + + openNewAppointmentDialog() { + this.isEditing = false; + this.appointmentDialog = true; + this.appointment = { + firstname: '', + lastname: '', + email: '', + gender: '', + date: '', + dob:'', + time: '', + mobile: '', + injury: '', + insuranceProvider: '', + notes: '', + doctor: '', + status: '', + visitType: '', + paymentStatus: '', + }; + } + + exportAppointments() { + console.log('Exporting appointment data'); + } + + editAppointment(appointment: any) { + console.log('Editing appointment', appointment); + } + + deleteAppointment(id: number) { + console.log('Deleting appointment with ID', id); + } + saveAppointment() { + console.log(this.appointment); + this.appointmentDialog = false; + } + + closeDialog() { + this.appointmentDialog = false; + } + getdoctorlist() { + this.DoctorService.get().subscribe(result => { + debugger; + this.doctors = result; + // Create a formatted array for dropdown + this.doctorOptions = this.doctors.map(doctor => ({ + label: `${doctor.firstName} ${doctor.lastName}`, // Combine first and last name + value: doctor.id, // Use the ID as the value + })); + }); + } } diff --git a/angular/src/app/appointment/view-appointment/view-appointment.module.ts b/angular/src/app/appointment/view-appointment/view-appointment.module.ts index fadea4b..3505ed2 100644 --- a/angular/src/app/appointment/view-appointment/view-appointment.module.ts +++ b/angular/src/app/appointment/view-appointment/view-appointment.module.ts @@ -3,15 +3,33 @@ import { CommonModule } from '@angular/common'; import { ViewAppointmentRoutingModule } from './view-appointment-routing.module'; import { ViewAppointmentComponent } from './view-appointment.component'; - +import { TableModule } from 'primeng/table'; +import { DialogModule } from 'primeng/dialog'; +import { FormsModule } from '@angular/forms'; +import { ButtonModule } from 'primeng/button'; +import { CalendarModule } from 'primeng/calendar'; +import { DropdownModule } from 'primeng/dropdown'; +import { InputTextModule } from 'primeng/inputtext'; +import { RadioButtonModule } from 'primeng/radiobutton'; +import { DoctorService } from '@proxy/doctors'; @NgModule({ - declarations: [ - ViewAppointmentComponent - ], + declarations: [ViewAppointmentComponent], imports: [ CommonModule, - ViewAppointmentRoutingModule - ] + ViewAppointmentRoutingModule, + TableModule, + DialogModule, + FormsModule, + TableModule, + ButtonModule, + DialogModule, + InputTextModule, + CalendarModule, + DropdownModule, + RadioButtonModule, + + ], + providers:[DoctorService] }) -export class ViewAppointmentModule { } +export class ViewAppointmentModule {} diff --git a/angular/src/app/proxy/doctors/doctor.service.ts b/angular/src/app/proxy/doctors/doctor.service.ts index ea1efbb..8ffcb9c 100644 --- a/angular/src/app/proxy/doctors/doctor.service.ts +++ b/angular/src/app/proxy/doctors/doctor.service.ts @@ -1,6 +1,6 @@ import { RestService, Rest } from '@abp/ng.core'; import { Injectable } from '@angular/core'; -import type { DoctorDto } from '../dtos/models'; +import type { CreateDoctorDto, DoctorDto } from '../dtos/models'; @Injectable({ providedIn: 'root', @@ -9,6 +9,15 @@ export class DoctorService { apiName = 'Default'; + create = (input: CreateDoctorDto, config?: Partial) => + this.restService.request({ + method: 'POST', + url: '/api/app/doctor', + body: input, + }, + { apiName: this.apiName,...config }); + + get = (config?: Partial) => this.restService.request({ method: 'GET', diff --git a/angular/src/app/proxy/dtos/models.ts b/angular/src/app/proxy/dtos/models.ts index f96f907..57b9074 100644 --- a/angular/src/app/proxy/dtos/models.ts +++ b/angular/src/app/proxy/dtos/models.ts @@ -1,5 +1,4 @@ import type { FullAuditedEntity } from '../volo/abp/domain/entities/auditing/models'; -import type { GenderEnum } from '../enums/gender-enum.enum'; export interface CreateDepartmentDto { departmentNo?: string; @@ -9,6 +8,20 @@ export interface CreateDepartmentDto { description?: string; } +export interface CreateDoctorDto { + firstName?: string; + lastName?: string; + gender?: string; + mobile?: string; + password?: string; + designation?: string; + departmentId?: string; + address?: string; + email?: string; + dob?: string; + education?: string; +} + export interface DepartmentDto extends FullAuditedEntity { departmentNo?: string; departmentName?: string; @@ -21,7 +34,7 @@ export interface DepartmentDto extends FullAuditedEntity { export interface DoctorDto extends FullAuditedEntity { firstName?: string; lastName?: string; - gender?: GenderEnum; + gender?: string; mobile?: string; designation?: string; departmentId?: string; diff --git a/angular/src/app/proxy/enums/gender-enum.enum.ts b/angular/src/app/proxy/enums/gender-enum.enum.ts deleted file mode 100644 index 72858b2..0000000 --- a/angular/src/app/proxy/enums/gender-enum.enum.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { mapEnumToOptions } from '@abp/ng.core'; - -export enum GenderEnum { - Male = 0, - Female = 1, - Others = 2, -} - -export const genderEnumOptions = mapEnumToOptions(GenderEnum); diff --git a/angular/src/app/proxy/enums/index.ts b/angular/src/app/proxy/enums/index.ts deleted file mode 100644 index 5f7080a..0000000 --- a/angular/src/app/proxy/enums/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './gender-enum.enum'; diff --git a/angular/src/app/proxy/generate-proxy.json b/angular/src/app/proxy/generate-proxy.json index 474dc03..a78bac9 100644 --- a/angular/src/app/proxy/generate-proxy.json +++ b/angular/src/app/proxy/generate-proxy.json @@ -1047,6 +1047,43 @@ }, "allowAnonymous": null, "implementFrom": "HospitalManagementSystem.Doctors.IDoctorAppService" + }, + "CreateAsyncByInput": { + "uniqueName": "CreateAsyncByInput", + "name": "CreateAsync", + "httpMethod": "POST", + "url": "api/app/doctor", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "HospitalManagementSystem.Dtos.CreateDoctorDto, HospitalManagementSystem.Application", + "type": "HospitalManagementSystem.Dtos.CreateDoctorDto", + "typeSimple": "HospitalManagementSystem.Dtos.CreateDoctorDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "jsonName": null, + "type": "HospitalManagementSystem.Dtos.CreateDoctorDto", + "typeSimple": "HospitalManagementSystem.Dtos.CreateDoctorDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "HospitalManagementSystem.Dtos.DoctorDto", + "typeSimple": "HospitalManagementSystem.Dtos.DoctorDto" + }, + "allowAnonymous": null, + "implementFrom": "HospitalManagementSystem.Doctors.DoctorAppService" } } } @@ -3764,6 +3801,147 @@ } ] }, + "HospitalManagementSystem.Dtos.CreateDoctorDto": { + "baseType": null, + "isEnum": false, + "enumNames": null, + "enumValues": null, + "genericArguments": null, + "properties": [ + { + "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": "System.String", + "typeSimple": "string", + "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": "Password", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "Designation", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + }, + { + "name": "DepartmentId", + "jsonName": null, + "type": "System.Guid?", + "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": "Education", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isRequired": false, + "minLength": null, + "maxLength": null, + "minimum": null, + "maximum": null, + "regex": null + } + ] + }, "HospitalManagementSystem.Dtos.DepartmentDto": { "baseType": "Volo.Abp.Domain.Entities.Auditing.FullAuditedEntity", "isEnum": false, @@ -3879,8 +4057,8 @@ { "name": "Gender", "jsonName": null, - "type": "HospitalManagementSystem.Enums.GenderEnum?", - "typeSimple": "HospitalManagementSystem.Enums.GenderEnum?", + "type": "System.String", + "typeSimple": "string", "isRequired": false, "minLength": null, "maxLength": null, @@ -3974,57 +4152,6 @@ } ] }, - "HospitalManagementSystem.Enums.GenderEnum": { - "baseType": "System.Enum", - "isEnum": true, - "enumNames": [ - "Male", - "Female", - "Others" - ], - "enumValues": [ - 0, - 1, - 2 - ], - "genericArguments": null, - "properties": null - }, - "System.Nullable": { - "baseType": "System.ValueType", - "isEnum": false, - "enumNames": null, - "enumValues": null, - "genericArguments": [ - "T" - ], - "properties": [ - { - "name": "HasValue", - "jsonName": null, - "type": "System.Boolean", - "typeSimple": "boolean", - "isRequired": false, - "minLength": null, - "maxLength": null, - "minimum": null, - "maximum": null, - "regex": null - }, - { - "name": "Value", - "jsonName": null, - "type": "T", - "typeSimple": "T", - "isRequired": false, - "minLength": null, - "maxLength": null, - "minimum": null, - "maximum": null, - "regex": null - } - ] - }, "Volo.Abp.Account.ChangePasswordInput": { "baseType": null, "isEnum": false, diff --git a/angular/src/app/proxy/index.ts b/angular/src/app/proxy/index.ts index 388acf2..a881a96 100644 --- a/angular/src/app/proxy/index.ts +++ b/angular/src/app/proxy/index.ts @@ -2,6 +2,5 @@ import * as Appointments from './appointments'; import * as Departments from './departments'; import * as Doctors from './doctors'; import * as Dtos from './dtos'; -import * as Enums from './enums'; import * as Volo from './volo'; -export { Appointments, Departments, Doctors, Dtos, Enums, Volo }; +export { Appointments, Departments, Doctors, Dtos, Volo }; diff --git a/angular/src/app/proxy/volo/abp/domain/entities/models.ts b/angular/src/app/proxy/volo/abp/domain/entities/models.ts index 0de711e..bd62616 100644 --- a/angular/src/app/proxy/volo/abp/domain/entities/models.ts +++ b/angular/src/app/proxy/volo/abp/domain/entities/models.ts @@ -1,3 +1,3 @@ -export interface Entity { +export interface Entity { }