Compare commits

...

3 Commits

19 changed files with 830 additions and 166 deletions

View File

@ -1,11 +1,8 @@
<div> <div>
<p-table <p-table #dt2 dataKey="id" [value]="appointments" [paginator]="true" [rows]="10" [totalRecords]="totalRecords"
#dt2 [lazy]="true" (onLazyLoad)="loadappointments($event)" [rowsPerPageOptions]="[10, 20, 50]"
dataKey="id" [responsiveLayout]="'scroll'" [globalFilterFields]="['id', 'name', 'status']"
[value]="appointments" [filters]="{ global: { value: '', matchMode: 'contains' } }" class="table table-striped"
[paginator]="true"
[rows]="10"
[rowsPerPageOptions]="[10, 20, 50]"
> >
<ng-template pTemplate="caption"> <ng-template pTemplate="caption">
<div class="flex align-items-center justify-content-between mb-3 gap-3"> <div class="flex align-items-center justify-content-between mb-3 gap-3">
@ -14,7 +11,7 @@
<!-- Center: Search Bar with Icon Inside --> <!-- Center: Search Bar with Icon Inside -->
<div class="flex-grow-1 flex justify-content-center"> <div class="flex-grow-1 flex justify-content-center">
<span class="p-input-icon-left w-50"> <span class="p-input-icon-left w-100">
<i class="pi pi-search"></i> <i class="pi pi-search"></i>
<input <input
pInputText pInputText
@ -26,30 +23,36 @@
/> />
</span> </span>
</div> </div>
<!-- Right: Add Button -->
<div> <div>
<button pButton class="p-button-rounded p-button-secondary ml-2" (click)="loadappointments($event)">
<i class="pi pi-refresh"></i>
</button>
<button <button
*ngIf="createPermission" *ngIf="createPermission"
pButton pButton
class="p-button-rounded p-button-success" class="p-button-rounded p-button-success ml-2"
(click)="openNewAppointmentDialog()" (click)="openNewAppointmentDialog()"
pTooltip="Add Appointment" pTooltip="Add Appointment"
tooltipPosition="left" tooltipPosition="left"
> >
<i class="pi pi-plus-circle"></i> <i class="pi pi-plus-circle"></i>
</button> </button>
<button pButton class="p-button-rounded p-button-warning ml-2" (click)="exportPatient()">
<i class="pi pi-download"></i>
</button>
</div> </div>
</div> </div>
</ng-template> </ng-template>
<ng-template pTemplate="header"> <ng-template pTemplate="header">
<tr> <tr>
<th pSortableColumn="name">Name <p-sortIcon field="name" /></th> <th pSortableColumn="firstName">Name <p-sortIcon field="firstName" /></th>
<th pSortableColumn="doctor">Doctor <p-sortIcon field="doctor" /></th> <th pSortableColumn="doctor">Doctor <p-sortIcon field="doctor" /></th>
<th pSortableColumn="date">Date <p-sortIcon field="date" /></th> <th pSortableColumn="gender">gender <p-sortIcon field="gender" /></th>
<th pSortableColumn="Time">Time<p-sortIcon field="Time" /></th> <th pSortableColumn="dateOfAppointment">Date <p-sortIcon field="dateOfAppointment" /></th>
<th pSortableColumn="mobile">Mobile No<p-sortIcon field="mobile" /></th> <th pSortableColumn="timeOfAppointment">Time<p-sortIcon field="timeOfAppointment" /></th>
<th>Mobile No</th>
<th>Email</th>
<th pSortableColumn="status">Appointment Status<p-sortIcon field="status" /></th> <th pSortableColumn="status">Appointment Status<p-sortIcon field="status" /></th>
<th pSortableColumn="visitType">Visit Type<p-sortIcon field="visitType" /></th> <th pSortableColumn="visitType">Visit Type<p-sortIcon field="visitType" /></th>
<th>Actions</th> <th>Actions</th>
@ -58,11 +61,13 @@
<ng-template pTemplate="body" let-appointment> <ng-template pTemplate="body" let-appointment>
<tr> <tr>
<td>{{ appointment.name }}</td> <td>{{ appointment.firstName }} {{ appointment.lastName }}</td>
<td>{{ appointment.doctor }}</td> <td>{{ appointment.doctor }}</td>
<td>{{ appointment.date | date }}</td> <td></td>
<td>{{ appointment.time }}</td> <td>{{ appointment.dateOfAppointment | date }}</td>
<td><i class="pi pi-clock"></i> {{ appointment.timeOfAppointment }}</td>
<td>{{ appointment.mobile }}</td> <td>{{ appointment.mobile }}</td>
<td>{{ appointment.email }}</td>
<td>{{ appointment.status }}</td> <td>{{ appointment.status }}</td>
<td>{{ appointment.visitType }}</td> <td>{{ appointment.visitType }}</td>
<td> <td>
@ -89,7 +94,7 @@
<label for="fname">First Name</label> <label for="fname">First Name</label>
<span class="p-input-icon-left"> <span class="p-input-icon-left">
<i class="pi pi-user"></i> <i class="pi pi-user"></i>
<input pInputText id="fname" name="fname" [(ngModel)]="appointment.firstname" required /> <input pInputText id="fname" name="fname" [(ngModel)]="appointment.firstName" required />
</span> </span>
</div> </div>
<div class="field col-md-1"></div> <div class="field col-md-1"></div>
@ -98,16 +103,16 @@
<label for="lname">Last Name</label> <label for="lname">Last Name</label>
<span class="p-input-icon-left"> <span class="p-input-icon-left">
<i class="pi pi-user"></i> <i class="pi pi-user"></i>
<input pInputText id="lname" name="lname" [(ngModel)]="appointment.lastname" required /> <input pInputText id="lname" name="lname" [(ngModel)]="appointment.lastName" required />
</span> </span>
</div> </div>
<div class="field col-md-5"> <div class="field col-md-5">
<label>Gender</label> <label>Gender</label>
<div class="flex align-items-center"> <div class="flex align-items-center">
<p-radioButton name="gender" value="Male" [(ngModel)]="appointment.gender" inputId="male" required></p-radioButton> <p-radioButton name="gender" value="1" [(ngModel)]="appointment.gender" inputId="male" required></p-radioButton>
<label for="male" class="ml-2 mr-3">Male</label> <label for="male" class="ml-2 mr-3">Male</label>
<p-radioButton name="gender" value="Female" [(ngModel)]="appointment.gender" inputId="female" required></p-radioButton> <p-radioButton name="gender" value="2" [(ngModel)]="appointment.gender" inputId="female" required></p-radioButton>
<label for="female" class="ml-2">Female</label> <label for="female" class="ml-2">Female</label>
</div> </div>
</div> </div>
@ -119,53 +124,59 @@
<i class="pi pi-phone"></i> <i class="pi pi-phone"></i>
<input pInputText id="mobile" name="mobile" [(ngModel)]="appointment.mobile" required /> <input pInputText id="mobile" name="mobile" [(ngModel)]="appointment.mobile" required />
</span> </span>
<small class="p-error" *ngIf="appointmentForm.controls.mobile?.invalid && appointmentForm.controls.mobile?.touched">Mobile number Required</small>
</div> </div>
<div class="field col-md-11"> <div class="field col-md-11">
<label for="mobile">Address</label> <label for="mobile">Address</label>
<span class="p-input-icon-left"> <span class="p-input-icon-left">
<i class="pi pi-map-marker"></i> <i class="pi pi-map-marker"></i>
<input pInputText id="Address" name="Address" [(ngModel)]="appointment.Address" required /> <input pInputText id="Address" name="Address" [(ngModel)]="appointment.address" required />
</span> </span>
</div> </div>
<div class="field col-md-5"> <div class="field col-md-5">
<label for="email">Email ID</label> <label for="email">Email ID</label>
<span class="p-input-icon-left"> <span class="p-input-icon-left">
<i class="pi pi-envelope"></i> <i class="pi pi-envelope"></i>
<input pInputText id="email" name="email" [(ngModel)]="appointment.email" required email /> <input pInputText id="email" name="email" [(ngModel)]="appointment.email" required/>
</span> </span>
<small class="p-error" *ngIf="appointmentForm.controls.email?.invalid && appointmentForm.controls.email?.touched">Email address Required</small>
</div> </div>
<!-- <div class="field col-md-1"></div>
<div class="field col-md-5"> <div class="field col-md-5">
<label for="dob">Date of Birth</label> <label for="dob">Date of Birth</label>
<p-calendar id="dob" name="dob" [(ngModel)]="appointment.dob" [showIcon]="true" required></p-calendar> <p-calendar id="dob" required name="dob" [(ngModel)]="appointment.dob" [showIcon]="true" required></p-calendar>
</div> --> <small class="p-error" *ngIf="appointmentForm.controls.dob?.invalid && appointmentForm.controls.dob?.touched">DOB Required</small>
<div class="field col-md-1"></div>
</div>
<div class="field col-md-5"> <div class="field col-md-5">
<label for="doctor">Consulting Doctor</label> <label for="doctor">Consulting Doctor</label>
<p-dropdown id="doctor" name="doctor" [(ngModel)]="appointment.doctor" [options]="doctorOptions" placeholder="Select Doctor" optionLabel="label" optionValue="value" required></p-dropdown> <p-dropdown id="doctor" name="doctor" [(ngModel)]="appointment.doctorId" [options]="doctorOptions" placeholder="Select Doctor" optionLabel="label" optionValue="value" required></p-dropdown>
</div> </div>
<div class="field col-md-1"></div>
<div class="field col-md-5"> <div class="field col-md-5">
<label for="date">Date of Appointment</label> <label for="date">Date of Appointment</label>
<p-calendar id="date" name="date" [(ngModel)]="appointment.date" [showIcon]="true" required></p-calendar> <p-calendar id="date" name="date" [(ngModel)]="appointment.dateOfAppointment" [showIcon]="true" required></p-calendar>
</div> </div>
<div class="field col-md-1"></div>
<div class="field col-md-5"> <div class="field col-md-5">
<label for="time">Time Of Appointment</label> <label for="time">Time Of Appointment</label>
<span class="p-input-icon-left"> <span class="p-input-icon-left">
<i class="pi pi-clock"></i> <i class="pi pi-clock"></i>
<input pInputText id="time" name="time" type="time" [(ngModel)]="appointment.time" required /> <input pInputText id="time" name="time" type="time" [(ngModel)]="appointment.timeOfAppointment" required />
</span> </span>
</div> </div>
<div class="field col-md-1"></div>
<!-- Injury (Full Width) --> <!-- Injury (Full Width) -->
<div class="field col-11"> <div class="field col-md-5">
<label for="injury">Injury/Condition</label> <label for="injury">Injury/Condition</label>
<span class="p-input-icon-left"> <span class="p-input-icon-left">
<i class="pi pi-exclamation-triangle"></i> <i class="pi pi-exclamation-triangle"></i>
<input pInputText id="injury" name="injury" [(ngModel)]="appointment.injury" /> <input pInputText id="injury" name="injury" [(ngModel)]="appointment.injuryORContion" />
</span> </span>
</div> </div>
<!-- <!--
@ -195,7 +206,7 @@
<!-- Notes (Full Width) --> <!-- Notes (Full Width) -->
<div class="field col-11"> <div class="field col-11">
<label for="notes">Notes</label> <label for="notes">Notes</label>
<textarea id="notes" name="notes" [(ngModel)]="appointment.notes" rows="5"cols="30"pInputTextarea></textarea> <textarea id="notes" name="notes" [(ngModel)]="appointment.note" rows="5"cols="30"pInputTextarea></textarea>
</div> </div>

View File

@ -1,6 +1,11 @@
import { ConfirmationService, ToasterService } from '@abp/ng.theme.shared';
import { HttpClient } from '@angular/common/http';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { NgForm } from '@angular/forms'; import { NgForm } from '@angular/forms';
import { AppointmentDto } from '@proxy/appoinments/dto';
import { AppointmentService } from '@proxy/appointments';
import { DoctorService } from '@proxy/doctors'; import { DoctorService } from '@proxy/doctors';
import { PagingSortResultDto } from '@proxy/dto';
import { Gender } from '@proxy/global-enum'; import { Gender } from '@proxy/global-enum';
@Component({ @Component({
@ -17,69 +22,28 @@ export class ViewAppointmentComponent {
appointmentDialog = false; appointmentDialog = false;
genders = Gender; genders = Gender;
isEditMode: boolean = false; isEditMode: boolean = false;
loading: boolean = false;
params: PagingSortResultDto;
appointment = { appointment: AppointmentDto = {
firstname: '', id: '',
lastname: '', firstName: '',
lastName: '',
email: '', email: '',
gender: Gender.Male, gender: Gender.Male,
date: '',
dob:'',
time: '',
mobile: '', mobile: '',
injury: '', address: '',
insuranceProvider: '', dob: '',
notes: '', doctorId: '',
doctor: '', dateOfAppointment: '',
status: '', timeOfAppointment: '',
visitType: '', injuryORContion: '',
paymentStatus: '', note: '',
Address:''
}; };
appointments = [
{ 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',
},
];
// status = { 1: 'Scheduled', 2: 'Completed', 3: 'Canceled' }; // status = { 1: 'Scheduled', 2: 'Completed', 3: 'Canceled' };
doctors = []; doctors = [];
doctorOptions = []; doctorOptions = [];
appointmentStatuses = [ appointmentStatuses = [
@ -100,32 +64,59 @@ export class ViewAppointmentComponent {
createPermission = true; createPermission = true;
editPermission = true; editPermission = true;
deletePermission = 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 { ngOnInit(): void {
this.getdoctorlist(); 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() { openNewAppointmentDialog() {
this.isEditing = false; this.isEditing = false;
this.appointmentDialog = true; this.appointmentDialog = true;
this.appointment = { this.appointment = {
firstname: '', firstName: '',
lastname: '', lastName: '',
email: '', email: '',
gender: Gender.Male, gender: Gender.Male,
date: '', dateOfAppointment: '',
dob:'', dob: '',
time: '', timeOfAppointment: '',
mobile: '', mobile: '',
injury: '', injuryORContion: '',
insuranceProvider: '', note: '',
notes: '', doctorId: '',
doctor: '', address: '',
status: '',
visitType: '',
paymentStatus: '',
Address:''
}; };
} }
@ -141,14 +132,50 @@ export class ViewAppointmentComponent {
console.log('Deleting appointment with ID', id); console.log('Deleting appointment with ID', id);
} }
saveAppointment(form: NgForm) { saveAppointment(form: NgForm) {
debugger debugger;
console.log(form.controls); console.log(form.controls);
if (form.invalid) { if (form.invalid) {
Object.values(form.controls).forEach(control => control.markAsTouched()); Object.values(form.controls).forEach(control => control.markAsTouched());
return; 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() { closeDialog() {
this.appointmentDialog = false; this.appointmentDialog = false;

View File

@ -4,7 +4,7 @@ import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { NgForm } from '@angular/forms'; import { NgForm } from '@angular/forms';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { PagingSortPatientResultDto } from '@proxy/dto'; import { PagingSortResultDto } from '@proxy/dto';
import { Gender, Status } from '@proxy/global-enum'; import { Gender, Status } from '@proxy/global-enum';
import { PatientService } from '@proxy/patients'; import { PatientService } from '@proxy/patients';
import { PatientDto, CreateUpdatePatientDto } from '@proxy/patients/dto'; import { PatientDto, CreateUpdatePatientDto } from '@proxy/patients/dto';
@ -24,7 +24,7 @@ export class AllPatientsComponent implements OnInit {
selectedPatient: CreateUpdatePatientDto; selectedPatient: CreateUpdatePatientDto;
isEditMode: boolean = false; isEditMode: boolean = false;
patientDialogTitle: string = ''; patientDialogTitle: string = '';
params: PagingSortPatientResultDto; params: PagingSortResultDto;
status: any; status: any;
gender: any; gender: any;
statuslist: any; statuslist: any;

View File

@ -1,6 +1,6 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { NgForm } from '@angular/forms'; import { NgForm } from '@angular/forms';
import { PagingSortPatientResultDto } from '@proxy/dto'; import { PagingSortResultDto } from '@proxy/dto';
import { Gender, Status } from '@proxy/global-enum'; import { Gender, Status } from '@proxy/global-enum';
import { PatientService } from '@proxy/patients'; import { PatientService } from '@proxy/patients';
import { CreateUpdatePatientRecordDto, PatientDto, PatientRecordDto } from '@proxy/patients/dto'; import { CreateUpdatePatientRecordDto, PatientDto, PatientRecordDto } from '@proxy/patients/dto';
@ -25,7 +25,7 @@ export class PatientRecordComponent implements OnInit {
patientdto: PatientDto; patientdto: PatientDto;
isEditMode: boolean = false; isEditMode: boolean = false;
patientDialogTitle: string = ''; patientDialogTitle: string = '';
params: PagingSortPatientResultDto; params: PagingSortResultDto;
status: any; status: any;
gender: any; gender: any;
statuslist: any; statuslist: any;

View File

@ -0,0 +1,2 @@
import * as Services from './services';
export { Services };

View File

@ -0,0 +1 @@
export * from './models';

View File

@ -0,0 +1,8 @@
export interface ListResultDto<T> {
items: T[];
}
export interface PagedResultDto<T> extends ListResultDto<T> {
totalCount: number;
}

View File

@ -0,0 +1,2 @@
import * as Dto from './dto';
export { Dto };

View File

@ -0,0 +1,2 @@
import * as Application from './application';
export { Application };

View File

@ -0,0 +1 @@
export * from './models';

View File

@ -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;
}

View File

@ -0,0 +1,2 @@
import * as Dto from './dto';
export { Dto };

View File

@ -1,5 +1,9 @@
import { RestService, Rest } from '@abp/ng.core'; import { RestService, Rest } from '@abp/ng.core';
import { Injectable } from '@angular/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({ @Injectable({
providedIn: 'root', providedIn: 'root',
@ -8,6 +12,15 @@ export class AppointmentService {
apiName = 'Default'; apiName = 'Default';
createAppointment = (input: CreateOrUpdateAppointmentDto, config?: Partial<Rest.Config>) =>
this.restService.request<any, AppointmentDto>({
method: 'POST',
url: '/api/app/appointment/appointment',
body: input,
},
{ apiName: this.apiName,...config });
get = (config?: Partial<Rest.Config>) => get = (config?: Partial<Rest.Config>) =>
this.restService.request<any, string>({ this.restService.request<any, string>({
method: 'GET', method: 'GET',
@ -15,6 +28,24 @@ export class AppointmentService {
url: '/api/app/appointment', url: '/api/app/appointment',
}, },
{ apiName: this.apiName,...config }); { apiName: this.apiName,...config });
getAppointmentList = (input: PagingSortResultDto, config?: Partial<Rest.Config>) =>
this.restService.request<any, PagedResultDto<AppointmentDto>>({
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<Rest.Config>) =>
this.restService.request<any, PatientRecordDto>({
method: 'PUT',
url: `/api/app/appointment/${id}/appointment`,
body: input,
},
{ apiName: this.apiName,...config });
constructor(private restService: RestService) {} constructor(private restService: RestService) {}
} }

View File

@ -10,6 +10,6 @@ export interface FileDownloadDto {
fileContent?: string; fileContent?: string;
} }
export interface PagingSortPatientResultDto extends PagedAndSortedResultRequestDto { export interface PagingSortResultDto extends PagedAndSortedResultRequestDto {
search?: string; search?: string;
} }

View File

@ -911,6 +911,173 @@
}, },
"allowAnonymous": null, "allowAnonymous": null,
"implementFrom": "HospitalManagementSystem.Appointments.IAppointmentAppService" "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<HospitalManagementSystem.Appoinments.Dto.AppointmentDto>",
"typeSimple": "Abp.Application.Services.Dto.PagedResultDto<HospitalManagementSystem.Appoinments.Dto.AppointmentDto>"
},
"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": [ "parametersOnMethod": [
{ {
"name": "input", "name": "input",
"typeAsString": "HospitalManagementSystem.Dto.PagingSortPatientResultDto, HospitalManagementSystem.Domain.Shared", "typeAsString": "HospitalManagementSystem.Dto.PagingSortResultDto, HospitalManagementSystem.Domain.Shared",
"type": "HospitalManagementSystem.Dto.PagingSortPatientResultDto", "type": "HospitalManagementSystem.Dto.PagingSortResultDto",
"typeSimple": "HospitalManagementSystem.Dto.PagingSortPatientResultDto", "typeSimple": "HospitalManagementSystem.Dto.PagingSortResultDto",
"isOptional": false, "isOptional": false,
"defaultValue": null "defaultValue": null
}, },
@ -1381,9 +1548,9 @@
"parametersOnMethod": [ "parametersOnMethod": [
{ {
"name": "input", "name": "input",
"typeAsString": "HospitalManagementSystem.Dto.PagingSortPatientResultDto, HospitalManagementSystem.Domain.Shared", "typeAsString": "HospitalManagementSystem.Dto.PagingSortResultDto, HospitalManagementSystem.Domain.Shared",
"type": "HospitalManagementSystem.Dto.PagingSortPatientResultDto", "type": "HospitalManagementSystem.Dto.PagingSortResultDto",
"typeSimple": "HospitalManagementSystem.Dto.PagingSortPatientResultDto", "typeSimple": "HospitalManagementSystem.Dto.PagingSortResultDto",
"isOptional": false, "isOptional": false,
"defaultValue": null "defaultValue": null
} }
@ -4424,6 +4591,382 @@
} }
}, },
"types": { "types": {
"Abp.Application.Services.Dto.ListResultDto<T0>": {
"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<T0>": {
"baseType": "Abp.Application.Services.Dto.ListResultDto<T>",
"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": { "HospitalManagementSystem.Documents.EntityDocument": {
"baseType": "Volo.Abp.Domain.Entities.Auditing.AuditedAggregateRoot<System.Guid>", "baseType": "Volo.Abp.Domain.Entities.Auditing.AuditedAggregateRoot<System.Guid>",
"isEnum": false, "isEnum": false,
@ -4583,7 +5126,7 @@
} }
] ]
}, },
"HospitalManagementSystem.Dto.PagingSortPatientResultDto": { "HospitalManagementSystem.Dto.PagingSortResultDto": {
"baseType": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto", "baseType": "Volo.Abp.Application.Dtos.PagedAndSortedResultRequestDto",
"isEnum": false, "isEnum": false,
"enumNames": null, "enumNames": null,

View File

@ -1,3 +1,5 @@
import * as Abp from './abp';
import * as Appoinments from './appoinments';
import * as Appointments from './appointments'; import * as Appointments from './appointments';
import * as Departments from './departments'; import * as Departments from './departments';
import * as Doctors from './doctors'; import * as Doctors from './doctors';
@ -7,4 +9,4 @@ import * as Dtos from './dtos';
import * as GlobalEnum from './global-enum'; import * as GlobalEnum from './global-enum';
import * as Patients from './patients'; import * as Patients from './patients';
import * as Volo from './volo'; 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 };

View File

@ -1,38 +1,6 @@
import type { Gender } from '../../global-enum/gender.enum'; import type { Gender } from '../../global-enum/gender.enum';
import type { Status } from '../../global-enum/status.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 { export interface PatientDto {
id?: string; id?: string;
name?: string; name?: string;
@ -65,3 +33,35 @@ export interface PatientRecordDto {
insuranceProvider?: string; insuranceProvider?: string;
status: Status; 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;
}

View File

@ -4,7 +4,7 @@ import { RestService, Rest } from '@abp/ng.core';
import type { PagedResultDto } from '@abp/ng.core'; import type { PagedResultDto } from '@abp/ng.core';
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import type { EntityDocument } from '../documents/models'; import type { EntityDocument } from '../documents/models';
import type { DropDownItems, FileDownloadDto, PagingSortPatientResultDto } from '../dto/models'; import type { DropDownItems, FileDownloadDto, PagingSortResultDto } from '../dto/models';
@Injectable({ @Injectable({
providedIn: 'root', providedIn: 'root',
@ -71,7 +71,7 @@ export class PatientService {
{ apiName: this.apiName,...config }); { apiName: this.apiName,...config });
getPatientList = (input: PagingSortPatientResultDto, config?: Partial<Rest.Config>) => getPatientList = (input: PagingSortResultDto, config?: Partial<Rest.Config>) =>
this.restService.request<any, PagedResultDto<PatientDto>>({ this.restService.request<any, PagedResultDto<PatientDto>>({
method: 'GET', method: 'GET',
url: '/api/app/patient/patient-list', url: '/api/app/patient/patient-list',
@ -88,7 +88,7 @@ export class PatientService {
{ apiName: this.apiName,...config }); { apiName: this.apiName,...config });
getPatientRecordList = (input: PagingSortPatientResultDto, Id: string, config?: Partial<Rest.Config>) => getPatientRecordList = (input: PagingSortResultDto, Id: string, config?: Partial<Rest.Config>) =>
this.restService.request<any, PagedResultDto<PatientRecordDto>>({ this.restService.request<any, PagedResultDto<PatientRecordDto>>({
method: 'GET', method: 'GET',
url: `/api/app/patient/patient-record-list/${Id}`, url: `/api/app/patient/patient-record-list/${Id}`,

View File

@ -39,13 +39,12 @@ namespace HospitalManagementSystem.Appointments
return _currentUser.Name + " checking done."; return _currentUser.Name + " checking done.";
} }
#region Get Patient List with Paging and Searching #region Get Patient List with Paging and Searching
public async Task<PagedResultDto<AppointmentDto>> GetAppointmentListAsync(PagingSortResultDto input, Guid Id) public async Task<PagedResultDto<AppointmentDto>> GetAppointmentListAsync(PagingSortResultDto input)
{ {
var queryable = await _appointmentsRepository.GetQueryableAsync(); var queryable = await _appointmentsRepository.GetQueryableAsync();
var filteredQuery = queryable var filteredQuery = queryable
.WhereIf(!string.IsNullOrEmpty(input.Search), x => x.FirstName.ToLower().Contains(input.Search.ToLower()) || x.LastName.ToLower().Contains(input.Search.ToLower())) .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);
var totalCount = await filteredQuery.CountAsync(); var totalCount = await filteredQuery.CountAsync();