misc fixes

This commit is contained in:
Sandipan Mitra 2025-02-06 18:00:35 +05:30
parent 48d6a3fae8
commit 79d1e38f26
2 changed files with 15 additions and 10 deletions

View File

@ -275,6 +275,17 @@
</div> </div>
</div> </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"> <div class="text-right">
<button type="submit" pButton class="btn btn-primary" <button type="submit" pButton class="btn btn-primary"

View File

@ -161,7 +161,7 @@ namespace HospitalManagementSystem.Patients
#region Create Patient #region Create Patient
[Authorize(HospitalManagementSystemPermissions.Patient.Create)] [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 patientEntity = await _patientRepository.GetAsync(input.PatientId); // Get Patient from DB
var patientRecord = ObjectMapper.Map<CreateUpdatePatientRecordDto, PatientRecord>(input); var patientRecord = ObjectMapper.Map<CreateUpdatePatientRecordDto, PatientRecord>(input);
@ -194,14 +194,12 @@ namespace HospitalManagementSystem.Patients
} }
} }
patientRecord = await _patientrecordRepository.InsertAsync(patientRecord); patientRecord = await _patientrecordRepository.InsertAsync(patientRecord);
return ObjectMapper.Map<PatientRecord, PatientRecordDto>(patientRecord);
} }
#endregion #endregion
#region Update Patient #region Update Patient
[Authorize(HospitalManagementSystemPermissions.Patient.Edit)] [Authorize(HospitalManagementSystemPermissions.Patient.Edit)]
public async Task<PatientRecordDto> UpdatePatientRecordAsync(Guid id, CreateUpdatePatientRecordDto input) public async Task UpdatePatientRecordAsync(Guid id, CreateUpdatePatientRecordDto input)
{ {
try try
{ {
@ -240,7 +238,6 @@ namespace HospitalManagementSystem.Patients
} }
patientRecord = await _patientrecordRepository.UpdateAsync(patientRecord); patientRecord = await _patientrecordRepository.UpdateAsync(patientRecord);
return ObjectMapper.Map<PatientRecord, PatientRecordDto>(patientRecord);
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -364,7 +361,7 @@ namespace HospitalManagementSystem.Patients
#region Create Patient #region Create Patient
[Authorize(HospitalManagementSystemPermissions.Patient.Create)] [Authorize(HospitalManagementSystemPermissions.Patient.Create)]
public async Task<PatientDto> CreatePatientAsync(CreateUpdatePatientDto input) public async Task CreatePatientAsync(CreateUpdatePatientDto input)
{ {
var patient = ObjectMapper.Map<CreateUpdatePatientDto, Patient>(input); var patient = ObjectMapper.Map<CreateUpdatePatientDto, Patient>(input);
@ -381,14 +378,12 @@ namespace HospitalManagementSystem.Patients
} }
} }
} }
return ObjectMapper.Map<Patient, PatientDto>(patient);
} }
#endregion #endregion
#region Update Patient #region Update Patient
[Authorize(HospitalManagementSystemPermissions.Patient.Edit)] [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(); var patient = await _patientRepository.GetQueryableAsync().Result.Include(x => x.Images).Where(x => x.Id == id).FirstOrDefaultAsync();
List<EntityDocument> entitydocument = new List<EntityDocument>(); List<EntityDocument> entitydocument = new List<EntityDocument>();
@ -407,7 +402,6 @@ namespace HospitalManagementSystem.Patients
} }
patient = await _patientRepository.UpdateAsync(patient); patient = await _patientRepository.UpdateAsync(patient);
return ObjectMapper.Map<Patient, PatientDto>(patient);
} }
#endregion #endregion