Implement US-15 public measurement guidance

This commit is contained in:
Steffen committed 2026-10-04 16:00:41 +02:00
1 parent a5b269cfc3
commit fa5e20f4d6
3 files changed
+222

No files matched your search

+29
View File
@@ -77,6 +77,35 @@ Authentication and access control are defined in US-13, US-14 and `Docs/Design/a
## Automated acceptance tests
### US-15 public measurement guidance
`GET /api/measurement-guidance` returns ordered instructions for resting home
self-measurement, with source URLs, source update dates and review date. It works
before a patient or observation exists and requires no authentication or upstream
service access. The gateway serves this static general content without persistence.
Optional `setting` accepts `Home`, `Clinic`, `Other`, or `Unknown`; omission means
unknown. Home or unknown requests return explicitly labelled home instructions;
clinic/other requests return `available: false` and no instructions because no
verified guidance for those settings is bundled. Optional `activityCondition`
accepts `AtRest`, `DuringActivity`, `AfterActivity`, or `Unknown`. The response
preserves requested conditions while identifying the resting applicability of the
instructions. Unsupported categories return `400` problem details.
The bundled content was reviewed on 2026-10-04 against the two Sundhed.dk pages
specified in US-15. It distinguishes the planned Danish three-day monitoring
protocol from an individual observation. Review sources again when updating the
content; requests do not fetch live guidance. Viewing/declining instructions never
records context, certifies compliance or gates observation submission. Pulse
information describes the device-reported rate rather than rhythm assessment.
The `MeasurementGuidanceTests` HTTP tests need no PostgreSQL server and cover
public access, ordered sourced content, unknown setting, activity limitations,
unavailable guidance, invalid selections, and absence of patient-service calls.
Run them with `dotnet test tests/PatientProfile.AcceptanceTests -c Release --filter
FullyQualifiedName~MeasurementGuidanceTests`. Existing observation recording tests
cover submission without viewing guidance. No dependencies were added.
Tests require a real PostgreSQL instance. Provide an administrator connection with permission to create/drop databases; the fixture creates an isolated database named `us01_<random>`, applies the committed migration, and deletes that database at teardown. Never point this connection at a production server.
```bash