Implement US-12 consolidated health overview service
This commit is contained in:
1 parent
cc76c9bde4
commit
076e675c81
26 files changed
+804
-16
No files matched your search
@@ -0,0 +1,64 @@
|
||||
# US-12 health overview
|
||||
|
||||
`GET /api/patients/{patientId}/overview?from=...&to=...&setting=Home&activityCondition=AtRest`
|
||||
requires the patient's authenticated account or an assigned read-only professional.
|
||||
Dates use the existing inclusive measurement-instant convention. Offset-free timestamps
|
||||
mean UTC; equivalent offsets identify the same instant. From and to are required,
|
||||
equal bounds are valid, reversed/malformed/missing bounds return 400. Both selected
|
||||
context dimensions must match for insight; `Unknown` is an explicit selectable category.
|
||||
Omitted dimensions are unrestricted. Unsupported selections return 400 validation details.
|
||||
|
||||
The independent ASP.NET Core Health Overview Service loads the profile, latest overall
|
||||
observation and US-10 numerical insight through three HTTP clients routed through the
|
||||
gateway. It has no production project references to another service, database, stored
|
||||
aggregate or cache. The renamed Overview ER illustration explicitly denotes data needed
|
||||
from other services rather than overview persistence; the current class model governs.
|
||||
|
||||
## Response
|
||||
|
||||
A successful request returns 200 with:
|
||||
|
||||
- `patient`: the current profile, including ID, name, birth date and contact information.
|
||||
- `latestObservation`: latest overall reading, including original text, note and all recorded
|
||||
structured context, or null when no observations exist. Latest retains US-06 timestamp,
|
||||
original recording-time and deterministic ID ordering. The insight period and filters
|
||||
never limit latest-observation selection.
|
||||
- `insight`: the existing US-10 response or null when no observations match the insight
|
||||
period/context. Its rounded means, extrema, selection, contributing count and context
|
||||
explanation are preserved. No trend component is added.
|
||||
- `periodStart`, `periodEnd`, `insightSelection`, `insightContributingCount`: explicit insight
|
||||
basis even when insight is absent (count zero).
|
||||
- `latestObservationBasis`: explains that latest context belongs to that reading only.
|
||||
- `insightExplanation`: preserves the insight's context limitations or explains why no
|
||||
selected-period insight is available. Empty insight does not remove profile/latest.
|
||||
|
||||
An authorized missing patient returns 404 with `Patient does not exist.` Access rejection
|
||||
retains the gateway's non-disclosing empty 404 convention; unauthenticated clients get 401.
|
||||
Professional writes remain forbidden. Upstream connection/status/invalid-JSON failures
|
||||
return 502; local upstream timeouts return 504. These are not reported as absent data.
|
||||
Only upstream 404 responses on the appropriate profile/latest/insight routes represent
|
||||
missing data. Requests are cancelled on client disconnect.
|
||||
|
||||
Every overview request fetches current source data, including profile updates, corrected
|
||||
measurement/context, and deletions. Reads occur separately across services, so concurrent
|
||||
writes may occur between them; the overview does not promise a cross-service snapshot.
|
||||
There is no extra transaction, refresh mechanism, synchronisation process or persisted
|
||||
copy to invalidate.
|
||||
|
||||
## Deployment and verification
|
||||
|
||||
The service builds/publishes independently with .NET 10 and starts from external
|
||||
configuration. See `deploy/health-overview.env.example`, the independent systemd unit,
|
||||
[README.md](README.md) and [AUTHENTICATION.md](AUTHENTICATION.md). It requires only the
|
||||
gateway origin and incoming/outgoing service credentials; no database configuration or
|
||||
migration is needed. Production uses HTTPS; local HTTP is limited to Development.
|
||||
Addresses, network binding, credentials and certificates are configurable for separate
|
||||
machines. Standard stdout/stderr logging, graceful shutdown and restart follow the other
|
||||
service units. No new package dependencies are introduced.
|
||||
|
||||
US-12 acceptance tests run five actual HTTP hosts against separate patient/observation
|
||||
PostgreSQL databases. They cover all story scenarios, boundaries/offsets, patient scope,
|
||||
latest tie rules, context preservation, independent filters, unknown/mixed context,
|
||||
empty selected insight, corrections/deletions/restart, profile updates, missing patients,
|
||||
validation, owner/assignment enforcement, direct bypass rejection, restricted internal
|
||||
service reads and unavailable upstream/Overview services.
|
||||
Reference in new issue
Block a user