fix: Missing input validators + No patient update endpoint + Pagination inconsistencies + Missing list/get endpoints

This commit is contained in:
voltsrage
2026-06-21 19:13:13 +08:00
parent 33895122d1
commit a37fad0e57
26 changed files with 932 additions and 22 deletions
@@ -67,6 +67,22 @@ public class PatientsController : ControllerBase
return Ok(ApiResponse<Patient>.Ok(patient));
}
/// <summary>
/// Updates patient demographics. Only non-null fields are applied.
/// </summary>
/// <param name="id">Patient id.</param>
/// <param name="req">Fields to update.</param>
/// <returns>The updated patient record.</returns>
[HttpPatch("{id:guid}")]
[AuthorizePermission(ClinicalPermissions.PatientsWrite)]
[ProducesResponseType(typeof(ApiResponse<Patient>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ApiResponse<object>), StatusCodes.Status404NotFound)]
public async Task<IActionResult> Update(Guid id, [FromBody] UpdatePatientRequest req)
{
var patient = await _patients.UpdateAsync(id, req);
return Ok(ApiResponse<Patient>.Ok(patient));
}
/// <summary>
/// Opens a new active encounter for the patient.
/// </summary>