doctor dto and shared service added

This commit is contained in:
Sandipan Mitra 2025-02-07 17:16:01 +05:30
parent b2ede1c9c7
commit 49799abf29
13 changed files with 1389 additions and 999 deletions

View File

@ -1,6 +1,7 @@
import type { DoctorDto } from './dto/models';
import { RestService, Rest } from '@abp/ng.core';
import { Injectable } from '@angular/core';
import type { CreateDoctorDto, DoctorDto } from '../dtos/models';
import type { CreateDoctorDto } from '../dtos/models';
@Injectable({
providedIn: 'root',

View File

@ -1,2 +1,4 @@
import * as Dto from './dto';
export * from './doctor.service';
export * from './models';
export { Dto };

View File

@ -30,16 +30,3 @@ export interface DepartmentDto extends FullAuditedEntity<string> {
status?: string;
description?: string;
}
export interface DoctorDto extends FullAuditedEntity<string> {
firstName?: string;
lastName?: string;
gender?: string;
mobile?: string;
designation?: string;
departmentId?: string;
address?: string;
email?: string;
dob?: string;
education?: string;
}

View File

@ -1261,8 +1261,8 @@
"name": "GetAsync",
"parametersOnMethod": [],
"returnValue": {
"type": "System.Collections.Generic.List<HospitalManagementSystem.Dtos.DoctorDto>",
"typeSimple": "[HospitalManagementSystem.Dtos.DoctorDto]"
"type": "System.Collections.Generic.List<HospitalManagementSystem.Doctors.Dto.DoctorDto>",
"typeSimple": "[HospitalManagementSystem.Doctors.Dto.DoctorDto]"
}
}
]
@ -1278,8 +1278,8 @@
"parametersOnMethod": [],
"parameters": [],
"returnValue": {
"type": "System.Collections.Generic.List<HospitalManagementSystem.Dtos.DoctorDto>",
"typeSimple": "[HospitalManagementSystem.Dtos.DoctorDto]"
"type": "System.Collections.Generic.List<HospitalManagementSystem.Doctors.Dto.DoctorDto>",
"typeSimple": "[HospitalManagementSystem.Doctors.Dto.DoctorDto]"
},
"allowAnonymous": null,
"implementFrom": "HospitalManagementSystem.Doctors.IDoctorAppService"
@ -1315,8 +1315,8 @@
}
],
"returnValue": {
"type": "HospitalManagementSystem.Dtos.DoctorDto",
"typeSimple": "HospitalManagementSystem.Dtos.DoctorDto"
"type": "HospitalManagementSystem.Doctors.Dto.DoctorDto",
"typeSimple": "HospitalManagementSystem.Doctors.Dto.DoctorDto"
},
"allowAnonymous": null,
"implementFrom": "HospitalManagementSystem.Doctors.DoctorAppService"
@ -1508,8 +1508,8 @@
}
],
"returnValue": {
"type": "HospitalManagementSystem.Patients.Dto.PatientRecordDto",
"typeSimple": "HospitalManagementSystem.Patients.Dto.PatientRecordDto"
"type": "System.Void",
"typeSimple": "System.Void"
},
"allowAnonymous": false,
"implementFrom": "HospitalManagementSystem.Patients.PatientAppService"
@ -1565,8 +1565,8 @@
}
],
"returnValue": {
"type": "HospitalManagementSystem.Patients.Dto.PatientRecordDto",
"typeSimple": "HospitalManagementSystem.Patients.Dto.PatientRecordDto"
"type": "System.Void",
"typeSimple": "System.Void"
},
"allowAnonymous": false,
"implementFrom": "HospitalManagementSystem.Patients.PatientAppService"
@ -1764,8 +1764,8 @@
}
],
"returnValue": {
"type": "HospitalManagementSystem.Patients.Dto.PatientDto",
"typeSimple": "HospitalManagementSystem.Patients.Dto.PatientDto"
"type": "System.Void",
"typeSimple": "System.Void"
},
"allowAnonymous": false,
"implementFrom": "HospitalManagementSystem.Patients.PatientAppService"
@ -1821,8 +1821,8 @@
}
],
"returnValue": {
"type": "HospitalManagementSystem.Patients.Dto.PatientDto",
"typeSimple": "HospitalManagementSystem.Patients.Dto.PatientDto"
"type": "System.Void",
"typeSimple": "System.Void"
},
"allowAnonymous": false,
"implementFrom": "HospitalManagementSystem.Patients.PatientAppService"
@ -1878,12 +1878,23 @@
},
"allowAnonymous": null,
"implementFrom": "HospitalManagementSystem.Patients.PatientAppService"
},
}
}
},
"HospitalManagementSystem.Shared.SharedAppService": {
"controllerName": "Shared",
"controllerGroupName": "Shared",
"isRemoteService": true,
"isIntegrationService": false,
"apiVersion": null,
"type": "HospitalManagementSystem.Shared.SharedAppService",
"interfaces": [],
"actions": {
"UploadFileAsyncByTagNameAndFile": {
"uniqueName": "UploadFileAsyncByTagNameAndFile",
"name": "UploadFileAsync",
"httpMethod": "POST",
"url": "api/app/patient/upload-file",
"url": "api/app/shared/upload-file",
"supportedVersions": [],
"parametersOnMethod": [
{
@ -1934,13 +1945,13 @@
"typeSimple": "string"
},
"allowAnonymous": null,
"implementFrom": "HospitalManagementSystem.Patients.PatientAppService"
"implementFrom": "HospitalManagementSystem.Shared.SharedAppService"
},
"SaveFileToDocumentByPatientAndUniqueIdsAndIsNew": {
"uniqueName": "SaveFileToDocumentByPatientAndUniqueIdsAndIsNew",
"name": "SaveFileToDocument",
"httpMethod": "POST",
"url": "api/app/patient/save-file-to-document",
"url": "api/app/shared/save-file-to-document",
"supportedVersions": [],
"parametersOnMethod": [
{
@ -2011,7 +2022,7 @@
"typeSimple": "[HospitalManagementSystem.Documents.EntityDocument]"
},
"allowAnonymous": null,
"implementFrom": "HospitalManagementSystem.Patients.PatientAppService"
"implementFrom": "HospitalManagementSystem.Shared.SharedAppService"
}
}
}
@ -5591,6 +5602,135 @@
}
]
},
"HospitalManagementSystem.Doctors.Dto.DoctorDto": {
"baseType": "Volo.Abp.Domain.Entities.Auditing.FullAuditedEntity<System.Guid>",
"isEnum": false,
"enumNames": null,
"enumValues": null,
"genericArguments": null,
"properties": [
{
"name": "FirstName",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "LastName",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "Gender",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "Mobile",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "Designation",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "DepartmentId",
"jsonName": null,
"type": "System.Guid?",
"typeSimple": "string?",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "Address",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "Email",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "DOB",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "Education",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
}
]
},
"HospitalManagementSystem.Documents.EntityDocument": {
"baseType": "Volo.Abp.Domain.Entities.Auditing.AuditedAggregateRoot<System.Guid>",
"isEnum": false,
@ -6062,135 +6202,6 @@
}
]
},
"HospitalManagementSystem.Dtos.DoctorDto": {
"baseType": "Volo.Abp.Domain.Entities.Auditing.FullAuditedEntity<System.Guid>",
"isEnum": false,
"enumNames": null,
"enumValues": null,
"genericArguments": null,
"properties": [
{
"name": "FirstName",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "LastName",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "Gender",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "Mobile",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "Designation",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "DepartmentId",
"jsonName": null,
"type": "System.Guid?",
"typeSimple": "string?",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "Address",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "Email",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "DOB",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "Education",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
}
]
},
"HospitalManagementSystem.GlobalEnum.appointmentStatus": {
"baseType": "System.Enum",
"isEnum": true,
@ -6286,6 +6297,18 @@
"maximum": null,
"regex": null
},
{
"name": "PatientCardId",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "Name",
"jsonName": null,
@ -6346,30 +6369,6 @@
"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,
@ -6395,9 +6394,9 @@
"regex": null
},
{
"name": "AdmissionDate",
"name": "InsuranceProvider",
"jsonName": null,
"type": "System.DateTime",
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
@ -6406,35 +6405,11 @@
"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": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "ImageID",
"jsonName": null,
"type": "System.Guid",
"typeSimple": "string",
"type": "System.Guid?",
"typeSimple": "string?",
"isRequired": false,
"minLength": null,
"maxLength": null,
@ -6480,7 +6455,7 @@
"jsonName": null,
"type": "System.DateTime",
"typeSimple": "string",
"isRequired": false,
"isRequired": true,
"minLength": null,
"maxLength": null,
"minimum": null,
@ -6488,33 +6463,9 @@
"regex": null
},
{
"name": "LabReportUrlID",
"name": "DischargeDate",
"jsonName": null,
"type": "System.Guid?",
"typeSimple": "string?",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "MedicationUrlID",
"jsonName": null,
"type": "System.Guid?",
"typeSimple": "string?",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "MedicationHistoryUrlID",
"jsonName": null,
"type": "System.Guid?",
"type": "System.DateTime?",
"typeSimple": "string?",
"isRequired": false,
"minLength": null,
@ -6559,6 +6510,18 @@
"maximum": null,
"regex": null
},
{
"name": "DoctorAssignedID",
"jsonName": null,
"type": "System.Guid?",
"typeSimple": "string?",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "DoctorNotes",
"jsonName": null,
@ -6572,10 +6535,34 @@
"regex": null
},
{
"name": "InsuranceProvider",
"name": "LabReportUrlID",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"type": "System.Guid?",
"typeSimple": "string?",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "MedicationUrlID",
"jsonName": null,
"type": "System.Guid?",
"typeSimple": "string?",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "MedicationHistoryUrlID",
"jsonName": null,
"type": "System.Guid?",
"typeSimple": "string?",
"isRequired": false,
"minLength": null,
"maxLength": null,
@ -6616,6 +6603,18 @@
"maximum": null,
"regex": null
},
{
"name": "PatientCardId",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "Name",
"jsonName": null,
@ -6676,30 +6675,6 @@
"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,
@ -6725,9 +6700,9 @@
"regex": null
},
{
"name": "AdmissionDate",
"name": "InsuranceProvider",
"jsonName": null,
"type": "System.DateTime",
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
@ -6736,30 +6711,6 @@
"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": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "Imagepath",
"jsonName": null,
@ -6822,6 +6773,30 @@
"jsonName": null,
"type": "System.DateTime",
"typeSimple": "string",
"isRequired": true,
"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": "NextFollowUp",
"jsonName": null,
"type": "System.DateTime?",
"typeSimple": "string?",
"isRequired": false,
"minLength": null,
"maxLength": null,
@ -6853,6 +6828,18 @@
"maximum": null,
"regex": null
},
{
"name": "DoctorAssigned",
"jsonName": null,
"type": "HospitalManagementSystem.Doctors.Dto.DoctorDto",
"typeSimple": "HospitalManagementSystem.Doctors.Dto.DoctorDto",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "DoctorNotes",
"jsonName": null,
@ -6901,30 +6888,6 @@
"maximum": null,
"regex": null
},
{
"name": "NextFollowUp",
"jsonName": null,
"type": "System.DateTime?",
"typeSimple": "string?",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "InsuranceProvider",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "Status",
"jsonName": null,
@ -6946,6 +6909,18 @@
"enumValues": null,
"genericArguments": null,
"properties": [
{
"name": "PatientCardId",
"jsonName": null,
"type": "System.String",
"typeSimple": "string",
"isRequired": true,
"minLength": null,
"maxLength": null,
"minimum": null,
"maximum": null,
"regex": null
},
{
"name": "Name",
"jsonName": null,
@ -7006,30 +6981,6 @@
"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,
@ -7055,9 +7006,9 @@
"regex": null
},
{
"name": "AdmissionDate",
"name": "InsuranceProvider",
"jsonName": null,
"type": "System.DateTime",
"type": "System.String",
"typeSimple": "string",
"isRequired": false,
"minLength": null,
@ -7066,30 +7017,6 @@
"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,

View File

@ -8,5 +8,6 @@ import * as Dto from './dto';
import * as Dtos from './dtos';
import * as GlobalEnum from './global-enum';
import * as Patients from './patients';
import * as Shared from './shared';
import * as Volo from './volo';
export { Abp, Appoinments, Appointments, Departments, Doctors, Documents, Dto, Dtos, GlobalEnum, Patients, Volo };
export { Abp, Appoinments, Appointments, Departments, Doctors, Documents, Dto, Dtos, GlobalEnum, Patients, Shared, Volo };

View File

@ -1,52 +1,48 @@
import type { Gender } from '../../global-enum/gender.enum';
import type { Status } from '../../global-enum/status.enum';
import type { DoctorDto } from '../../doctors/dto/models';
export interface CreateUpdatePatientDto {
id?: string;
patientCardId?: 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;
insuranceProvider?: string;
imageID?: string;
}
export interface CreateUpdatePatientRecordDto {
id?: string;
patientId?: string;
dateOfAdmission?: string;
labReportUrlID?: string;
medicationUrlID?: string;
medicationHistoryUrlID?: string;
dateOfAdmission: string;
dischargeDate?: string;
nextFollowUp?: string;
diagnosis?: string;
treatmentPlan?: string;
doctorAssignedID?: string;
doctorNotes?: string;
insuranceProvider?: string;
labReportUrlID?: string;
medicationUrlID?: string;
medicationHistoryUrlID?: string;
status: Status;
}
export interface PatientDto {
id?: string;
patientCardId?: 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;
insuranceProvider?: string;
imagepath?: string;
}
@ -54,14 +50,15 @@ export interface PatientRecordDto {
id?: string;
patientId?: string;
patients: PatientDto;
dateOfAdmission?: string;
dateOfAdmission: string;
dischargeDate?: string;
nextFollowUp?: string;
diagnosis?: string;
treatmentPlan?: string;
doctorAssigned: DoctorDto;
doctorNotes?: string;
labReportUrl?: string;
medicationUrl?: string;
medicationHistoryUrl?: string;
nextFollowUp?: string;
insuranceProvider?: string;
status: Status;
}

View File

@ -1,20 +1,16 @@
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> {
patientCardId: 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;
insuranceProvider?: string;
images: EntityDocument;
}

View File

@ -1,9 +1,7 @@
import type { CreateUpdatePatientDto, CreateUpdatePatientRecordDto, PatientDto, PatientRecordDto } from './dto/models';
import type { Patient } from './models';
import { RestService, Rest } from '@abp/ng.core';
import type { PagedResultDto } from '@abp/ng.core';
import { Injectable } from '@angular/core';
import type { EntityDocument } from '../documents/models';
import type { DropDownItems, FileDownloadDto, PagingSortResultDto } from '../dto/models';
@Injectable({
@ -14,7 +12,7 @@ export class PatientService {
createPatient = (input: CreateUpdatePatientDto, config?: Partial<Rest.Config>) =>
this.restService.request<any, PatientDto>({
this.restService.request<any, void>({
method: 'POST',
url: '/api/app/patient/patient',
body: input,
@ -23,7 +21,7 @@ export class PatientService {
createPatientRecord = (input: CreateUpdatePatientRecordDto, config?: Partial<Rest.Config>) =>
this.restService.request<any, PatientRecordDto>({
this.restService.request<any, void>({
method: 'POST',
url: '/api/app/patient/patient-record',
body: input,
@ -105,18 +103,8 @@ export class PatientService {
{ apiName: this.apiName,...config });
saveFileToDocumentByPatientAndUniqueIdsAndIsNew = (patient: Patient, uniqueIds: string[], isNew?: boolean, config?: Partial<Rest.Config>) =>
this.restService.request<any, EntityDocument[]>({
method: 'POST',
url: '/api/app/patient/save-file-to-document',
params: { isNew },
body: uniqueIds,
},
{ apiName: this.apiName,...config });
updatePatient = (id: string, input: CreateUpdatePatientDto, config?: Partial<Rest.Config>) =>
this.restService.request<any, PatientDto>({
this.restService.request<any, void>({
method: 'PUT',
url: `/api/app/patient/${id}/patient`,
body: input,
@ -125,23 +113,12 @@ export class PatientService {
updatePatientRecord = (id: string, input: CreateUpdatePatientRecordDto, config?: Partial<Rest.Config>) =>
this.restService.request<any, PatientRecordDto>({
this.restService.request<any, void>({
method: 'PUT',
url: `/api/app/patient/${id}/patient-record`,
body: input,
},
{ apiName: this.apiName,...config });
uploadFile = (TagName: string, file: FormData, config?: Partial<Rest.Config>) =>
this.restService.request<any, string>({
method: 'POST',
responseType: 'text',
url: '/api/app/patient/upload-file',
params: { tagName: TagName },
body: file,
},
{ apiName: this.apiName,...config });
constructor(private restService: RestService) {}
}

View File

@ -1,5 +1,5 @@
export interface Entity<TKey> {
export interface Entity<Tkey> {
}
export interface AggregateRoot<TKey> extends BasicAggregateRoot<TKey> {

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Auditing;
namespace HospitalManagementSystem.Doctors.Dto
{
public class DoctorDto : FullAuditedEntity<Guid>
{
public string? FirstName { get; set; }
public string? LastName { get; set; }
public string? Gender { get; set; }
public string? Mobile { get; set; }
public string? Designation { get; set; }
public Guid? DepartmentId { get; set; }
public string? Address { get; set; }
public string? Email { get; set; }
public string? DOB { get; set; }
public string? Education { get; set; }
}
}

View File

@ -389,7 +389,7 @@ namespace HospitalManagementSystem.Patients
#region Export Patient Data to Excel
public async Task<FileDownloadDto> GetExportPatientDataAsync()
{
var patients = await _patientRepository.GetListAsync();
var patients = await _patientRepository.GetQueryableAsync().Result.Include(x => x.Images).ToListAsync();
var folderPath = Path.Combine(_env.WebRootPath, "temp");
if (!Directory.Exists(folderPath))
@ -426,7 +426,7 @@ namespace HospitalManagementSystem.Patients
worksheet.Cell(i + 2, 7).Value = patients[i].Address;
worksheet.Cell(i + 2, 8).Value = patients[i].BloodGroup;
worksheet.Cell(i + 2, 9).Value = patients[i].InsuranceProvider ?? "N/A";
worksheet.Cell(i + 2, 19).Value = patients[i].Images?.GeneratedFileName ?? "N/A";
worksheet.Cell(i + 2, 10).Value = patients[i].Images?.GeneratedFileName ?? "N/A";
}
worksheet.Columns().AdjustToContents();

View File

@ -0,0 +1,173 @@
using HospitalManagementSystem.Documents;
using HospitalManagementSystem.Patients;
using Microsoft.AspNetCore.Hosting;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using Volo.Abp.Content;
using Volo.Abp.Domain.Repositories;
namespace HospitalManagementSystem.Shared
{
public class SharedAppService : Volo.Abp.Application.Services.ApplicationService
{
private readonly IWebHostEnvironment _env;
private IRepository<EntityDocument, Guid> _entityDocumentRepository;
public SharedAppService(IWebHostEnvironment env, IRepository<EntityDocument, Guid> entityDocumentRepository)
{
_env = env;
_entityDocumentRepository = entityDocumentRepository;
}
#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 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);
//}
return savedDocuments;
}
catch (Exception ex)
{
throw new Exception($"Error saving files for patient {patient.Id}: {ex.Message}", ex);
}
}
#endregion
}
}