Implement US-07 context-filtered observation history

This commit is contained in:
Steffen committed 2026-10-05 12:28:04 +02:00
1 parent ac6b42f32e
commit ce03038ce1
8 files changed
+235 -11

No files matched your search

@@ -60,11 +60,13 @@ public sealed class ObservationController(ObservationApplicationService service)
[HttpGet("patients/{patientId:guid}/observations")]
public async Task<ActionResult<List<ObservationDto>>> GetByPeriod(Guid patientId,
[FromQuery, BindRequired] DateTime from, [FromQuery, BindRequired] DateTime to,
CancellationToken cancellationToken)
[FromQuery] ContextSelection selection, CancellationToken cancellationToken)
{
try
{
var observations = await service.GetByPeriodAsync(patientId, from, to, cancellationToken);
var observations = await service.GetByPeriodAsync(patientId, from, to, selection, cancellationToken);
Response.Headers["X-Measurement-Setting"] = selection.Setting ?? "All";
Response.Headers["X-Activity-Condition"] = selection.ActivityCondition ?? "All";
return Ok(observations.Select(ToDto).ToList());
}
catch (ArgumentException)