Fixing Issue
This commit is contained in:
parent
c5df13a8f2
commit
6394ece8d3
@ -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)
|
||||
@ -33,12 +32,12 @@ export class ViewAppointmentComponent {
|
||||
label: visitType[key as unknown as keyof typeof visitType],
|
||||
value: Number(key),
|
||||
}));
|
||||
paymentStatuses = Object.keys(paymentStatus)
|
||||
.filter(key => !isNaN(Number(key)))
|
||||
.map(key => ({
|
||||
label: paymentStatus[key as unknown as keyof typeof paymentStatus],
|
||||
value: Number(key),
|
||||
}));;
|
||||
paymentStatuses = Object.keys(paymentStatus)
|
||||
.filter(key => !isNaN(Number(key)))
|
||||
.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]
|
||||
|
@ -17,6 +17,10 @@ export interface AppointmentDto {
|
||||
timeOfAppointment?: string;
|
||||
injuryORContion?: string;
|
||||
note?: string;
|
||||
insuranceProvider?: string;
|
||||
appointmentStatus: appointmentStatus;
|
||||
visitType: visitType;
|
||||
paymentStatus: paymentStatus;
|
||||
}
|
||||
|
||||
export interface CreateOrUpdateAppointmentDto {
|
||||
|
@ -21,6 +21,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 +38,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 +55,10 @@ export class AppointmentService {
|
||||
{ apiName: this.apiName,...config });
|
||||
|
||||
|
||||
updateAppointment = (id: string, input: CreateOrUpdateAppointmentDto, config?: Partial<Rest.Config>) =>
|
||||
updateAppointment = (input: CreateOrUpdateAppointmentDto, config?: Partial<Rest.Config>) =>
|
||||
this.restService.request<any, PatientRecordDto>({
|
||||
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,21 +1059,13 @@
|
||||
"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": "id",
|
||||
"typeAsString": "System.Guid, System.Private.CoreLib",
|
||||
"type": "System.Guid",
|
||||
"typeSimple": "string",
|
||||
"isOptional": false,
|
||||
"defaultValue": null
|
||||
},
|
||||
{
|
||||
"name": "input",
|
||||
"typeAsString": "HospitalManagementSystem.Appoinments.Dto.CreateOrUpdateAppointmentDto, HospitalManagementSystem.Application.Contracts",
|
||||
@ -1047,18 +1076,6 @@
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"nameOnMethod": "id",
|
||||
"name": "id",
|
||||
"jsonName": null,
|
||||
"type": "System.Guid",
|
||||
"typeSimple": "string",
|
||||
"isOptional": false,
|
||||
"defaultValue": null,
|
||||
"constraintTypes": [],
|
||||
"bindingSourceId": "Path",
|
||||
"descriptorName": ""
|
||||
},
|
||||
{
|
||||
"nameOnMethod": "input",
|
||||
"name": "input",
|
||||
@ -1078,6 +1095,43 @@
|
||||
},
|
||||
"allowAnonymous": null,
|
||||
"implementFrom": "HospitalManagementSystem.Appointments.AppointmentAppService"
|
||||
},
|
||||
"DeleteAppointmentRecordAsyncById": {
|
||||
"uniqueName": "DeleteAppointmentRecordAsyncById",
|
||||
"name": "DeleteAppointmentRecordAsync",
|
||||
"httpMethod": "DELETE",
|
||||
"url": "api/app/appointment/{id}/appointment-record",
|
||||
"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": "System.Void",
|
||||
"typeSimple": "System.Void"
|
||||
},
|
||||
"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,
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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