From 79d1e38f261831ecd71520e433c54cd14bb6152c Mon Sep 17 00:00:00 2001 From: Sandipan Mitra <sandipan.mitra@sentientgeeks.com> Date: Thu, 6 Feb 2025 18:00:35 +0530 Subject: [PATCH] misc fixes --- .../all-patients/all-patients.component.html | 11 +++++++++++ .../Patients/PatientAppService.cs | 14 ++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/angular/src/app/patients/all-patients/all-patients.component.html b/angular/src/app/patients/all-patients/all-patients.component.html index 3aadf3e..9be33ea 100644 --- a/angular/src/app/patients/all-patients/all-patients.component.html +++ b/angular/src/app/patients/all-patients/all-patients.component.html @@ -275,6 +275,17 @@ </div> </div> </div> + <div class="p-fluid grid"> + <div class="col-6"> + <div class="field"> + <label for="status">Status</label> + <p-dropdown name="status" id="status" [options]="statuslist" [(ngModel)]="selectedstatus" + optionLabel="label" optionValue="value" placeholder="Select status" + required></p-dropdown> + <small *ngIf="selectedstatus === 0" class="p-error">Status is required</small> + </div> + </div> + </div> <div class="text-right"> <button type="submit" pButton class="btn btn-primary" diff --git a/aspnet-core/src/HospitalManagementSystem.Application/Patients/PatientAppService.cs b/aspnet-core/src/HospitalManagementSystem.Application/Patients/PatientAppService.cs index 35acb19..42b1652 100644 --- a/aspnet-core/src/HospitalManagementSystem.Application/Patients/PatientAppService.cs +++ b/aspnet-core/src/HospitalManagementSystem.Application/Patients/PatientAppService.cs @@ -161,7 +161,7 @@ namespace HospitalManagementSystem.Patients #region Create Patient [Authorize(HospitalManagementSystemPermissions.Patient.Create)] - public async Task<PatientRecordDto> CreatePatientRecordAsync(CreateUpdatePatientRecordDto input) + public async Task CreatePatientRecordAsync(CreateUpdatePatientRecordDto input) { var patientEntity = await _patientRepository.GetAsync(input.PatientId); // Get Patient from DB var patientRecord = ObjectMapper.Map<CreateUpdatePatientRecordDto, PatientRecord>(input); @@ -194,14 +194,12 @@ namespace HospitalManagementSystem.Patients } } patientRecord = await _patientrecordRepository.InsertAsync(patientRecord); - - return ObjectMapper.Map<PatientRecord, PatientRecordDto>(patientRecord); } #endregion #region Update Patient [Authorize(HospitalManagementSystemPermissions.Patient.Edit)] - public async Task<PatientRecordDto> UpdatePatientRecordAsync(Guid id, CreateUpdatePatientRecordDto input) + public async Task UpdatePatientRecordAsync(Guid id, CreateUpdatePatientRecordDto input) { try { @@ -240,7 +238,6 @@ namespace HospitalManagementSystem.Patients } patientRecord = await _patientrecordRepository.UpdateAsync(patientRecord); - return ObjectMapper.Map<PatientRecord, PatientRecordDto>(patientRecord); } catch (Exception ex) { @@ -364,7 +361,7 @@ namespace HospitalManagementSystem.Patients #region Create Patient [Authorize(HospitalManagementSystemPermissions.Patient.Create)] - public async Task<PatientDto> CreatePatientAsync(CreateUpdatePatientDto input) + public async Task CreatePatientAsync(CreateUpdatePatientDto input) { var patient = ObjectMapper.Map<CreateUpdatePatientDto, Patient>(input); @@ -381,14 +378,12 @@ namespace HospitalManagementSystem.Patients } } } - - return ObjectMapper.Map<Patient, PatientDto>(patient); } #endregion #region Update Patient [Authorize(HospitalManagementSystemPermissions.Patient.Edit)] - public async Task<PatientDto> UpdatePatientAsync(Guid id, CreateUpdatePatientDto input) + public async Task UpdatePatientAsync(Guid id, CreateUpdatePatientDto input) { var patient = await _patientRepository.GetQueryableAsync().Result.Include(x => x.Images).Where(x => x.Id == id).FirstOrDefaultAsync(); List<EntityDocument> entitydocument = new List<EntityDocument>(); @@ -407,7 +402,6 @@ namespace HospitalManagementSystem.Patients } patient = await _patientRepository.UpdateAsync(patient); - return ObjectMapper.Map<Patient, PatientDto>(patient); } #endregion