patient module done with file upload
This commit is contained in:
parent
e65b1f5870
commit
9ca3ab6eba
@ -57,7 +57,7 @@
|
|||||||
<td class="d-flex">
|
<td class="d-flex">
|
||||||
<button *ngIf="createpermission" pButton class="btn btn-success btn-sm"
|
<button *ngIf="createpermission" pButton class="btn btn-success btn-sm"
|
||||||
(click)="addnewrecord(patient.id)">
|
(click)="addnewrecord(patient.id)">
|
||||||
<i class="pi pi-plus-circle"></i>
|
<i class="pi pi-arrow-right"></i>
|
||||||
</button>
|
</button>
|
||||||
<button *ngIf="editpermission" class="btn btn-warning btn-sm ml-1" (click)="editPatient(patient)"><i
|
<button *ngIf="editpermission" class="btn btn-warning btn-sm ml-1" (click)="editPatient(patient)"><i
|
||||||
class="pi pi-pencil"></i></button>
|
class="pi pi-pencil"></i></button>
|
||||||
@ -89,6 +89,13 @@
|
|||||||
placeholder="Enter full patient name" required #name="ngModel" />
|
placeholder="Enter full patient name" required #name="ngModel" />
|
||||||
<small *ngIf="name.invalid && name.touched" class="p-error">Full Name is required</small>
|
<small *ngIf="name.invalid && name.touched" class="p-error">Full Name is required</small>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
|
|
||||||
<!-- Mobile -->
|
<!-- Mobile -->
|
||||||
@ -150,6 +157,25 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</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">
|
<div class="p-grid">
|
||||||
<!-- Blood Group -->
|
<!-- 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 {
|
.table-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { PermissionService } from '@abp/ng.core';
|
import { PermissionService } from '@abp/ng.core';
|
||||||
|
import { Confirmation, ConfirmationService, ToasterService } from '@abp/ng.theme.shared';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { NgForm } from '@angular/forms';
|
import { NgForm } from '@angular/forms';
|
||||||
@ -7,13 +8,12 @@ import { PagingSortPatientResultDto } from '@proxy/dto';
|
|||||||
import { Gender, Status } from '@proxy/global-enum';
|
import { Gender, Status } from '@proxy/global-enum';
|
||||||
import { PatientService } from '@proxy/patients';
|
import { PatientService } from '@proxy/patients';
|
||||||
import { PatientDto, CreateUpdatePatientDto } from '@proxy/patients/dto';
|
import { PatientDto, CreateUpdatePatientDto } from '@proxy/patients/dto';
|
||||||
import { MessageService } from 'primeng/api';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-all-patients',
|
selector: 'app-all-patients',
|
||||||
templateUrl: './all-patients.component.html',
|
templateUrl: './all-patients.component.html',
|
||||||
styleUrl: './all-patients.component.scss',
|
styleUrl: './all-patients.component.scss',
|
||||||
providers: [PatientService, MessageService, PermissionService],
|
providers: [PatientService, ConfirmationService, ToasterService, PermissionService],
|
||||||
})
|
})
|
||||||
export class AllPatientsComponent implements OnInit {
|
export class AllPatientsComponent implements OnInit {
|
||||||
globalFilter: string = '';
|
globalFilter: string = '';
|
||||||
@ -32,18 +32,30 @@ export class AllPatientsComponent implements OnInit {
|
|||||||
selectedgender: any = 0;
|
selectedgender: any = 0;
|
||||||
selectadmissionDate: Date = new Date();
|
selectadmissionDate: Date = new Date();
|
||||||
selectdischargeDate: Date = new Date();
|
selectdischargeDate: Date = new Date();
|
||||||
uploadfile: {
|
|
||||||
file: File[];
|
|
||||||
name: string;
|
|
||||||
}[] = [];
|
|
||||||
createpermission: boolean;
|
createpermission: boolean;
|
||||||
editpermission: boolean;
|
editpermission: boolean;
|
||||||
deletepermission: 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(
|
constructor(
|
||||||
private patientService: PatientService,
|
private patientService: PatientService,
|
||||||
private http: HttpClient,
|
private http: HttpClient,
|
||||||
private messageService: MessageService,
|
private confirmation: ConfirmationService,
|
||||||
|
private toaster: ToasterService,
|
||||||
private permissionChecker: PermissionService,
|
private permissionChecker: PermissionService,
|
||||||
private router: Router
|
private router: Router
|
||||||
) {}
|
) {}
|
||||||
@ -88,6 +100,9 @@ export class AllPatientsComponent implements OnInit {
|
|||||||
dischargeDate: '',
|
dischargeDate: '',
|
||||||
status: Status.InTreatment,
|
status: Status.InTreatment,
|
||||||
};
|
};
|
||||||
|
this.imgpath = '';
|
||||||
|
this.selectedgender = 0;
|
||||||
|
this.selectedstatus = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
loadPatient(event: any) {
|
loadPatient(event: any) {
|
||||||
@ -147,30 +162,60 @@ export class AllPatientsComponent implements OnInit {
|
|||||||
this.router.navigate(['/patients/patient-record', id]);
|
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) {
|
editPatient(Patient: any) {
|
||||||
|
this.resetselectpatient();
|
||||||
this.patientDialogTitle = 'Edit Patient';
|
this.patientDialogTitle = 'Edit Patient';
|
||||||
this.selectedPatient = { ...Patient };
|
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.selectedgender = this.selectedPatient.gender;
|
||||||
this.selectedstatus = this.selectedPatient.status;
|
this.selectedstatus = this.selectedPatient.status;
|
||||||
this.selectadmissionDate = new Date(this.selectedPatient.admissionDate);
|
});
|
||||||
this.selectdischargeDate = new Date(this.selectedPatient.dischargeDate);
|
|
||||||
this.patientDialog = true;
|
this.patientDialog = true;
|
||||||
this.isEditMode = true;
|
this.isEditMode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
deletePatient(id: any) {
|
deletePatient(id: any) {
|
||||||
|
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.patientService.deletePatient(id).subscribe(() => {
|
||||||
this.messageService.add({
|
this.toaster.success('Patient deleted successfully', 'Success');
|
||||||
severity: 'success',
|
|
||||||
summary: 'Success',
|
|
||||||
detail: 'Patient deleted successfully',
|
|
||||||
});
|
|
||||||
this.loadPatient(this.params);
|
this.loadPatient(this.params);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
savePatient(form: NgForm) {
|
savePatient(form: NgForm) {
|
||||||
debugger;
|
|
||||||
console.log(form.controls);
|
console.log(form.controls);
|
||||||
if (form.invalid) {
|
if (form.invalid) {
|
||||||
Object.values(form.controls).forEach(control => control.markAsTouched());
|
Object.values(form.controls).forEach(control => control.markAsTouched());
|
||||||
@ -180,18 +225,15 @@ export class AllPatientsComponent implements OnInit {
|
|||||||
this.selectedPatient.status = this.selectedstatus;
|
this.selectedPatient.status = this.selectedstatus;
|
||||||
this.selectedPatient.admissionDate = this.selectadmissionDate.toDateString();
|
this.selectedPatient.admissionDate = this.selectadmissionDate.toDateString();
|
||||||
this.selectedPatient.dischargeDate = this.selectdischargeDate.toDateString();
|
this.selectedPatient.dischargeDate = this.selectdischargeDate.toDateString();
|
||||||
|
this.selectedPatient.imageID = this.selectedPatient.imageID
|
||||||
|
? this.selectedPatient.imageID.replace('"', '').replace('"', '')
|
||||||
|
: this.guid;
|
||||||
console.log(this.selectedPatient);
|
console.log(this.selectedPatient);
|
||||||
|
|
||||||
if (this.isEditMode) {
|
if (this.isEditMode) {
|
||||||
this.patientService
|
this.patientService.updatePatient(this.selectedPatient.id, this.selectedPatient).subscribe(
|
||||||
.updatePatient(this.selectedPatient.id, this.selectedPatient)
|
() => {
|
||||||
.subscribe(() => {
|
this.toaster.success('Patient updated successfully', 'Success');
|
||||||
this.messageService.add({
|
|
||||||
severity: 'success',
|
|
||||||
summary: 'Success',
|
|
||||||
detail: 'Patient updated successfully',
|
|
||||||
});
|
|
||||||
this.patientDialog = false;
|
this.patientDialog = false;
|
||||||
this.loadPatient({
|
this.loadPatient({
|
||||||
first: 0,
|
first: 0,
|
||||||
@ -200,14 +242,16 @@ export class AllPatientsComponent implements OnInit {
|
|||||||
sortOrder: 1,
|
sortOrder: 1,
|
||||||
globalFilter: null,
|
globalFilter: null,
|
||||||
});
|
});
|
||||||
});
|
},
|
||||||
|
error => {
|
||||||
|
console.log(error);
|
||||||
|
this.closeDialog();
|
||||||
|
}
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
this.patientService.createPatient(this.selectedPatient).subscribe(() => {
|
this.patientService.createPatient(this.selectedPatient).subscribe(
|
||||||
this.messageService.add({
|
() => {
|
||||||
severity: 'success',
|
this.toaster.success('Patient created successfully', 'Success');
|
||||||
summary: 'Success',
|
|
||||||
detail: 'Patient created successfully',
|
|
||||||
});
|
|
||||||
this.patientDialog = false;
|
this.patientDialog = false;
|
||||||
this.loadPatient({
|
this.loadPatient({
|
||||||
first: 0,
|
first: 0,
|
||||||
@ -216,7 +260,12 @@ export class AllPatientsComponent implements OnInit {
|
|||||||
sortOrder: 1,
|
sortOrder: 1,
|
||||||
globalFilter: null,
|
globalFilter: null,
|
||||||
});
|
});
|
||||||
});
|
},
|
||||||
|
error => {
|
||||||
|
console.log(error);
|
||||||
|
this.closeDialog();
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,9 +30,15 @@
|
|||||||
<div class="info-item">
|
<div class="info-item">
|
||||||
<strong>Admission:</strong> {{ patientdto?.admissionDate | date }}
|
<strong>Admission:</strong> {{ patientdto?.admissionDate | date }}
|
||||||
</div>
|
</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">
|
<div class="info-item">
|
||||||
<strong>Status:</strong>
|
<strong>Status:</strong>
|
||||||
<span class="status" [ngClass]="{'active': patientdto?.status === 'Active', 'inactive': patientdto?.status === 'Inactive'}">
|
<span class="status">
|
||||||
{{ status[patientdto?.status] }}
|
{{ status[patientdto?.status] }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@ -40,11 +46,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</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>
|
<div>
|
||||||
<p-table #dt2 dataKey="id" [value]="patientrecords" [paginator]="true" [rows]="10" [totalRecords]="totalRecords"
|
<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']"
|
[responsiveLayout]="'scroll'" [globalFilterFields]="['id', 'name', 'diagnosis']"
|
||||||
[filters]="{ global: { value: '', matchMode: 'contains' } }" class="table table-striped">
|
[filters]="{ global: { value: '', matchMode: 'contains' } }" class="table table-striped">
|
||||||
|
|
||||||
@ -103,8 +113,8 @@
|
|||||||
<td class="d-flex">
|
<td class="d-flex">
|
||||||
<button *ngIf="editpermission" class="btn btn-warning btn-sm" (click)="editPatient(patientrecord)"><i
|
<button *ngIf="editpermission" class="btn btn-warning btn-sm" (click)="editPatient(patientrecord)"><i
|
||||||
class="pi pi-pencil"></i></button>
|
class="pi pi-pencil"></i></button>
|
||||||
<button *ngIf="deletepermission" class="btn btn-danger btn-sm ml-1" (click)="deletePatient(patientrecord.id)"><i
|
<button *ngIf="deletepermission" class="btn btn-danger btn-sm ml-1"
|
||||||
class="pi pi-trash"></i></button>
|
(click)="deletePatient(patientrecord.id)"><i class="pi pi-trash"></i></button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
@ -186,6 +196,7 @@
|
|||||||
<input type="file" id="labReport" name="labReport" accept=".pdf,.doc,.docx"
|
<input type="file" id="labReport" name="labReport" accept=".pdf,.doc,.docx"
|
||||||
(change)="handleLabReportUpload($event)" />
|
(change)="handleLabReportUpload($event)" />
|
||||||
</div>
|
</div>
|
||||||
|
<small *ngIf="labReportUrlpath !==''">{{labReportUrlpath}} <i class="pi pi-file-pdf pdf-icon"></i></small>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-col-6">
|
<div class="p-col-6">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
@ -193,6 +204,7 @@
|
|||||||
<input type="file" id="medications" name="medications" accept=".pdf,.doc,.docx"
|
<input type="file" id="medications" name="medications" accept=".pdf,.doc,.docx"
|
||||||
(change)="handleMedicationsUpload($event)" />
|
(change)="handleMedicationsUpload($event)" />
|
||||||
</div>
|
</div>
|
||||||
|
<small *ngIf="medicationUrlpath !==''">{{medicationUrlpath}} <i class="pi pi-file-pdf pdf-icon"></i></small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -203,6 +215,7 @@
|
|||||||
<input type="file" id="medicationHistory" name="medicationHistory" accept=".pdf,.doc,.docx"
|
<input type="file" id="medicationHistory" name="medicationHistory" accept=".pdf,.doc,.docx"
|
||||||
(change)="handleMedicationHistoryUpload($event)" />
|
(change)="handleMedicationHistoryUpload($event)" />
|
||||||
</div>
|
</div>
|
||||||
|
<small *ngIf="medicationHistoryUrlpath !==''">{{medicationHistoryUrlpath}} <i class="pi pi-file-pdf pdf-icon"></i></small>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-col-6">
|
<div class="p-col-6">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
@ -237,7 +250,8 @@
|
|||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="insuranceProvider">Insurance Provider</label>
|
<label for="insuranceProvider">Insurance Provider</label>
|
||||||
<input id="insuranceProvider" name="insuranceProvider" type="text" autocomplete="off" pInputText
|
<input id="insuranceProvider" name="insuranceProvider" type="text" autocomplete="off" pInputText
|
||||||
[(ngModel)]="selectedPatient.insuranceProvider" required placeholder="Enter insurance provider" #insurance="ngModel" />
|
[(ngModel)]="selectedPatient.insuranceProvider" required placeholder="Enter insurance provider"
|
||||||
|
#insurance="ngModel" />
|
||||||
<small *ngIf="insurance.invalid && insurance.touched" class="p-error">
|
<small *ngIf="insurance.invalid && insurance.touched" class="p-error">
|
||||||
Insurance is required.
|
Insurance is required.
|
||||||
</small>
|
</small>
|
||||||
@ -257,8 +271,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button type="submit" pButton class="btn btn-primary"
|
<button type="submit" pButton class="btn btn-primary" [disabled]="patientrecord.invalid">Save</button>
|
||||||
[disabled]="patientrecord.invalid">Save</button>
|
|
||||||
<button pButton class="btn btn-secondary ml-1" (click)="closeDialog()">Close</button>
|
<button pButton class="btn btn-secondary ml-1" (click)="closeDialog()">Close</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -78,19 +78,4 @@
|
|||||||
border-radius: 6px;
|
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 { Gender, Status } from '@proxy/global-enum';
|
||||||
import { PatientService } from '@proxy/patients';
|
import { PatientService } from '@proxy/patients';
|
||||||
import { CreateUpdatePatientRecordDto, PatientDto, PatientRecordDto } from '@proxy/patients/dto';
|
import { CreateUpdatePatientRecordDto, PatientDto, PatientRecordDto } from '@proxy/patients/dto';
|
||||||
import { MessageService } from 'primeng/api';
|
|
||||||
import { PermissionService } from '@abp/ng.core';
|
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({
|
@Component({
|
||||||
selector: 'app-patient-record',
|
selector: 'app-patient-record',
|
||||||
templateUrl: './patient-record.component.html',
|
templateUrl: './patient-record.component.html',
|
||||||
styleUrl: './patient-record.component.scss',
|
styleUrl: './patient-record.component.scss',
|
||||||
providers: [PatientService, MessageService, PermissionService],
|
providers: [PatientService, ConfirmationService, ToasterService, PermissionService],
|
||||||
})
|
})
|
||||||
export class PatientRecordComponent implements OnInit {
|
export class PatientRecordComponent implements OnInit {
|
||||||
globalFilter: string = '';
|
globalFilter: string = '';
|
||||||
@ -30,26 +31,40 @@ export class PatientRecordComponent implements OnInit {
|
|||||||
statuslist: any;
|
statuslist: any;
|
||||||
selectdateOfAdmission: Date = new Date();
|
selectdateOfAdmission: Date = new Date();
|
||||||
selectnextFollowUp: Date = new Date();
|
selectnextFollowUp: Date = new Date();
|
||||||
uploadfile: {
|
|
||||||
file: File[];
|
|
||||||
name: string;
|
|
||||||
}[] = [];
|
|
||||||
createpermission: boolean;
|
createpermission: boolean;
|
||||||
editpermission: boolean;
|
editpermission: boolean;
|
||||||
deletepermission: boolean;
|
deletepermission: boolean;
|
||||||
userid: any;
|
patientId: any;
|
||||||
patientImageUrl: string;
|
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(
|
constructor(
|
||||||
private patientService: PatientService,
|
private patientService: PatientService,
|
||||||
private messageService: MessageService,
|
private confirmation: ConfirmationService,
|
||||||
private permissionChecker: PermissionService,
|
private permissionChecker: PermissionService,
|
||||||
private route: ActivatedRoute
|
private toaster: ToasterService,
|
||||||
|
private route: ActivatedRoute,
|
||||||
|
private router: Router
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.userid = this.route.snapshot.paramMap.get('id');
|
this.patientId = this.route.snapshot.paramMap.get('id');
|
||||||
console.log(this.userid);
|
console.log(this.patientId);
|
||||||
|
|
||||||
this.createpermission = this.permissionChecker.getGrantedPolicy(
|
this.createpermission = this.permissionChecker.getGrantedPolicy(
|
||||||
'HospitalManagementSystem.Patient.Create'
|
'HospitalManagementSystem.Patient.Create'
|
||||||
@ -71,11 +86,11 @@ export class PatientRecordComponent implements OnInit {
|
|||||||
|
|
||||||
resetselectpatient() {
|
resetselectpatient() {
|
||||||
this.selectedPatient = {
|
this.selectedPatient = {
|
||||||
patientId: this.userid,
|
patientId: this.patientId,
|
||||||
dateOfAdmission: '',
|
dateOfAdmission: '',
|
||||||
labReportUrl: '',
|
// labReportUrl: '',
|
||||||
medicationUrl: '',
|
// medicationUrl: '',
|
||||||
medicationHistoryUrl: '',
|
// medicationHistoryUrl: '',
|
||||||
nextFollowUp: '',
|
nextFollowUp: '',
|
||||||
diagnosis: '',
|
diagnosis: '',
|
||||||
treatmentPlan: '',
|
treatmentPlan: '',
|
||||||
@ -83,10 +98,15 @@ export class PatientRecordComponent implements OnInit {
|
|||||||
insuranceProvider: '',
|
insuranceProvider: '',
|
||||||
status: Status.InTreatment,
|
status: Status.InTreatment,
|
||||||
};
|
};
|
||||||
|
this.labReportUrlpath = '';
|
||||||
|
this.medicationUrlpath = '';
|
||||||
|
this.medicationHistoryUrlpath = '';
|
||||||
|
this.selectdateOfAdmission = new Date();
|
||||||
|
this.selectnextFollowUp = new Date();
|
||||||
}
|
}
|
||||||
|
|
||||||
loadPatient(event: any, id: any) {
|
loadPatient(event: any, id: any) {
|
||||||
this.selectedPatient.patientId = this.userid;
|
this.selectedPatient.patientId = this.patientId;
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
let order = event.sortOrder == 1 ? ' asc' : ' desc';
|
let order = event.sortOrder == 1 ? ' asc' : ' desc';
|
||||||
event.sortField = event.sortField == undefined ? 'id' : event.sortField;
|
event.sortField = event.sortField == undefined ? 'id' : event.sortField;
|
||||||
@ -96,16 +116,22 @@ export class PatientRecordComponent implements OnInit {
|
|||||||
sorting: event.sortField + order,
|
sorting: event.sortField + order,
|
||||||
search: event.globalFilter == null ? '' : event.globalFilter,
|
search: event.globalFilter == null ? '' : event.globalFilter,
|
||||||
};
|
};
|
||||||
this.patientService.getPatientById(this.userid).subscribe(result => {
|
this.patientService.getPatientById(this.patientId).subscribe(result => {
|
||||||
this.patientdto = result;
|
this.patientdto = result;
|
||||||
|
this.patientImageUrl = environment.apis.default.url + result.imagepath;
|
||||||
});
|
});
|
||||||
this.patientService.getPatientRecordList(this.params, id).subscribe(data => {
|
this.patientService.getPatientRecordList(this.params, id).subscribe(data => {
|
||||||
this.patientrecords = data.items;
|
this.patientrecords = data.items;
|
||||||
|
// console.log(data.items);
|
||||||
this.totalRecords = data.totalCount;
|
this.totalRecords = data.totalCount;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
backtopatient() {
|
||||||
|
this.router.navigate(['/patients/all-patients']);
|
||||||
|
}
|
||||||
|
|
||||||
exportPatient() {
|
exportPatient() {
|
||||||
this.patientService.getExportPatientRecord().subscribe(result => {
|
this.patientService.getExportPatientRecord().subscribe(result => {
|
||||||
const binary = atob(result.fileContent);
|
const binary = atob(result.fileContent);
|
||||||
@ -140,81 +166,113 @@ export class PatientRecordComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
editPatient(Patient: any) {
|
editPatient(Patient: any) {
|
||||||
|
this.resetselectpatient();
|
||||||
this.patientDialogTitle = 'Edit Patient';
|
this.patientDialogTitle = 'Edit Patient';
|
||||||
this.selectedPatient = { ...Patient };
|
this.patientService.getPatientRecordById(Patient.id).subscribe(result => {
|
||||||
this.selectedPatient.patientId = this.userid;
|
this.selectedPatient = result;
|
||||||
|
this.selectedPatient.patientId = this.patientId;
|
||||||
this.selectdateOfAdmission = new Date(this.selectedPatient.dateOfAdmission);
|
this.selectdateOfAdmission = new Date(this.selectedPatient.dateOfAdmission);
|
||||||
this.selectnextFollowUp = new Date(this.selectedPatient.nextFollowUp);
|
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.patientDialog = true;
|
||||||
this.isEditMode = true;
|
this.isEditMode = true;
|
||||||
console.log(this.selectedPatient);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
deletePatient(id: any) {
|
deletePatient(id: any) {
|
||||||
|
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.patientService.deletePatientRecord(id).subscribe(() => {
|
||||||
this.messageService.add({
|
this.loadPatient(this.params, this.patientId);
|
||||||
severity: 'success',
|
this.toaster.success('Patient deleted successfully', 'Success');
|
||||||
summary: 'Success',
|
|
||||||
detail: 'Patient deleted successfully',
|
|
||||||
});
|
});
|
||||||
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 {
|
handleLabReportUpload(event: Event): void {
|
||||||
const input = event.target as HTMLInputElement;
|
const input = event.target as HTMLInputElement;
|
||||||
if (input && input.files) {
|
if (input && input.files) {
|
||||||
const files: File[] = Array.from(input.files); // Convert FileList to an array of File
|
const tag = 'Lab-Report';
|
||||||
this.addToUploadList(files, 'Lab-Report');
|
const formdata = new FormData();
|
||||||
} else {
|
formdata.append('file', input.files[0]);
|
||||||
console.error('No files selected');
|
this.UploadFileData(tag, formdata);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleMedicationsUpload(event: any): void {
|
handleMedicationsUpload(event: any): void {
|
||||||
const files: File[] = event.files; // Files uploaded
|
const input = event.target as HTMLInputElement;
|
||||||
this.addToUploadList(files, 'Medications');
|
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 {
|
handleMedicationHistoryUpload(event: any): void {
|
||||||
const files: File[] = event.files; // Files uploaded
|
const input = event.target as HTMLInputElement;
|
||||||
this.addToUploadList(files, 'Medication-History');
|
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 {
|
UploadFileData(tag: string, formdata: FormData) {
|
||||||
const existingIndex = this.uploadfile.findIndex(item => item.name === name);
|
this.patientService.uploadFile(tag, formdata).subscribe(result => {
|
||||||
|
switch (tag) {
|
||||||
if (existingIndex > -1) {
|
case 'Lab-Report':
|
||||||
this.uploadfile[existingIndex].file = files;
|
this.selectedPatient.labReportUrlID = result;
|
||||||
} else {
|
break;
|
||||||
this.uploadfile.push({ file: files, name });
|
case 'Medication':
|
||||||
|
this.selectedPatient.medicationUrlID = result;
|
||||||
|
break;
|
||||||
|
case 'Medication-History':
|
||||||
|
this.selectedPatient.medicationHistoryUrlID = result;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
console.log(this.uploadfile);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
savePatient(form: NgForm) {
|
savePatient(form: NgForm) {
|
||||||
// console.log(form);
|
// console.log(form);
|
||||||
this.selectedPatient.patientId = this.userid;
|
this.selectedPatient.patientId = this.patientId;
|
||||||
this.selectedPatient.status = this.patientdto.status;
|
this.selectedPatient.status = this.patientdto.status;
|
||||||
this.selectedPatient.dateOfAdmission = this.selectdateOfAdmission.toDateString();
|
this.selectedPatient.dateOfAdmission = this.selectdateOfAdmission.toDateString();
|
||||||
this.selectedPatient.nextFollowUp = this.selectnextFollowUp.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) {
|
if (this.isEditMode) {
|
||||||
this.patientService
|
this.patientService
|
||||||
.updatePatientRecord(this.selectedPatient.id, this.selectedPatient)
|
.updatePatientRecord(this.selectedPatient.id, this.selectedPatient)
|
||||||
.subscribe(() => {
|
.subscribe(
|
||||||
this.messageService.add({
|
result => {
|
||||||
severity: 'success',
|
this.toaster.success('Patient updated successfully', 'Success');
|
||||||
summary: 'Success',
|
|
||||||
detail: 'Patient updated successfully',
|
|
||||||
});
|
|
||||||
this.patientDialog = false;
|
this.patientDialog = false;
|
||||||
|
console.log(result);
|
||||||
|
|
||||||
this.loadPatient(
|
this.loadPatient(
|
||||||
{
|
{
|
||||||
first: 0,
|
first: 0,
|
||||||
@ -223,16 +281,18 @@ export class PatientRecordComponent implements OnInit {
|
|||||||
sortOrder: 1,
|
sortOrder: 1,
|
||||||
globalFilter: null,
|
globalFilter: null,
|
||||||
},
|
},
|
||||||
this.userid
|
this.patientId
|
||||||
|
);
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
console.log(error);
|
||||||
|
this.closeDialog();
|
||||||
|
}
|
||||||
);
|
);
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
this.patientService.createPatientRecord(this.selectedPatient).subscribe(() => {
|
this.patientService.createPatientRecord(this.selectedPatient).subscribe(
|
||||||
this.messageService.add({
|
() => {
|
||||||
severity: 'success',
|
this.toaster.success('Patient created successfully', 'Success');
|
||||||
summary: 'Success',
|
|
||||||
detail: 'Patient created successfully',
|
|
||||||
});
|
|
||||||
this.patientDialog = false;
|
this.patientDialog = false;
|
||||||
this.loadPatient(
|
this.loadPatient(
|
||||||
{
|
{
|
||||||
@ -242,9 +302,14 @@ export class PatientRecordComponent implements OnInit {
|
|||||||
sortOrder: 1,
|
sortOrder: 1,
|
||||||
globalFilter: null,
|
globalFilter: null,
|
||||||
},
|
},
|
||||||
this.userid
|
this.patientId
|
||||||
|
);
|
||||||
|
},
|
||||||
|
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,
|
"allowAnonymous": null,
|
||||||
"implementFrom": "HospitalManagementSystem.Patients.PatientAppService"
|
"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": {
|
"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": {
|
"HospitalManagementSystem.Dto.DropDownItems": {
|
||||||
"baseType": null,
|
"baseType": null,
|
||||||
"isEnum": false,
|
"isEnum": false,
|
||||||
@ -4355,6 +4582,18 @@
|
|||||||
"minimum": null,
|
"minimum": null,
|
||||||
"maximum": null,
|
"maximum": null,
|
||||||
"regex": 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
|
"regex": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "LabReportUrl",
|
"name": "LabReportUrlID",
|
||||||
"jsonName": null,
|
"jsonName": null,
|
||||||
"type": "System.String",
|
"type": "System.Guid?",
|
||||||
"typeSimple": "string",
|
"typeSimple": "string?",
|
||||||
"isRequired": false,
|
"isRequired": false,
|
||||||
"minLength": null,
|
"minLength": null,
|
||||||
"maxLength": null,
|
"maxLength": null,
|
||||||
@ -4414,10 +4653,10 @@
|
|||||||
"regex": null
|
"regex": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "MedicationUrl",
|
"name": "MedicationUrlID",
|
||||||
"jsonName": null,
|
"jsonName": null,
|
||||||
"type": "System.String",
|
"type": "System.Guid?",
|
||||||
"typeSimple": "string",
|
"typeSimple": "string?",
|
||||||
"isRequired": false,
|
"isRequired": false,
|
||||||
"minLength": null,
|
"minLength": null,
|
||||||
"maxLength": null,
|
"maxLength": null,
|
||||||
@ -4426,10 +4665,10 @@
|
|||||||
"regex": null
|
"regex": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "MedicationHistoryUrl",
|
"name": "MedicationHistoryUrlID",
|
||||||
"jsonName": null,
|
"jsonName": null,
|
||||||
"type": "System.String",
|
"type": "System.Guid?",
|
||||||
"typeSimple": "string",
|
"typeSimple": "string?",
|
||||||
"isRequired": false,
|
"isRequired": false,
|
||||||
"minLength": null,
|
"minLength": null,
|
||||||
"maxLength": null,
|
"maxLength": null,
|
||||||
@ -4673,6 +4912,18 @@
|
|||||||
"minimum": null,
|
"minimum": null,
|
||||||
"maximum": null,
|
"maximum": null,
|
||||||
"regex": 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": {
|
"Volo.Abp.Account.ChangePasswordInput": {
|
||||||
"baseType": null,
|
"baseType": null,
|
||||||
"isEnum": false,
|
"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": {
|
"Volo.Abp.FeatureManagement.FeatureDto": {
|
||||||
"baseType": null,
|
"baseType": null,
|
||||||
"isEnum": false,
|
"isEnum": false,
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
|
import * as Documents from './documents';
|
||||||
import * as Dto from './dto';
|
import * as Dto from './dto';
|
||||||
import * as GlobalEnum from './global-enum';
|
import * as GlobalEnum from './global-enum';
|
||||||
import * as Patients from './patients';
|
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;
|
admissionDate?: string;
|
||||||
dischargeDate?: string;
|
dischargeDate?: string;
|
||||||
status: Status;
|
status: Status;
|
||||||
|
imageID?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CreateUpdatePatientRecordDto {
|
export interface CreateUpdatePatientRecordDto {
|
||||||
id?: string;
|
id?: string;
|
||||||
patientId?: string;
|
patientId?: string;
|
||||||
dateOfAdmission?: string;
|
dateOfAdmission?: string;
|
||||||
labReportUrl?: string;
|
labReportUrlID?: string;
|
||||||
medicationUrl?: string;
|
medicationUrlID?: string;
|
||||||
medicationHistoryUrl?: string;
|
medicationHistoryUrlID?: string;
|
||||||
nextFollowUp?: string;
|
nextFollowUp?: string;
|
||||||
diagnosis?: string;
|
diagnosis?: string;
|
||||||
treatmentPlan?: string;
|
treatmentPlan?: string;
|
||||||
@ -46,6 +47,7 @@ export interface PatientDto {
|
|||||||
admissionDate?: string;
|
admissionDate?: string;
|
||||||
dischargeDate?: string;
|
dischargeDate?: string;
|
||||||
status: Status;
|
status: Status;
|
||||||
|
imagepath?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PatientRecordDto {
|
export interface PatientRecordDto {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
import * as Dto from './dto';
|
import * as Dto from './dto';
|
||||||
|
export * from './models';
|
||||||
export * from './patient.service';
|
export * from './patient.service';
|
||||||
export { Dto };
|
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 { CreateUpdatePatientDto, CreateUpdatePatientRecordDto, PatientDto, PatientRecordDto } from './dto/models';
|
||||||
|
import type { Patient } from './models';
|
||||||
import { RestService, Rest } from '@abp/ng.core';
|
import { RestService, Rest } from '@abp/ng.core';
|
||||||
import type { PagedResultDto } from '@abp/ng.core';
|
import type { PagedResultDto } from '@abp/ng.core';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
import type { EntityDocument } from '../documents/models';
|
||||||
import type { DropDownItems, FileDownloadDto, PagingSortPatientResultDto } from '../dto/models';
|
import type { DropDownItems, FileDownloadDto, PagingSortPatientResultDto } from '../dto/models';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@ -103,6 +105,16 @@ export class PatientService {
|
|||||||
{ apiName: this.apiName,...config });
|
{ 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>) =>
|
updatePatient = (id: string, input: CreateUpdatePatientDto, config?: Partial<Rest.Config>) =>
|
||||||
this.restService.request<any, PatientDto>({
|
this.restService.request<any, PatientDto>({
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
@ -120,5 +132,16 @@ export class PatientService {
|
|||||||
},
|
},
|
||||||
{ apiName: this.apiName,...config });
|
{ 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) {}
|
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 AdmissionDate { get; set; }
|
||||||
public DateTime? DischargeDate { get; set; }
|
public DateTime? DischargeDate { get; set; }
|
||||||
public Status Status { 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 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 Guid PatientId { get; set; }
|
||||||
|
|
||||||
public DateTime DateOfAdmission { 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; }
|
public DateTime? NextFollowUp { get; set; }
|
||||||
|
|
||||||
|
@ -22,5 +22,6 @@ namespace HospitalManagementSystem.Patients.Dto
|
|||||||
public DateTime AdmissionDate { get; set; }
|
public DateTime AdmissionDate { get; set; }
|
||||||
public DateTime? DischargeDate { get; set; }
|
public DateTime? DischargeDate { get; set; }
|
||||||
public Status Status { 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 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 Guid PatientId { get; set; }
|
||||||
|
|
||||||
public PatientDto Patients { get; set; }
|
public PatientDto Patients { get; set; }
|
||||||
|
@ -1,19 +1,24 @@
|
|||||||
using ClosedXML.Excel;
|
using ClosedXML.Excel;
|
||||||
|
using HospitalManagementSystem.Documents;
|
||||||
using HospitalManagementSystem.Dto;
|
using HospitalManagementSystem.Dto;
|
||||||
using HospitalManagementSystem.GlobalEnum;
|
using HospitalManagementSystem.GlobalEnum;
|
||||||
using HospitalManagementSystem.Patients.Dto;
|
using HospitalManagementSystem.Patients.Dto;
|
||||||
using HospitalManagementSystem.Permissions;
|
using HospitalManagementSystem.Permissions;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Linq.Dynamic.Core;
|
using System.Linq.Dynamic.Core;
|
||||||
|
using System.Text.Json;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Volo.Abp.Application.Dtos;
|
using Volo.Abp.Application.Dtos;
|
||||||
using Volo.Abp.Application.Services;
|
using Volo.Abp.Application.Services;
|
||||||
|
using Volo.Abp.Content;
|
||||||
using Volo.Abp.Domain.Repositories;
|
using Volo.Abp.Domain.Repositories;
|
||||||
|
using static HospitalManagementSystem.Permissions.HospitalManagementSystemPermissions;
|
||||||
|
|
||||||
|
|
||||||
namespace HospitalManagementSystem.Patients
|
namespace HospitalManagementSystem.Patients
|
||||||
@ -22,11 +27,18 @@ namespace HospitalManagementSystem.Patients
|
|||||||
{
|
{
|
||||||
private IRepository<PatientRecord, Guid> _patientrecordRepository;
|
private IRepository<PatientRecord, Guid> _patientrecordRepository;
|
||||||
private IRepository<Patient, Guid> _patientRepository;
|
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;
|
_patientrecordRepository = patientrecordRepository;
|
||||||
_patientRepository = patientRepository;
|
_patientRepository = patientRepository;
|
||||||
|
_env = env;
|
||||||
|
_entityDocumentRepository = entityDocumentRepository;
|
||||||
|
_patientDocumentRepository = patientDocumentRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region PatientRecord
|
#region PatientRecord
|
||||||
@ -35,46 +47,36 @@ namespace HospitalManagementSystem.Patients
|
|||||||
[Authorize(HospitalManagementSystemPermissions.Patient.Default)]
|
[Authorize(HospitalManagementSystemPermissions.Patient.Default)]
|
||||||
public async Task<PagedResultDto<PatientRecordDto>> GetPatientRecordListAsync(PagingSortPatientResultDto input, Guid Id)
|
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 queryable = await _patientrecordRepository.GetQueryableAsync();
|
||||||
|
|
||||||
var filteredQuery = queryable
|
var filteredQuery = queryable
|
||||||
.Include(x => x.Patients)
|
.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()))
|
.WhereIf(!string.IsNullOrEmpty(input.Search), x => x.Patients.Name.ToLower().Contains(input.Search.ToLower()))
|
||||||
.Where(x => x.Patients.Id == Id);
|
.Where(x => x.Patients.Id == Id);
|
||||||
|
|
||||||
// Get total count after filtering
|
|
||||||
var totalCount = await filteredQuery.CountAsync();
|
var totalCount = await filteredQuery.CountAsync();
|
||||||
|
|
||||||
// Apply sorting dynamically (ensure input.Sorting is valid)
|
|
||||||
filteredQuery = !string.IsNullOrEmpty(input.Sorting)
|
filteredQuery = !string.IsNullOrEmpty(input.Sorting)
|
||||||
? filteredQuery.OrderBy(input.Sorting)
|
? filteredQuery.OrderBy(input.Sorting)
|
||||||
: filteredQuery.OrderBy(x => x.Id);
|
: filteredQuery.OrderBy(x => x.Id);
|
||||||
|
|
||||||
// Apply paging
|
|
||||||
var pagedQuery = await filteredQuery
|
var pagedQuery = await filteredQuery
|
||||||
.Skip(input.SkipCount)
|
.Skip(input.SkipCount)
|
||||||
.Take(input.MaxResultCount)
|
.Take(input.MaxResultCount)
|
||||||
.ToListAsync();
|
.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>(
|
return new PagedResultDto<PatientRecordDto>(
|
||||||
totalCount,
|
totalCount,
|
||||||
ObjectMapper.Map<List<PatientRecord>, List<PatientRecordDto>>(pagedQuery)
|
patientrecorddto
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -84,17 +86,26 @@ namespace HospitalManagementSystem.Patients
|
|||||||
[Authorize(HospitalManagementSystemPermissions.Patient.Default)]
|
[Authorize(HospitalManagementSystemPermissions.Patient.Default)]
|
||||||
public async Task<PatientRecordDto> GetPatientRecordByIdAsync(Guid id)
|
public async Task<PatientRecordDto> GetPatientRecordByIdAsync(Guid id)
|
||||||
{
|
{
|
||||||
var patient = await _patientrecordRepository.GetAsync(id);
|
var patient = await _patientrecordRepository.GetQueryableAsync().Result
|
||||||
return ObjectMapper.Map<PatientRecord, PatientRecordDto>(patient);
|
.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
|
#endregion
|
||||||
|
|
||||||
#region Export Patient Data to Excel
|
#region Export Patient Data to Excel
|
||||||
public async Task<FileDownloadDto> GetExportPatientRecordAsync()
|
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))
|
if (!Directory.Exists(folderPath))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(folderPath); // Ensure the folder exists
|
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, 3).Value = "Date of Admission";
|
||||||
worksheet.Cell(1, 4).Value = "Diagnosis";
|
worksheet.Cell(1, 4).Value = "Diagnosis";
|
||||||
worksheet.Cell(1, 5).Value = "Next Follow-Up";
|
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, 1).Value = patientrecord[i].Patients.Name;
|
||||||
worksheet.Cell(i + 2, 2).Value = patients[i].Patients.Gender.ToString();
|
worksheet.Cell(i + 2, 2).Value = patientrecord[i].Patients.Gender.ToString();
|
||||||
worksheet.Cell(i + 2, 3).Value = patients[i].DateOfAdmission.ToShortDateString();
|
worksheet.Cell(i + 2, 3).Value = patientrecord[i].DateOfAdmission.ToShortDateString();
|
||||||
worksheet.Cell(i + 2, 4).Value = patients[i].Diagnosis;
|
worksheet.Cell(i + 2, 4).Value = patientrecord[i].Diagnosis;
|
||||||
worksheet.Cell(i + 2, 5).Value = patients[i].NextFollowUp?.ToShortDateString();
|
worksheet.Cell(i + 2, 5).Value = patientrecord[i].NextFollowUp?.ToShortDateString();
|
||||||
worksheet.Cell(i + 2, 6).Value = patients[i].Status.ToString();
|
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();
|
worksheet.Columns().AdjustToContents();
|
||||||
@ -147,10 +164,35 @@ namespace HospitalManagementSystem.Patients
|
|||||||
public async Task<PatientRecordDto> CreatePatientRecordAsync(CreateUpdatePatientRecordDto input)
|
public async Task<PatientRecordDto> CreatePatientRecordAsync(CreateUpdatePatientRecordDto input)
|
||||||
{
|
{
|
||||||
var patientEntity = await _patientRepository.GetAsync(input.PatientId); // Get Patient from DB
|
var patientEntity = await _patientRepository.GetAsync(input.PatientId); // Get Patient from DB
|
||||||
|
|
||||||
var patientRecord = ObjectMapper.Map<CreateUpdatePatientRecordDto, PatientRecord>(input);
|
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);
|
patientRecord = await _patientrecordRepository.InsertAsync(patientRecord);
|
||||||
|
|
||||||
return ObjectMapper.Map<PatientRecord, PatientRecordDto>(patientRecord);
|
return ObjectMapper.Map<PatientRecord, PatientRecordDto>(patientRecord);
|
||||||
@ -161,19 +203,49 @@ namespace HospitalManagementSystem.Patients
|
|||||||
[Authorize(HospitalManagementSystemPermissions.Patient.Edit)]
|
[Authorize(HospitalManagementSystemPermissions.Patient.Edit)]
|
||||||
public async Task<PatientRecordDto> UpdatePatientRecordAsync(Guid id, CreateUpdatePatientRecordDto input)
|
public async Task<PatientRecordDto> UpdatePatientRecordAsync(Guid id, CreateUpdatePatientRecordDto input)
|
||||||
{
|
{
|
||||||
var patientRecord = await _patientrecordRepository.GetAsync(id);
|
try
|
||||||
|
{
|
||||||
|
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
|
if (patientRecord.Patients.Id != input.PatientId) // If PatientId is updated, fetch new Patient
|
||||||
{
|
{
|
||||||
var newPatient = await _patientRepository.GetAsync(input.PatientId);
|
var newPatient = await _patientRepository.GetAsync(input.PatientId);
|
||||||
patientRecord.Patients = newPatient;
|
patientRecord.Patients = newPatient;
|
||||||
}
|
}
|
||||||
|
|
||||||
ObjectMapper.Map(input, patientRecord);
|
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);
|
patientRecord = await _patientrecordRepository.UpdateAsync(patientRecord);
|
||||||
|
|
||||||
return ObjectMapper.Map<PatientRecord, PatientRecordDto>(patientRecord);
|
return ObjectMapper.Map<PatientRecord, PatientRecordDto>(patientRecord);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
throw new Exception(ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@ -225,8 +297,10 @@ namespace HospitalManagementSystem.Patients
|
|||||||
[Authorize(HospitalManagementSystemPermissions.Patient.Default)]
|
[Authorize(HospitalManagementSystemPermissions.Patient.Default)]
|
||||||
public async Task<PatientDto> GetPatientByIdAsync(Guid id)
|
public async Task<PatientDto> GetPatientByIdAsync(Guid id)
|
||||||
{
|
{
|
||||||
var patient = await _patientRepository.GetAsync(id);
|
var patient = await _patientRepository.GetQueryableAsync().Result.Include(x => x.Images).Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||||
return ObjectMapper.Map<Patient, PatientDto>(patient);
|
var patientdto = ObjectMapper.Map<Patient, PatientDto>(patient);
|
||||||
|
patientdto.Imagepath = patient.Images != null ? patient.Images.FilePath : null;
|
||||||
|
return patientdto;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -235,7 +309,7 @@ namespace HospitalManagementSystem.Patients
|
|||||||
{
|
{
|
||||||
var patients = await _patientRepository.GetListAsync();
|
var patients = await _patientRepository.GetListAsync();
|
||||||
|
|
||||||
var folderPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "exports");
|
var folderPath = Path.Combine(_env.WebRootPath, "temp");
|
||||||
if (!Directory.Exists(folderPath))
|
if (!Directory.Exists(folderPath))
|
||||||
{
|
{
|
||||||
Directory.CreateDirectory(folderPath);
|
Directory.CreateDirectory(folderPath);
|
||||||
@ -252,11 +326,12 @@ namespace HospitalManagementSystem.Patients
|
|||||||
worksheet.Cell(1, 1).Value = "Name";
|
worksheet.Cell(1, 1).Value = "Name";
|
||||||
worksheet.Cell(1, 2).Value = "Gender";
|
worksheet.Cell(1, 2).Value = "Gender";
|
||||||
worksheet.Cell(1, 3).Value = "Age";
|
worksheet.Cell(1, 3).Value = "Age";
|
||||||
worksheet.Cell(1, 4).Value = "Treatment";
|
worksheet.Cell(1, 4).Value = "BloodGroup";
|
||||||
worksheet.Cell(1, 5).Value = "Doctor Assigned";
|
worksheet.Cell(1, 5).Value = "Treatment";
|
||||||
worksheet.Cell(1, 6).Value = "Admission Date";
|
worksheet.Cell(1, 6).Value = "Doctor Assigned";
|
||||||
worksheet.Cell(1, 7).Value = "Discharge Date";
|
worksheet.Cell(1, 7).Value = "Admission Date";
|
||||||
worksheet.Cell(1, 8).Value = "Status";
|
worksheet.Cell(1, 8).Value = "Discharge Date";
|
||||||
|
worksheet.Cell(1, 9).Value = "Status";
|
||||||
|
|
||||||
// Add data rows
|
// Add data rows
|
||||||
for (int i = 0; i < patients.Count; i++)
|
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, 1).Value = patients[i].Name;
|
||||||
worksheet.Cell(i + 2, 2).Value = patients[i].Gender.ToString();
|
worksheet.Cell(i + 2, 2).Value = patients[i].Gender.ToString();
|
||||||
worksheet.Cell(i + 2, 3).Value = patients[i].Age;
|
worksheet.Cell(i + 2, 3).Value = patients[i].Age;
|
||||||
worksheet.Cell(i + 2, 4).Value = patients[i].Treatment;
|
worksheet.Cell(i + 2, 4).Value = patients[i].BloodGroup;
|
||||||
worksheet.Cell(i + 2, 5).Value = patients[i].DoctorAssigned;
|
worksheet.Cell(i + 2, 5).Value = patients[i].Treatment;
|
||||||
worksheet.Cell(i + 2, 6).Value = patients[i].AdmissionDate.ToShortDateString();
|
worksheet.Cell(i + 2, 6).Value = patients[i].DoctorAssigned;
|
||||||
worksheet.Cell(i + 2, 7).Value = patients[i].DischargeDate?.ToShortDateString();
|
worksheet.Cell(i + 2, 7).Value = patients[i].AdmissionDate.ToShortDateString();
|
||||||
worksheet.Cell(i + 2, 8).Value = patients[i].Status.ToString();
|
worksheet.Cell(i + 2, 8).Value = patients[i].DischargeDate?.ToShortDateString();
|
||||||
|
worksheet.Cell(i + 2, 9).Value = patients[i].Status.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
worksheet.Columns().AdjustToContents();
|
worksheet.Columns().AdjustToContents();
|
||||||
@ -293,6 +369,19 @@ namespace HospitalManagementSystem.Patients
|
|||||||
var patient = ObjectMapper.Map<CreateUpdatePatientDto, Patient>(input);
|
var patient = ObjectMapper.Map<CreateUpdatePatientDto, Patient>(input);
|
||||||
|
|
||||||
patient = await _patientRepository.InsertAsync(patient);
|
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);
|
return ObjectMapper.Map<Patient, PatientDto>(patient);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@ -301,9 +390,21 @@ namespace HospitalManagementSystem.Patients
|
|||||||
[Authorize(HospitalManagementSystemPermissions.Patient.Edit)]
|
[Authorize(HospitalManagementSystemPermissions.Patient.Edit)]
|
||||||
public async Task<PatientDto> UpdatePatientAsync(Guid id, CreateUpdatePatientDto input)
|
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);
|
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);
|
patient = await _patientRepository.UpdateAsync(patient);
|
||||||
return ObjectMapper.Map<Patient, PatientDto>(patient);
|
return ObjectMapper.Map<Patient, PatientDto>(patient);
|
||||||
@ -343,5 +444,220 @@ namespace HospitalManagementSystem.Patients
|
|||||||
return await Task.FromResult(statuslist);
|
return await Task.FromResult(statuslist);
|
||||||
}
|
}
|
||||||
#endregion
|
#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>
|
||||||
|
|
||||||
<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.Emailing" Version="9.0.2" />
|
||||||
<PackageReference Include="Volo.Abp.Identity.Domain" 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" />
|
<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;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
@ -31,6 +32,7 @@ namespace HospitalManagementSystem.Patients
|
|||||||
public DateTime? DischargeDate { get; set; }
|
public DateTime? DischargeDate { get; set; }
|
||||||
[Required]
|
[Required]
|
||||||
public Status Status { get; set; }
|
public Status Status { get; set; }
|
||||||
|
public EntityDocument? Images { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using HospitalManagementSystem.GlobalEnum;
|
using HospitalManagementSystem.GlobalEnum;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using HospitalManagementSystem.Documents;
|
||||||
|
|
||||||
namespace HospitalManagementSystem.Patients
|
namespace HospitalManagementSystem.Patients
|
||||||
{
|
{
|
||||||
@ -31,11 +32,11 @@ namespace HospitalManagementSystem.Patients
|
|||||||
|
|
||||||
public string DoctorNotes { get; set; }
|
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; }
|
public DateTime? NextFollowUp { get; set; }
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using HospitalManagementSystem.Patients;
|
using HospitalManagementSystem.Documents;
|
||||||
|
using HospitalManagementSystem.Patients;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Volo.Abp.AuditLogging.EntityFrameworkCore;
|
using Volo.Abp.AuditLogging.EntityFrameworkCore;
|
||||||
using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
|
using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
|
||||||
@ -28,6 +29,9 @@ public class HospitalManagementSystemDbContext :
|
|||||||
/* Add DbSet properties for your Aggregate Roots / Entities here. */
|
/* Add DbSet properties for your Aggregate Roots / Entities here. */
|
||||||
public DbSet<PatientRecord> PatientRecords { get; set; }
|
public DbSet<PatientRecord> PatientRecords { get; set; }
|
||||||
public DbSet<Patient> Patients { 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
|
#region Entities from the modules
|
||||||
|
|
||||||
/* Notice: We only implemented IIdentityDbContext and ITenantManagementDbContext
|
/* Notice: We only implemented IIdentityDbContext and ITenantManagementDbContext
|
||||||
@ -90,6 +94,18 @@ public class HospitalManagementSystemDbContext :
|
|||||||
b.ConfigureByConvention(); //auto configure for the base class props
|
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 =>
|
//builder.Entity<YourEntity>(b =>
|
||||||
//{
|
//{
|
||||||
// b.ToTable(HospitalManagementSystemConsts.DbTablePrefix + "YourEntities", HospitalManagementSystemConsts.DbSchema);
|
// 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
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
|
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
|
||||||
.HasAnnotation("ProductVersion", "9.0.0")
|
.HasAnnotation("ProductVersion", "9.0.1")
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||||
|
|
||||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
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 =>
|
modelBuilder.Entity("HospitalManagementSystem.Patients.Patient", b =>
|
||||||
{
|
{
|
||||||
b.Property<Guid>("Id")
|
b.Property<Guid>("Id")
|
||||||
@ -77,6 +194,9 @@ namespace HospitalManagementSystem.Migrations
|
|||||||
b.Property<int>("Gender")
|
b.Property<int>("Gender")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
|
b.Property<Guid?>("ImagesId")
|
||||||
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<DateTime?>("LastModificationTime")
|
b.Property<DateTime?>("LastModificationTime")
|
||||||
.HasColumnType("datetime2")
|
.HasColumnType("datetime2")
|
||||||
.HasColumnName("LastModificationTime");
|
.HasColumnName("LastModificationTime");
|
||||||
@ -102,6 +222,8 @@ namespace HospitalManagementSystem.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ImagesId");
|
||||||
|
|
||||||
b.ToTable("Patient", (string)null);
|
b.ToTable("Patient", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -145,8 +267,8 @@ namespace HospitalManagementSystem.Migrations
|
|||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
b.Property<string>("LabReportUrl")
|
b.Property<Guid?>("LabReportUrlId")
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<DateTime?>("LastModificationTime")
|
b.Property<DateTime?>("LastModificationTime")
|
||||||
.HasColumnType("datetime2")
|
.HasColumnType("datetime2")
|
||||||
@ -156,11 +278,11 @@ namespace HospitalManagementSystem.Migrations
|
|||||||
.HasColumnType("uniqueidentifier")
|
.HasColumnType("uniqueidentifier")
|
||||||
.HasColumnName("LastModifierId");
|
.HasColumnName("LastModifierId");
|
||||||
|
|
||||||
b.Property<string>("MedicationHistoryUrl")
|
b.Property<Guid?>("MedicationHistoryUrlId")
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<string>("MedicationUrl")
|
b.Property<Guid?>("MedicationUrlId")
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<DateTime?>("NextFollowUp")
|
b.Property<DateTime?>("NextFollowUp")
|
||||||
.HasColumnType("datetime2");
|
.HasColumnType("datetime2");
|
||||||
@ -177,6 +299,12 @@ namespace HospitalManagementSystem.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("LabReportUrlId");
|
||||||
|
|
||||||
|
b.HasIndex("MedicationHistoryUrlId");
|
||||||
|
|
||||||
|
b.HasIndex("MedicationUrlId");
|
||||||
|
|
||||||
b.HasIndex("PatientsId");
|
b.HasIndex("PatientsId");
|
||||||
|
|
||||||
b.ToTable("PatientRecords", (string)null);
|
b.ToTable("PatientRecords", (string)null);
|
||||||
@ -1922,14 +2050,60 @@ namespace HospitalManagementSystem.Migrations
|
|||||||
b.ToTable("AbpTenantConnectionStrings", (string)null);
|
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")
|
b.HasOne("HospitalManagementSystem.Patients.Patient", "Patients")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("PatientsId")
|
.HasForeignKey("PatientsId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.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");
|
b.Navigation("Patients");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user