Compare commits
5 Commits
c5df13a8f2
...
91bfc622d1
Author | SHA1 | Date | |
---|---|---|---|
91bfc622d1 | |||
b5ef24a736 | |||
6394ece8d3 | |||
48d6a3fae8 | |||
bcd8aa205a |
@ -67,7 +67,7 @@
|
||||
<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="appointmentStatus">Appointment Status<p-sortIcon field="appointmentStatus" /></th>
|
||||
<th pSortableColumn="visitType">Visit Type<p-sortIcon field="visitType" /></th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
@ -78,25 +78,44 @@
|
||||
<td>{{ appointment.firstName }} {{ appointment.lastName }}</td>
|
||||
<td>{{ appointment.doctor }}</td>
|
||||
<td>
|
||||
<i
|
||||
class="pi"
|
||||
[ngClass]="{
|
||||
'pi-mars text-primary': appointment.gender === 1,
|
||||
'pi-venus text-pink-500': appointment.gender === 2
|
||||
}"
|
||||
></i>
|
||||
<p-chip
|
||||
[severity]="appointment.gender === 1 ? 'info' : 'danger'"
|
||||
[styleClass]="'px-2 py-1 text-sm font-medium'"
|
||||
>
|
||||
|
||||
{{ getGenderLabel(appointment.gender) }}
|
||||
</p-chip>
|
||||
|
||||
</td>
|
||||
<td>{{ appointment.dateOfAppointment | date }}</td>
|
||||
<td><i class="pi pi-clock"></i> {{ appointment.timeOfAppointment }}</td>
|
||||
<td>{{ appointment.timeOfAppointment }}</td>
|
||||
<td>{{ appointment.mobile }}</td>
|
||||
<td>{{ appointment.email }}</td>
|
||||
<td>{{ appointment.status }}</td>
|
||||
<td>{{ appointment.visitType }}</td>
|
||||
<td>
|
||||
<p-chip
|
||||
[severity]="appointment.appointmentStatus === 1 ? 'info' : 'danger'"
|
||||
[styleClass]="'px-2 py-1 text-sm font-medium'"
|
||||
>
|
||||
|
||||
{{ getStatusLabel(appointment.appointmentStatus) }}
|
||||
</p-chip>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<p-chip
|
||||
[severity]="appointment.visitType === 1 ? 'info' : 'danger'"
|
||||
[styleClass]="'px-2 py-1 text-sm font-medium'"
|
||||
>
|
||||
|
||||
{{ getVisitTypeLabel(appointment.visitType) }}
|
||||
</p-chip>
|
||||
</td>
|
||||
<td class="d-flex">
|
||||
<button class="btn btn-warning btn-sm ml-1" (click)="editAppointment(appointment)">
|
||||
<i class="pi pi-pencil"></i>
|
||||
</button>
|
||||
<button class="btn btn-danger btn-sm ml-1"
|
||||
(click)="deleteAppointment(appointment.id)"><i class="pi pi-trash"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
</ng-template>
|
||||
@ -104,7 +123,7 @@
|
||||
</div>
|
||||
|
||||
<p-dialog
|
||||
header="{{ isEditing ? 'Edit Appointment' : 'New Appointment' }}"
|
||||
header="{{ isEditMode ? 'Edit Appointment' : 'New Appointment' }}"
|
||||
[(visible)]="appointmentDialog"
|
||||
[modal]="true"
|
||||
[closable]="true"
|
||||
|
@ -0,0 +1,15 @@
|
||||
.table-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.badge {
|
||||
display: inline-block;
|
||||
padding: 0.2rem 0.6rem;
|
||||
border-radius: 0.5rem;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ConfirmationService, ToasterService } from '@abp/ng.theme.shared';
|
||||
import { Confirmation, ConfirmationService, ToasterService } from '@abp/ng.theme.shared';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Component } from '@angular/core';
|
||||
import { NgForm } from '@angular/forms';
|
||||
@ -18,7 +18,6 @@ export class ViewAppointmentComponent {
|
||||
AppointmentDialogTitle: string = '';
|
||||
AppointmentDialog: boolean = false;
|
||||
patients: [];
|
||||
isEditing = false;
|
||||
appointmentDialog = false;
|
||||
genders = Gender;
|
||||
appointmentStatuses = Object.keys(appointmentStatus)
|
||||
@ -38,7 +37,7 @@ export class ViewAppointmentComponent {
|
||||
.map(key => ({
|
||||
label: paymentStatus[key as unknown as keyof typeof paymentStatus],
|
||||
value: Number(key),
|
||||
}));;
|
||||
}));
|
||||
isEditMode: boolean = false;
|
||||
loading: boolean = false;
|
||||
params: PagingSortResultDto;
|
||||
@ -92,8 +91,15 @@ export class ViewAppointmentComponent {
|
||||
});
|
||||
}
|
||||
getGenderLabel(gender: number): string {
|
||||
return gender === Gender.Male ? 'Male' : gender === Gender.Female ? 'Female' : 'Unknown';
|
||||
return Gender[gender] ?? 'Unknown';
|
||||
}
|
||||
getStatusLabel(Status: number): string {
|
||||
return appointmentStatus[Status] ?? 'Unknown';
|
||||
}
|
||||
getVisitTypeLabel(VisitType: number): string {
|
||||
return visitType[VisitType] ?? 'Unknown';
|
||||
}
|
||||
|
||||
loadappointments(event: any) {
|
||||
this.loading = true;
|
||||
let order = event.sortOrder == 1 ? ' asc' : ' desc';
|
||||
@ -113,7 +119,7 @@ export class ViewAppointmentComponent {
|
||||
});
|
||||
}
|
||||
openNewAppointmentDialog() {
|
||||
this.isEditing = false;
|
||||
this.isEditMode = false;
|
||||
this.appointmentDialog = true;
|
||||
this.appointment = {
|
||||
firstName: '',
|
||||
@ -140,11 +146,33 @@ export class ViewAppointmentComponent {
|
||||
}
|
||||
|
||||
editAppointment(appointment: any) {
|
||||
console.log('Editing appointment', appointment);
|
||||
debugger;
|
||||
this.isEditMode = true;
|
||||
this.appointmentDialog = true;
|
||||
|
||||
this.AppointmentService.getAppointmentById(appointment.id).subscribe(result => {
|
||||
debugger;
|
||||
this.appointment = result;
|
||||
this.appointment.dateOfAppointment = new Date(result.dateOfAppointment).toISOString().split('T')[0];;
|
||||
this.appointment.dob = new Date(result.dob).toISOString().split('T')[0];;
|
||||
});
|
||||
}
|
||||
|
||||
deleteAppointment(id: number) {
|
||||
console.log('Deleting appointment with ID', id);
|
||||
deleteAppointment(id: string) {
|
||||
this.confirmation
|
||||
.warn('Do you really want to delete this Appointment?', {
|
||||
key: '::AreYouSure',
|
||||
defaultValue: 'Are you sure?',
|
||||
})
|
||||
.subscribe((status: Confirmation.Status) => {
|
||||
// your code here
|
||||
if (status == 'confirm') {
|
||||
this.AppointmentService.deleteAppointmentRecord(id).subscribe(() => {
|
||||
this.toaster.success('Appointment deleted successfully', 'Success');
|
||||
this.loadappointments(this.params);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
saveAppointment(form: NgForm) {
|
||||
debugger;
|
||||
@ -154,21 +182,22 @@ export class ViewAppointmentComponent {
|
||||
return;
|
||||
}
|
||||
if (this.isEditMode) {
|
||||
this.AppointmentService.createAppointment(this.appointment).subscribe(
|
||||
this.AppointmentService.updateAppointment(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,
|
||||
// });
|
||||
this.loadappointments({
|
||||
first: 0,
|
||||
rows: 10,
|
||||
sortField: 'id',
|
||||
sortOrder: 1,
|
||||
globalFilter: null,
|
||||
});
|
||||
this.closeDialog();
|
||||
},
|
||||
error => {
|
||||
console.log(error);
|
||||
this.closeDialog();
|
||||
this.toaster.error(error.error.error.message, 'Error');
|
||||
}
|
||||
);
|
||||
} else {
|
||||
@ -184,12 +213,10 @@ export class ViewAppointmentComponent {
|
||||
globalFilter: null,
|
||||
});
|
||||
this.closeDialog();
|
||||
|
||||
},
|
||||
error => {
|
||||
console.log(error);
|
||||
this.toaster.error(error.error.error.message, 'Error');
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ import { InputTextModule } from 'primeng/inputtext';
|
||||
import { RadioButtonModule } from 'primeng/radiobutton';
|
||||
import { DoctorService } from '@proxy/doctors';
|
||||
import { InputTextareaModule } from 'primeng/inputtextarea';
|
||||
import { ChipModule } from 'primeng/chip';
|
||||
|
||||
@NgModule({
|
||||
declarations: [ViewAppointmentComponent],
|
||||
@ -29,7 +30,8 @@ import { InputTextareaModule } from 'primeng/inputtextarea';
|
||||
CalendarModule,
|
||||
DropdownModule,
|
||||
RadioButtonModule,
|
||||
InputTextareaModule
|
||||
InputTextareaModule,
|
||||
ChipModule
|
||||
|
||||
],
|
||||
providers:[DoctorService]
|
||||
|
@ -1,4 +1,4 @@
|
||||
<div>
|
||||
<!-- <div>
|
||||
<p-table #dt2 dataKey="id" [value]="patients" [paginator]="true" [rows]="10" [totalRecords]="totalRecords"
|
||||
[lazy]="true" (onLazyLoad)="loadPatient($event)" [rowsPerPageOptions]="[10, 20, 50]"
|
||||
[responsiveLayout]="'scroll'" [globalFilterFields]="['id', 'name', 'status']"
|
||||
@ -74,34 +74,119 @@
|
||||
</ng-template>
|
||||
</p-table>
|
||||
<span>Total Records: {{totalRecords}}</span>
|
||||
</div> -->
|
||||
<div class="container-fluid py-3">
|
||||
<div class="card shadow-sm p-3">
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h2 class="mb-0">Patient List</h2>
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<button *ngIf="createpermission" class="btn btn-success btn-sm" (click)="openNewPatientDialog()">
|
||||
<i class="pi pi-plus-circle"></i>
|
||||
</button>
|
||||
<button class="btn btn-warning btn-sm" (click)="exportPatient()">
|
||||
<i class="pi pi-download"></i>
|
||||
</button>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="pi pi-search"></i></span>
|
||||
<input pInputText type="text" class="form-control"
|
||||
(input)="dt2.filterGlobal($event.target.value, 'contains')" [(ngModel)]="globalFilter"
|
||||
placeholder="Search keyword" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p-table #dt2 dataKey="id" [value]="patients" [paginator]="true" [rows]="10" [totalRecords]="totalRecords"
|
||||
[lazy]="true" (onLazyLoad)="loadPatient($event)" [rowsPerPageOptions]="[10, 20, 50]"
|
||||
styleClass="p-datatable-gridlines" [responsiveLayout]="'scroll'"
|
||||
[globalFilterFields]="['id', 'name', 'status']" [filters]="{ global: { value: '', matchMode: 'contains' } }"
|
||||
class="table table-hover table-responsive-md">
|
||||
|
||||
<ng-template pTemplate="header">
|
||||
<tr class="table-dark">
|
||||
<th class="hidden" pSortableColumn="id">Patient ID <p-sortIcon field="id" /></th>
|
||||
<th pSortableColumn="name">Full Name <p-sortIcon field="name" /></th>
|
||||
<th pSortableColumn="gender">Gender <p-sortIcon field="gender" /></th>
|
||||
<th pSortableColumn="admissionDate">Date of Admission <p-sortIcon field="admissionDate" /></th>
|
||||
<th pSortableColumn="bloodGroup">Blood Group <p-sortIcon field="bloodGroup" /></th>
|
||||
<th>Mobile</th>
|
||||
<th>Email</th>
|
||||
<th pSortableColumn="status">Status <p-sortIcon field="status" /></th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</ng-template>
|
||||
|
||||
<ng-template pTemplate="body" let-patient>
|
||||
<tr>
|
||||
<td class="hidden">{{ patient.id }}</td>
|
||||
<td>{{ patient.name }}</td>
|
||||
<td>
|
||||
<span class="badge" [ngClass]="patient.gender === 1 ? 'bg-primary' : 'bg-pink'">
|
||||
{{ gender[patient.gender] }}
|
||||
</span>
|
||||
</td>
|
||||
<td>{{ patient.admissionDate | date }}</td>
|
||||
<td>{{ patient.bloodGroup }}</td>
|
||||
<td>{{ patient.mobile }}</td>
|
||||
<td>{{ patient.email }}</td>
|
||||
<td>
|
||||
<span class="badge"
|
||||
[ngClass]="patient.status === 1 ? 'bg-success' : (patient.status === 2 ? 'bg-primary':'bg-danger')">
|
||||
{{ status[patient.status] }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="d-flex gap-1">
|
||||
<button *ngIf="createpermission" class="btn btn-success btn-sm"
|
||||
(click)="addnewrecord(patient.id)">
|
||||
<i class="pi pi-arrow-right"></i>
|
||||
</button>
|
||||
<button *ngIf="editpermission" class="btn btn-warning btn-sm" (click)="editPatient(patient)"><i
|
||||
class="pi pi-pencil"></i></button>
|
||||
<button *ngIf="deletepermission" class="btn btn-danger btn-sm"
|
||||
(click)="deletePatient(patient.id)"><i class="pi pi-trash"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
</ng-template>
|
||||
|
||||
<ng-template pTemplate="emptymessage">
|
||||
<tr>
|
||||
<td colspan="10" class="text-center">No Patients found.</td>
|
||||
</tr>
|
||||
</ng-template>
|
||||
</p-table>
|
||||
<div class="text-end mt-2 fw-bold">Total Records: {{ totalRecords }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p-dialog *ngIf="patientDialog" header="{{patientDialogTitle}}" [(visible)]="patientDialog" [modal]="true"
|
||||
[closable]="true" [style]="{width: '85%', height: '100%'}">
|
||||
[closable]="true" [style]="{width: '80%', height: 'auto'}" class="modern-dialog">
|
||||
<form #patientrecord="ngForm" (ngSubmit)="savePatient(patientrecord)">
|
||||
<div class="p-fluid">
|
||||
<div class="p-grid">
|
||||
<!-- Full Name -->
|
||||
<div class="p-col-6">
|
||||
<div class="p-fluid grid">
|
||||
<!-- Full Name & Profile Image -->
|
||||
<div class="col-6">
|
||||
<div class="field">
|
||||
<label for="name">Full Name</label>
|
||||
<label for="name"><i class="pi pi-user"></i> Full Name</label>
|
||||
<input id="name" name="name" type="text" pInputText [(ngModel)]="selectedPatient.name"
|
||||
placeholder="Enter full patient name" required #name="ngModel" />
|
||||
<small *ngIf="name.invalid && name.touched" class="p-error">Full Name is required</small>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="image">Profile Image</label>
|
||||
<label for="image"><i class="pi pi-image"></i> Profile Image</label>
|
||||
<input type="file" id="image" name="image" accept=".jpg,.png"
|
||||
(change)="profileimageupload($event)" />
|
||||
</div>
|
||||
<small *ngIf="error !== ''" class="p-error">{{error}}</small>
|
||||
<div *ngIf="uploadProgress > 0">
|
||||
<p>Uploading... {{ uploadProgress }}%</p>
|
||||
<progress [value]="uploadProgress" max="100"></progress>
|
||||
</div>
|
||||
<small *ngIf="imgpath !== ''">{{imgpath}} <i class="pi pi-image"></i></small>
|
||||
</div>
|
||||
|
||||
<!-- Mobile -->
|
||||
<div class="p-col-6">
|
||||
<!-- Mobile & Address -->
|
||||
<div class="col-6">
|
||||
<div class="field">
|
||||
<label for="mobile">Mobile</label>
|
||||
<label for="mobile"><i class="pi pi-phone"></i> Mobile</label>
|
||||
<input id="mobile" name="mobile" type="text" pInputText [(ngModel)]="selectedPatient.mobile"
|
||||
placeholder="Enter mobile number" maxlength="10" required pattern="[0-9]{10}"
|
||||
#mobile="ngModel" />
|
||||
@ -109,26 +194,20 @@
|
||||
Mobile is required and must be 10 digits
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Address -->
|
||||
<div class="p-col-6">
|
||||
<div class="field">
|
||||
<label for="address">Address</label>
|
||||
<input id="address" name="address" type="text" pInputText
|
||||
[(ngModel)]="selectedPatient.address" placeholder="Enter address" required
|
||||
#address="ngModel" />
|
||||
<small *ngIf="address.invalid && address.touched" class="p-error">Address is
|
||||
required</small>
|
||||
<label for="address"><i class="pi pi-map-marker"></i> Address</label>
|
||||
<input id="address" name="address" type="text" pInputText [(ngModel)]="selectedPatient.address"
|
||||
placeholder="Enter address" required #address="ngModel" />
|
||||
<small *ngIf="address.invalid && address.touched" class="p-error">Address is required</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-grid">
|
||||
<!-- Gender -->
|
||||
<div class="p-col-6">
|
||||
<div class="p-fluid grid">
|
||||
<!-- Gender & Admission Date -->
|
||||
<div class="col-6">
|
||||
<div class="field">
|
||||
<label for="gender">Gender</label>
|
||||
<label for="gender"><i class="pi pi-users"></i> Gender</label>
|
||||
<div>
|
||||
<label class="mx-1">
|
||||
<input id="male" type="radio" name="gender" [(ngModel)]="selectedgender" [value]="1"
|
||||
@ -144,44 +223,41 @@
|
||||
<small *ngIf="!selectedgender" class="p-error">Gender is required</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Admission Date -->
|
||||
<div class="p-col-6">
|
||||
<div class="col-6">
|
||||
<div class="field">
|
||||
<label for="admissionDate">Admission Date</label>
|
||||
<p-calendar id="admissionDate" name="admissionDate" [(ngModel)]="selectadmissionDate"
|
||||
showIcon styleClass="small-calendar" required #admissionDate="ngModel"></p-calendar>
|
||||
<label for="admissionDate"><i class="pi pi-calendar"></i> Admission Date</label>
|
||||
<p-calendar id="admissionDate" name="admissionDate" [(ngModel)]="selectadmissionDate" showIcon
|
||||
styleClass="small-calendar" required #admissionDate="ngModel"></p-calendar>
|
||||
<small *ngIf="admissionDate.invalid && admissionDate.touched" class="p-error">
|
||||
Admission Date is required
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-grid">
|
||||
<!-- Doctors Note -->
|
||||
<div class="p-col-6">
|
||||
|
||||
<div class="p-fluid grid">
|
||||
<!-- Doctor & Treatment -->
|
||||
<div class="col-6">
|
||||
<div class="field">
|
||||
<label for="doctorAssigned">Doctor Assigned</label>
|
||||
<label for="doctorAssigned"><i class="pi pi-user-md"></i> Doctor Assigned</label>
|
||||
<input id="doctorAssigned" name="doctorAssigned" type="text" pInputText
|
||||
[(ngModel)]="selectedPatient.doctorAssigned" placeholder="Enter assigned doctor" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Treatment -->
|
||||
<div class="p-col-6">
|
||||
<div class="col-6">
|
||||
<div class="field">
|
||||
<label for="treatment">Treatment</label>
|
||||
<input id="treatment" name="treatment" type="treatment" pInputText
|
||||
<label for="treatment"><i class="pi pi-heartbeat"></i> Treatment</label>
|
||||
<input id="treatment" name="treatment" type="text" pInputText
|
||||
[(ngModel)]="selectedPatient.treatment" placeholder="Enter treatment" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-grid">
|
||||
<!-- Blood Group -->
|
||||
<div class="p-col-6">
|
||||
<div class="p-fluid grid">
|
||||
<!-- Blood Group & Email -->
|
||||
<div class="col-6">
|
||||
<div class="field">
|
||||
<label for="bloodGroup">Blood Group</label>
|
||||
<label for="bloodGroup"><i class="pi pi-tint"></i> Blood Group</label>
|
||||
<input id="bloodGroup" name="bloodGroup" type="text" pInputText
|
||||
[(ngModel)]="selectedPatient.bloodGroup" placeholder="Enter blood group" required
|
||||
#bloodGroup="ngModel" />
|
||||
@ -189,11 +265,9 @@
|
||||
required</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Email -->
|
||||
<div class="p-col-6">
|
||||
<div class="col-6">
|
||||
<div class="field">
|
||||
<label for="email">Email</label>
|
||||
<label for="email"><i class="pi pi-envelope"></i> Email</label>
|
||||
<input id="email" name="email" type="email" pInputText [(ngModel)]="selectedPatient.email"
|
||||
placeholder="Enter email address" required email #email="ngModel" />
|
||||
<small *ngIf="email.invalid && email.touched" class="p-error">Enter a valid email
|
||||
@ -202,36 +276,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-grid">
|
||||
<!-- Age -->
|
||||
<div class="p-col-6">
|
||||
<div class="field">
|
||||
<label for="age">Age</label>
|
||||
<input id="age" name="age" type="number" pInputText [(ngModel)]="selectedPatient.age"
|
||||
placeholder="Enter age" required min="1" max="120" #age="ngModel" />
|
||||
<small *ngIf="age.invalid && age.touched" class="p-error">
|
||||
Age is required and must be between 1 and 90
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Status -->
|
||||
<div class="p-col-6">
|
||||
<div class="field">
|
||||
<label for="status">Status</label>
|
||||
<p-dropdown name="status" id="status" [options]="statuslist" [(ngModel)]="selectedstatus"
|
||||
optionLabel="label" optionValue="value" placeholder="Select status"
|
||||
required></p-dropdown>
|
||||
<small *ngIf="selectedstatus === 0" class="p-error">Status is required</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="text-right">
|
||||
<button type="submit" pButton class="btn btn-primary"
|
||||
[disabled]="(patientrecord.invalid || selectedstatus === 0 || !selectedgender)">Save</button>
|
||||
<button pButton class="btn btn-secondary ml-1" (click)="closeDialog()">Close</button>
|
||||
[disabled]="(patientrecord.invalid || selectedstatus === 0 || !selectedgender)">
|
||||
<i class="pi pi-check"></i> Save
|
||||
</button>
|
||||
<button pButton class="btn btn-secondary ml-1" (click)="closeDialog()">
|
||||
<i class="pi pi-times"></i> Close
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</p-dialog>
|
||||
|
@ -26,3 +26,12 @@
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.bg-pink {
|
||||
background-color: #ff4081 !important;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.gap-1 {
|
||||
gap: 5px;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { PermissionService } from '@abp/ng.core';
|
||||
import { Confirmation, ConfirmationService, ToasterService } from '@abp/ng.theme.shared';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { HttpClient, HttpEventType, HttpParams, HttpRequest } from '@angular/common/http';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { NgForm } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
@ -8,6 +8,7 @@ import { PagingSortResultDto } from '@proxy/dto';
|
||||
import { Gender, Status } from '@proxy/global-enum';
|
||||
import { PatientService } from '@proxy/patients';
|
||||
import { PatientDto, CreateUpdatePatientDto } from '@proxy/patients/dto';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-all-patients',
|
||||
@ -38,18 +39,7 @@ export class AllPatientsComponent implements OnInit {
|
||||
error: string = '';
|
||||
imgpath: string = '';
|
||||
guid: string = '00000000-0000-0000-0000-000000000000';
|
||||
options: Partial<Confirmation.Options> = {
|
||||
hideCancelBtn: false,
|
||||
hideYesBtn: false,
|
||||
dismissible: false,
|
||||
cancelText: 'Close',
|
||||
// yesText: 'Confirm',
|
||||
messageLocalizationParams: ['Demo'],
|
||||
titleLocalizationParams: [],
|
||||
// You can customize icon
|
||||
// icon: 'fa fa-exclamation-triangle', // or
|
||||
// iconTemplate : '<img src="custom-image-path.jpg" alt=""/>'
|
||||
};
|
||||
uploadProgress = 0;
|
||||
|
||||
constructor(
|
||||
private patientService: PatientService,
|
||||
@ -103,6 +93,7 @@ export class AllPatientsComponent implements OnInit {
|
||||
this.imgpath = '';
|
||||
this.selectedgender = 0;
|
||||
this.selectedstatus = 0;
|
||||
this.uploadProgress = 0;
|
||||
}
|
||||
|
||||
loadPatient(event: any) {
|
||||
@ -167,6 +158,7 @@ export class AllPatientsComponent implements OnInit {
|
||||
this.error = 'Please Type a Name';
|
||||
return;
|
||||
}
|
||||
this.error = '';
|
||||
const input = event.target as HTMLInputElement;
|
||||
if (input.files.length > 0) {
|
||||
const tag = 'Image';
|
||||
@ -174,14 +166,40 @@ export class AllPatientsComponent implements OnInit {
|
||||
formdata.append('file', input.files[0]);
|
||||
this.UploadFileData(tag, formdata);
|
||||
} else {
|
||||
this.uploadProgress = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
UploadFileData(tag: string, formdata: FormData) {
|
||||
this.patientService.uploadFile(tag, formdata).subscribe(result => {
|
||||
this.selectedPatient.imageID = result;
|
||||
});
|
||||
// this.patientService.uploadFile(tag, formdata).subscribe(result => {
|
||||
// this.selectedPatient.imageID = result;
|
||||
// });
|
||||
const req = new HttpRequest(
|
||||
'POST',
|
||||
environment.apis.default.url + '/api/app/patient/upload-file',
|
||||
formdata,
|
||||
{
|
||||
reportProgress: true,
|
||||
responseType: 'text',
|
||||
params: new HttpParams().set('tagName', tag),
|
||||
}
|
||||
);
|
||||
this.http.request(req).subscribe(
|
||||
event => {
|
||||
if (event.type === HttpEventType.UploadProgress) {
|
||||
this.uploadProgress = Math.round((event.loaded / event.total!) * 100);
|
||||
console.log(event.type, this.uploadProgress);
|
||||
} else if (event.type === HttpEventType.Response) {
|
||||
this.uploadProgress = 100;
|
||||
this.selectedPatient.imageID = event.body.toString();
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.error('Upload failed', error);
|
||||
this.uploadProgress = 0;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
editPatient(Patient: any) {
|
||||
|
@ -52,30 +52,27 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p-table #dt2 dataKey="id" [value]="patientrecords" [paginator]="true" [rows]="10" [totalRecords]="totalRecords"
|
||||
[lazy]="true" (onLazyLoad)="loadPatient($event,patientId)" [rowsPerPageOptions]="[10, 20, 50]"
|
||||
[responsiveLayout]="'scroll'" [globalFilterFields]="['id', 'name', 'diagnosis']"
|
||||
[filters]="{ global: { value: '', matchMode: 'contains' } }" class="table table-striped">
|
||||
<div class="mt-4">
|
||||
<p-table #dt2 [value]="patientrecords" [paginator]="true" [rows]="10" [totalRecords]="totalRecords" [lazy]="true"
|
||||
(onLazyLoad)="loadPatient($event,patientId)" [rowsPerPageOptions]="[10, 20, 50]" [responsiveLayout]="'scroll'"
|
||||
[globalFilterFields]="['id', 'name', 'diagnosis']" class="card shadow-sm">
|
||||
|
||||
<ng-template pTemplate="caption">
|
||||
<div class="flex">
|
||||
<h2 class="mr-auto">{{'::PatientHeader' | abpLocalization}}</h2>
|
||||
<div>
|
||||
<button *ngIf="createpermission" pButton class="p-button-rounded p-button-success ml-2"
|
||||
<div class="flex justify-content-between align-items-center">
|
||||
<h3>{{'::PatientHeader' | abpLocalization}}</h3>
|
||||
<div class="flex gap-2">
|
||||
<button *ngIf="createpermission" pButton class="p-button-rounded p-button-success"
|
||||
(click)="openNewPatientDialog()">
|
||||
<i class="pi pi-plus-circle"></i>
|
||||
</button>
|
||||
<button pButton class="p-button-rounded p-button-warning ml-2" (click)="exportPatient()">
|
||||
<button pButton class="p-button-rounded p-button-warning" (click)="exportPatient()">
|
||||
<i class="pi pi-download"></i>
|
||||
</button>
|
||||
<p-iconField iconPosition="right" class="ml-2">
|
||||
<p-inputIcon>
|
||||
<span class="p-input-icon-left">
|
||||
<i class="pi pi-search"></i>
|
||||
</p-inputIcon>
|
||||
<input pInputText type="text" (input)="dt2.filterGlobal($event.target.value, 'contains')"
|
||||
[(ngModel)]="globalFilter" placeholder="Search keyword" />
|
||||
</p-iconField>
|
||||
<input pInputText type="text" [(ngModel)]="globalFilter"
|
||||
(input)="dt2.filterGlobal($event.target.value, 'contains')" placeholder="Search...">
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
@ -83,14 +80,14 @@
|
||||
<ng-template pTemplate="header">
|
||||
<tr>
|
||||
<th class="hidden" pSortableColumn="id">Patient ID <p-sortIcon field="id" /></th>
|
||||
<th pSortableColumn="fullName">Full Name <p-sortIcon field="fullName" /></th>
|
||||
<th pSortableColumn="gender">Gender <p-sortIcon field="fullName" /></th>
|
||||
<th>Full Name</th>
|
||||
<th>Gender</th>
|
||||
<th pSortableColumn="dateOfAdmission">Date of Admission <p-sortIcon field="dateOfAdmission" /></th>
|
||||
<th pSortableColumn="diagnosis">Diagnosis <p-sortIcon field="diagnosis" /></th>
|
||||
<th>Lab Reports</th>
|
||||
<th>Medications</th>
|
||||
<th pSortableColumn="nextFollowUp">Next Follow-Up <p-sortIcon field="nextFollowUp" /></th>
|
||||
<th pSortableColumn="status">Status <p-sortIcon field="status" /></th>
|
||||
<th>Status</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</ng-template>
|
||||
@ -106,80 +103,44 @@
|
||||
</td>
|
||||
<td>{{ patientrecord.dateOfAdmission | date }}</td>
|
||||
<td>{{ patientrecord.diagnosis }}</td>
|
||||
<td><i class="pi pi-file-pdf pdf-icon"></i></td>
|
||||
<td><i class="pi pi-file-pdf pdf-icon"></i></td>
|
||||
<td><i class="pi pi-file-pdf text-danger"></i></td>
|
||||
<td><i class="pi pi-file-pdf text-primary"></i></td>
|
||||
<td>{{ patientrecord.nextFollowUp | date }}</td>
|
||||
<td>{{ status[patientrecord.patients.status] }}</td>
|
||||
<td class="d-flex">
|
||||
<button *ngIf="editpermission" class="btn btn-warning btn-sm" (click)="editPatient(patientrecord)"><i
|
||||
class="pi pi-pencil"></i></button>
|
||||
<button *ngIf="deletepermission" class="btn btn-danger btn-sm ml-1"
|
||||
(click)="deletePatient(patientrecord.id)"><i class="pi pi-trash"></i></button>
|
||||
<td>
|
||||
<span class="badge"
|
||||
[ngClass]="patientrecord.patients.status === 1 ? 'bg-success' : (patientrecord.patients.status === 2 ? 'bg-primary':'bg-danger')">
|
||||
{{ status[patientrecord.patients.status] }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="flex gap-2">
|
||||
<button *ngIf="editpermission" class="btn btn-warning btn-sm" (click)="editPatient(patientrecord)">
|
||||
<i class="pi pi-pencil"></i>
|
||||
</button>
|
||||
<button *ngIf="deletepermission" class="btn btn-danger btn-sm" (click)="deletePatient(patientrecord.id)">
|
||||
<i class="pi pi-trash"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
</ng-template>
|
||||
|
||||
<ng-template pTemplate="emptymessage">
|
||||
<tr>
|
||||
<td colspan="11">No Patients found.</td>
|
||||
<td colspan="9">No Patients found.</td>
|
||||
</tr>
|
||||
</ng-template>
|
||||
</p-table>
|
||||
<span>Total Records: {{totalRecords}}</span>
|
||||
<div class="mt-2">Total Records: {{totalRecords}}</div>
|
||||
</div>
|
||||
<div>
|
||||
<p-dialog *ngIf="patientDialog" header="{{patientDialogTitle}}" [(visible)]="patientDialog" [modal]="true"
|
||||
[closable]="true" [style]="{width: '85%', height: '100%'}">
|
||||
[closable]="true" [style]="{width: '70%', height: 'auto'}">
|
||||
<form #patientrecord="ngForm" (ngSubmit)="savePatient(patientrecord)" novalidate>
|
||||
<div class="p-fluid">
|
||||
<div class="p-grid">
|
||||
<!-- <div class="p-col-6">
|
||||
<div class="field">
|
||||
<label for="fullname">Full Name</label>
|
||||
<input id="fullname" name="fullname" type="text" autocomplete="off" pInputText
|
||||
[(ngModel)]="selectedPatient.fullName" placeholder="Enter full patient name" required
|
||||
#fullname="ngModel" />
|
||||
<small *ngIf="fullname.invalid && fullname.touched" class="p-error">
|
||||
Full Name is required.
|
||||
</small>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- <div class="p-col-6">
|
||||
<div class="field">
|
||||
<label for="mobile">Mobile</label>
|
||||
<input id="mobile" name="mobile" type="text" autocomplete="off" pInputText
|
||||
[(ngModel)]="selectedPatient.mobile" maxlength="10" pattern="^[0-9]{10}$"
|
||||
placeholder="Enter mobile number" required #mobile="ngModel" />
|
||||
<small *ngIf="mobile.invalid && mobile.touched" class="p-error">
|
||||
Mobile number is required and must be 10 digits.
|
||||
</small>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="p-fluid grid">
|
||||
|
||||
<div class="p-grid">
|
||||
<div class="p-col-6">
|
||||
<!-- <div class="field">
|
||||
<label for="gender">Gender</label>
|
||||
<div>
|
||||
<label class="mx-1">
|
||||
<input style="background-color: #fff;" id="male" type="radio" name="gender"
|
||||
[(ngModel)]="selectedgender" [value]="1" required #gender="ngModel" />
|
||||
Male
|
||||
</label>
|
||||
<label>
|
||||
<input style="background-color: #fff;" id="female" type="radio" name="gender"
|
||||
[(ngModel)]="selectedgender" [value]="2" required />
|
||||
Female
|
||||
</label>
|
||||
<small *ngIf="!selectedgender" class="p-error">
|
||||
Please select a gender.
|
||||
</small>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="p-col-6">
|
||||
<!-- Admission Date -->
|
||||
<div class="col-6">
|
||||
<div class="field">
|
||||
<label for="admissionDate">Admission Date</label>
|
||||
<label for="admissionDate"><i class="pi pi-calendar"></i> Admission Date</label>
|
||||
<p-calendar id="admissionDate" name="admissionDate" [(ngModel)]="selectdateOfAdmission" showIcon required
|
||||
#admissionDate="ngModel"></p-calendar>
|
||||
<small *ngIf="admissionDate.invalid && admissionDate.touched" class="p-error">
|
||||
@ -187,39 +148,11 @@
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-grid">
|
||||
<div class="p-col-6">
|
||||
<!-- Next Follow-Up Date -->
|
||||
<div class="col-6">
|
||||
<div class="field">
|
||||
<label for="labReport">Lab Report</label>
|
||||
<input type="file" id="labReport" name="labReport" accept=".pdf,.doc,.docx"
|
||||
(change)="handleLabReportUpload($event)" />
|
||||
</div>
|
||||
<small *ngIf="labReportUrlpath !==''">{{labReportUrlpath}} <i class="pi pi-file-pdf pdf-icon"></i></small>
|
||||
</div>
|
||||
<div class="p-col-6">
|
||||
<div class="field">
|
||||
<label for="medications">Medications</label>
|
||||
<input type="file" id="medications" name="medications" accept=".pdf,.doc,.docx"
|
||||
(change)="handleMedicationsUpload($event)" />
|
||||
</div>
|
||||
<small *ngIf="medicationUrlpath !==''">{{medicationUrlpath}} <i class="pi pi-file-pdf pdf-icon"></i></small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-grid">
|
||||
<div class="p-col-6">
|
||||
<div class="field">
|
||||
<label for="medicationHistory">Medication History</label>
|
||||
<input type="file" id="medicationHistory" name="medicationHistory" accept=".pdf,.doc,.docx"
|
||||
(change)="handleMedicationHistoryUpload($event)" />
|
||||
</div>
|
||||
<small *ngIf="medicationHistoryUrlpath !==''">{{medicationHistoryUrlpath}} <i class="pi pi-file-pdf pdf-icon"></i></small>
|
||||
</div>
|
||||
<div class="p-col-6">
|
||||
<div class="field">
|
||||
<label for="nextFollowUp">Next FollowUp Date</label>
|
||||
<label for="nextFollowUp"><i class="pi pi-calendar-plus"></i> Next Follow-Up Date</label>
|
||||
<p-calendar id="nextFollowUp" name="nextFollowUp" [(ngModel)]="selectnextFollowUp" showIcon required
|
||||
#nextFollowUp="ngModel"></p-calendar>
|
||||
<small *ngIf="nextFollowUp.invalid && nextFollowUp.touched" class="p-error">
|
||||
@ -229,12 +162,52 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-grid">
|
||||
<div class="p-col-12">
|
||||
<!-- File Uploads -->
|
||||
<div class="p-fluid grid">
|
||||
<div class="col-6">
|
||||
<div class="field">
|
||||
<div>
|
||||
<label for="diagnosis">Diagnosis</label>
|
||||
<label for="labReport"><i class="pi pi-file-pdf"></i> Lab Report</label>
|
||||
<input type="file" id="labReport" name="labReport" accept=".pdf,.doc,.docx"
|
||||
(change)="handleUpload($event,'Lab-Report')" />
|
||||
<div *ngIf="uploadProgress1 > 0">
|
||||
<p>Uploading... {{ uploadProgress1 }}%</p>
|
||||
<progress [value]="uploadProgress1" max="100"></progress>
|
||||
</div>
|
||||
<small *ngIf="labReportUrlpath!==''">{{labReportUrlpath}} <i class="pi pi-file"></i></small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<div class="field">
|
||||
<label for="medications"><i class="pi pi-file-pdf"></i> Medications</label>
|
||||
<input type="file" id="medications" name="medications" accept=".pdf,.doc,.docx"
|
||||
(change)="handleUpload($event,'Medication')" />
|
||||
<div *ngIf="uploadProgress2 > 0">
|
||||
<p>Uploading... {{ uploadProgress2 }}%</p>
|
||||
<progress [value]="uploadProgress2" max="100"></progress>
|
||||
</div>
|
||||
<small *ngIf="medicationUrlpath!==''">{{medicationUrlpath}} <i class="pi pi-file"></i></small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="field">
|
||||
<label for="medicationHistory"><i class="pi pi-file-pdf"></i>Medication History</label>
|
||||
<input type="file" id="medicationHistory" name="medicationHistory" accept=".pdf,.doc,.docx"
|
||||
(change)="handleUpload($event,'Medication-History')" />
|
||||
<div *ngIf="uploadProgress3 > 0">
|
||||
<p>Uploading... {{ uploadProgress3 }}%</p>
|
||||
<progress [value]="uploadProgress3" max="100"></progress>
|
||||
</div>
|
||||
<small *ngIf="medicationHistoryUrlpath !==''">{{medicationHistoryUrlpath}} <i
|
||||
class="pi pi-file-pdf pdf-icon"></i></small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Diagnosis -->
|
||||
<div class="p-fluid">
|
||||
<div class="field">
|
||||
<label for="diagnosis"><i class="pi pi-heartbeat"></i> Diagnosis</label>
|
||||
<textarea style="width: 100%; background-color: #fff; color: black;" id="diagnosis" name="diagnosis"
|
||||
pInputTextarea rows="5" cols="30" [(ngModel)]="selectedPatient.diagnosis" required
|
||||
#diagnosis="ngModel"></textarea>
|
||||
@ -243,13 +216,12 @@
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-grid">
|
||||
<div class="p-col-6">
|
||||
<!-- Insurance Provider -->
|
||||
<div class="p-fluid">
|
||||
<div class="field">
|
||||
<label for="insuranceProvider">Insurance Provider</label>
|
||||
<input id="insuranceProvider" name="insuranceProvider" type="text" autocomplete="off" pInputText
|
||||
<label for="insuranceProvider"><i class="pi pi-credit-card"></i> Insurance Provider</label>
|
||||
<input id="insuranceProvider" name="insuranceProvider" type="text" pInputText
|
||||
[(ngModel)]="selectedPatient.insuranceProvider" required placeholder="Enter insurance provider"
|
||||
#insurance="ngModel" />
|
||||
<small *ngIf="insurance.invalid && insurance.touched" class="p-error">
|
||||
@ -257,22 +229,15 @@
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-col-6">
|
||||
<!-- <div class="field">
|
||||
<label for="status">Status</label>
|
||||
<p-dropdown name="status" id="status" [options]="statuslist" [(ngModel)]="selectedstatus"
|
||||
optionLabel="label" optionValue="value" placeholder="Select status" required
|
||||
#status="ngModel"></p-dropdown>
|
||||
<small *ngIf="selectedstatus === 0" class="p-error">
|
||||
Status is required.
|
||||
</small>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" pButton class="btn btn-primary" [disabled]="patientrecord.invalid">Save</button>
|
||||
<button pButton class="btn btn-secondary ml-1" (click)="closeDialog()">Close</button>
|
||||
|
||||
<!-- Buttons -->
|
||||
<div class="p-dialog-footer flex justify-content-end">
|
||||
<button type="submit" pButton class="btn btn-primary" [disabled]="patientrecord.invalid">
|
||||
<i class="pi pi-check"></i> Save
|
||||
</button>
|
||||
<button pButton class="btn btn-secondary ml-2" (click)="closeDialog()">
|
||||
<i class="pi pi-times"></i> Close
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</p-dialog>
|
||||
|
@ -18,7 +18,8 @@
|
||||
}
|
||||
|
||||
.female {
|
||||
background-color: purple;
|
||||
background-color: #ff4081 !important;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.pdf-icon {
|
||||
|
@ -8,6 +8,7 @@ import { PermissionService } from '@abp/ng.core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { Confirmation, ConfirmationService, ToasterService } from '@abp/ng.theme.shared';
|
||||
import { HttpClient, HttpEventType, HttpParams, HttpRequest } from '@angular/common/http';
|
||||
|
||||
@Component({
|
||||
selector: 'app-patient-record',
|
||||
@ -40,18 +41,9 @@ export class PatientRecordComponent implements OnInit {
|
||||
medicationHistoryUrlpath: string;
|
||||
medicationUrlpath: string;
|
||||
guid: string = '00000000-0000-0000-0000-000000000000';
|
||||
options: Partial<Confirmation.Options> = {
|
||||
hideCancelBtn: false,
|
||||
hideYesBtn: false,
|
||||
dismissible: false,
|
||||
cancelText: 'Close',
|
||||
yesText: 'Confirm',
|
||||
messageLocalizationParams: ['Demo'],
|
||||
titleLocalizationParams: [],
|
||||
// You can customize icon
|
||||
// icon: 'fa fa-exclamation-triangle', // or
|
||||
// iconTemplate : '<img src="custom-image-path.jpg" alt=""/>'
|
||||
};
|
||||
uploadProgress1 = 0;
|
||||
uploadProgress2 = 0;
|
||||
uploadProgress3 = 0;
|
||||
|
||||
constructor(
|
||||
private patientService: PatientService,
|
||||
@ -59,7 +51,8 @@ export class PatientRecordComponent implements OnInit {
|
||||
private permissionChecker: PermissionService,
|
||||
private toaster: ToasterService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router
|
||||
private router: Router,
|
||||
private http: HttpClient
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
@ -103,6 +96,9 @@ export class PatientRecordComponent implements OnInit {
|
||||
this.medicationHistoryUrlpath = '';
|
||||
this.selectdateOfAdmission = new Date();
|
||||
this.selectnextFollowUp = new Date();
|
||||
this.uploadProgress1 = 0;
|
||||
this.uploadProgress2 = 0;
|
||||
this.uploadProgress3 = 0;
|
||||
}
|
||||
|
||||
loadPatient(event: any, id: any) {
|
||||
@ -122,7 +118,6 @@ export class PatientRecordComponent implements OnInit {
|
||||
});
|
||||
this.patientService.getPatientRecordList(this.params, id).subscribe(data => {
|
||||
this.patientrecords = data.items;
|
||||
// console.log(data.items);
|
||||
this.totalRecords = data.totalCount;
|
||||
this.loading = false;
|
||||
});
|
||||
@ -201,50 +196,113 @@ export class PatientRecordComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
handleLabReportUpload(event: Event): void {
|
||||
handleUpload(event: Event, tag: string): void {
|
||||
const input = event.target as HTMLInputElement;
|
||||
if (input && input.files) {
|
||||
const tag = 'Lab-Report';
|
||||
if (input.files.length > 0) {
|
||||
const formdata = new FormData();
|
||||
formdata.append('file', input.files[0]);
|
||||
this.UploadFileData(tag, formdata);
|
||||
} else {
|
||||
this.uploadProgress1 = 0;
|
||||
this.uploadProgress2 = 0;
|
||||
this.uploadProgress3 = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
handleMedicationsUpload(event: any): void {
|
||||
const input = event.target as HTMLInputElement;
|
||||
if (input && input.files) {
|
||||
const tag = 'Medication';
|
||||
const formdata = new FormData();
|
||||
formdata.append('file', input.files[0]);
|
||||
this.UploadFileData(tag, formdata);
|
||||
}
|
||||
}
|
||||
// handleLabReportUpload(event: Event): void {
|
||||
// const input = event.target as HTMLInputElement;
|
||||
// if (input && input.files) {
|
||||
// const tag = 'Lab-Report';
|
||||
// const formdata = new FormData();
|
||||
// formdata.append('file', input.files[0]);
|
||||
// this.UploadFileData(tag, formdata);
|
||||
// }
|
||||
// }
|
||||
|
||||
handleMedicationHistoryUpload(event: any): void {
|
||||
const input = event.target as HTMLInputElement;
|
||||
if (input && input.files) {
|
||||
const tag = 'Medication-History';
|
||||
const formdata = new FormData();
|
||||
formdata.append('file', input.files[0]);
|
||||
this.UploadFileData(tag, formdata);
|
||||
}
|
||||
}
|
||||
// handleMedicationsUpload(event: any): void {
|
||||
// const input = event.target as HTMLInputElement;
|
||||
// if (input && input.files) {
|
||||
// const tag = 'Medication';
|
||||
// const formdata = new FormData();
|
||||
// formdata.append('file', input.files[0]);
|
||||
// this.UploadFileData(tag, formdata);
|
||||
// }
|
||||
// }
|
||||
|
||||
// handleMedicationHistoryUpload(event: any): void {
|
||||
// const input = event.target as HTMLInputElement;
|
||||
// if (input && input.files) {
|
||||
// const tag = 'Medication-History';
|
||||
// const formdata = new FormData();
|
||||
// formdata.append('file', input.files[0]);
|
||||
// this.UploadFileData(tag, formdata);
|
||||
// }
|
||||
// }
|
||||
|
||||
UploadFileData(tag: string, formdata: FormData) {
|
||||
this.patientService.uploadFile(tag, formdata).subscribe(result => {
|
||||
// this.patientService.uploadFile(tag, formdata).subscribe(result => {
|
||||
// switch (tag) {
|
||||
// case 'Lab-Report':
|
||||
// this.selectedPatient.labReportUrlID = result;
|
||||
// break;
|
||||
// case 'Medication':
|
||||
// this.selectedPatient.medicationUrlID = result;
|
||||
// break;
|
||||
// case 'Medication-History':
|
||||
// this.selectedPatient.medicationHistoryUrlID = result;
|
||||
// break;
|
||||
// }
|
||||
// });
|
||||
const req = new HttpRequest(
|
||||
'POST',
|
||||
environment.apis.default.url + '/api/app/patient/upload-file',
|
||||
formdata,
|
||||
{
|
||||
reportProgress: true,
|
||||
responseType: 'text',
|
||||
params: new HttpParams().set('tagName', tag),
|
||||
}
|
||||
);
|
||||
this.http.request(req).subscribe(
|
||||
event => {
|
||||
if (event.type === HttpEventType.UploadProgress) {
|
||||
// this.uploadProgress = Math.round((event.loaded / event.total!) * 100);
|
||||
switch (tag) {
|
||||
case 'Lab-Report':
|
||||
this.selectedPatient.labReportUrlID = result;
|
||||
this.uploadProgress1 = Math.round((event.loaded / event.total!) * 100);
|
||||
break;
|
||||
case 'Medication':
|
||||
this.selectedPatient.medicationUrlID = result;
|
||||
this.uploadProgress2 = Math.round((event.loaded / event.total!) * 100);
|
||||
break;
|
||||
case 'Medication-History':
|
||||
this.selectedPatient.medicationHistoryUrlID = result;
|
||||
this.uploadProgress3 = Math.round((event.loaded / event.total!) * 100);
|
||||
break;
|
||||
}
|
||||
});
|
||||
} else if (event.type === HttpEventType.Response) {
|
||||
switch (tag) {
|
||||
case 'Lab-Report':
|
||||
this.uploadProgress1 = 100;
|
||||
this.selectedPatient.labReportUrlID = event.body.toString();
|
||||
break;
|
||||
case 'Medication':
|
||||
this.uploadProgress2 = 100;
|
||||
this.selectedPatient.medicationUrlID = event.body.toString();
|
||||
break;
|
||||
case 'Medication-History':
|
||||
this.uploadProgress3 = 100;
|
||||
this.selectedPatient.medicationHistoryUrlID = event.body.toString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.error('Upload failed', error);
|
||||
this.uploadProgress1 = 100;
|
||||
this.uploadProgress2 = 100;
|
||||
this.uploadProgress3 = 100;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
savePatient(form: NgForm) {
|
||||
|
@ -17,6 +17,10 @@ export interface AppointmentDto {
|
||||
timeOfAppointment?: string;
|
||||
injuryORContion?: string;
|
||||
note?: string;
|
||||
insuranceProvider?: string;
|
||||
appointmentStatus: appointmentStatus;
|
||||
visitType: visitType;
|
||||
paymentStatus: paymentStatus;
|
||||
}
|
||||
|
||||
export interface CreateOrUpdateAppointmentDto {
|
||||
|
@ -3,7 +3,6 @@ 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',
|
||||
@ -21,6 +20,14 @@ export class AppointmentService {
|
||||
{ apiName: this.apiName,...config });
|
||||
|
||||
|
||||
deleteAppointmentRecord = (id: string, config?: Partial<Rest.Config>) =>
|
||||
this.restService.request<any, void>({
|
||||
method: 'DELETE',
|
||||
url: `/api/app/appointment/${id}/appointment-record`,
|
||||
},
|
||||
{ apiName: this.apiName,...config });
|
||||
|
||||
|
||||
get = (config?: Partial<Rest.Config>) =>
|
||||
this.restService.request<any, string>({
|
||||
method: 'GET',
|
||||
@ -30,6 +37,14 @@ export class AppointmentService {
|
||||
{ apiName: this.apiName,...config });
|
||||
|
||||
|
||||
getAppointmentById = (id: string, config?: Partial<Rest.Config>) =>
|
||||
this.restService.request<any, AppointmentDto>({
|
||||
method: 'GET',
|
||||
url: `/api/app/appointment/${id}/appointment-by-id`,
|
||||
},
|
||||
{ apiName: this.apiName,...config });
|
||||
|
||||
|
||||
getAppointmentList = (input: PagingSortResultDto, config?: Partial<Rest.Config>) =>
|
||||
this.restService.request<any, PagedResultDto<AppointmentDto>>({
|
||||
method: 'GET',
|
||||
@ -39,10 +54,10 @@ export class AppointmentService {
|
||||
{ apiName: this.apiName,...config });
|
||||
|
||||
|
||||
updateAppointment = (id: string, input: CreateOrUpdateAppointmentDto, config?: Partial<Rest.Config>) =>
|
||||
this.restService.request<any, PatientRecordDto>({
|
||||
updateAppointment = (input: CreateOrUpdateAppointmentDto, config?: Partial<Rest.Config>) =>
|
||||
this.restService.request<any, AppointmentDto>({
|
||||
method: 'PUT',
|
||||
url: `/api/app/appointment/${id}/appointment`,
|
||||
url: '/api/app/appointment/appointment',
|
||||
body: input,
|
||||
},
|
||||
{ apiName: this.apiName,...config });
|
||||
|
@ -985,6 +985,43 @@
|
||||
"allowAnonymous": null,
|
||||
"implementFrom": "HospitalManagementSystem.Appointments.AppointmentAppService"
|
||||
},
|
||||
"GetAppointmentByIdAsyncById": {
|
||||
"uniqueName": "GetAppointmentByIdAsyncById",
|
||||
"name": "GetAppointmentByIdAsync",
|
||||
"httpMethod": "GET",
|
||||
"url": "api/app/appointment/{id}/appointment-by-id",
|
||||
"supportedVersions": [],
|
||||
"parametersOnMethod": [
|
||||
{
|
||||
"name": "id",
|
||||
"typeAsString": "System.Guid, System.Private.CoreLib",
|
||||
"type": "System.Guid",
|
||||
"typeSimple": "string",
|
||||
"isOptional": false,
|
||||
"defaultValue": null
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"nameOnMethod": "id",
|
||||
"name": "id",
|
||||
"jsonName": null,
|
||||
"type": "System.Guid",
|
||||
"typeSimple": "string",
|
||||
"isOptional": false,
|
||||
"defaultValue": null,
|
||||
"constraintTypes": [],
|
||||
"bindingSourceId": "Path",
|
||||
"descriptorName": ""
|
||||
}
|
||||
],
|
||||
"returnValue": {
|
||||
"type": "HospitalManagementSystem.Appoinments.Dto.AppointmentDto",
|
||||
"typeSimple": "HospitalManagementSystem.Appoinments.Dto.AppointmentDto"
|
||||
},
|
||||
"allowAnonymous": null,
|
||||
"implementFrom": "HospitalManagementSystem.Appointments.AppointmentAppService"
|
||||
},
|
||||
"CreateAppointmentAsyncByInput": {
|
||||
"uniqueName": "CreateAppointmentAsyncByInput",
|
||||
"name": "CreateAppointmentAsync",
|
||||
@ -1022,11 +1059,48 @@
|
||||
"allowAnonymous": null,
|
||||
"implementFrom": "HospitalManagementSystem.Appointments.AppointmentAppService"
|
||||
},
|
||||
"UpdateAppointmentAsyncByIdAndInput": {
|
||||
"uniqueName": "UpdateAppointmentAsyncByIdAndInput",
|
||||
"UpdateAppointmentAsyncByInput": {
|
||||
"uniqueName": "UpdateAppointmentAsyncByInput",
|
||||
"name": "UpdateAppointmentAsync",
|
||||
"httpMethod": "PUT",
|
||||
"url": "api/app/appointment/{id}/appointment",
|
||||
"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"
|
||||
},
|
||||
"DeleteAppointmentRecordAsyncById": {
|
||||
"uniqueName": "DeleteAppointmentRecordAsyncById",
|
||||
"name": "DeleteAppointmentRecordAsync",
|
||||
"httpMethod": "DELETE",
|
||||
"url": "api/app/appointment/{id}/appointment-record",
|
||||
"supportedVersions": [],
|
||||
"parametersOnMethod": [
|
||||
{
|
||||
@ -1036,14 +1110,6 @@
|
||||
"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": [
|
||||
@ -1058,25 +1124,13 @@
|
||||
"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"
|
||||
"type": "System.Void",
|
||||
"typeSimple": "System.Void"
|
||||
},
|
||||
"allowAnonymous": null,
|
||||
"allowAnonymous": false,
|
||||
"implementFrom": "HospitalManagementSystem.Appointments.AppointmentAppService"
|
||||
}
|
||||
}
|
||||
@ -4731,8 +4785,8 @@
|
||||
{
|
||||
"name": "DOB",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"type": "System.DateTime?",
|
||||
"typeSimple": "string?",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
@ -4799,6 +4853,54 @@
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "InsuranceProvider",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "AppointmentStatus",
|
||||
"jsonName": null,
|
||||
"type": "HospitalManagementSystem.GlobalEnum.appointmentStatus",
|
||||
"typeSimple": "HospitalManagementSystem.GlobalEnum.appointmentStatus",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "VisitType",
|
||||
"jsonName": null,
|
||||
"type": "HospitalManagementSystem.GlobalEnum.visitType",
|
||||
"typeSimple": "HospitalManagementSystem.GlobalEnum.visitType",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "PaymentStatus",
|
||||
"jsonName": null,
|
||||
"type": "HospitalManagementSystem.GlobalEnum.paymentStatus",
|
||||
"typeSimple": "HospitalManagementSystem.GlobalEnum.paymentStatus",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -4896,8 +4998,8 @@
|
||||
{
|
||||
"name": "DOB",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"type": "System.DateTime?",
|
||||
"typeSimple": "string?",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
|
@ -1,6 +1,38 @@
|
||||
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;
|
||||
@ -33,35 +65,3 @@ 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;
|
||||
}
|
||||
|
@ -16,11 +16,15 @@ namespace HospitalManagementSystem.Appoinments.Dto
|
||||
public string? Mobile { get; set; }
|
||||
public string? Address { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public string? DOB { get; set; }
|
||||
public DateTime? DOB { get; set; }
|
||||
public Guid? DoctorId { get; set; }
|
||||
public DateTime? DateOfAppointment { get; set; }
|
||||
public string? TimeOfAppointment { get; set; }
|
||||
public string? InjuryORContion { get; set; }
|
||||
public string? Note { get; set; }
|
||||
public string? InsuranceProvider { get; set; }
|
||||
public appointmentStatus AppointmentStatus { get; set; }
|
||||
public visitType VisitType { get; set; }
|
||||
public paymentStatus PaymentStatus { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ namespace HospitalManagementSystem.Appoinments.Dto
|
||||
public string? Mobile { get; set; }
|
||||
public string? Address { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public string? DOB { get; set; }
|
||||
public DateTime? DOB { get; set; }
|
||||
public Guid? DoctorId { get; set; }
|
||||
public DateTime? DateOfAppointment { get; set; }
|
||||
public string? TimeOfAppointment { get; set; }
|
||||
|
@ -18,6 +18,8 @@ using HospitalManagementSystem.Dto;
|
||||
using Abp.Application.Services.Dto;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Linq.Dynamic.Core;
|
||||
using Abp.UI;
|
||||
using HospitalManagementSystem.Doctors;
|
||||
|
||||
namespace HospitalManagementSystem.Appointments
|
||||
{
|
||||
@ -26,11 +28,14 @@ namespace HospitalManagementSystem.Appointments
|
||||
private readonly ICurrentUser _currentUser;
|
||||
private readonly ICurrentTenant _currentTenant;
|
||||
private IRepository<Appointment, Guid> _appointmentsRepository;
|
||||
public AppointmentAppService(ICurrentUser currentUser, ICurrentTenant currentTenant, IRepository<Appointment, Guid> appointmentsRepository)
|
||||
private readonly IRepository<Doctor, Guid> _doctorRepository;
|
||||
|
||||
public AppointmentAppService(ICurrentUser currentUser, ICurrentTenant currentTenant, IRepository<Appointment, Guid> appointmentsRepository, IRepository<Doctor, Guid> doctorRepository)
|
||||
{
|
||||
_currentUser = currentUser;
|
||||
_currentTenant = currentTenant;
|
||||
_appointmentsRepository = appointmentsRepository;
|
||||
_doctorRepository = doctorRepository;
|
||||
}
|
||||
public async Task<string> GetAsync()
|
||||
{
|
||||
@ -63,6 +68,20 @@ namespace HospitalManagementSystem.Appointments
|
||||
);
|
||||
|
||||
}
|
||||
#endregion
|
||||
#region Get Appointment by ID
|
||||
public async Task<AppointmentDto> GetAppointmentByIdAsync(Guid id)
|
||||
{
|
||||
var appointment = await _appointmentsRepository.FirstOrDefaultAsync(x => x.Id == id);
|
||||
|
||||
if (appointment == null)
|
||||
{
|
||||
throw new UserFriendlyException("Appointment Details not found");
|
||||
}
|
||||
|
||||
return ObjectMapper.Map<Appointment, AppointmentDto>(appointment);
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region Create Appointment
|
||||
public async Task<AppointmentDto> CreateAppointmentAsync(CreateOrUpdateAppointmentDto input)
|
||||
@ -76,13 +95,23 @@ namespace HospitalManagementSystem.Appointments
|
||||
#endregion
|
||||
|
||||
#region Update Appointment
|
||||
public async Task<PatientRecordDto> UpdateAppointmentAsync(Guid id, CreateOrUpdateAppointmentDto input)
|
||||
public async Task<AppointmentDto> UpdateAppointmentAsync(CreateOrUpdateAppointmentDto input)
|
||||
{
|
||||
var appointment = await _appointmentsRepository.GetAsync(id);
|
||||
//var appointment = await _appointmentsRepository.GetAsync(input.Id);
|
||||
Appointment appointment = new Appointment();
|
||||
var newdata = ObjectMapper.Map<CreateOrUpdateAppointmentDto, Appointment>(input);
|
||||
newdata.Doctor = await _doctorRepository.GetAsync(input.DoctorId.Value);
|
||||
appointment = newdata;
|
||||
appointment = await _appointmentsRepository.UpdateAsync(appointment);
|
||||
return ObjectMapper.Map<Appointment, PatientRecordDto>(appointment);
|
||||
return ObjectMapper.Map<Appointment, AppointmentDto>(appointment);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Delete Appointment
|
||||
[Authorize(HospitalManagementSystemPermissions.Patient.Delete)]
|
||||
public async Task DeleteAppointmentRecordAsync(Guid id)
|
||||
{
|
||||
await _appointmentsRepository.DeleteAsync(id);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ namespace HospitalManagementSystem.Patients
|
||||
.Include(x => x.LabReportUrl)
|
||||
.Include(x => x.MedicationUrl)
|
||||
.Include(x => x.MedicationHistoryUrl)
|
||||
.WhereIf(!string.IsNullOrEmpty(input.Search), x => x.Patients.Name.ToLower().Contains(input.Search.ToLower()))
|
||||
.WhereIf(!string.IsNullOrEmpty(input.Search), x => x.Patients.Name.ToLower().Contains(input.Search.ToLower()) || x.Patients.Email.Contains(input.Search))
|
||||
.Where(x => x.Patients.Id == Id);
|
||||
|
||||
var totalCount = await filteredQuery.CountAsync();
|
||||
@ -270,7 +270,7 @@ namespace HospitalManagementSystem.Patients
|
||||
if (!string.IsNullOrEmpty(input.Search))
|
||||
{
|
||||
query = _patientRepository.GetQueryableAsync().Result
|
||||
.Where(x => x.Name.ToLower().Contains(input.Search.ToLower()))
|
||||
.Where(x => x.Name.ToLower().Contains(input.Search.ToLower()) || x.Email.Contains(input.Search))
|
||||
.OrderBy(input.Sorting ?? (nameof(Patient.Id) + " asc"))
|
||||
.Skip(input.SkipCount)
|
||||
.Take(input.MaxResultCount)
|
||||
|
@ -29,6 +29,7 @@ namespace HospitalManagementSystem.GlobalEnum
|
||||
NewPatient = 1,
|
||||
Followup = 2,
|
||||
}
|
||||
|
||||
public enum paymentStatus
|
||||
{
|
||||
Paid = 1,
|
||||
|
@ -14,8 +14,8 @@ namespace HospitalManagementSystem.Appointments
|
||||
public string? Mobile { get; set; }
|
||||
public string? Address { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public string? DOB { get; set; }
|
||||
public Guid? DoctorId { get; set; }
|
||||
public DateTime? DOB { get; set; }
|
||||
//public Guid? DoctorId { get; set; }
|
||||
[ForeignKey("DoctorId")]
|
||||
public virtual Doctor? Doctor { get; set; }
|
||||
public DateTime? DateOfAppointment { get; set; }
|
||||
|
@ -28,4 +28,8 @@
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Migrations\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,131 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace HospitalManagementSystem.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addedDepartment_Doctor_Appointment_Table : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Departments",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
DepartmentNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DepartmentName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DepartmentDate = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DepartmentHead = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Status = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Departments", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Doctors",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
FirstName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
LastName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Gender = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Mobile = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Password = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Designation = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DepartmentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
Address = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DOB = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Education = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Doctors", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Doctors_Departments_DepartmentId",
|
||||
column: x => x.DepartmentId,
|
||||
principalTable: "Departments",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Appointments",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
FirstName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
LastName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Gender = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Mobile = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Address = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DOB = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DoctorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DateOfAppointment = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
TimeOfAppointment = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
InjuryORContion = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Note = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Appointments", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Appointments_Doctors_DoctorId",
|
||||
column: x => x.DoctorId,
|
||||
principalTable: "Doctors",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Appointments_DoctorId",
|
||||
table: "Appointments",
|
||||
column: "DoctorId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Doctors_DepartmentId",
|
||||
table: "Doctors",
|
||||
column: "DepartmentId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Appointments");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Doctors");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Departments");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,93 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace HospitalManagementSystem.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class added_patientinpatientrecord : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Patient",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Gender = table.Column<int>(type: "int", nullable: false),
|
||||
Mobile = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Age = table.Column<int>(type: "int", nullable: false),
|
||||
Treatment = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
DoctorAssigned = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Address = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
BloodGroup = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
AdmissionDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DischargeDate = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Patient", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PatientRecords",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
PatientsId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
DateOfAdmission = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
Diagnosis = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
TreatmentPlan = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
DoctorNotes = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
LabReportUrl = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
MedicationUrl = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
MedicationHistoryUrl = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
NextFollowUp = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
InsuranceProvider = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PatientRecords", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_PatientRecords_Patient_PatientsId",
|
||||
column: x => x.PatientsId,
|
||||
principalTable: "Patient",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PatientRecords_PatientsId",
|
||||
table: "PatientRecords",
|
||||
column: "PatientsId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "PatientRecords");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Patient");
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,241 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace HospitalManagementSystem.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class patientdocument_entitydocument : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LabReportUrl",
|
||||
table: "PatientRecords");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MedicationHistoryUrl",
|
||||
table: "PatientRecords");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MedicationUrl",
|
||||
table: "PatientRecords");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "LabReportUrlId",
|
||||
table: "PatientRecords",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "MedicationHistoryUrlId",
|
||||
table: "PatientRecords",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "MedicationUrlId",
|
||||
table: "PatientRecords",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "ImagesId",
|
||||
table: "Patient",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EntityDocuments",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
OriginalFileName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
GeneratedFileName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
FileSize = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
FilePath = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
FileType = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
TagName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
UploadDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EntityDocuments", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PatientDocuments",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
PatientsId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
EntityDocumentsId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
TagName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PatientDocuments", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_PatientDocuments_EntityDocuments_EntityDocumentsId",
|
||||
column: x => x.EntityDocumentsId,
|
||||
principalTable: "EntityDocuments",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_PatientDocuments_Patient_PatientsId",
|
||||
column: x => x.PatientsId,
|
||||
principalTable: "Patient",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PatientRecords_LabReportUrlId",
|
||||
table: "PatientRecords",
|
||||
column: "LabReportUrlId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PatientRecords_MedicationHistoryUrlId",
|
||||
table: "PatientRecords",
|
||||
column: "MedicationHistoryUrlId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PatientRecords_MedicationUrlId",
|
||||
table: "PatientRecords",
|
||||
column: "MedicationUrlId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Patient_ImagesId",
|
||||
table: "Patient",
|
||||
column: "ImagesId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PatientDocuments_EntityDocumentsId",
|
||||
table: "PatientDocuments",
|
||||
column: "EntityDocumentsId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PatientDocuments_PatientsId",
|
||||
table: "PatientDocuments",
|
||||
column: "PatientsId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Patient_EntityDocuments_ImagesId",
|
||||
table: "Patient",
|
||||
column: "ImagesId",
|
||||
principalTable: "EntityDocuments",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PatientRecords_EntityDocuments_LabReportUrlId",
|
||||
table: "PatientRecords",
|
||||
column: "LabReportUrlId",
|
||||
principalTable: "EntityDocuments",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PatientRecords_EntityDocuments_MedicationHistoryUrlId",
|
||||
table: "PatientRecords",
|
||||
column: "MedicationHistoryUrlId",
|
||||
principalTable: "EntityDocuments",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PatientRecords_EntityDocuments_MedicationUrlId",
|
||||
table: "PatientRecords",
|
||||
column: "MedicationUrlId",
|
||||
principalTable: "EntityDocuments",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Patient_EntityDocuments_ImagesId",
|
||||
table: "Patient");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_PatientRecords_EntityDocuments_LabReportUrlId",
|
||||
table: "PatientRecords");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_PatientRecords_EntityDocuments_MedicationHistoryUrlId",
|
||||
table: "PatientRecords");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_PatientRecords_EntityDocuments_MedicationUrlId",
|
||||
table: "PatientRecords");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PatientDocuments");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "EntityDocuments");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_PatientRecords_LabReportUrlId",
|
||||
table: "PatientRecords");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_PatientRecords_MedicationHistoryUrlId",
|
||||
table: "PatientRecords");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_PatientRecords_MedicationUrlId",
|
||||
table: "PatientRecords");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Patient_ImagesId",
|
||||
table: "Patient");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "LabReportUrlId",
|
||||
table: "PatientRecords");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MedicationHistoryUrlId",
|
||||
table: "PatientRecords");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MedicationUrlId",
|
||||
table: "PatientRecords");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ImagesId",
|
||||
table: "Patient");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "LabReportUrl",
|
||||
table: "PatientRecords",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "MedicationHistoryUrl",
|
||||
table: "PatientRecords",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "MedicationUrl",
|
||||
table: "PatientRecords",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
}
|
||||
}
|
||||
}
|
@ -13,8 +13,8 @@ using Volo.Abp.EntityFrameworkCore;
|
||||
namespace HospitalManagementSystem.Migrations
|
||||
{
|
||||
[DbContext(typeof(HospitalManagementSystemDbContext))]
|
||||
[Migration("20250131062928_patientdocument_entitydocument")]
|
||||
partial class patientdocument_entitydocument
|
||||
[Migration("20250206061352_initial")]
|
||||
partial class initial
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@ -27,6 +27,229 @@ namespace HospitalManagementSystem.Migrations
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Appointments.Appointment", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("AppointmentStatus")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<string>("DOB")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime?>("DateOfAppointment")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<Guid?>("DoctorId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Gender")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("InjuryORContion")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("InsuranceProvider")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("PaymentStatus")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("TimeOfAppointment")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("VisitType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DoctorId");
|
||||
|
||||
b.ToTable("Appointments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Departments.Department", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<DateTime?>("DepartmentDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("DepartmentHead")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DepartmentName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DepartmentNo")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Departments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Doctors.Doctor", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<string>("DOB")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<Guid?>("DepartmentId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Designation")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Education")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Gender")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DepartmentId");
|
||||
|
||||
b.ToTable("Doctors");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Documents.EntityDocument", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@ -2053,6 +2276,24 @@ namespace HospitalManagementSystem.Migrations
|
||||
b.ToTable("AbpTenantConnectionStrings", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Appointments.Appointment", b =>
|
||||
{
|
||||
b.HasOne("HospitalManagementSystem.Doctors.Doctor", "Doctor")
|
||||
.WithMany("Appointments")
|
||||
.HasForeignKey("DoctorId");
|
||||
|
||||
b.Navigation("Doctor");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Doctors.Doctor", b =>
|
||||
{
|
||||
b.HasOne("HospitalManagementSystem.Departments.Department", "Department")
|
||||
.WithMany()
|
||||
.HasForeignKey("DepartmentId");
|
||||
|
||||
b.Navigation("Department");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Documents.PatientDocument", b =>
|
||||
{
|
||||
b.HasOne("HospitalManagementSystem.Documents.EntityDocument", "EntityDocuments")
|
||||
@ -2252,6 +2493,11 @@ namespace HospitalManagementSystem.Migrations
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Doctors.Doctor", b =>
|
||||
{
|
||||
b.Navigation("Appointments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
|
||||
{
|
||||
b.Navigation("Actions");
|
@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
namespace HospitalManagementSystem.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class Initial : Migration
|
||||
public partial class initial : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
@ -412,6 +412,54 @@ namespace HospitalManagementSystem.Migrations
|
||||
table.PrimaryKey("PK_AbpUsers", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Departments",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
DepartmentNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DepartmentName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DepartmentDate = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DepartmentHead = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Status = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Departments", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "EntityDocuments",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
OriginalFileName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
GeneratedFileName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
FileSize = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
FilePath = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
FileType = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
TagName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
UploadDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_EntityDocuments", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "OpenIddictApplications",
|
||||
columns: table => new
|
||||
@ -707,6 +755,75 @@ namespace HospitalManagementSystem.Migrations
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Doctors",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
FirstName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
LastName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Gender = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Mobile = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Password = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Designation = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DepartmentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
Address = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DOB = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Education = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Doctors", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Doctors_Departments_DepartmentId",
|
||||
column: x => x.DepartmentId,
|
||||
principalTable: "Departments",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Patient",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Gender = table.Column<int>(type: "int", nullable: false),
|
||||
Mobile = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Age = table.Column<int>(type: "int", nullable: false),
|
||||
Treatment = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
DoctorAssigned = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Address = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
BloodGroup = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
AdmissionDate = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DischargeDate = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
ImagesId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Patient", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Patient_EntityDocuments_ImagesId",
|
||||
column: x => x.ImagesId,
|
||||
principalTable: "EntityDocuments",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "OpenIddictAuthorizations",
|
||||
columns: table => new
|
||||
@ -755,6 +872,126 @@ namespace HospitalManagementSystem.Migrations
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Appointments",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
FirstName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
LastName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Gender = table.Column<int>(type: "int", nullable: false),
|
||||
Mobile = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Address = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DOB = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
DoctorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DateOfAppointment = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
TimeOfAppointment = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
InjuryORContion = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
Note = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
InsuranceProvider = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
||||
AppointmentStatus = table.Column<int>(type: "int", nullable: false),
|
||||
VisitType = table.Column<int>(type: "int", nullable: false),
|
||||
PaymentStatus = table.Column<int>(type: "int", nullable: false),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Appointments", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Appointments_Doctors_DoctorId",
|
||||
column: x => x.DoctorId,
|
||||
principalTable: "Doctors",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PatientDocuments",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
PatientsId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
EntityDocumentsId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
TagName = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PatientDocuments", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_PatientDocuments_EntityDocuments_EntityDocumentsId",
|
||||
column: x => x.EntityDocumentsId,
|
||||
principalTable: "EntityDocuments",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_PatientDocuments_Patient_PatientsId",
|
||||
column: x => x.PatientsId,
|
||||
principalTable: "Patient",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PatientRecords",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
PatientsId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
DateOfAdmission = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
Diagnosis = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
TreatmentPlan = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
DoctorNotes = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
LabReportUrlId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
MedicationUrlId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
MedicationHistoryUrlId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
NextFollowUp = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
InsuranceProvider = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PatientRecords", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_PatientRecords_EntityDocuments_LabReportUrlId",
|
||||
column: x => x.LabReportUrlId,
|
||||
principalTable: "EntityDocuments",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PatientRecords_EntityDocuments_MedicationHistoryUrlId",
|
||||
column: x => x.MedicationHistoryUrlId,
|
||||
principalTable: "EntityDocuments",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PatientRecords_EntityDocuments_MedicationUrlId",
|
||||
column: x => x.MedicationUrlId,
|
||||
principalTable: "EntityDocuments",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_PatientRecords_Patient_PatientsId",
|
||||
column: x => x.PatientsId,
|
||||
principalTable: "Patient",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "OpenIddictTokens",
|
||||
columns: table => new
|
||||
@ -1007,6 +1244,16 @@ namespace HospitalManagementSystem.Migrations
|
||||
table: "AbpUsers",
|
||||
column: "UserName");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Appointments_DoctorId",
|
||||
table: "Appointments",
|
||||
column: "DoctorId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Doctors_DepartmentId",
|
||||
table: "Doctors",
|
||||
column: "DepartmentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_OpenIddictApplications_ClientId",
|
||||
table: "OpenIddictApplications",
|
||||
@ -1036,6 +1283,41 @@ namespace HospitalManagementSystem.Migrations
|
||||
name: "IX_OpenIddictTokens_ReferenceId",
|
||||
table: "OpenIddictTokens",
|
||||
column: "ReferenceId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Patient_ImagesId",
|
||||
table: "Patient",
|
||||
column: "ImagesId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PatientDocuments_EntityDocumentsId",
|
||||
table: "PatientDocuments",
|
||||
column: "EntityDocumentsId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PatientDocuments_PatientsId",
|
||||
table: "PatientDocuments",
|
||||
column: "PatientsId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PatientRecords_LabReportUrlId",
|
||||
table: "PatientRecords",
|
||||
column: "LabReportUrlId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PatientRecords_MedicationHistoryUrlId",
|
||||
table: "PatientRecords",
|
||||
column: "MedicationHistoryUrlId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PatientRecords_MedicationUrlId",
|
||||
table: "PatientRecords",
|
||||
column: "MedicationUrlId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_PatientRecords_PatientsId",
|
||||
table: "PatientRecords",
|
||||
column: "PatientsId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@ -1113,12 +1395,21 @@ namespace HospitalManagementSystem.Migrations
|
||||
migrationBuilder.DropTable(
|
||||
name: "AbpUserTokens");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Appointments");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "OpenIddictScopes");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "OpenIddictTokens");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PatientDocuments");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "PatientRecords");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AbpEntityChanges");
|
||||
|
||||
@ -1134,14 +1425,26 @@ namespace HospitalManagementSystem.Migrations
|
||||
migrationBuilder.DropTable(
|
||||
name: "AbpUsers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Doctors");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "OpenIddictAuthorizations");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Patient");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AbpAuditLogs");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Departments");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "OpenIddictApplications");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "EntityDocuments");
|
||||
}
|
||||
}
|
||||
}
|
@ -13,8 +13,8 @@ using Volo.Abp.EntityFrameworkCore;
|
||||
namespace HospitalManagementSystem.Migrations
|
||||
{
|
||||
[DbContext(typeof(HospitalManagementSystemDbContext))]
|
||||
[Migration("20250115133021_addedDepartment_Doctor_Appointment_Table")]
|
||||
partial class addedDepartment_Doctor_Appointment_Table
|
||||
[Migration("20250206080641_dobdatetime")]
|
||||
partial class dobdatetime
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@ -22,7 +22,7 @@ namespace HospitalManagementSystem.Migrations
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
|
||||
.HasAnnotation("ProductVersion", "9.0.0")
|
||||
.HasAnnotation("ProductVersion", "9.0.1")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
@ -35,6 +35,9 @@ namespace HospitalManagementSystem.Migrations
|
||||
b.Property<string>("Address")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("AppointmentStatus")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
@ -43,8 +46,8 @@ namespace HospitalManagementSystem.Migrations
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<string>("DOB")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
b.Property<DateTime?>("DOB")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateOfAppointment")
|
||||
.HasColumnType("datetime2");
|
||||
@ -66,12 +69,15 @@ namespace HospitalManagementSystem.Migrations
|
||||
b.Property<string>("FirstName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Gender")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
b.Property<int>("Gender")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("InjuryORContion")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("InsuranceProvider")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
@ -95,9 +101,15 @@ namespace HospitalManagementSystem.Migrations
|
||||
b.Property<string>("Note")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("PaymentStatus")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("TimeOfAppointment")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("VisitType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DoctorId");
|
||||
@ -238,6 +250,292 @@ namespace HospitalManagementSystem.Migrations
|
||||
b.ToTable("Doctors");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Documents.EntityDocument", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("nvarchar(40)")
|
||||
.HasColumnName("ConcurrencyStamp");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<string>("ExtraProperties")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)")
|
||||
.HasColumnName("ExtraProperties");
|
||||
|
||||
b.Property<string>("FilePath")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FileSize")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FileType")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("GeneratedFileName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<string>("OriginalFileName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("TagName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("UploadDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("EntityDocuments", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Documents.PatientDocument", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("nvarchar(40)")
|
||||
.HasColumnName("ConcurrencyStamp");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<Guid>("EntityDocumentsId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("ExtraProperties")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)")
|
||||
.HasColumnName("ExtraProperties");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<Guid>("PatientsId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("TagName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("EntityDocumentsId");
|
||||
|
||||
b.HasIndex("PatientsId");
|
||||
|
||||
b.ToTable("PatientDocuments", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Patients.Patient", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("AdmissionDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Age")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("BloodGroup")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("nvarchar(40)")
|
||||
.HasColumnName("ConcurrencyStamp");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<DateTime?>("DischargeDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("DoctorAssigned")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ExtraProperties")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)")
|
||||
.HasColumnName("ExtraProperties");
|
||||
|
||||
b.Property<int>("Gender")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid?>("ImagesId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Treatment")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ImagesId");
|
||||
|
||||
b.ToTable("Patient", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Patients.PatientRecord", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("nvarchar(40)")
|
||||
.HasColumnName("ConcurrencyStamp");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<DateTime>("DateOfAdmission")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Diagnosis")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DoctorNotes")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ExtraProperties")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)")
|
||||
.HasColumnName("ExtraProperties");
|
||||
|
||||
b.Property<string>("InsuranceProvider")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("LabReportUrlId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<Guid?>("MedicationHistoryUrlId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<Guid?>("MedicationUrlId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("NextFollowUp")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid>("PatientsId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("TreatmentPlan")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LabReportUrlId");
|
||||
|
||||
b.HasIndex("MedicationHistoryUrlId");
|
||||
|
||||
b.HasIndex("MedicationUrlId");
|
||||
|
||||
b.HasIndex("PatientsId");
|
||||
|
||||
b.ToTable("PatientRecords", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@ -1996,6 +2294,63 @@ namespace HospitalManagementSystem.Migrations
|
||||
b.Navigation("Department");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Documents.PatientDocument", b =>
|
||||
{
|
||||
b.HasOne("HospitalManagementSystem.Documents.EntityDocument", "EntityDocuments")
|
||||
.WithMany()
|
||||
.HasForeignKey("EntityDocumentsId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("HospitalManagementSystem.Patients.Patient", "Patients")
|
||||
.WithMany()
|
||||
.HasForeignKey("PatientsId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("EntityDocuments");
|
||||
|
||||
b.Navigation("Patients");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Patients.Patient", b =>
|
||||
{
|
||||
b.HasOne("HospitalManagementSystem.Documents.EntityDocument", "Images")
|
||||
.WithMany()
|
||||
.HasForeignKey("ImagesId");
|
||||
|
||||
b.Navigation("Images");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Patients.PatientRecord", b =>
|
||||
{
|
||||
b.HasOne("HospitalManagementSystem.Documents.EntityDocument", "LabReportUrl")
|
||||
.WithMany()
|
||||
.HasForeignKey("LabReportUrlId");
|
||||
|
||||
b.HasOne("HospitalManagementSystem.Documents.EntityDocument", "MedicationHistoryUrl")
|
||||
.WithMany()
|
||||
.HasForeignKey("MedicationHistoryUrlId");
|
||||
|
||||
b.HasOne("HospitalManagementSystem.Documents.EntityDocument", "MedicationUrl")
|
||||
.WithMany()
|
||||
.HasForeignKey("MedicationUrlId");
|
||||
|
||||
b.HasOne("HospitalManagementSystem.Patients.Patient", "Patients")
|
||||
.WithMany()
|
||||
.HasForeignKey("PatientsId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LabReportUrl");
|
||||
|
||||
b.Navigation("MedicationHistoryUrl");
|
||||
|
||||
b.Navigation("MedicationUrl");
|
||||
|
||||
b.Navigation("Patients");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
|
||||
{
|
||||
b.HasOne("Volo.Abp.AuditLogging.AuditLog", null)
|
@ -1,19 +1,20 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace HospitalManagementSystem.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class changeGenderEnumToString : Migration
|
||||
public partial class dobdatetime : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<int>(
|
||||
name: "Gender",
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "DOB",
|
||||
table: "Appointments",
|
||||
type: "int",
|
||||
type: "datetime2",
|
||||
nullable: true,
|
||||
oldClrType: typeof(string),
|
||||
oldType: "nvarchar(max)",
|
||||
@ -24,12 +25,12 @@ namespace HospitalManagementSystem.Migrations
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "Gender",
|
||||
name: "DOB",
|
||||
table: "Appointments",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true,
|
||||
oldClrType: typeof(int),
|
||||
oldType: "int",
|
||||
oldClrType: typeof(DateTime),
|
||||
oldType: "datetime2",
|
||||
oldNullable: true);
|
||||
}
|
||||
}
|
@ -24,6 +24,229 @@ namespace HospitalManagementSystem.Migrations
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Appointments.Appointment", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("AppointmentStatus")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<DateTime?>("DOB")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("DateOfAppointment")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<Guid?>("DoctorId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Gender")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("InjuryORContion")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("InsuranceProvider")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Note")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("PaymentStatus")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("TimeOfAppointment")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("VisitType")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DoctorId");
|
||||
|
||||
b.ToTable("Appointments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Departments.Department", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<DateTime?>("DepartmentDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("DepartmentHead")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DepartmentName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("DepartmentNo")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Departments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Doctors.Doctor", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<string>("DOB")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<Guid?>("DepartmentId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("Designation")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Education")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Gender")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Mobile")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Password")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("DepartmentId");
|
||||
|
||||
b.ToTable("Doctors");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Documents.EntityDocument", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@ -2050,6 +2273,24 @@ namespace HospitalManagementSystem.Migrations
|
||||
b.ToTable("AbpTenantConnectionStrings", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Appointments.Appointment", b =>
|
||||
{
|
||||
b.HasOne("HospitalManagementSystem.Doctors.Doctor", "Doctor")
|
||||
.WithMany("Appointments")
|
||||
.HasForeignKey("DoctorId");
|
||||
|
||||
b.Navigation("Doctor");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Doctors.Doctor", b =>
|
||||
{
|
||||
b.HasOne("HospitalManagementSystem.Departments.Department", "Department")
|
||||
.WithMany()
|
||||
.HasForeignKey("DepartmentId");
|
||||
|
||||
b.Navigation("Department");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Documents.PatientDocument", b =>
|
||||
{
|
||||
b.HasOne("HospitalManagementSystem.Documents.EntityDocument", "EntityDocuments")
|
||||
@ -2249,6 +2490,11 @@ namespace HospitalManagementSystem.Migrations
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Doctors.Doctor", b =>
|
||||
{
|
||||
b.Navigation("Appointments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
|
||||
{
|
||||
b.Navigation("Actions");
|
||||
|
Loading…
x
Reference in New Issue
Block a user