patient module done with file upload
This commit is contained in:
parent
e65b1f5870
commit
9ca3ab6eba
@ -57,7 +57,7 @@
|
||||
<td class="d-flex">
|
||||
<button *ngIf="createpermission" pButton class="btn btn-success btn-sm"
|
||||
(click)="addnewrecord(patient.id)">
|
||||
<i class="pi pi-plus-circle"></i>
|
||||
<i class="pi pi-arrow-right"></i>
|
||||
</button>
|
||||
<button *ngIf="editpermission" class="btn btn-warning btn-sm ml-1" (click)="editPatient(patient)"><i
|
||||
class="pi pi-pencil"></i></button>
|
||||
@ -89,6 +89,13 @@
|
||||
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>
|
||||
<input type="file" id="image" name="image" accept=".jpg,.png"
|
||||
(change)="profileimageupload($event)" />
|
||||
</div>
|
||||
<small *ngIf="error !== ''" class="p-error">{{error}}</small>
|
||||
<small *ngIf="imgpath !== ''">{{imgpath}} <i class="pi pi-image"></i></small>
|
||||
</div>
|
||||
|
||||
<!-- Mobile -->
|
||||
@ -150,6 +157,25 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-grid">
|
||||
<!-- Doctors Note -->
|
||||
<div class="p-col-6">
|
||||
<div class="field">
|
||||
<label for="doctorAssigned">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="field">
|
||||
<label for="treatment">Treatment</label>
|
||||
<input id="treatment" name="treatment" type="treatment" pInputText
|
||||
[(ngModel)]="selectedPatient.treatment" placeholder="Enter treatment" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-grid">
|
||||
<!-- Blood Group -->
|
||||
|
@ -1,21 +1,3 @@
|
||||
/* Adjusting the calendar popup */
|
||||
.small-calendar .p-datepicker {
|
||||
width: 200px !important; /* Adjust the width as per your needs */
|
||||
font-size: 12px !important; /* Adjust the font size */
|
||||
}
|
||||
|
||||
.small-calendar .p-datepicker-header {
|
||||
padding: 2px !important; /* Adjust the header padding */
|
||||
}
|
||||
|
||||
.small-calendar .p-datepicker-calendar th {
|
||||
font-size: 10px !important; /* Smaller font size for the header */
|
||||
}
|
||||
|
||||
.small-calendar .p-datepicker-calendar td {
|
||||
font-size: 10px !important; /* Smaller font size for the days */
|
||||
}
|
||||
|
||||
.table-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { PermissionService } from '@abp/ng.core';
|
||||
import { Confirmation, ConfirmationService, ToasterService } from '@abp/ng.theme.shared';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { NgForm } from '@angular/forms';
|
||||
@ -7,13 +8,12 @@ import { PagingSortPatientResultDto } from '@proxy/dto';
|
||||
import { Gender, Status } from '@proxy/global-enum';
|
||||
import { PatientService } from '@proxy/patients';
|
||||
import { PatientDto, CreateUpdatePatientDto } from '@proxy/patients/dto';
|
||||
import { MessageService } from 'primeng/api';
|
||||
|
||||
@Component({
|
||||
selector: 'app-all-patients',
|
||||
templateUrl: './all-patients.component.html',
|
||||
styleUrl: './all-patients.component.scss',
|
||||
providers: [PatientService, MessageService, PermissionService],
|
||||
providers: [PatientService, ConfirmationService, ToasterService, PermissionService],
|
||||
})
|
||||
export class AllPatientsComponent implements OnInit {
|
||||
globalFilter: string = '';
|
||||
@ -32,18 +32,30 @@ export class AllPatientsComponent implements OnInit {
|
||||
selectedgender: any = 0;
|
||||
selectadmissionDate: Date = new Date();
|
||||
selectdischargeDate: Date = new Date();
|
||||
uploadfile: {
|
||||
file: File[];
|
||||
name: string;
|
||||
}[] = [];
|
||||
createpermission: boolean;
|
||||
editpermission: boolean;
|
||||
deletepermission: boolean;
|
||||
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=""/>'
|
||||
};
|
||||
|
||||
constructor(
|
||||
private patientService: PatientService,
|
||||
private http: HttpClient,
|
||||
private messageService: MessageService,
|
||||
private confirmation: ConfirmationService,
|
||||
private toaster: ToasterService,
|
||||
private permissionChecker: PermissionService,
|
||||
private router: Router
|
||||
) {}
|
||||
@ -88,6 +100,9 @@ export class AllPatientsComponent implements OnInit {
|
||||
dischargeDate: '',
|
||||
status: Status.InTreatment,
|
||||
};
|
||||
this.imgpath = '';
|
||||
this.selectedgender = 0;
|
||||
this.selectedstatus = 0;
|
||||
}
|
||||
|
||||
loadPatient(event: any) {
|
||||
@ -147,30 +162,60 @@ export class AllPatientsComponent implements OnInit {
|
||||
this.router.navigate(['/patients/patient-record', id]);
|
||||
}
|
||||
|
||||
profileimageupload(event: Event) {
|
||||
if (this.selectedPatient.name == '') {
|
||||
this.error = 'Please Type a Name';
|
||||
return;
|
||||
}
|
||||
const input = event.target as HTMLInputElement;
|
||||
if (input.files.length > 0) {
|
||||
const tag = 'Image';
|
||||
const formdata = new FormData();
|
||||
formdata.append('file', input.files[0]);
|
||||
this.UploadFileData(tag, formdata);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
UploadFileData(tag: string, formdata: FormData) {
|
||||
this.patientService.uploadFile(tag, formdata).subscribe(result => {
|
||||
this.selectedPatient.imageID = result;
|
||||
});
|
||||
}
|
||||
|
||||
editPatient(Patient: any) {
|
||||
this.resetselectpatient();
|
||||
this.patientDialogTitle = 'Edit Patient';
|
||||
this.selectedPatient = { ...Patient };
|
||||
this.selectedgender = this.selectedPatient.gender;
|
||||
this.selectedstatus = this.selectedPatient.status;
|
||||
this.selectadmissionDate = new Date(this.selectedPatient.admissionDate);
|
||||
this.selectdischargeDate = new Date(this.selectedPatient.dischargeDate);
|
||||
this.patientService.getPatientById(Patient.id).subscribe(result => {
|
||||
this.selectedPatient = result;
|
||||
this.imgpath = result.imagepath != null ? result.imagepath.split('\\')[3] : '';
|
||||
this.selectadmissionDate = new Date(this.selectedPatient.admissionDate);
|
||||
this.selectedgender = this.selectedPatient.gender;
|
||||
this.selectedstatus = this.selectedPatient.status;
|
||||
});
|
||||
this.patientDialog = true;
|
||||
this.isEditMode = true;
|
||||
}
|
||||
|
||||
deletePatient(id: any) {
|
||||
this.patientService.deletePatient(id).subscribe(() => {
|
||||
this.messageService.add({
|
||||
severity: 'success',
|
||||
summary: 'Success',
|
||||
detail: 'Patient deleted successfully',
|
||||
this.confirmation
|
||||
.warn('Do you really want to delete this patient?', {
|
||||
key: '::AreYouSure',
|
||||
defaultValue: 'Are you sure?',
|
||||
})
|
||||
.subscribe((status: Confirmation.Status) => {
|
||||
// your code here
|
||||
if (status == 'confirm') {
|
||||
this.patientService.deletePatient(id).subscribe(() => {
|
||||
this.toaster.success('Patient deleted successfully', 'Success');
|
||||
this.loadPatient(this.params);
|
||||
});
|
||||
}
|
||||
});
|
||||
this.loadPatient(this.params);
|
||||
});
|
||||
}
|
||||
|
||||
savePatient(form: NgForm) {
|
||||
debugger;
|
||||
console.log(form.controls);
|
||||
if (form.invalid) {
|
||||
Object.values(form.controls).forEach(control => control.markAsTouched());
|
||||
@ -180,18 +225,15 @@ export class AllPatientsComponent implements OnInit {
|
||||
this.selectedPatient.status = this.selectedstatus;
|
||||
this.selectedPatient.admissionDate = this.selectadmissionDate.toDateString();
|
||||
this.selectedPatient.dischargeDate = this.selectdischargeDate.toDateString();
|
||||
|
||||
this.selectedPatient.imageID = this.selectedPatient.imageID
|
||||
? this.selectedPatient.imageID.replace('"', '').replace('"', '')
|
||||
: this.guid;
|
||||
console.log(this.selectedPatient);
|
||||
|
||||
if (this.isEditMode) {
|
||||
this.patientService
|
||||
.updatePatient(this.selectedPatient.id, this.selectedPatient)
|
||||
.subscribe(() => {
|
||||
this.messageService.add({
|
||||
severity: 'success',
|
||||
summary: 'Success',
|
||||
detail: 'Patient updated successfully',
|
||||
});
|
||||
this.patientService.updatePatient(this.selectedPatient.id, this.selectedPatient).subscribe(
|
||||
() => {
|
||||
this.toaster.success('Patient updated successfully', 'Success');
|
||||
this.patientDialog = false;
|
||||
this.loadPatient({
|
||||
first: 0,
|
||||
@ -200,23 +242,30 @@ export class AllPatientsComponent implements OnInit {
|
||||
sortOrder: 1,
|
||||
globalFilter: null,
|
||||
});
|
||||
});
|
||||
},
|
||||
error => {
|
||||
console.log(error);
|
||||
this.closeDialog();
|
||||
}
|
||||
);
|
||||
} else {
|
||||
this.patientService.createPatient(this.selectedPatient).subscribe(() => {
|
||||
this.messageService.add({
|
||||
severity: 'success',
|
||||
summary: 'Success',
|
||||
detail: 'Patient created successfully',
|
||||
});
|
||||
this.patientDialog = false;
|
||||
this.loadPatient({
|
||||
first: 0,
|
||||
rows: 10,
|
||||
sortField: 'id',
|
||||
sortOrder: 1,
|
||||
globalFilter: null,
|
||||
});
|
||||
});
|
||||
this.patientService.createPatient(this.selectedPatient).subscribe(
|
||||
() => {
|
||||
this.toaster.success('Patient created successfully', 'Success');
|
||||
this.patientDialog = false;
|
||||
this.loadPatient({
|
||||
first: 0,
|
||||
rows: 10,
|
||||
sortField: 'id',
|
||||
sortOrder: 1,
|
||||
globalFilter: null,
|
||||
});
|
||||
},
|
||||
error => {
|
||||
console.log(error);
|
||||
this.closeDialog();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,9 +30,15 @@
|
||||
<div class="info-item">
|
||||
<strong>Admission:</strong> {{ patientdto?.admissionDate | date }}
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<strong>Discharge:</strong> {{ patientdto?.dischargeDate | date }}
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<strong>Treatment:</strong> {{ patientdto?.treatment || 'N/A' }}
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<strong>Status:</strong>
|
||||
<span class="status" [ngClass]="{'active': patientdto?.status === 'Active', 'inactive': patientdto?.status === 'Inactive'}">
|
||||
<span class="status">
|
||||
{{ status[patientdto?.status] }}
|
||||
</span>
|
||||
</div>
|
||||
@ -40,11 +46,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button class="btn btn-sm btn-primary mb-2" (click)="backtopatient()">
|
||||
<i class="pi pi-arrow-left"></i> Back
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p-table #dt2 dataKey="id" [value]="patientrecords" [paginator]="true" [rows]="10" [totalRecords]="totalRecords"
|
||||
[lazy]="true" (onLazyLoad)="loadPatient($event,userid)" [rowsPerPageOptions]="[10, 20, 50]"
|
||||
[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">
|
||||
|
||||
@ -103,8 +113,8 @@
|
||||
<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>
|
||||
<button *ngIf="deletepermission" class="btn btn-danger btn-sm ml-1"
|
||||
(click)="deletePatient(patientrecord.id)"><i class="pi pi-trash"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
</ng-template>
|
||||
@ -186,6 +196,7 @@
|
||||
<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">
|
||||
@ -193,6 +204,7 @@
|
||||
<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>
|
||||
|
||||
@ -203,6 +215,7 @@
|
||||
<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">
|
||||
@ -237,10 +250,11 @@
|
||||
<div class="field">
|
||||
<label for="insuranceProvider">Insurance Provider</label>
|
||||
<input id="insuranceProvider" name="insuranceProvider" type="text" autocomplete="off" pInputText
|
||||
[(ngModel)]="selectedPatient.insuranceProvider" required placeholder="Enter insurance provider" #insurance="ngModel" />
|
||||
<small *ngIf="insurance.invalid && insurance.touched" class="p-error">
|
||||
Insurance is required.
|
||||
</small>
|
||||
[(ngModel)]="selectedPatient.insuranceProvider" required placeholder="Enter insurance provider"
|
||||
#insurance="ngModel" />
|
||||
<small *ngIf="insurance.invalid && insurance.touched" class="p-error">
|
||||
Insurance is required.
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-col-6">
|
||||
@ -257,8 +271,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" pButton class="btn btn-primary"
|
||||
[disabled]="patientrecord.invalid">Save</button>
|
||||
<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>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -78,19 +78,4 @@
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.status {
|
||||
font-weight: bold;
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.status.active {
|
||||
background: #28a745;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.status.inactive {
|
||||
background: #dc3545;
|
||||
color: white;
|
||||
}
|
||||
|
@ -4,15 +4,16 @@ import { PagingSortPatientResultDto } from '@proxy/dto';
|
||||
import { Gender, Status } from '@proxy/global-enum';
|
||||
import { PatientService } from '@proxy/patients';
|
||||
import { CreateUpdatePatientRecordDto, PatientDto, PatientRecordDto } from '@proxy/patients/dto';
|
||||
import { MessageService } from 'primeng/api';
|
||||
import { PermissionService } from '@abp/ng.core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { Confirmation, ConfirmationService, ToasterService } from '@abp/ng.theme.shared';
|
||||
|
||||
@Component({
|
||||
selector: 'app-patient-record',
|
||||
templateUrl: './patient-record.component.html',
|
||||
styleUrl: './patient-record.component.scss',
|
||||
providers: [PatientService, MessageService, PermissionService],
|
||||
providers: [PatientService, ConfirmationService, ToasterService, PermissionService],
|
||||
})
|
||||
export class PatientRecordComponent implements OnInit {
|
||||
globalFilter: string = '';
|
||||
@ -30,26 +31,40 @@ export class PatientRecordComponent implements OnInit {
|
||||
statuslist: any;
|
||||
selectdateOfAdmission: Date = new Date();
|
||||
selectnextFollowUp: Date = new Date();
|
||||
uploadfile: {
|
||||
file: File[];
|
||||
name: string;
|
||||
}[] = [];
|
||||
createpermission: boolean;
|
||||
editpermission: boolean;
|
||||
deletepermission: boolean;
|
||||
userid: any;
|
||||
patientId: any;
|
||||
patientImageUrl: string;
|
||||
labReportUrlpath: string;
|
||||
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=""/>'
|
||||
};
|
||||
|
||||
constructor(
|
||||
private patientService: PatientService,
|
||||
private messageService: MessageService,
|
||||
private confirmation: ConfirmationService,
|
||||
private permissionChecker: PermissionService,
|
||||
private route: ActivatedRoute
|
||||
private toaster: ToasterService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.userid = this.route.snapshot.paramMap.get('id');
|
||||
console.log(this.userid);
|
||||
this.patientId = this.route.snapshot.paramMap.get('id');
|
||||
console.log(this.patientId);
|
||||
|
||||
this.createpermission = this.permissionChecker.getGrantedPolicy(
|
||||
'HospitalManagementSystem.Patient.Create'
|
||||
@ -71,11 +86,11 @@ export class PatientRecordComponent implements OnInit {
|
||||
|
||||
resetselectpatient() {
|
||||
this.selectedPatient = {
|
||||
patientId: this.userid,
|
||||
patientId: this.patientId,
|
||||
dateOfAdmission: '',
|
||||
labReportUrl: '',
|
||||
medicationUrl: '',
|
||||
medicationHistoryUrl: '',
|
||||
// labReportUrl: '',
|
||||
// medicationUrl: '',
|
||||
// medicationHistoryUrl: '',
|
||||
nextFollowUp: '',
|
||||
diagnosis: '',
|
||||
treatmentPlan: '',
|
||||
@ -83,10 +98,15 @@ export class PatientRecordComponent implements OnInit {
|
||||
insuranceProvider: '',
|
||||
status: Status.InTreatment,
|
||||
};
|
||||
this.labReportUrlpath = '';
|
||||
this.medicationUrlpath = '';
|
||||
this.medicationHistoryUrlpath = '';
|
||||
this.selectdateOfAdmission = new Date();
|
||||
this.selectnextFollowUp = new Date();
|
||||
}
|
||||
|
||||
loadPatient(event: any, id: any) {
|
||||
this.selectedPatient.patientId = this.userid;
|
||||
this.selectedPatient.patientId = this.patientId;
|
||||
this.loading = true;
|
||||
let order = event.sortOrder == 1 ? ' asc' : ' desc';
|
||||
event.sortField = event.sortField == undefined ? 'id' : event.sortField;
|
||||
@ -96,16 +116,22 @@ export class PatientRecordComponent implements OnInit {
|
||||
sorting: event.sortField + order,
|
||||
search: event.globalFilter == null ? '' : event.globalFilter,
|
||||
};
|
||||
this.patientService.getPatientById(this.userid).subscribe(result => {
|
||||
this.patientService.getPatientById(this.patientId).subscribe(result => {
|
||||
this.patientdto = result;
|
||||
this.patientImageUrl = environment.apis.default.url + result.imagepath;
|
||||
});
|
||||
this.patientService.getPatientRecordList(this.params, id).subscribe(data => {
|
||||
this.patientrecords = data.items;
|
||||
// console.log(data.items);
|
||||
this.totalRecords = data.totalCount;
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
backtopatient() {
|
||||
this.router.navigate(['/patients/all-patients']);
|
||||
}
|
||||
|
||||
exportPatient() {
|
||||
this.patientService.getExportPatientRecord().subscribe(result => {
|
||||
const binary = atob(result.fileContent);
|
||||
@ -140,80 +166,133 @@ export class PatientRecordComponent implements OnInit {
|
||||
}
|
||||
|
||||
editPatient(Patient: any) {
|
||||
this.resetselectpatient();
|
||||
this.patientDialogTitle = 'Edit Patient';
|
||||
this.selectedPatient = { ...Patient };
|
||||
this.selectedPatient.patientId = this.userid;
|
||||
this.selectdateOfAdmission = new Date(this.selectedPatient.dateOfAdmission);
|
||||
this.selectnextFollowUp = new Date(this.selectedPatient.nextFollowUp);
|
||||
this.patientService.getPatientRecordById(Patient.id).subscribe(result => {
|
||||
this.selectedPatient = result;
|
||||
this.selectedPatient.patientId = this.patientId;
|
||||
this.selectdateOfAdmission = new Date(this.selectedPatient.dateOfAdmission);
|
||||
this.selectnextFollowUp = new Date(this.selectedPatient.nextFollowUp);
|
||||
this.labReportUrlpath = result.labReportUrl != null ? result.labReportUrl.split('\\')[3] : '';
|
||||
this.medicationUrlpath =
|
||||
result.medicationUrl != null ? result.medicationUrl.split('\\')[3] : '';
|
||||
this.medicationHistoryUrlpath =
|
||||
result.medicationHistoryUrl != null ? result.medicationHistoryUrl.split('\\')[3] : '';
|
||||
console.log(result);
|
||||
});
|
||||
this.patientDialog = true;
|
||||
this.isEditMode = true;
|
||||
console.log(this.selectedPatient);
|
||||
}
|
||||
|
||||
deletePatient(id: any) {
|
||||
this.patientService.deletePatientRecord(id).subscribe(() => {
|
||||
this.messageService.add({
|
||||
severity: 'success',
|
||||
summary: 'Success',
|
||||
detail: 'Patient deleted successfully',
|
||||
this.confirmation
|
||||
.warn('Do you really want to delete this record ?', {
|
||||
key: '::AreYouSure',
|
||||
defaultValue: 'Are you sure?',
|
||||
})
|
||||
.subscribe((status: Confirmation.Status) => {
|
||||
// your code here
|
||||
if (status == 'confirm') {
|
||||
this.patientService.deletePatientRecord(id).subscribe(() => {
|
||||
this.loadPatient(this.params, this.patientId);
|
||||
this.toaster.success('Patient deleted successfully', 'Success');
|
||||
});
|
||||
}
|
||||
});
|
||||
this.loadPatient(this.params, this.userid);
|
||||
});
|
||||
}
|
||||
|
||||
// handleLabReportUpload(event: any): void {
|
||||
// const input = event.target as HTMLInputElement;
|
||||
// console.log(input);
|
||||
// const files: File[] = event.files; // Files uploaded
|
||||
// this.addToUploadList(files, 'Lab-Report');
|
||||
// }
|
||||
handleLabReportUpload(event: Event): void {
|
||||
const input = event.target as HTMLInputElement;
|
||||
if (input && input.files) {
|
||||
const files: File[] = Array.from(input.files); // Convert FileList to an array of File
|
||||
this.addToUploadList(files, 'Lab-Report');
|
||||
} else {
|
||||
console.error('No files selected');
|
||||
const tag = 'Lab-Report';
|
||||
const formdata = new FormData();
|
||||
formdata.append('file', input.files[0]);
|
||||
this.UploadFileData(tag, formdata);
|
||||
}
|
||||
}
|
||||
|
||||
handleMedicationsUpload(event: any): void {
|
||||
const files: File[] = event.files; // Files uploaded
|
||||
this.addToUploadList(files, 'Medications');
|
||||
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 files: File[] = event.files; // Files uploaded
|
||||
this.addToUploadList(files, 'Medication-History');
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
private addToUploadList(files: File[], name: string): void {
|
||||
const existingIndex = this.uploadfile.findIndex(item => item.name === name);
|
||||
|
||||
if (existingIndex > -1) {
|
||||
this.uploadfile[existingIndex].file = files;
|
||||
} else {
|
||||
this.uploadfile.push({ file: files, name });
|
||||
}
|
||||
console.log(this.uploadfile);
|
||||
UploadFileData(tag: string, formdata: FormData) {
|
||||
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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
savePatient(form: NgForm) {
|
||||
// console.log(form);
|
||||
this.selectedPatient.patientId = this.userid;
|
||||
this.selectedPatient.patientId = this.patientId;
|
||||
this.selectedPatient.status = this.patientdto.status;
|
||||
this.selectedPatient.dateOfAdmission = this.selectdateOfAdmission.toDateString();
|
||||
this.selectedPatient.nextFollowUp = this.selectnextFollowUp.toDateString();
|
||||
this.selectedPatient.labReportUrlID = this.selectedPatient.labReportUrlID
|
||||
? this.selectedPatient.labReportUrlID.replace('"', '').replace('"', '')
|
||||
: this.guid;
|
||||
this.selectedPatient.medicationUrlID = this.selectedPatient.medicationUrlID
|
||||
? this.selectedPatient.medicationUrlID.replace('"', '').replace('"', '')
|
||||
: this.guid;
|
||||
this.selectedPatient.medicationHistoryUrlID = this.selectedPatient.medicationHistoryUrlID
|
||||
? this.selectedPatient.medicationHistoryUrlID.replace('"', '').replace('"', '')
|
||||
: this.guid;
|
||||
console.log(this.selectedPatient);
|
||||
|
||||
if (this.isEditMode) {
|
||||
this.patientService
|
||||
.updatePatientRecord(this.selectedPatient.id, this.selectedPatient)
|
||||
.subscribe(() => {
|
||||
this.messageService.add({
|
||||
severity: 'success',
|
||||
summary: 'Success',
|
||||
detail: 'Patient updated successfully',
|
||||
});
|
||||
.subscribe(
|
||||
result => {
|
||||
this.toaster.success('Patient updated successfully', 'Success');
|
||||
this.patientDialog = false;
|
||||
console.log(result);
|
||||
|
||||
this.loadPatient(
|
||||
{
|
||||
first: 0,
|
||||
rows: 10,
|
||||
sortField: 'id',
|
||||
sortOrder: 1,
|
||||
globalFilter: null,
|
||||
},
|
||||
this.patientId
|
||||
);
|
||||
},
|
||||
error => {
|
||||
console.log(error);
|
||||
this.closeDialog();
|
||||
}
|
||||
);
|
||||
} else {
|
||||
this.patientService.createPatientRecord(this.selectedPatient).subscribe(
|
||||
() => {
|
||||
this.toaster.success('Patient created successfully', 'Success');
|
||||
this.patientDialog = false;
|
||||
this.loadPatient(
|
||||
{
|
||||
@ -223,28 +302,14 @@ export class PatientRecordComponent implements OnInit {
|
||||
sortOrder: 1,
|
||||
globalFilter: null,
|
||||
},
|
||||
this.userid
|
||||
this.patientId
|
||||
);
|
||||
});
|
||||
} else {
|
||||
this.patientService.createPatientRecord(this.selectedPatient).subscribe(() => {
|
||||
this.messageService.add({
|
||||
severity: 'success',
|
||||
summary: 'Success',
|
||||
detail: 'Patient created successfully',
|
||||
});
|
||||
this.patientDialog = false;
|
||||
this.loadPatient(
|
||||
{
|
||||
first: 0,
|
||||
rows: 10,
|
||||
sortField: 'id',
|
||||
sortOrder: 1,
|
||||
globalFilter: null,
|
||||
},
|
||||
this.userid
|
||||
);
|
||||
});
|
||||
},
|
||||
error => {
|
||||
console.log(error);
|
||||
this.closeDialog();
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
1
angular/src/app/proxy/documents/index.ts
Normal file
1
angular/src/app/proxy/documents/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './models';
|
11
angular/src/app/proxy/documents/models.ts
Normal file
11
angular/src/app/proxy/documents/models.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import type { AuditedAggregateRoot } from '../volo/abp/domain/entities/auditing/models';
|
||||
|
||||
export interface EntityDocument extends AuditedAggregateRoot<string> {
|
||||
originalFileName?: string;
|
||||
generatedFileName?: string;
|
||||
fileSize?: string;
|
||||
filePath?: string;
|
||||
fileType?: string;
|
||||
tagName?: string;
|
||||
uploadDate?: string;
|
||||
}
|
@ -1428,6 +1428,140 @@
|
||||
},
|
||||
"allowAnonymous": null,
|
||||
"implementFrom": "HospitalManagementSystem.Patients.PatientAppService"
|
||||
},
|
||||
"UploadFileAsyncByTagNameAndFile": {
|
||||
"uniqueName": "UploadFileAsyncByTagNameAndFile",
|
||||
"name": "UploadFileAsync",
|
||||
"httpMethod": "POST",
|
||||
"url": "api/app/patient/upload-file",
|
||||
"supportedVersions": [],
|
||||
"parametersOnMethod": [
|
||||
{
|
||||
"name": "TagName",
|
||||
"typeAsString": "System.String, System.Private.CoreLib",
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isOptional": false,
|
||||
"defaultValue": null
|
||||
},
|
||||
{
|
||||
"name": "file",
|
||||
"typeAsString": "Volo.Abp.Content.IRemoteStreamContent, Volo.Abp.Core",
|
||||
"type": "Volo.Abp.Content.IRemoteStreamContent",
|
||||
"typeSimple": "Volo.Abp.Content.IRemoteStreamContent",
|
||||
"isOptional": false,
|
||||
"defaultValue": null
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"nameOnMethod": "TagName",
|
||||
"name": "TagName",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isOptional": false,
|
||||
"defaultValue": null,
|
||||
"constraintTypes": null,
|
||||
"bindingSourceId": "ModelBinding",
|
||||
"descriptorName": ""
|
||||
},
|
||||
{
|
||||
"nameOnMethod": "file",
|
||||
"name": "file",
|
||||
"jsonName": null,
|
||||
"type": "Volo.Abp.Content.IRemoteStreamContent",
|
||||
"typeSimple": "Volo.Abp.Content.IRemoteStreamContent",
|
||||
"isOptional": false,
|
||||
"defaultValue": null,
|
||||
"constraintTypes": null,
|
||||
"bindingSourceId": "FormFile",
|
||||
"descriptorName": ""
|
||||
}
|
||||
],
|
||||
"returnValue": {
|
||||
"type": "System.Guid",
|
||||
"typeSimple": "string"
|
||||
},
|
||||
"allowAnonymous": null,
|
||||
"implementFrom": "HospitalManagementSystem.Patients.PatientAppService"
|
||||
},
|
||||
"SaveFileToDocumentByPatientAndUniqueIdsAndIsNew": {
|
||||
"uniqueName": "SaveFileToDocumentByPatientAndUniqueIdsAndIsNew",
|
||||
"name": "SaveFileToDocument",
|
||||
"httpMethod": "POST",
|
||||
"url": "api/app/patient/save-file-to-document",
|
||||
"supportedVersions": [],
|
||||
"parametersOnMethod": [
|
||||
{
|
||||
"name": "patient",
|
||||
"typeAsString": "HospitalManagementSystem.Patients.Patient, HospitalManagementSystem.Domain",
|
||||
"type": "HospitalManagementSystem.Patients.Patient",
|
||||
"typeSimple": "HospitalManagementSystem.Patients.Patient",
|
||||
"isOptional": false,
|
||||
"defaultValue": null
|
||||
},
|
||||
{
|
||||
"name": "uniqueIds",
|
||||
"typeAsString": "System.Collections.Generic.List`1[[System.Guid, System.Private.CoreLib, Version=9.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib",
|
||||
"type": "System.Collections.Generic.List<System.Guid>",
|
||||
"typeSimple": "[string]",
|
||||
"isOptional": false,
|
||||
"defaultValue": null
|
||||
},
|
||||
{
|
||||
"name": "isNew",
|
||||
"typeAsString": "System.Boolean, System.Private.CoreLib",
|
||||
"type": "System.Boolean",
|
||||
"typeSimple": "boolean",
|
||||
"isOptional": true,
|
||||
"defaultValue": false
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"nameOnMethod": "patient",
|
||||
"name": "patient",
|
||||
"jsonName": null,
|
||||
"type": "HospitalManagementSystem.Patients.Patient",
|
||||
"typeSimple": "HospitalManagementSystem.Patients.Patient",
|
||||
"isOptional": false,
|
||||
"defaultValue": null,
|
||||
"constraintTypes": null,
|
||||
"bindingSourceId": "Body",
|
||||
"descriptorName": ""
|
||||
},
|
||||
{
|
||||
"nameOnMethod": "uniqueIds",
|
||||
"name": "uniqueIds",
|
||||
"jsonName": null,
|
||||
"type": "System.Collections.Generic.List<System.Guid>",
|
||||
"typeSimple": "[string]",
|
||||
"isOptional": false,
|
||||
"defaultValue": null,
|
||||
"constraintTypes": null,
|
||||
"bindingSourceId": "Body",
|
||||
"descriptorName": ""
|
||||
},
|
||||
{
|
||||
"nameOnMethod": "isNew",
|
||||
"name": "isNew",
|
||||
"jsonName": null,
|
||||
"type": "System.Boolean",
|
||||
"typeSimple": "boolean",
|
||||
"isOptional": false,
|
||||
"defaultValue": null,
|
||||
"constraintTypes": null,
|
||||
"bindingSourceId": "ModelBinding",
|
||||
"descriptorName": ""
|
||||
}
|
||||
],
|
||||
"returnValue": {
|
||||
"type": "System.Collections.Generic.List<HospitalManagementSystem.Documents.EntityDocument>",
|
||||
"typeSimple": "[HospitalManagementSystem.Documents.EntityDocument]"
|
||||
},
|
||||
"allowAnonymous": null,
|
||||
"implementFrom": "HospitalManagementSystem.Patients.PatientAppService"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4076,6 +4210,99 @@
|
||||
}
|
||||
},
|
||||
"types": {
|
||||
"HospitalManagementSystem.Documents.EntityDocument": {
|
||||
"baseType": "Volo.Abp.Domain.Entities.Auditing.AuditedAggregateRoot<System.Guid>",
|
||||
"isEnum": false,
|
||||
"enumNames": null,
|
||||
"enumValues": null,
|
||||
"genericArguments": null,
|
||||
"properties": [
|
||||
{
|
||||
"name": "OriginalFileName",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "GeneratedFileName",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "FileSize",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "FilePath",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "FileType",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "TagName",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "UploadDate",
|
||||
"jsonName": null,
|
||||
"type": "System.DateTime",
|
||||
"typeSimple": "string",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"HospitalManagementSystem.Dto.DropDownItems": {
|
||||
"baseType": null,
|
||||
"isEnum": false,
|
||||
@ -4355,6 +4582,18 @@
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "ImageID",
|
||||
"jsonName": null,
|
||||
"type": "System.Guid",
|
||||
"typeSimple": "string",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -4402,10 +4641,10 @@
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "LabReportUrl",
|
||||
"name": "LabReportUrlID",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"type": "System.Guid?",
|
||||
"typeSimple": "string?",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
@ -4414,10 +4653,10 @@
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "MedicationUrl",
|
||||
"name": "MedicationUrlID",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"type": "System.Guid?",
|
||||
"typeSimple": "string?",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
@ -4426,10 +4665,10 @@
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "MedicationHistoryUrl",
|
||||
"name": "MedicationHistoryUrlID",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"type": "System.Guid?",
|
||||
"typeSimple": "string?",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
@ -4673,6 +4912,18 @@
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "Imagepath",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -4841,6 +5092,171 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"HospitalManagementSystem.Patients.Patient": {
|
||||
"baseType": "Volo.Abp.Domain.Entities.Auditing.AuditedAggregateRoot<System.Guid>",
|
||||
"isEnum": false,
|
||||
"enumNames": null,
|
||||
"enumValues": null,
|
||||
"genericArguments": null,
|
||||
"properties": [
|
||||
{
|
||||
"name": "Name",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isRequired": true,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "Gender",
|
||||
"jsonName": null,
|
||||
"type": "HospitalManagementSystem.GlobalEnum.Gender",
|
||||
"typeSimple": "HospitalManagementSystem.GlobalEnum.Gender",
|
||||
"isRequired": true,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "Mobile",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isRequired": true,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "Email",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isRequired": true,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "Age",
|
||||
"jsonName": null,
|
||||
"type": "System.Int32",
|
||||
"typeSimple": "number",
|
||||
"isRequired": true,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "Treatment",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "DoctorAssigned",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "Address",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isRequired": true,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "BloodGroup",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isRequired": true,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "AdmissionDate",
|
||||
"jsonName": null,
|
||||
"type": "System.DateTime",
|
||||
"typeSimple": "string",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "DischargeDate",
|
||||
"jsonName": null,
|
||||
"type": "System.DateTime?",
|
||||
"typeSimple": "string?",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "Status",
|
||||
"jsonName": null,
|
||||
"type": "HospitalManagementSystem.GlobalEnum.Status",
|
||||
"typeSimple": "HospitalManagementSystem.GlobalEnum.Status",
|
||||
"isRequired": true,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "Images",
|
||||
"jsonName": null,
|
||||
"type": "HospitalManagementSystem.Documents.EntityDocument",
|
||||
"typeSimple": "HospitalManagementSystem.Documents.EntityDocument",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"Volo.Abp.Account.ChangePasswordInput": {
|
||||
"baseType": null,
|
||||
"isEnum": false,
|
||||
@ -7599,6 +8015,197 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"Volo.Abp.Content.IRemoteStreamContent": {
|
||||
"baseType": null,
|
||||
"isEnum": false,
|
||||
"enumNames": null,
|
||||
"enumValues": null,
|
||||
"genericArguments": null,
|
||||
"properties": [
|
||||
{
|
||||
"name": "FileName",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "ContentType",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "ContentLength",
|
||||
"jsonName": null,
|
||||
"type": "System.Int64?",
|
||||
"typeSimple": "number?",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"Volo.Abp.Domain.Entities.AggregateRoot<T0>": {
|
||||
"baseType": "Volo.Abp.Domain.Entities.BasicAggregateRoot<TKey>",
|
||||
"isEnum": false,
|
||||
"enumNames": null,
|
||||
"enumValues": null,
|
||||
"genericArguments": [
|
||||
"TKey"
|
||||
],
|
||||
"properties": [
|
||||
{
|
||||
"name": "ExtraProperties",
|
||||
"jsonName": null,
|
||||
"type": "{System.String:System.Object}",
|
||||
"typeSimple": "{string:object}",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "ConcurrencyStamp",
|
||||
"jsonName": null,
|
||||
"type": "System.String",
|
||||
"typeSimple": "string",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"Volo.Abp.Domain.Entities.Auditing.AuditedAggregateRoot<T0>": {
|
||||
"baseType": "Volo.Abp.Domain.Entities.Auditing.CreationAuditedAggregateRoot<TKey>",
|
||||
"isEnum": false,
|
||||
"enumNames": null,
|
||||
"enumValues": null,
|
||||
"genericArguments": [
|
||||
"TKey"
|
||||
],
|
||||
"properties": [
|
||||
{
|
||||
"name": "LastModificationTime",
|
||||
"jsonName": null,
|
||||
"type": "System.DateTime?",
|
||||
"typeSimple": "string?",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "LastModifierId",
|
||||
"jsonName": null,
|
||||
"type": "System.Guid?",
|
||||
"typeSimple": "string?",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"Volo.Abp.Domain.Entities.Auditing.CreationAuditedAggregateRoot<T0>": {
|
||||
"baseType": "Volo.Abp.Domain.Entities.AggregateRoot<TKey>",
|
||||
"isEnum": false,
|
||||
"enumNames": null,
|
||||
"enumValues": null,
|
||||
"genericArguments": [
|
||||
"TKey"
|
||||
],
|
||||
"properties": [
|
||||
{
|
||||
"name": "CreationTime",
|
||||
"jsonName": null,
|
||||
"type": "System.DateTime",
|
||||
"typeSimple": "string",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
},
|
||||
{
|
||||
"name": "CreatorId",
|
||||
"jsonName": null,
|
||||
"type": "System.Guid?",
|
||||
"typeSimple": "string?",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"Volo.Abp.Domain.Entities.BasicAggregateRoot<T0>": {
|
||||
"baseType": "Volo.Abp.Domain.Entities.Entity<TKey>",
|
||||
"isEnum": false,
|
||||
"enumNames": null,
|
||||
"enumValues": null,
|
||||
"genericArguments": [
|
||||
"TKey"
|
||||
],
|
||||
"properties": []
|
||||
},
|
||||
"Volo.Abp.Domain.Entities.Entity": {
|
||||
"baseType": null,
|
||||
"isEnum": false,
|
||||
"enumNames": null,
|
||||
"enumValues": null,
|
||||
"genericArguments": null,
|
||||
"properties": []
|
||||
},
|
||||
"Volo.Abp.Domain.Entities.Entity<T0>": {
|
||||
"baseType": "Volo.Abp.Domain.Entities.Entity",
|
||||
"isEnum": false,
|
||||
"enumNames": null,
|
||||
"enumValues": null,
|
||||
"genericArguments": [
|
||||
"TKey"
|
||||
],
|
||||
"properties": [
|
||||
{
|
||||
"name": "Id",
|
||||
"jsonName": null,
|
||||
"type": "TKey",
|
||||
"typeSimple": "TKey",
|
||||
"isRequired": false,
|
||||
"minLength": null,
|
||||
"maxLength": null,
|
||||
"minimum": null,
|
||||
"maximum": null,
|
||||
"regex": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"Volo.Abp.FeatureManagement.FeatureDto": {
|
||||
"baseType": null,
|
||||
"isEnum": false,
|
||||
|
@ -1,4 +1,6 @@
|
||||
import * as Documents from './documents';
|
||||
import * as Dto from './dto';
|
||||
import * as GlobalEnum from './global-enum';
|
||||
import * as Patients from './patients';
|
||||
export { Dto, GlobalEnum, Patients };
|
||||
import * as Volo from './volo';
|
||||
export { Documents, Dto, GlobalEnum, Patients, Volo };
|
||||
|
@ -15,15 +15,16 @@ export interface CreateUpdatePatientDto {
|
||||
admissionDate?: string;
|
||||
dischargeDate?: string;
|
||||
status: Status;
|
||||
imageID?: string;
|
||||
}
|
||||
|
||||
export interface CreateUpdatePatientRecordDto {
|
||||
id?: string;
|
||||
patientId?: string;
|
||||
dateOfAdmission?: string;
|
||||
labReportUrl?: string;
|
||||
medicationUrl?: string;
|
||||
medicationHistoryUrl?: string;
|
||||
labReportUrlID?: string;
|
||||
medicationUrlID?: string;
|
||||
medicationHistoryUrlID?: string;
|
||||
nextFollowUp?: string;
|
||||
diagnosis?: string;
|
||||
treatmentPlan?: string;
|
||||
@ -46,6 +47,7 @@ export interface PatientDto {
|
||||
admissionDate?: string;
|
||||
dischargeDate?: string;
|
||||
status: Status;
|
||||
imagepath?: string;
|
||||
}
|
||||
|
||||
export interface PatientRecordDto {
|
||||
|
@ -1,3 +1,4 @@
|
||||
import * as Dto from './dto';
|
||||
export * from './models';
|
||||
export * from './patient.service';
|
||||
export { Dto };
|
||||
|
20
angular/src/app/proxy/patients/models.ts
Normal file
20
angular/src/app/proxy/patients/models.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import type { AuditedAggregateRoot } from '../volo/abp/domain/entities/auditing/models';
|
||||
import type { Gender } from '../global-enum/gender.enum';
|
||||
import type { Status } from '../global-enum/status.enum';
|
||||
import type { EntityDocument } from '../documents/models';
|
||||
|
||||
export interface Patient extends AuditedAggregateRoot<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;
|
||||
images: EntityDocument;
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
import type { CreateUpdatePatientDto, CreateUpdatePatientRecordDto, PatientDto, PatientRecordDto } from './dto/models';
|
||||
import type { Patient } from './models';
|
||||
import { RestService, Rest } from '@abp/ng.core';
|
||||
import type { PagedResultDto } from '@abp/ng.core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import type { EntityDocument } from '../documents/models';
|
||||
import type { DropDownItems, FileDownloadDto, PagingSortPatientResultDto } from '../dto/models';
|
||||
|
||||
@Injectable({
|
||||
@ -103,6 +105,16 @@ export class PatientService {
|
||||
{ apiName: this.apiName,...config });
|
||||
|
||||
|
||||
saveFileToDocumentByPatientAndUniqueIdsAndIsNew = (patient: Patient, uniqueIds: string[], isNew?: boolean, config?: Partial<Rest.Config>) =>
|
||||
this.restService.request<any, EntityDocument[]>({
|
||||
method: 'POST',
|
||||
url: '/api/app/patient/save-file-to-document',
|
||||
params: { isNew },
|
||||
body: uniqueIds,
|
||||
},
|
||||
{ apiName: this.apiName,...config });
|
||||
|
||||
|
||||
updatePatient = (id: string, input: CreateUpdatePatientDto, config?: Partial<Rest.Config>) =>
|
||||
this.restService.request<any, PatientDto>({
|
||||
method: 'PUT',
|
||||
@ -119,6 +131,17 @@ export class PatientService {
|
||||
body: input,
|
||||
},
|
||||
{ apiName: this.apiName,...config });
|
||||
|
||||
|
||||
uploadFile = (TagName: string, file: FormData, config?: Partial<Rest.Config>) =>
|
||||
this.restService.request<any, string>({
|
||||
method: 'POST',
|
||||
responseType: 'text',
|
||||
url: '/api/app/patient/upload-file',
|
||||
params: { tagName: TagName },
|
||||
body: file,
|
||||
},
|
||||
{ apiName: this.apiName,...config });
|
||||
|
||||
constructor(private restService: RestService) {}
|
||||
}
|
||||
|
@ -0,0 +1 @@
|
||||
export * from './models';
|
@ -0,0 +1,11 @@
|
||||
import type { AggregateRoot } from '../models';
|
||||
|
||||
export interface AuditedAggregateRoot<TKey> extends CreationAuditedAggregateRoot<TKey> {
|
||||
lastModificationTime?: string;
|
||||
lastModifierId?: string;
|
||||
}
|
||||
|
||||
export interface CreationAuditedAggregateRoot<TKey> extends AggregateRoot<TKey> {
|
||||
creationTime?: string;
|
||||
creatorId?: string;
|
||||
}
|
3
angular/src/app/proxy/volo/abp/domain/entities/index.ts
Normal file
3
angular/src/app/proxy/volo/abp/domain/entities/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import * as Auditing from './auditing';
|
||||
export * from './models';
|
||||
export { Auditing };
|
11
angular/src/app/proxy/volo/abp/domain/entities/models.ts
Normal file
11
angular/src/app/proxy/volo/abp/domain/entities/models.ts
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
export interface AggregateRoot<TKey> extends BasicAggregateRoot<TKey> {
|
||||
extraProperties: Record<string, object>;
|
||||
concurrencyStamp?: string;
|
||||
}
|
||||
|
||||
export interface BasicAggregateRoot<TKey> extends Entity<TKey> {
|
||||
}
|
||||
|
||||
export interface Entity<TKey> {
|
||||
}
|
2
angular/src/app/proxy/volo/abp/domain/index.ts
Normal file
2
angular/src/app/proxy/volo/abp/domain/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
import * as Entities from './entities';
|
||||
export { Entities };
|
2
angular/src/app/proxy/volo/abp/index.ts
Normal file
2
angular/src/app/proxy/volo/abp/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
import * as Domain from './domain';
|
||||
export { Domain };
|
2
angular/src/app/proxy/volo/index.ts
Normal file
2
angular/src/app/proxy/volo/index.ts
Normal file
@ -0,0 +1,2 @@
|
||||
import * as Abp from './abp';
|
||||
export { Abp };
|
BIN
angular/src/assets/default-profile.png
Normal file
BIN
angular/src/assets/default-profile.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
@ -23,5 +23,6 @@ namespace HospitalManagementSystem.Patients.Dto
|
||||
public DateTime AdmissionDate { get; set; }
|
||||
public DateTime? DischargeDate { get; set; }
|
||||
public Status Status { get; set; }
|
||||
public Guid ImageID { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -13,21 +13,15 @@ namespace HospitalManagementSystem.Patients.Dto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
//public string FullName { get; set; }
|
||||
|
||||
//public string Mobile { get; set; }
|
||||
|
||||
//public Gender Gender { get; set; }
|
||||
|
||||
public Guid PatientId { get; set; }
|
||||
|
||||
public DateTime DateOfAdmission { get; set; }
|
||||
|
||||
public string? LabReportUrl { get; set; }
|
||||
public Guid? LabReportUrlID { get; set; }
|
||||
|
||||
public string? MedicationUrl { get; set; }
|
||||
public Guid? MedicationUrlID { get; set; }
|
||||
|
||||
public string? MedicationHistoryUrl { get; set; }
|
||||
public Guid? MedicationHistoryUrlID { get; set; }
|
||||
|
||||
public DateTime? NextFollowUp { get; set; }
|
||||
|
||||
|
@ -22,5 +22,6 @@ namespace HospitalManagementSystem.Patients.Dto
|
||||
public DateTime AdmissionDate { get; set; }
|
||||
public DateTime? DischargeDate { get; set; }
|
||||
public Status Status { get; set; }
|
||||
public string? Imagepath { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -14,12 +14,6 @@ namespace HospitalManagementSystem.Patients.Dto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
//public string FullName { get; set; }
|
||||
|
||||
//public string Mobile { get; set; }
|
||||
|
||||
//public Gender Gender { get; set; }
|
||||
|
||||
public Guid PatientId { get; set; }
|
||||
|
||||
public PatientDto Patients { get; set; }
|
||||
|
@ -1,19 +1,24 @@
|
||||
using ClosedXML.Excel;
|
||||
using HospitalManagementSystem.Documents;
|
||||
using HospitalManagementSystem.Dto;
|
||||
using HospitalManagementSystem.GlobalEnum;
|
||||
using HospitalManagementSystem.Patients.Dto;
|
||||
using HospitalManagementSystem.Permissions;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Linq.Dynamic.Core;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.Application.Dtos;
|
||||
using Volo.Abp.Application.Services;
|
||||
using Volo.Abp.Content;
|
||||
using Volo.Abp.Domain.Repositories;
|
||||
using static HospitalManagementSystem.Permissions.HospitalManagementSystemPermissions;
|
||||
|
||||
|
||||
namespace HospitalManagementSystem.Patients
|
||||
@ -22,11 +27,18 @@ namespace HospitalManagementSystem.Patients
|
||||
{
|
||||
private IRepository<PatientRecord, Guid> _patientrecordRepository;
|
||||
private IRepository<Patient, Guid> _patientRepository;
|
||||
private IRepository<EntityDocument, Guid> _entityDocumentRepository;
|
||||
private IRepository<PatientDocument, Guid> _patientDocumentRepository;
|
||||
private readonly IWebHostEnvironment _env;
|
||||
List<Guid> uniqueid = new List<Guid>();
|
||||
|
||||
public PatientAppService(IRepository<PatientRecord, Guid> patientrecordRepository, IRepository<Patient, Guid> patientRepository)
|
||||
public PatientAppService(IRepository<PatientRecord, Guid> patientrecordRepository, IRepository<Patient, Guid> patientRepository, IWebHostEnvironment env, IRepository<EntityDocument, Guid> entityDocumentRepository, IRepository<PatientDocument, Guid> patientDocumentRepository)
|
||||
{
|
||||
_patientrecordRepository = patientrecordRepository;
|
||||
_patientRepository = patientRepository;
|
||||
_env = env;
|
||||
_entityDocumentRepository = entityDocumentRepository;
|
||||
_patientDocumentRepository = patientDocumentRepository;
|
||||
}
|
||||
|
||||
#region PatientRecord
|
||||
@ -35,46 +47,36 @@ namespace HospitalManagementSystem.Patients
|
||||
[Authorize(HospitalManagementSystemPermissions.Patient.Default)]
|
||||
public async Task<PagedResultDto<PatientRecordDto>> GetPatientRecordListAsync(PagingSortPatientResultDto input, Guid Id)
|
||||
{
|
||||
//List<PatientRecord>? query;
|
||||
|
||||
//query = _patientrecordRepository.GetQueryableAsync().Result
|
||||
// .Include(x => x.Patients)
|
||||
// .WhereIf(!String.IsNullOrEmpty(input.Search), x => x.Patients.Name.ToLower().Contains(input.Search.ToLower()))
|
||||
// .Where(x => x.Patients.Id == Id)
|
||||
// .OrderBy(input.Sorting ?? (nameof(PatientRecord.Id) + " asc"))
|
||||
// .Skip(input.SkipCount)
|
||||
// .Take(input.MaxResultCount)
|
||||
// .ToList();
|
||||
|
||||
//var totalCount = await _patientrecordRepository.CountAsync();
|
||||
//return new PagedResultDto<PatientRecordDto>(
|
||||
// totalCount,
|
||||
// ObjectMapper.Map<List<PatientRecord>, List<PatientRecordDto>>(query)
|
||||
//);
|
||||
var queryable = await _patientrecordRepository.GetQueryableAsync();
|
||||
|
||||
var filteredQuery = queryable
|
||||
.Include(x => x.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()))
|
||||
.Where(x => x.Patients.Id == Id);
|
||||
|
||||
// Get total count after filtering
|
||||
var totalCount = await filteredQuery.CountAsync();
|
||||
|
||||
// Apply sorting dynamically (ensure input.Sorting is valid)
|
||||
filteredQuery = !string.IsNullOrEmpty(input.Sorting)
|
||||
? filteredQuery.OrderBy(input.Sorting)
|
||||
: filteredQuery.OrderBy(x => x.Id);
|
||||
|
||||
// Apply paging
|
||||
var pagedQuery = await filteredQuery
|
||||
.Skip(input.SkipCount)
|
||||
.Take(input.MaxResultCount)
|
||||
.ToListAsync();
|
||||
|
||||
var patientrecorddto = ObjectMapper.Map<List<PatientRecord>, List<PatientRecordDto>>(pagedQuery);
|
||||
foreach (var pr in patientrecorddto)
|
||||
{
|
||||
pr.LabReportUrl = filteredQuery.Where(x => x.Id == pr.Id).Select(x => x.LabReportUrl.FilePath).FirstOrDefault();
|
||||
pr.MedicationUrl = filteredQuery.Where(x => x.Id == pr.Id).Select(x => x.MedicationUrl.FilePath).FirstOrDefault();
|
||||
pr.MedicationHistoryUrl = filteredQuery.Where(x => x.Id == pr.Id).Select(x => x.MedicationHistoryUrl.FilePath).FirstOrDefault();
|
||||
}
|
||||
return new PagedResultDto<PatientRecordDto>(
|
||||
totalCount,
|
||||
ObjectMapper.Map<List<PatientRecord>, List<PatientRecordDto>>(pagedQuery)
|
||||
patientrecorddto
|
||||
);
|
||||
|
||||
}
|
||||
@ -84,17 +86,26 @@ namespace HospitalManagementSystem.Patients
|
||||
[Authorize(HospitalManagementSystemPermissions.Patient.Default)]
|
||||
public async Task<PatientRecordDto> GetPatientRecordByIdAsync(Guid id)
|
||||
{
|
||||
var patient = await _patientrecordRepository.GetAsync(id);
|
||||
return ObjectMapper.Map<PatientRecord, PatientRecordDto>(patient);
|
||||
var patient = await _patientrecordRepository.GetQueryableAsync().Result
|
||||
.Include(x => x.LabReportUrl)
|
||||
.Include(x => x.MedicationUrl)
|
||||
.Include(x => x.MedicationHistoryUrl)
|
||||
.Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||
var patientdto = ObjectMapper.Map<PatientRecord, PatientRecordDto>(patient);
|
||||
|
||||
patientdto.LabReportUrl = patient.LabReportUrl != null ? patient.LabReportUrl.FilePath : null;
|
||||
patientdto.MedicationUrl = patient.MedicationUrl != null ? patient.MedicationUrl.FilePath : null;
|
||||
patientdto.MedicationHistoryUrl = patient.MedicationHistoryUrl != null ? patient.MedicationHistoryUrl.FilePath : null;
|
||||
return patientdto;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Export Patient Data to Excel
|
||||
public async Task<FileDownloadDto> GetExportPatientRecordAsync()
|
||||
{
|
||||
var patients = await _patientrecordRepository.GetListAsync();
|
||||
var patientrecord = await _patientrecordRepository.GetQueryableAsync().Result.Include(x => x.Patients).ToListAsync();
|
||||
|
||||
var folderPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "exports");
|
||||
var folderPath = Path.Combine(_env.WebRootPath, "temp");
|
||||
if (!Directory.Exists(folderPath))
|
||||
{
|
||||
Directory.CreateDirectory(folderPath); // Ensure the folder exists
|
||||
@ -114,16 +125,22 @@ namespace HospitalManagementSystem.Patients
|
||||
worksheet.Cell(1, 3).Value = "Date of Admission";
|
||||
worksheet.Cell(1, 4).Value = "Diagnosis";
|
||||
worksheet.Cell(1, 5).Value = "Next Follow-Up";
|
||||
worksheet.Cell(1, 6).Value = "Status";
|
||||
worksheet.Cell(1, 6).Value = "InsuranceProvider";
|
||||
worksheet.Cell(1, 7).Value = "InsuranceProvider";
|
||||
worksheet.Cell(1, 8).Value = "InsuranceProvider";
|
||||
worksheet.Cell(1, 9).Value = "Status";
|
||||
|
||||
for (int i = 0; i < patients.Count; i++)
|
||||
for (int i = 0; i < patientrecord.Count; i++)
|
||||
{
|
||||
worksheet.Cell(i + 2, 1).Value = patients[i].Patients.Name;
|
||||
worksheet.Cell(i + 2, 2).Value = patients[i].Patients.Gender.ToString();
|
||||
worksheet.Cell(i + 2, 3).Value = patients[i].DateOfAdmission.ToShortDateString();
|
||||
worksheet.Cell(i + 2, 4).Value = patients[i].Diagnosis;
|
||||
worksheet.Cell(i + 2, 5).Value = patients[i].NextFollowUp?.ToShortDateString();
|
||||
worksheet.Cell(i + 2, 6).Value = patients[i].Status.ToString();
|
||||
worksheet.Cell(i + 2, 1).Value = patientrecord[i].Patients.Name;
|
||||
worksheet.Cell(i + 2, 2).Value = patientrecord[i].Patients.Gender.ToString();
|
||||
worksheet.Cell(i + 2, 3).Value = patientrecord[i].DateOfAdmission.ToShortDateString();
|
||||
worksheet.Cell(i + 2, 4).Value = patientrecord[i].Diagnosis;
|
||||
worksheet.Cell(i + 2, 5).Value = patientrecord[i].NextFollowUp?.ToShortDateString();
|
||||
worksheet.Cell(i + 2, 6).Value = patientrecord[i].InsuranceProvider;
|
||||
worksheet.Cell(i + 2, 7).Value = patientrecord[i].InsuranceProvider;
|
||||
worksheet.Cell(i + 2, 8).Value = patientrecord[i].InsuranceProvider;
|
||||
worksheet.Cell(i + 2, 9).Value = patientrecord[i].Status.ToString();
|
||||
}
|
||||
|
||||
worksheet.Columns().AdjustToContents();
|
||||
@ -147,10 +164,35 @@ namespace HospitalManagementSystem.Patients
|
||||
public async Task<PatientRecordDto> CreatePatientRecordAsync(CreateUpdatePatientRecordDto input)
|
||||
{
|
||||
var patientEntity = await _patientRepository.GetAsync(input.PatientId); // Get Patient from DB
|
||||
|
||||
var patientRecord = ObjectMapper.Map<CreateUpdatePatientRecordDto, PatientRecord>(input);
|
||||
patientRecord.Patients = patientEntity; // Assign the fetched entity
|
||||
patientRecord.Patients = patientEntity;
|
||||
List<EntityDocument> entitydocument = new List<EntityDocument>();
|
||||
|
||||
if (input.LabReportUrlID != Guid.Empty)
|
||||
uniqueid.Add(input.LabReportUrlID.Value);
|
||||
if (input.MedicationUrlID != Guid.Empty)
|
||||
uniqueid.Add(input.MedicationUrlID.Value);
|
||||
if (input.MedicationHistoryUrlID != Guid.Empty)
|
||||
uniqueid.Add(input.MedicationHistoryUrlID.Value);
|
||||
if (uniqueid.Count > 0)
|
||||
{
|
||||
entitydocument = await SaveFileToDocument(patientEntity, uniqueid);
|
||||
foreach (var entity in entitydocument)
|
||||
{
|
||||
switch (entity.TagName)
|
||||
{
|
||||
case "Lab-Report":
|
||||
patientRecord.LabReportUrl = entity;
|
||||
break;
|
||||
case "Medication":
|
||||
patientRecord.MedicationUrl = entity;
|
||||
break;
|
||||
case "Medication-History":
|
||||
patientRecord.MedicationHistoryUrl = entity;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
patientRecord = await _patientrecordRepository.InsertAsync(patientRecord);
|
||||
|
||||
return ObjectMapper.Map<PatientRecord, PatientRecordDto>(patientRecord);
|
||||
@ -161,19 +203,49 @@ namespace HospitalManagementSystem.Patients
|
||||
[Authorize(HospitalManagementSystemPermissions.Patient.Edit)]
|
||||
public async Task<PatientRecordDto> UpdatePatientRecordAsync(Guid id, CreateUpdatePatientRecordDto input)
|
||||
{
|
||||
var patientRecord = await _patientrecordRepository.GetAsync(id);
|
||||
|
||||
if (patientRecord.Patients.Id != input.PatientId) // If PatientId is updated, fetch new Patient
|
||||
try
|
||||
{
|
||||
var newPatient = await _patientRepository.GetAsync(input.PatientId);
|
||||
patientRecord.Patients = newPatient;
|
||||
var patientRecord = await _patientrecordRepository.GetQueryableAsync().Result.Include(x => x.Patients).Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||
List<EntityDocument> entitydocument = new List<EntityDocument>();
|
||||
if (patientRecord.Patients.Id != input.PatientId) // If PatientId is updated, fetch new Patient
|
||||
{
|
||||
var newPatient = await _patientRepository.GetAsync(input.PatientId);
|
||||
patientRecord.Patients = newPatient;
|
||||
}
|
||||
ObjectMapper.Map(input, patientRecord);
|
||||
if (input.LabReportUrlID != Guid.Empty)
|
||||
uniqueid.Add(input.LabReportUrlID.Value);
|
||||
if (input.MedicationUrlID != Guid.Empty)
|
||||
uniqueid.Add(input.MedicationUrlID.Value);
|
||||
if (input.MedicationHistoryUrlID != Guid.Empty)
|
||||
uniqueid.Add(input.MedicationHistoryUrlID.Value);
|
||||
if (uniqueid.Count > 0)
|
||||
{
|
||||
entitydocument = await SaveFileToDocument(patientRecord.Patients, uniqueid);
|
||||
foreach (var entity in entitydocument)
|
||||
{
|
||||
switch (entity.TagName)
|
||||
{
|
||||
case "Lab-Report":
|
||||
patientRecord.LabReportUrl = entity;
|
||||
break;
|
||||
case "Medication":
|
||||
patientRecord.MedicationUrl = entity;
|
||||
break;
|
||||
case "Medication-History":
|
||||
patientRecord.MedicationHistoryUrl = entity;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
patientRecord = await _patientrecordRepository.UpdateAsync(patientRecord);
|
||||
|
||||
return ObjectMapper.Map<PatientRecord, PatientRecordDto>(patientRecord);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception(ex.Message);
|
||||
}
|
||||
|
||||
ObjectMapper.Map(input, patientRecord);
|
||||
|
||||
patientRecord = await _patientrecordRepository.UpdateAsync(patientRecord);
|
||||
|
||||
return ObjectMapper.Map<PatientRecord, PatientRecordDto>(patientRecord);
|
||||
|
||||
}
|
||||
#endregion
|
||||
@ -225,8 +297,10 @@ namespace HospitalManagementSystem.Patients
|
||||
[Authorize(HospitalManagementSystemPermissions.Patient.Default)]
|
||||
public async Task<PatientDto> GetPatientByIdAsync(Guid id)
|
||||
{
|
||||
var patient = await _patientRepository.GetAsync(id);
|
||||
return ObjectMapper.Map<Patient, PatientDto>(patient);
|
||||
var patient = await _patientRepository.GetQueryableAsync().Result.Include(x => x.Images).Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||
var patientdto = ObjectMapper.Map<Patient, PatientDto>(patient);
|
||||
patientdto.Imagepath = patient.Images != null ? patient.Images.FilePath : null;
|
||||
return patientdto;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@ -235,7 +309,7 @@ namespace HospitalManagementSystem.Patients
|
||||
{
|
||||
var patients = await _patientRepository.GetListAsync();
|
||||
|
||||
var folderPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "exports");
|
||||
var folderPath = Path.Combine(_env.WebRootPath, "temp");
|
||||
if (!Directory.Exists(folderPath))
|
||||
{
|
||||
Directory.CreateDirectory(folderPath);
|
||||
@ -252,11 +326,12 @@ namespace HospitalManagementSystem.Patients
|
||||
worksheet.Cell(1, 1).Value = "Name";
|
||||
worksheet.Cell(1, 2).Value = "Gender";
|
||||
worksheet.Cell(1, 3).Value = "Age";
|
||||
worksheet.Cell(1, 4).Value = "Treatment";
|
||||
worksheet.Cell(1, 5).Value = "Doctor Assigned";
|
||||
worksheet.Cell(1, 6).Value = "Admission Date";
|
||||
worksheet.Cell(1, 7).Value = "Discharge Date";
|
||||
worksheet.Cell(1, 8).Value = "Status";
|
||||
worksheet.Cell(1, 4).Value = "BloodGroup";
|
||||
worksheet.Cell(1, 5).Value = "Treatment";
|
||||
worksheet.Cell(1, 6).Value = "Doctor Assigned";
|
||||
worksheet.Cell(1, 7).Value = "Admission Date";
|
||||
worksheet.Cell(1, 8).Value = "Discharge Date";
|
||||
worksheet.Cell(1, 9).Value = "Status";
|
||||
|
||||
// Add data rows
|
||||
for (int i = 0; i < patients.Count; i++)
|
||||
@ -264,11 +339,12 @@ namespace HospitalManagementSystem.Patients
|
||||
worksheet.Cell(i + 2, 1).Value = patients[i].Name;
|
||||
worksheet.Cell(i + 2, 2).Value = patients[i].Gender.ToString();
|
||||
worksheet.Cell(i + 2, 3).Value = patients[i].Age;
|
||||
worksheet.Cell(i + 2, 4).Value = patients[i].Treatment;
|
||||
worksheet.Cell(i + 2, 5).Value = patients[i].DoctorAssigned;
|
||||
worksheet.Cell(i + 2, 6).Value = patients[i].AdmissionDate.ToShortDateString();
|
||||
worksheet.Cell(i + 2, 7).Value = patients[i].DischargeDate?.ToShortDateString();
|
||||
worksheet.Cell(i + 2, 8).Value = patients[i].Status.ToString();
|
||||
worksheet.Cell(i + 2, 4).Value = patients[i].BloodGroup;
|
||||
worksheet.Cell(i + 2, 5).Value = patients[i].Treatment;
|
||||
worksheet.Cell(i + 2, 6).Value = patients[i].DoctorAssigned;
|
||||
worksheet.Cell(i + 2, 7).Value = patients[i].AdmissionDate.ToShortDateString();
|
||||
worksheet.Cell(i + 2, 8).Value = patients[i].DischargeDate?.ToShortDateString();
|
||||
worksheet.Cell(i + 2, 9).Value = patients[i].Status.ToString();
|
||||
}
|
||||
|
||||
worksheet.Columns().AdjustToContents();
|
||||
@ -293,6 +369,19 @@ namespace HospitalManagementSystem.Patients
|
||||
var patient = ObjectMapper.Map<CreateUpdatePatientDto, Patient>(input);
|
||||
|
||||
patient = await _patientRepository.InsertAsync(patient);
|
||||
if (input.ImageID != Guid.Empty)
|
||||
{
|
||||
uniqueid.Add(input.ImageID);
|
||||
var entitydocument = await SaveFileToDocument(patient, uniqueid, true);
|
||||
foreach (var entity in entitydocument)
|
||||
{
|
||||
if (entity.TagName == "Image")
|
||||
{
|
||||
patient.Images = entity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ObjectMapper.Map<Patient, PatientDto>(patient);
|
||||
}
|
||||
#endregion
|
||||
@ -301,9 +390,21 @@ namespace HospitalManagementSystem.Patients
|
||||
[Authorize(HospitalManagementSystemPermissions.Patient.Edit)]
|
||||
public async Task<PatientDto> UpdatePatientAsync(Guid id, CreateUpdatePatientDto input)
|
||||
{
|
||||
var patient = await _patientRepository.GetAsync(id);
|
||||
|
||||
var patient = await _patientRepository.GetQueryableAsync().Result.Include(x => x.Images).Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||
List<EntityDocument> entitydocument = new List<EntityDocument>();
|
||||
ObjectMapper.Map(input, patient);
|
||||
if (input.ImageID != Guid.Empty)
|
||||
{
|
||||
uniqueid.Add(input.ImageID);
|
||||
entitydocument = await SaveFileToDocument(patient, uniqueid);
|
||||
foreach (var entity in entitydocument)
|
||||
{
|
||||
if (entity.TagName == "Image")
|
||||
{
|
||||
patient.Images = entity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
patient = await _patientRepository.UpdateAsync(patient);
|
||||
return ObjectMapper.Map<Patient, PatientDto>(patient);
|
||||
@ -343,5 +444,220 @@ namespace HospitalManagementSystem.Patients
|
||||
return await Task.FromResult(statuslist);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region UploadFile
|
||||
public async Task<Guid> UploadFileAsync(string TagName, IRemoteStreamContent file)
|
||||
{
|
||||
if (file == null)
|
||||
{
|
||||
throw new Exception("File cannot be null");
|
||||
}
|
||||
string patientFolder = Path.Combine(_env.WebRootPath, "temp");
|
||||
Guid uniqueId = Guid.NewGuid();
|
||||
if (!Directory.Exists(patientFolder))
|
||||
{
|
||||
Directory.CreateDirectory(patientFolder);
|
||||
}
|
||||
|
||||
string fileExtension = Path.GetExtension(file.FileName);
|
||||
string fileName = $"{uniqueId}({TagName}){fileExtension}";
|
||||
string filePath = Path.Combine(patientFolder, fileName);
|
||||
|
||||
using (var fileStream = new FileStream(filePath, FileMode.Create, FileAccess.Write))
|
||||
{
|
||||
await file.GetStream().CopyToAsync(fileStream);
|
||||
}
|
||||
|
||||
var metadata = new
|
||||
{
|
||||
OriginalFileName = file.FileName,
|
||||
FileName = fileName,
|
||||
FileSize = new FileInfo(filePath).Length.ToString(),
|
||||
FilePath = filePath,
|
||||
UploadDate = DateTime.UtcNow,
|
||||
FileType = fileExtension,
|
||||
TagName = TagName,
|
||||
};
|
||||
|
||||
string jsonFileName = $"{uniqueId}({TagName}).json";
|
||||
string jsonFilePath = Path.Combine(patientFolder, jsonFileName);
|
||||
await File.WriteAllTextAsync(jsonFilePath, JsonSerializer.Serialize(metadata, new JsonSerializerOptions { WriteIndented = true }));
|
||||
|
||||
return uniqueId;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SaveFileToDocument
|
||||
//public async Task<List<EntityDocument>> SaveFileToDocument(Patient Patients, Guid ImageId, bool IsNew = false)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// //string patientFolder = Path.Combine(_env.WebRootPath, "uploads", PatientId.ToString());
|
||||
// string patientFolder = Path.Combine(_env.WebRootPath, "uploads", $"{Patients.Id}({Patients.Name})");
|
||||
// string ImageFolder = Path.Combine(_env.WebRootPath, "uploads", $"{ImageId}({Patients.Name})");
|
||||
// List<string>? jsonFiles;
|
||||
|
||||
// if (IsNew)
|
||||
// {
|
||||
// jsonFiles = Directory.EnumerateFiles(ImageFolder, "*.json").Where(x => Path.GetFileName(x).StartsWith(ImageId.ToString())).ToList();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// jsonFiles = Directory.EnumerateFiles(patientFolder, "*.json").Where(x => Path.GetFileName(x).StartsWith(Patients.Id.ToString())).ToList();
|
||||
// }
|
||||
|
||||
// List<EntityDocument> savedDocuments = new List<EntityDocument>();
|
||||
|
||||
// // Iterate over all matching JSON files and save data to the database
|
||||
// foreach (var jsonFilePath in jsonFiles)
|
||||
// {
|
||||
// string jsonContent = await File.ReadAllTextAsync(jsonFilePath);
|
||||
// var metadata = JsonSerializer.Deserialize<dynamic>(jsonContent);
|
||||
|
||||
// var document = new EntityDocument
|
||||
// {
|
||||
// OriginalFileName = metadata.GetProperty("OriginalFileName").GetString(),
|
||||
// GeneratedFileName = metadata.GetProperty("FileName").GetString(),
|
||||
// FileSize = metadata.GetProperty("FileSize").GetString(),
|
||||
// FilePath = metadata.GetProperty("FilePath").GetString(),
|
||||
// FileType = metadata.GetProperty("FileType").GetString(),
|
||||
// TagName = metadata.GetProperty("TagName").GetString(),
|
||||
// UploadDate = metadata.GetProperty("UploadDate").GetDateTime() // Use GetDateTime()
|
||||
// };
|
||||
|
||||
// // Save document record to the database
|
||||
// await _entityDocumentRepository.InsertAsync(document);
|
||||
// savedDocuments.Add(document);
|
||||
// var patientidexist = await _patientDocumentRepository.GetQueryableAsync().Result.Include(x => x.Patients).Include(x => x.EntityDocuments)
|
||||
// .Where(x => x.Patients.Id == Patients.Id && x.TagName == document.TagName).FirstOrDefaultAsync();
|
||||
// var patientDocument = new PatientDocument
|
||||
// {
|
||||
// Patients = Patients,
|
||||
// EntityDocuments = document,
|
||||
// TagName = metadata.GetProperty("TagName").GetString()
|
||||
// };
|
||||
// if (patientidexist != null)
|
||||
// {
|
||||
// await _patientDocumentRepository.UpdateAsync(patientDocument);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// await _patientDocumentRepository.InsertAsync(patientDocument);
|
||||
// }
|
||||
// File.Delete(jsonFilePath);
|
||||
// }
|
||||
// return savedDocuments;
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// throw new Exception(ex.Message);
|
||||
// }
|
||||
//}
|
||||
public async Task<List<EntityDocument>> SaveFileToDocument(Patient patient, List<Guid> uniqueIds, bool isNew = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
string tempFolder = Path.Combine(_env.WebRootPath, "temp");
|
||||
string patientFolder = Path.Combine(_env.WebRootPath, "uploads", $"{patient.Id}({patient.Name})");
|
||||
|
||||
if (!Directory.Exists(patientFolder))
|
||||
{
|
||||
Directory.CreateDirectory(patientFolder);
|
||||
}
|
||||
|
||||
List<EntityDocument> savedDocuments = new List<EntityDocument>();
|
||||
|
||||
foreach (var uniqueId in uniqueIds)
|
||||
{
|
||||
// Fetch all matching JSON metadata files for the current uniqueId
|
||||
foreach (var jsonFilePath in Directory.EnumerateFiles(tempFolder, $"{uniqueId}(*).json"))
|
||||
{
|
||||
string jsonContent = await File.ReadAllTextAsync(jsonFilePath);
|
||||
var metadata = JsonSerializer.Deserialize<JsonElement>(jsonContent);
|
||||
|
||||
string originalFileName = metadata.GetProperty("OriginalFileName").GetString();
|
||||
string generatedFileName = metadata.GetProperty("FileName").GetString();
|
||||
string fileSize = metadata.GetProperty("FileSize").GetString();
|
||||
string filePath = metadata.GetProperty("FilePath").GetString();
|
||||
string fileType = metadata.GetProperty("FileType").GetString();
|
||||
string tagName = metadata.GetProperty("TagName").GetString();
|
||||
DateTime uploadDate = metadata.GetProperty("UploadDate").GetDateTime();
|
||||
|
||||
// Move the file from temp folder to patient folder
|
||||
string newFilePath = Path.Combine(patientFolder, generatedFileName);
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
File.Move(filePath, newFilePath, true);
|
||||
}
|
||||
newFilePath = newFilePath.Split("wwwroot")[1];
|
||||
var document = new EntityDocument
|
||||
{
|
||||
OriginalFileName = originalFileName,
|
||||
GeneratedFileName = generatedFileName,
|
||||
FileSize = fileSize,
|
||||
FilePath = newFilePath,
|
||||
FileType = fileType,
|
||||
TagName = tagName,
|
||||
UploadDate = uploadDate
|
||||
};
|
||||
savedDocuments.Add(document);
|
||||
|
||||
// Delete JSON file after processing
|
||||
File.Delete(jsonFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
// Batch insert entity documents
|
||||
if (savedDocuments.Any())
|
||||
{
|
||||
await _entityDocumentRepository.InsertManyAsync(savedDocuments);
|
||||
}
|
||||
|
||||
// Fetch existing patient documents in one query
|
||||
var existingPatientDocs = await _patientDocumentRepository.GetQueryableAsync()
|
||||
.Result.Where(x => x.Patients.Id == patient.Id)
|
||||
.ToListAsync();
|
||||
|
||||
List<PatientDocument> patientDocuments = new List<PatientDocument>();
|
||||
|
||||
foreach (var document in savedDocuments)
|
||||
{
|
||||
var existingDoc = existingPatientDocs.FirstOrDefault(x => x.TagName == document.TagName);
|
||||
|
||||
var patientDocument = new PatientDocument
|
||||
{
|
||||
Patients = patient,
|
||||
EntityDocuments = document,
|
||||
TagName = document.TagName
|
||||
};
|
||||
|
||||
if (existingDoc != null)
|
||||
{
|
||||
existingDoc.EntityDocuments = document; // Update reference
|
||||
await _patientDocumentRepository.UpdateAsync(existingDoc);
|
||||
}
|
||||
else
|
||||
{
|
||||
patientDocuments.Add(patientDocument);
|
||||
}
|
||||
}
|
||||
|
||||
// Batch insert new patient documents
|
||||
if (patientDocuments.Any())
|
||||
{
|
||||
await _patientDocumentRepository.InsertManyAsync(patientDocuments);
|
||||
}
|
||||
uniqueid.Clear();
|
||||
return savedDocuments;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
uniqueid.Clear();
|
||||
throw new Exception($"Error saving files for patient {patient.Id}: {ex.Message}", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.Content;
|
||||
|
||||
namespace HospitalManagementSystem.Dto
|
||||
{
|
||||
public class UploadFileDto
|
||||
{
|
||||
public Guid PatientId { get; set; } // Patient GUID ID
|
||||
public string PatientName { get; set; } // Patient Name
|
||||
public string TagName { get; set; } // Tag name for the file
|
||||
public IRemoteStreamContent File { get; set; } // File content
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using HospitalManagementSystem.Patients;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.Domain.Entities.Auditing;
|
||||
|
||||
namespace HospitalManagementSystem.Documents
|
||||
{
|
||||
public class EntityDocument : AuditedAggregateRoot<Guid>
|
||||
{
|
||||
public string OriginalFileName { get; set; }
|
||||
public string GeneratedFileName { get; set; }
|
||||
public string FileSize { get; set; }
|
||||
public string FilePath { get; set; }
|
||||
public string FileType { get; set; }
|
||||
public string TagName { get; set; }
|
||||
public DateTime UploadDate { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
using HospitalManagementSystem.Patients;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.Domain.Entities.Auditing;
|
||||
|
||||
namespace HospitalManagementSystem.Documents
|
||||
{
|
||||
public class PatientDocument : AuditedAggregateRoot<Guid>
|
||||
{
|
||||
[Required]
|
||||
public Patient Patients { get; set; }
|
||||
[Required]
|
||||
public EntityDocument EntityDocuments { get; set; }
|
||||
[Required]
|
||||
public string TagName { get; set; }
|
||||
}
|
||||
}
|
@ -13,6 +13,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.17" />
|
||||
<PackageReference Include="Volo.Abp.Emailing" Version="9.0.2" />
|
||||
<PackageReference Include="Volo.Abp.Identity.Domain" Version="9.0.2" />
|
||||
<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="9.0.2" />
|
||||
|
@ -1,4 +1,5 @@
|
||||
using HospitalManagementSystem.GlobalEnum;
|
||||
using HospitalManagementSystem.Documents;
|
||||
using HospitalManagementSystem.GlobalEnum;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
@ -31,6 +32,7 @@ namespace HospitalManagementSystem.Patients
|
||||
public DateTime? DischargeDate { get; set; }
|
||||
[Required]
|
||||
public Status Status { get; set; }
|
||||
public EntityDocument? Images { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using HospitalManagementSystem.GlobalEnum;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using HospitalManagementSystem.Documents;
|
||||
|
||||
namespace HospitalManagementSystem.Patients
|
||||
{
|
||||
@ -31,11 +32,11 @@ namespace HospitalManagementSystem.Patients
|
||||
|
||||
public string DoctorNotes { get; set; }
|
||||
|
||||
public string? LabReportUrl { get; set; }
|
||||
public virtual EntityDocument? LabReportUrl { get; set; }
|
||||
|
||||
public string? MedicationUrl { get; set; }
|
||||
public virtual EntityDocument? MedicationUrl { get; set; }
|
||||
|
||||
public string? MedicationHistoryUrl { get; set; }
|
||||
public virtual EntityDocument? MedicationHistoryUrl { get; set; }
|
||||
|
||||
public DateTime? NextFollowUp { get; set; }
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
using HospitalManagementSystem.Patients;
|
||||
using HospitalManagementSystem.Documents;
|
||||
using HospitalManagementSystem.Patients;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Volo.Abp.AuditLogging.EntityFrameworkCore;
|
||||
using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
|
||||
@ -28,6 +29,9 @@ public class HospitalManagementSystemDbContext :
|
||||
/* Add DbSet properties for your Aggregate Roots / Entities here. */
|
||||
public DbSet<PatientRecord> PatientRecords { get; set; }
|
||||
public DbSet<Patient> Patients { get; set; }
|
||||
public DbSet<EntityDocument> EntityDocuments { get; set; }
|
||||
public DbSet<PatientDocument> PatientDocuments { get; set; }
|
||||
|
||||
#region Entities from the modules
|
||||
|
||||
/* Notice: We only implemented IIdentityDbContext and ITenantManagementDbContext
|
||||
@ -90,6 +94,18 @@ public class HospitalManagementSystemDbContext :
|
||||
b.ConfigureByConvention(); //auto configure for the base class props
|
||||
});
|
||||
|
||||
builder.Entity<EntityDocument>(b =>
|
||||
{
|
||||
b.ToTable("EntityDocuments");
|
||||
b.ConfigureByConvention(); //auto configure for the base class props
|
||||
});
|
||||
|
||||
builder.Entity<PatientDocument>(b =>
|
||||
{
|
||||
b.ToTable("PatientDocuments");
|
||||
b.ConfigureByConvention(); //auto configure for the base class props
|
||||
});
|
||||
|
||||
//builder.Entity<YourEntity>(b =>
|
||||
//{
|
||||
// b.ToTable(HospitalManagementSystemConsts.DbTablePrefix + "YourEntities", HospitalManagementSystemConsts.DbSchema);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,241 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
@ -19,11 +19,128 @@ 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);
|
||||
|
||||
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")
|
||||
@ -77,6 +194,9 @@ namespace HospitalManagementSystem.Migrations
|
||||
b.Property<int>("Gender")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid?>("ImagesId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
@ -102,6 +222,8 @@ namespace HospitalManagementSystem.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ImagesId");
|
||||
|
||||
b.ToTable("Patient", (string)null);
|
||||
});
|
||||
|
||||
@ -145,8 +267,8 @@ namespace HospitalManagementSystem.Migrations
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("LabReportUrl")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
b.Property<Guid?>("LabReportUrlId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
@ -156,11 +278,11 @@ namespace HospitalManagementSystem.Migrations
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<string>("MedicationHistoryUrl")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
b.Property<Guid?>("MedicationHistoryUrlId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<string>("MedicationUrl")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
b.Property<Guid?>("MedicationUrlId")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTime?>("NextFollowUp")
|
||||
.HasColumnType("datetime2");
|
||||
@ -177,6 +299,12 @@ namespace HospitalManagementSystem.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LabReportUrlId");
|
||||
|
||||
b.HasIndex("MedicationHistoryUrlId");
|
||||
|
||||
b.HasIndex("MedicationUrlId");
|
||||
|
||||
b.HasIndex("PatientsId");
|
||||
|
||||
b.ToTable("PatientRecords", (string)null);
|
||||
@ -1922,14 +2050,60 @@ namespace HospitalManagementSystem.Migrations
|
||||
b.ToTable("AbpTenantConnectionStrings", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("HospitalManagementSystem.Patients.PatientRecord", b =>
|
||||
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");
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user