Compare commits
40
Commits
d6f79a91c0
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b76897d8f8 | ||
|
|
2117236366 | ||
|
|
5d9371388c | ||
|
|
e5f00796af | ||
|
|
d69fcf8c76 | ||
|
|
453e37b3c3 | ||
|
|
743674a022 | ||
|
|
17f3b0dbd3 | ||
|
|
79bb6a11cd | ||
|
|
e50cf0a011 | ||
|
|
a69b9b2118 | ||
|
|
45a040f3a2 | ||
|
|
23a824dd81 | ||
|
|
7dc4ee60f0 | ||
|
|
dd68d16eba | ||
|
|
4562497541 | ||
|
|
eedf2a941b | ||
|
|
950f67d8b7 | ||
|
|
b6342afdad | ||
|
|
076e675c81 | ||
|
|
cc76c9bde4 | ||
|
|
a0a9e2e9b9 | ||
|
|
d21005b6fe | ||
|
|
5aefe52853 | ||
|
|
ce03038ce1 | ||
|
|
ac6b42f32e | ||
|
|
3bfa7ea149 | ||
|
|
cfacaa0c24 | ||
|
|
5996481081 | ||
|
|
0ce9b2b168 | ||
|
|
ebf50827d6 | ||
|
|
fa5e20f4d6 | ||
|
|
a5b269cfc3 | ||
|
|
4cb6798ec9 | ||
|
|
e4379ad2f4 | ||
|
|
0ea7866f82 | ||
|
|
df47bcbbd7 | ||
|
|
05f57dcba3 | ||
|
|
a9633e49e1 | ||
|
|
eb2cf2e54a |
No files matched your search
@@ -0,0 +1,38 @@
|
|||||||
|
name: Prototype native installation
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
jobs:
|
||||||
|
native-install:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-24.04, windows-latest, macos-14]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 40
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
dotnet-version: '10.0.x'
|
||||||
|
- name: Build portable release on Unix
|
||||||
|
if: runner.os != 'Windows'
|
||||||
|
shell: bash
|
||||||
|
run: bash deploy/build-release.sh --output "$RUNNER_TEMP/healthapp-release"
|
||||||
|
- name: Build portable release on Windows
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
shell: pwsh
|
||||||
|
run: ./deploy/build-release.ps1 -Output "$env:RUNNER_TEMP/healthapp-release"
|
||||||
|
- name: Provision and verify Ubuntu/systemd
|
||||||
|
if: runner.os == 'Linux'
|
||||||
|
shell: bash
|
||||||
|
run: sudo bash "$RUNNER_TEMP/healthapp-release/install.sh" --services all --host localhost --dotnet "$(command -v dotnet)"
|
||||||
|
- name: Provision and verify Windows Services
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
shell: pwsh
|
||||||
|
run: '& "$env:RUNNER_TEMP/healthapp-release/install.ps1" -Services all -HostName localhost'
|
||||||
|
- name: Provision and verify macOS/launchd
|
||||||
|
if: runner.os == 'macOS'
|
||||||
|
shell: bash
|
||||||
|
run: sudo bash "$RUNNER_TEMP/healthapp-release/install.sh" --services all --host localhost
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
**/bin/
|
||||||
|
**/obj/
|
||||||
|
TestResults/
|
||||||
|
.env
|
||||||
|
*.user
|
||||||
|
|
||||||
|
# Draw.io backup files
|
||||||
|
Docs/Architecture/.*.bkp
|
||||||
|
|
||||||
|
# Private workload credentials and generated measurement results
|
||||||
|
tools/energy-jmeter/.private/
|
||||||
|
tools/energy-jmeter/results/
|
||||||
|
tools/energy-jmeter/hash-tool/
|
||||||
|
jmeter.log
|
||||||
|
__pycache__/
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
# HealthApp as-built architecture
|
||||||
|
|
||||||
|
Snapshot: **2026-10-12**, repository commit `5d9371388c15066eeb2bc124ed227659c644dab5`. This describes the checked-out implementation, not a proposed architecture or a certification of a running installation.
|
||||||
|
|
||||||
|
## Documents
|
||||||
|
|
||||||
|
| Document | Contents |
|
||||||
|
| --- | --- |
|
||||||
|
| [Software architecture](software-architecture.md) | Runtime structure, contracts, data, security, deployment and failures |
|
||||||
|
| [Architecture decisions](architecture-decisions.md) | Observable decisions, evidence, rationale provenance and consequences |
|
||||||
|
| [Requirements traceability](requirements-traceability.md) | US-01–US-16 implementation and test mapping; coverage limits |
|
||||||
|
| [Discrepancies](discrepancies.md) | Historical differences, current omissions and unresolved uncertainties |
|
||||||
|
| [Evidence inventory](evidence-inventory.md) | Source/configuration/test inventory and inspection boundaries |
|
||||||
|
| [Validation](validation.md) | Deliverable, diagram, link and preservation checks |
|
||||||
|
| [Class-diagram coverage](class-diagram-coverage.md) | Every declared service type mapped to an individual UML classifier and source file |
|
||||||
|
|
||||||
|
## Editable diagrams
|
||||||
|
|
||||||
|
Open these files directly in diagrams.net / Draw.io. They contain native shapes, text and connectors, rather than embedded screenshots. Page tabs separate detailed views.
|
||||||
|
|
||||||
|
| File | Pages / purpose |
|
||||||
|
| --- | --- |
|
||||||
|
| [01-system-context.drawio](diagrams/01-system-context.drawio) | Actors, system boundary and optional experiment infrastructure |
|
||||||
|
| [02-logical-services.drawio](diagrams/02-logical-services.drawio) | Five processes, gateway routing and local layers |
|
||||||
|
| [03-domain-model.drawio](diagrams/03-domain-model.drawio) | Complete application domain: health, access, assignments, guidance, assessments and references; separate supporting deployment domain |
|
||||||
|
| [ApiGateway class diagram](diagrams/04-class-ApiGateway.drawio) | All 16 declared types, including controllers, security and nested records |
|
||||||
|
| [PatientProfileService class diagram](diagrams/04-class-PatientProfileService.drawio) | All 14 declared types; runtime and EF migration pages |
|
||||||
|
| [ObservationService class diagram](diagrams/04-class-ObservationService.drawio) | All 17 declared types; runtime and EF migration pages |
|
||||||
|
| [InsightsService class diagram](diagrams/04-class-InsightsService.drawio) | All 16 declared types, including individual DTO/result/reference records |
|
||||||
|
| [HealthOverviewService class diagram](diagrams/04-class-HealthOverviewService.drawio) | All 15 declared types, including distinct abstract/HTTP clients and DTOs |
|
||||||
|
| [04-design-classes.drawio](diagrams/04-design-classes.drawio) | Combined copy of the five service diagrams, plus the administrative provisioning view |
|
||||||
|
| [05-data-ownership.drawio](diagrams/05-data-ownership.drawio) | Physical tables, file/configuration ownership and transient results |
|
||||||
|
| [06-deployment.drawio](diagrams/06-deployment.drawio) | Colocated and distributed Linux topologies; Windows/macOS adapters |
|
||||||
|
| [07-sequences.drawio](diagrams/07-sequences.drawio) | Login/create, record, read/update/delete ownership, calculations, overview, professional access and installation |
|
||||||
|
|
||||||
|
## Interpretation
|
||||||
|
|
||||||
|
**Verified** means directly observable in repository implementation or configuration; a cited test demonstrates the intended check, not that it was executed in this documentation task. **Inferred** labels a consequence or rationale derived from that evidence. **Unknown** labels something the repository cannot establish. Existing specifications and functionality were preserved. No application code was generated or changed, and no live host was accessed.
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
# Observable architecture decisions
|
||||||
|
|
||||||
|
These records describe existing choices. They are not new approvals or proposed ADRs. **Documented rationale** is stated in a repository document; **inferred rationale/consequence** is analysis of the code; **unknown rationale** means no reason was found. Each decision is verified independently from implementation evidence.
|
||||||
|
|
||||||
|
| ID | Implemented decision and evidence | Rationale provenance | Consequences / limits |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| AB-01 | Five independent ASP.NET Core processes; no production service-to-service project references. [Solution](../HealthApp.slnx), [release build](../deploy/build-release.sh) | Documented: independent boundaries and location-independent deployment in [US-16](<../Docs/Requirements/US16 easy installation and deployment installer.txt>) and [service architecture](../Docs/Architecture/02_microservice_architecture.jpg) | Each service publishes/configures/stops separately. Availability dependencies still exist through HTTP. |
|
||||||
|
| AB-02 | All business HTTP between services goes through Gateway. [Observation](../src/ObservationService/Program.cs), [Insights](../src/InsightsService/Program.cs), [Overview](../src/HealthOverviewService/Program.cs) | Documented path in [architecture correction](../Docs/Architecture/us10-insights-correction.md) and existing service diagram. Additional rationale beyond that choice is unknown. | Inferred: extra hops and centralized availability/load; no direct aggregator-to-source shortcuts. |
|
||||||
|
| AB-03 | Controllers explicitly forward requests using named HttpClients. [Gateway Observation controller](../src/ApiGateway/Controllers/ObservationController.cs) | Unknown: no separate ADR explaining selection over a proxy library | Routes/header handling are explicit; forwarding implementation is duplicated, and only selected response headers survive. |
|
||||||
|
| AB-04 | Patient/Profile and Observation own separate PostgreSQL DBs/roles; context stored in same observation row. [contexts](../src/ObservationService/Persistence/ObservationDbContext.cs), [DB provisioning](../deploy/HealthApp.Provisioning/DatabaseProvisioning.cs) | Documented independent ownership in [addendum](../Docs/Requirements/us16-addendum). Same-row context is documented in [implementation README](../src/README.md); original logical model explicitly permits physical mapping choices. | No cross-service FK or DB joins. Context deletion is naturally row deletion. Optional preparation details do not require another table. |
|
||||||
|
| AB-05 | Account association resides in `patient.account_id`, with unique index. [migration](../src/PatientProfileService/Persistence/Migrations/20261005082209_AccountProfileAssociation.cs), [SQL repository](../src/PatientProfileService/Persistence/SqlPatientRepository.cs) | Documented: [authentication implementation](../src/AUTHENTICATION.md) explains single-row consistency and restart persistence | Concurrent creation cannot produce two non-null associations for one account. Existing nullable legacy associations are not backfilled. |
|
||||||
|
| AB-06 | Insights and Overview have no own DB/repository/result persistence. [Insights application](../src/InsightsService/Application/InsightsApplicationService.cs), [Overview application](../src/HealthOverviewService/Application/HealthOverviewApplicationService.cs) | Documented: [Insights correction](../Docs/Architecture/us10-insights-correction.md), [Overview implementation](../src/OVERVIEW.md) | New requests use current source data. No generated result ID/cache invalidation. Multi-service reads are not one snapshot. |
|
||||||
|
| AB-07 | Framework protected opaque bearer tickets; password hashing only at login. [login](../src/ApiGateway/Controllers/AuthenticationController.cs), [accounts](../src/ApiGateway/Security/PrototypeAccounts.cs), [startup](../src/ApiGateway/Program.cs) | Documented: [authentication design](../Docs/Design/authentication-and-access-control-design.md) separates credentials/token/policy, excludes custom crypto and repeated password verification. Concrete mechanism/lifetime recorded in [AUTHENTICATION.md](../src/AUTHENTICATION.md). | No JWT issuer/audience configuration, identity server or refresh workflow. Default 30-minute expiry requires new login. Token keys are persistent local files. |
|
||||||
|
| AB-08 | Gateway establishes ownership by protected HTTP reads and evaluates configured professional assignments. [middleware](../src/ApiGateway/Security/PatientAccessMiddleware.cs) | Documented: [authentication design](../Docs/Design/authentication-and-access-control-design.md) requires actual owner lookup and separated access policy | No ownership inside bearer token. Additional per-request lookup cost/dependency. Empty 404 hides cross-patient existence; professionals cannot write. |
|
||||||
|
| AB-09 | Backend shared-key guards; distinct callback keys with GET-only whitelist. [internal handler](../src/ApiGateway/Security/InternalServiceAuthenticationHandler.cs), [backend](../src/ObservationService/Program.cs) | Documented: [AUTHENTICATION.md](../src/AUTHENTICATION.md) selects prototype protection satisfying gateway-only enforcement | HTTPS protects key transport. Trusted backend incoming keys bypass end-user checks there; callback credentials have cross-patient access on their limited read routes. No mTLS or user delegation. |
|
||||||
|
| AB-10 | Require HTTPS outside Development; disable HTTP redirects in business clients. [Gateway Program](../src/ApiGateway/Program.cs), [Observation Program](../src/ObservationService/Program.cs) | HTTPS rationale documented in [authentication design](../Docs/Design/authentication-and-access-control-design.md). Credential redirect protection documented in [AUTHENTICATION.md](../src/AUTHENTICATION.md). | HTTP development is explicit. HTTP is rejected rather than automatically redirected; reverse-proxy forwarded-header support is absent. |
|
||||||
|
| AB-11 | UTC clock values stored in timestamp-without-timezone columns; offset normalization. [Observation application](../src/ObservationService/Application/ObservationApplicationService.cs) | Documented in [src README](../src/README.md): preserve original TIMESTAMP design while making instants/offset-free interpretation deterministic | Clients must interpret offset-free output as UTC. No local-zone interpretation or stored original offset. |
|
||||||
|
| AB-12 | Inclusive selection, deterministic latest UUID tie; history sorted by measurement time/UUID. [repository](../src/ObservationService/Persistence/SqlObservationRepository.cs) | Requirements prescribe inclusivity and deterministic ties; concrete final UUID order documented in [src README](../src/README.md) | Recording/edit order cannot override measurement-time precedence. Equal timestamps remain valid. No pagination/size bound. |
|
||||||
|
| AB-13 | Setter presence flags implement PATCH omission vs null; full numeric PUT remains. [patch](../src/ObservationService/Contracts/PatchObservationRequest.cs), [repository](../src/ObservationService/Persistence/SqlObservationRepository.cs) | Documented [US-08](../Docs/Requirements/us08-update-observation.md) requires preservation/clearing. Exact mechanism rationale inferred: distinguishes omitted JSON members from explicit clearing without a patch library. | Unknown PATCH/PUT fields rejected. No external JSON Patch dependency. No ETag/concurrency token. |
|
||||||
|
| AB-14 | Decimal final-only summary rounding; timestamp-grouped direction and OLS trend; static sourced references. [calculators](../src/InsightsService/Domain/InsightCalculator.Trends.cs) | Documented methods, clinical limits and cautious inference basis in [TRENDS.md](../src/TRENDS.md), required reproducibility in [US-11](../Docs/Requirements/us11-health-trend.md) | No prediction/significance test/diagnosis. Numerical evidence survives limited context; phrase detection cannot understand arbitrary narratives. Clinical applicability has not been independently validated by this task. |
|
||||||
|
| AB-15 | Overview reads profile → latest → insight sequentially; context selection applies only to insight. [application](../src/HealthOverviewService/Application/HealthOverviewApplicationService.cs) | Selection distinction documented in [US-12](../Docs/Requirements/us12-health-overview.md); lack of snapshot documented in [OVERVIEW.md](../src/OVERVIEW.md). Rationale for sequential execution is unknown. | Partial absence can still return available profile/latest; source failure returns failure. Inferred: latency follows dependent calls and writes may interleave. |
|
||||||
|
| AB-16 | External startup account/assignment config; no account/assignment administration API. [accounts](../src/ApiGateway/Security/PrototypeAccounts.cs), [assignments](../src/ApiGateway/Security/ProfessionalAssignments.cs) | Documented prototype scope in [US-13](../Docs/Requirements/us13-patient-authentication.md), [US-14](../Docs/Requirements/us14-professional-access.md) | No credential/assignment DB; changes require process restart. Existing token role/account claims are not rechecked against current account records every request. |
|
||||||
|
| AB-17 | Portable framework-dependent DLLs plus OS-specific package/service adapters. [build](../deploy/build-release.sh), [Linux](../deploy/installer/install.sh), [Windows](../deploy/installer/install.ps1), [macOS](../deploy/installer/install-macos.sh) | Documented in [INSTALLATION.md](../deploy/INSTALLATION.md): native deployment without combining processes, container requirement or host-generated apphost | Target runtime/native administration remain platform-specific. Non-Debian Linux automation is absent. Native-host execution evidence is limited. |
|
||||||
|
| AB-18 | Single generated topology plan; scoped SSH/SCP distribution; prototype CA + per-service certificates. [prepare](../deploy/HealthApp.Provisioning/Deployment.cs), [distribute](../deploy/HealthApp.Provisioning/Distribution.cs) | Documented normal-install automation in [US-16 addendum](../Docs/Requirements/us16-addendum), scoped distribution in [INSTALLATION.md](../deploy/INSTALLATION.md) | Compatible keys are automatic; separate independently prepared plans will not interoperate. CA signing private key is not retained. Admin access/network reachability still prerequisite. |
|
||||||
|
| AB-19 | Fail closed on ownership/upstream failure; absent aggregate data distinguished from dependency failure. [middleware](../src/ApiGateway/Security/PatientAccessMiddleware.cs), [Overview controller](../src/HealthOverviewService/Controllers/HealthOverviewController.cs) | Documented security requirement and [Overview error contract](../src/OVERVIEW.md) | 502/504 mapping, with generic 500 for some malformed ownership shapes. No resilience policy/circuit breaker. |
|
||||||
|
| AB-20 | Generated PostgreSQL connections disable pooling and use SSL Prefer. [Deployment.ConnectionString](../deploy/HealthApp.Provisioning/Deployment.cs) | Unknown: no explicit rationale found for these settings | Inferred: connection establishment recurs rather than using the driver pool; DB TLS is opportunistic rather than enforced. External configuration can change both. |
|
||||||
|
| AB-21 | Complete verification creates/reuses synthetic patient/observation then reads overview. [verification](../deploy/HealthApp.Provisioning/InstallationVerification.cs) | Documented in [INSTALLATION.md](../deploy/INSTALLATION.md), required representative workflow in US-16 | Installation can leave labelled test data; it is not a read-only check. No automatic native stop/restart cycle. |
|
||||||
|
| AB-22 | Public static guidance separate from observation writes. [controller](../src/ApiGateway/Controllers/MeasurementGuidanceController.cs) | Documented in [US-15](../Docs/Requirements/us15-measurement-guidance.md) | Available before records/login. No guidance read creates/certifies an observation. Sources are metadata, not runtime dependencies. |
|
||||||
|
|
||||||
|
No rationale has been invented for absent caching, missing optimistic concurrency, default business HTTP timeouts or the lack of deployment rollback. These are observable properties/limits, not necessarily deliberate tradeoffs documented by the authors.
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
# Implementation class-diagram coverage
|
||||||
|
|
||||||
|
Corrected after review: each service has its own UML class-diagram file. Every source-declared class, record and interface under that service is represented as an individual classifier. Nested types are named with their enclosing type; partial declarations count as one type. EF migrations, migration designers and model snapshots are included on separate persistence-support pages. No controller, DTO or request class is merged into a domain box.
|
||||||
|
|
||||||
|
Classifier compartments show actual attributes and operations with UML visibility. Record positional parameters are attributes plus a constructor. Primary-constructor parameters appear as constructor operations, with dependency links to local parameter types. They are not represented as invented C# fields. Explicit local attribute types supply associations; declared base classes/interfaces supply generalization/realization. The observation/context composition is justified by its EF-owned mapping. Inherited/automatically compiler-generated members are not enumerated.
|
||||||
|
|
||||||
|
Framework base types appear as labelled references, outside the service-defined type inventory. A same-service reference repeated on another page is marked as a reference and does not count as a second implementation type. Program registration dependencies do not mean shared cross-service memory or direct calls.
|
||||||
|
|
||||||
|
| Service | Declared types | Diagram |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| ApiGateway | 16 | [ApiGateway](diagrams/04-class-ApiGateway.drawio) |
|
||||||
|
| PatientProfileService | 14 | [PatientProfileService](diagrams/04-class-PatientProfileService.drawio) |
|
||||||
|
| ObservationService | 17 | [ObservationService](diagrams/04-class-ObservationService.drawio) |
|
||||||
|
| InsightsService | 16 | [InsightsService](diagrams/04-class-InsightsService.drawio) |
|
||||||
|
| HealthOverviewService | 15 | [HealthOverviewService](diagrams/04-class-HealthOverviewService.drawio) |
|
||||||
|
|
||||||
|
## Exact inventory
|
||||||
|
|
||||||
|
| Service | Fully qualified source type | Kind | Source files | Page |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| ApiGateway | `ApiGateway.Controllers.AuthenticationController` | class | [src/ApiGateway/Controllers/AuthenticationController.cs](../src/ApiGateway/Controllers/AuthenticationController.cs) | implementation classes |
|
||||||
|
| ApiGateway | `ApiGateway.Controllers.AuthenticationController.LoginRequest` | record | [src/ApiGateway/Controllers/AuthenticationController.cs](../src/ApiGateway/Controllers/AuthenticationController.cs) | implementation classes |
|
||||||
|
| ApiGateway | `ApiGateway.Controllers.HealthOverviewController` | class | [src/ApiGateway/Controllers/HealthOverviewController.cs](../src/ApiGateway/Controllers/HealthOverviewController.cs) | implementation classes |
|
||||||
|
| ApiGateway | `ApiGateway.Controllers.InsightsController` | class | [src/ApiGateway/Controllers/InsightsController.cs](../src/ApiGateway/Controllers/InsightsController.cs) | implementation classes |
|
||||||
|
| ApiGateway | `ApiGateway.Controllers.MeasurementGuidanceController` | class | [src/ApiGateway/Controllers/MeasurementGuidanceController.cs](../src/ApiGateway/Controllers/MeasurementGuidanceController.cs) | implementation classes |
|
||||||
|
| ApiGateway | `ApiGateway.Controllers.MeasurementGuidanceController.GuidanceSource` | record | [src/ApiGateway/Controllers/MeasurementGuidanceController.cs](../src/ApiGateway/Controllers/MeasurementGuidanceController.cs) | implementation classes |
|
||||||
|
| ApiGateway | `ApiGateway.Controllers.MeasurementGuidanceController.GuidanceStep` | record | [src/ApiGateway/Controllers/MeasurementGuidanceController.cs](../src/ApiGateway/Controllers/MeasurementGuidanceController.cs) | implementation classes |
|
||||||
|
| ApiGateway | `ApiGateway.Controllers.ObservationController` | class | [src/ApiGateway/Controllers/ObservationController.cs](../src/ApiGateway/Controllers/ObservationController.cs) | implementation classes |
|
||||||
|
| ApiGateway | `ApiGateway.Controllers.PatientController` | class | [src/ApiGateway/Controllers/PatientController.cs](../src/ApiGateway/Controllers/PatientController.cs) | implementation classes |
|
||||||
|
| ApiGateway | `ApiGateway.Controllers.ProfessionalController` | class | [src/ApiGateway/Controllers/ProfessionalController.cs](../src/ApiGateway/Controllers/ProfessionalController.cs) | implementation classes |
|
||||||
|
| ApiGateway | `ApiGateway.Program` | class | [src/ApiGateway/Program.cs](../src/ApiGateway/Program.cs) | implementation classes |
|
||||||
|
| ApiGateway | `ApiGateway.Security.InternalServiceAuthenticationHandler` | class | [src/ApiGateway/Security/InternalServiceAuthenticationHandler.cs](../src/ApiGateway/Security/InternalServiceAuthenticationHandler.cs) | implementation classes |
|
||||||
|
| ApiGateway | `ApiGateway.Security.PatientAccessMiddleware` | class | [src/ApiGateway/Security/PatientAccessMiddleware.cs](../src/ApiGateway/Security/PatientAccessMiddleware.cs) | implementation classes |
|
||||||
|
| ApiGateway | `ApiGateway.Security.ProfessionalAssignments` | class | [src/ApiGateway/Security/ProfessionalAssignments.cs](../src/ApiGateway/Security/ProfessionalAssignments.cs) | implementation classes |
|
||||||
|
| ApiGateway | `ApiGateway.Security.PrototypeAccount` | class | [src/ApiGateway/Security/PrototypeAccounts.cs](../src/ApiGateway/Security/PrototypeAccounts.cs) | implementation classes |
|
||||||
|
| ApiGateway | `ApiGateway.Security.PrototypeAccounts` | class | [src/ApiGateway/Security/PrototypeAccounts.cs](../src/ApiGateway/Security/PrototypeAccounts.cs) | implementation classes |
|
||||||
|
| PatientProfileService | `PatientProfileService.Application.PatientApplicationService` | class | [src/PatientProfileService/Application/PatientApplicationService.cs](../src/PatientProfileService/Application/PatientApplicationService.cs) | implementation classes |
|
||||||
|
| PatientProfileService | `PatientProfileService.Application.PatientRepository` | interface | [src/PatientProfileService/Application/PatientRepository.cs](../src/PatientProfileService/Application/PatientRepository.cs) | implementation classes |
|
||||||
|
| PatientProfileService | `PatientProfileService.Application.ProfileAlreadyExistsException` | class | [src/PatientProfileService/Application/ProfileAlreadyExistsException.cs](../src/PatientProfileService/Application/ProfileAlreadyExistsException.cs) | implementation classes |
|
||||||
|
| PatientProfileService | `PatientProfileService.Contracts.CreatePatientRequest` | record | [src/PatientProfileService/Contracts/CreatePatientRequest.cs](../src/PatientProfileService/Contracts/CreatePatientRequest.cs) | implementation classes |
|
||||||
|
| PatientProfileService | `PatientProfileService.Contracts.PatientDto` | record | [src/PatientProfileService/Contracts/PatientDto.cs](../src/PatientProfileService/Contracts/PatientDto.cs) | implementation classes |
|
||||||
|
| PatientProfileService | `PatientProfileService.Contracts.UpdatePatientRequest` | record | [src/PatientProfileService/Contracts/UpdatePatientRequest.cs](../src/PatientProfileService/Contracts/UpdatePatientRequest.cs) | implementation classes |
|
||||||
|
| PatientProfileService | `PatientProfileService.Controllers.PatientController` | class | [src/PatientProfileService/Controllers/PatientController.cs](../src/PatientProfileService/Controllers/PatientController.cs) | implementation classes |
|
||||||
|
| PatientProfileService | `PatientProfileService.Domain.Patient` | class | [src/PatientProfileService/Domain/Patient.cs](../src/PatientProfileService/Domain/Patient.cs) | implementation classes |
|
||||||
|
| PatientProfileService | `PatientProfileService.Persistence.Migrations.AccountProfileAssociation` | class | [src/PatientProfileService/Persistence/Migrations/20261005082209_AccountProfileAssociation.Designer.cs](../src/PatientProfileService/Persistence/Migrations/20261005082209_AccountProfileAssociation.Designer.cs)<br>[src/PatientProfileService/Persistence/Migrations/20261005082209_AccountProfileAssociation.cs](../src/PatientProfileService/Persistence/Migrations/20261005082209_AccountProfileAssociation.cs) | EF migration classes |
|
||||||
|
| PatientProfileService | `PatientProfileService.Persistence.Migrations.InitialPatientSchema` | class | [src/PatientProfileService/Persistence/Migrations/20260930200031_InitialPatientSchema.Designer.cs](../src/PatientProfileService/Persistence/Migrations/20260930200031_InitialPatientSchema.Designer.cs)<br>[src/PatientProfileService/Persistence/Migrations/20260930200031_InitialPatientSchema.cs](../src/PatientProfileService/Persistence/Migrations/20260930200031_InitialPatientSchema.cs) | EF migration classes |
|
||||||
|
| PatientProfileService | `PatientProfileService.Persistence.Migrations.PatientDbContextModelSnapshot` | class | [src/PatientProfileService/Persistence/Migrations/PatientDbContextModelSnapshot.cs](../src/PatientProfileService/Persistence/Migrations/PatientDbContextModelSnapshot.cs) | EF migration classes |
|
||||||
|
| PatientProfileService | `PatientProfileService.Persistence.PatientDbContext` | class | [src/PatientProfileService/Persistence/PatientDbContext.cs](../src/PatientProfileService/Persistence/PatientDbContext.cs) | implementation classes |
|
||||||
|
| PatientProfileService | `PatientProfileService.Persistence.SqlPatientRepository` | class | [src/PatientProfileService/Persistence/SqlPatientRepository.cs](../src/PatientProfileService/Persistence/SqlPatientRepository.cs) | implementation classes |
|
||||||
|
| PatientProfileService | `PatientProfileService.Program` | class | [src/PatientProfileService/Program.cs](../src/PatientProfileService/Program.cs) | implementation classes |
|
||||||
|
| ObservationService | `ObservationService.Application.ObservationApplicationService` | class | [src/ObservationService/Application/ObservationApplicationService.cs](../src/ObservationService/Application/ObservationApplicationService.cs) | implementation classes |
|
||||||
|
| ObservationService | `ObservationService.Application.ObservationRepository` | interface | [src/ObservationService/Application/ObservationRepository.cs](../src/ObservationService/Application/ObservationRepository.cs) | implementation classes |
|
||||||
|
| ObservationService | `ObservationService.Contracts.MeasurementContextPatch` | record | [src/ObservationService/Contracts/MeasurementContextPatch.cs](../src/ObservationService/Contracts/MeasurementContextPatch.cs) | implementation classes |
|
||||||
|
| ObservationService | `ObservationService.Contracts.ObservationDto` | record | [src/ObservationService/Contracts/ObservationDto.cs](../src/ObservationService/Contracts/ObservationDto.cs) | implementation classes |
|
||||||
|
| ObservationService | `ObservationService.Contracts.PatchObservationRequest` | record | [src/ObservationService/Contracts/PatchObservationRequest.cs](../src/ObservationService/Contracts/PatchObservationRequest.cs) | implementation classes |
|
||||||
|
| ObservationService | `ObservationService.Contracts.RecordObservationRequest` | record | [src/ObservationService/Contracts/RecordObservationRequest.cs](../src/ObservationService/Contracts/RecordObservationRequest.cs) | implementation classes |
|
||||||
|
| ObservationService | `ObservationService.Contracts.UpdateObservationRequest` | record | [src/ObservationService/Contracts/UpdateObservationRequest.cs](../src/ObservationService/Contracts/UpdateObservationRequest.cs) | implementation classes |
|
||||||
|
| ObservationService | `ObservationService.Controllers.ObservationController` | class | [src/ObservationService/Controllers/ObservationController.cs](../src/ObservationService/Controllers/ObservationController.cs) | implementation classes |
|
||||||
|
| ObservationService | `ObservationService.Domain.BloodPressureObservation` | class | [src/ObservationService/Domain/BloodPressureObservation.cs](../src/ObservationService/Domain/BloodPressureObservation.cs) | implementation classes |
|
||||||
|
| ObservationService | `ObservationService.Domain.ContextSelection` | record | [src/ObservationService/Domain/ContextSelection.cs](../src/ObservationService/Domain/ContextSelection.cs) | implementation classes |
|
||||||
|
| ObservationService | `ObservationService.Domain.MeasurementContext` | record | [src/ObservationService/Domain/MeasurementContext.cs](../src/ObservationService/Domain/MeasurementContext.cs) | implementation classes |
|
||||||
|
| ObservationService | `ObservationService.Persistence.Migrations.InitialObservationSchema` | class | [src/ObservationService/Persistence/Migrations/20261001095222_InitialObservationSchema.Designer.cs](../src/ObservationService/Persistence/Migrations/20261001095222_InitialObservationSchema.Designer.cs)<br>[src/ObservationService/Persistence/Migrations/20261001095222_InitialObservationSchema.cs](../src/ObservationService/Persistence/Migrations/20261001095222_InitialObservationSchema.cs) | EF migration classes |
|
||||||
|
| ObservationService | `ObservationService.Persistence.Migrations.ObservationDbContextModelSnapshot` | class | [src/ObservationService/Persistence/Migrations/ObservationDbContextModelSnapshot.cs](../src/ObservationService/Persistence/Migrations/ObservationDbContextModelSnapshot.cs) | EF migration classes |
|
||||||
|
| ObservationService | `ObservationService.Persistence.Migrations.RecordedMeasurementContext` | class | [src/ObservationService/Persistence/Migrations/20261005094632_RecordedMeasurementContext.Designer.cs](../src/ObservationService/Persistence/Migrations/20261005094632_RecordedMeasurementContext.Designer.cs)<br>[src/ObservationService/Persistence/Migrations/20261005094632_RecordedMeasurementContext.cs](../src/ObservationService/Persistence/Migrations/20261005094632_RecordedMeasurementContext.cs) | EF migration classes |
|
||||||
|
| ObservationService | `ObservationService.Persistence.ObservationDbContext` | class | [src/ObservationService/Persistence/ObservationDbContext.cs](../src/ObservationService/Persistence/ObservationDbContext.cs) | implementation classes |
|
||||||
|
| ObservationService | `ObservationService.Persistence.SqlObservationRepository` | class | [src/ObservationService/Persistence/SqlObservationRepository.cs](../src/ObservationService/Persistence/SqlObservationRepository.cs) | implementation classes |
|
||||||
|
| ObservationService | `ObservationService.Program` | class | [src/ObservationService/Program.cs](../src/ObservationService/Program.cs) | implementation classes |
|
||||||
|
| InsightsService | `InsightsService.Application.InsightsApplicationService` | class | [src/InsightsService/Application/InsightsApplicationService.cs](../src/InsightsService/Application/InsightsApplicationService.cs) | implementation classes |
|
||||||
|
| InsightsService | `InsightsService.Clients.HttpObservationServiceClient` | class | [src/InsightsService/Clients/HttpObservationServiceClient.cs](../src/InsightsService/Clients/HttpObservationServiceClient.cs) | implementation classes |
|
||||||
|
| InsightsService | `InsightsService.Clients.ObservationServiceClient` | interface | [src/InsightsService/Clients/ObservationServiceClient.cs](../src/InsightsService/Clients/ObservationServiceClient.cs) | implementation classes |
|
||||||
|
| InsightsService | `InsightsService.Contracts.HealthInsightDto` | record | [src/InsightsService/Contracts/HealthInsightDto.cs](../src/InsightsService/Contracts/HealthInsightDto.cs) | implementation classes |
|
||||||
|
| InsightsService | `InsightsService.Contracts.MeasurementContextDto` | record | [src/InsightsService/Contracts/ObservationDto.cs](../src/InsightsService/Contracts/ObservationDto.cs) | implementation classes |
|
||||||
|
| InsightsService | `InsightsService.Contracts.ObservationDto` | record | [src/InsightsService/Contracts/ObservationDto.cs](../src/InsightsService/Contracts/ObservationDto.cs) | implementation classes |
|
||||||
|
| InsightsService | `InsightsService.Controllers.InsightsController` | class | [src/InsightsService/Controllers/InsightsController.cs](../src/InsightsService/Controllers/InsightsController.cs) | implementation classes |
|
||||||
|
| InsightsService | `InsightsService.Domain.ClinicalReference` | record | [src/InsightsService/Domain/TrendAssessment.cs](../src/InsightsService/Domain/TrendAssessment.cs) | implementation classes |
|
||||||
|
| InsightsService | `InsightsService.Domain.ComparabilityAssessment` | record | [src/InsightsService/Domain/TrendAssessment.cs](../src/InsightsService/Domain/TrendAssessment.cs) | implementation classes |
|
||||||
|
| InsightsService | `InsightsService.Domain.ContextSelection` | record | [src/InsightsService/Domain/ContextSelection.cs](../src/InsightsService/Domain/ContextSelection.cs) | implementation classes |
|
||||||
|
| InsightsService | `InsightsService.Domain.HealthInsight` | record | [src/InsightsService/Domain/HealthInsight.cs](../src/InsightsService/Domain/HealthInsight.cs) | implementation classes |
|
||||||
|
| InsightsService | `InsightsService.Domain.InsightCalculator` | class | [src/InsightsService/Domain/InsightCalculator.Trends.cs](../src/InsightsService/Domain/InsightCalculator.Trends.cs)<br>[src/InsightsService/Domain/InsightCalculator.cs](../src/InsightsService/Domain/InsightCalculator.cs) | implementation classes |
|
||||||
|
| InsightsService | `InsightsService.Domain.MeasurementAssessment` | record | [src/InsightsService/Domain/TrendAssessment.cs](../src/InsightsService/Domain/TrendAssessment.cs) | implementation classes |
|
||||||
|
| InsightsService | `InsightsService.Domain.ReferenceSource` | record | [src/InsightsService/Domain/TrendAssessment.cs](../src/InsightsService/Domain/TrendAssessment.cs) | implementation classes |
|
||||||
|
| InsightsService | `InsightsService.Domain.TrendAssessment` | record | [src/InsightsService/Domain/TrendAssessment.cs](../src/InsightsService/Domain/TrendAssessment.cs) | implementation classes |
|
||||||
|
| InsightsService | `InsightsService.Program` | class | [src/InsightsService/Program.cs](../src/InsightsService/Program.cs) | implementation classes |
|
||||||
|
| HealthOverviewService | `HealthOverviewService.Application.HealthOverviewApplicationService` | class | [src/HealthOverviewService/Application/HealthOverviewApplicationService.cs](../src/HealthOverviewService/Application/HealthOverviewApplicationService.cs) | implementation classes |
|
||||||
|
| HealthOverviewService | `HealthOverviewService.Clients.HttpInsightsServiceClient` | class | [src/HealthOverviewService/Clients/InsightsServiceClient.cs](../src/HealthOverviewService/Clients/InsightsServiceClient.cs) | implementation classes |
|
||||||
|
| HealthOverviewService | `HealthOverviewService.Clients.HttpObservationServiceClient` | class | [src/HealthOverviewService/Clients/ObservationServiceClient.cs](../src/HealthOverviewService/Clients/ObservationServiceClient.cs) | implementation classes |
|
||||||
|
| HealthOverviewService | `HealthOverviewService.Clients.HttpPatientProfileServiceClient` | class | [src/HealthOverviewService/Clients/PatientProfileServiceClient.cs](../src/HealthOverviewService/Clients/PatientProfileServiceClient.cs) | implementation classes |
|
||||||
|
| HealthOverviewService | `HealthOverviewService.Clients.InsightsServiceClient` | class | [src/HealthOverviewService/Clients/InsightsServiceClient.cs](../src/HealthOverviewService/Clients/InsightsServiceClient.cs) | implementation classes |
|
||||||
|
| HealthOverviewService | `HealthOverviewService.Clients.ObservationServiceClient` | class | [src/HealthOverviewService/Clients/ObservationServiceClient.cs](../src/HealthOverviewService/Clients/ObservationServiceClient.cs) | implementation classes |
|
||||||
|
| HealthOverviewService | `HealthOverviewService.Clients.PatientProfileServiceClient` | class | [src/HealthOverviewService/Clients/PatientProfileServiceClient.cs](../src/HealthOverviewService/Clients/PatientProfileServiceClient.cs) | implementation classes |
|
||||||
|
| HealthOverviewService | `HealthOverviewService.Contracts.ContextSelection` | record | [src/HealthOverviewService/Contracts/HealthOverviewDto.cs](../src/HealthOverviewService/Contracts/HealthOverviewDto.cs) | implementation classes |
|
||||||
|
| HealthOverviewService | `HealthOverviewService.Contracts.HealthInsightDto` | record | [src/HealthOverviewService/Contracts/HealthOverviewDto.cs](../src/HealthOverviewService/Contracts/HealthOverviewDto.cs) | implementation classes |
|
||||||
|
| HealthOverviewService | `HealthOverviewService.Contracts.HealthOverviewDto` | record | [src/HealthOverviewService/Contracts/HealthOverviewDto.cs](../src/HealthOverviewService/Contracts/HealthOverviewDto.cs) | implementation classes |
|
||||||
|
| HealthOverviewService | `HealthOverviewService.Contracts.MeasurementContextDto` | record | [src/HealthOverviewService/Contracts/HealthOverviewDto.cs](../src/HealthOverviewService/Contracts/HealthOverviewDto.cs) | implementation classes |
|
||||||
|
| HealthOverviewService | `HealthOverviewService.Contracts.ObservationDto` | record | [src/HealthOverviewService/Contracts/HealthOverviewDto.cs](../src/HealthOverviewService/Contracts/HealthOverviewDto.cs) | implementation classes |
|
||||||
|
| HealthOverviewService | `HealthOverviewService.Contracts.PatientDto` | record | [src/HealthOverviewService/Contracts/HealthOverviewDto.cs](../src/HealthOverviewService/Contracts/HealthOverviewDto.cs) | implementation classes |
|
||||||
|
| HealthOverviewService | `HealthOverviewService.Controllers.HealthOverviewController` | class | [src/HealthOverviewService/Controllers/HealthOverviewController.cs](../src/HealthOverviewService/Controllers/HealthOverviewController.cs) | implementation classes |
|
||||||
|
| HealthOverviewService | `HealthOverviewService.Program` | class | [src/HealthOverviewService/Program.cs](../src/HealthOverviewService/Program.cs) | implementation classes |
|
||||||
|
|
||||||
|
## Validation
|
||||||
|
|
||||||
|
Source declarations were enumerated independently and compared with each per-service diagram’s `sourceType` attributes. A merged partial type is expected once per service file. All source-defined types must match exactly, with no extras or omissions. The combined `04-design-classes.drawio` contains the same corrected service views plus the administrative provisioning view; the standalone files are the primary per-service navigation targets.
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<mxfile host="app.diagrams.net" version="24.7.17" compressed="false">
|
||||||
|
<diagram id="p1" name="System context">
|
||||||
|
<mxGraphModel dx="1700" dy="1500" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="1100" math="0" shadow="0">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="c1" value="System context" style="text;html=0;fontSize=24;fontStyle=1;align=left;verticalAlign=middle;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="15" width="1440" height="45" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c2" value="Patient Pre-created account Creates own profile; records/reviews own measurements" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#d5e8d4;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="130" width="300" height="170" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c3" value="Healthcare professional Pre-created account Reads assigned patients; never writes" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#d5e8d4;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="400" width="300" height="170" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c4" value="HealthApp backend boundary Gateway + four application services REST/JSON over HTTPS Patient/Profile and Observation own persistence No product frontend in this repository" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#dae8fc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="530" y="230" width="400" height="250" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c5" value="Administrator / build machine Builds portable release Selects topology and installs native services Provides host administrative access" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#d5e8d4;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1100" y="150" width="330" height="190" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c6" value="Clinical reference publishers Sundhed.dk Source URLs/review dates compiled into code No runtime HTTP dependency" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#f5f5f5;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1100" y="430" width="330" height="180" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c7" value="HTTPS login + own-data APIs" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c2" target="c4">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c8" value="HTTPS login + assigned reads" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c3" target="c4">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c9" value="Native installation / configuration" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=open;dashed=1;" edge="1" parent="1" source="c5" target="c4">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c10" value="Reference metadata only" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=open;dashed=1;" edge="1" parent="1" source="c4" target="c6">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c11" value="Optional experiment system (outside product) JMeter generator → Gateway APIs JMeter ← PerfMon ServerAgent host telemetry JMeter ← Shelly plug HTTP power Idle scenario sends zero HealthApp requests" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#fff2cc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="420" y="710" width="600" height="190" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c12" value="Synthetic workload only" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c11" target="c4">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c13" value="Evidence: HealthApp.slnx; src/*/Program.cs; MeasurementGuidanceController; InsightCalculator.Trends; deploy/installer/*; tools/energy-jmeter. See software-architecture.md §§2, 6, 9, 11. Web/mobile clients are context actors, not implemented UI." style="rounded=0;whiteSpace=wrap;html=0;fillColor=#fff2cc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="960" width="1400" height="100" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
</mxfile>
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<mxfile host="app.diagrams.net" version="24.7.17" compressed="false">
|
||||||
|
<diagram id="p1" name="Service processes and communication">
|
||||||
|
<mxGraphModel dx="1700" dy="1500" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1750" pageHeight="1250" math="0" shadow="0">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="c1" value="Service processes and communication" style="text;html=0;fontSize=24;fontStyle=1;align=left;verticalAlign=middle;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="15" width="1690" height="45" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c2" value="ApiGateway process Authentication + PatientAccessMiddleware Controllers → named HttpClients Login / public guidance / assignments Persistent Data Protection key files" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#dae8fc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1" link="../../src/ApiGateway/Program.cs">
|
||||||
|
<mxGeometry as="geometry" x="640" y="110" width="420" height="240" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c3" value="PatientProfileService process PatientController → PatientApplicationService → PatientRepository / SqlPatientRepository → PatientDbContext" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#d5e8d4;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1" link="../../src/PatientProfileService/Program.cs">
|
||||||
|
<mxGeometry as="geometry" x="30" y="490" width="360" height="220" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c4" value="ObservationService process ObservationController → application → ObservationRepository / SQL / EF Patient existence client → Gateway" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#d5e8d4;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1" link="../../src/ObservationService/Program.cs">
|
||||||
|
<mxGeometry as="geometry" x="470" y="490" width="360" height="220" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c5" value="InsightsService process InsightsController → application → stateless InsightCalculator Observation HTTP client → Gateway No DB" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#d5e8d4;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1" link="../../src/InsightsService/Program.cs">
|
||||||
|
<mxGeometry as="geometry" x="910" y="490" width="360" height="220" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c6" value="HealthOverviewService process Overview controller → application Three typed HTTP clients → Gateway Sequential profile/latest/insight reads No DB" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#d5e8d4;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1" link="../../src/HealthOverviewService/Program.cs">
|
||||||
|
<mxGeometry as="geometry" x="1350" y="490" width="360" height="220" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c7" value="Profile APIs HTTPS + X-Gateway-Key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c2" target="c3">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c8" value="Observation APIs HTTPS + X-Gateway-Key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c2" target="c4">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c9" value="Summary / trend APIs HTTPS + X-Gateway-Key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c2" target="c5">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c10" value="Overview API HTTPS + X-Gateway-Key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c2" target="c6">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c11" value="Patient read HTTPS + X-Service-Key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c4" target="c2">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c12" value="History read HTTPS + X-Service-Key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c5" target="c2">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c13" value="Profile / latest / summary reads HTTPS + X-Service-Key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c6" target="c2">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c14" value="Patient DB patient + migration history Only Patient/Profile accesses it" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#fff2cc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="850" width="360" height="150" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c15" value="Observation DB observation + flattened context Only Observation accesses it" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#fff2cc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="470" y="850" width="360" height="150" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c16" value="EF Core / PostgreSQL" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c3" target="c14">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c17" value="EF Core / PostgreSQL" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c4" target="c15">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c18" value="No direct application-service network links, shared runtime library, shared domain objects, broker or cross-service DB access. Domain/client names do not change the configured Gateway origin. Each box is a separate project/process. Source links are attached to service boxes." style="rounded=0;whiteSpace=wrap;html=0;fillColor=#fff2cc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="1090" width="1680" height="100" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
</mxfile>
|
||||||
@@ -0,0 +1,205 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<mxfile host="app.diagrams.net" compressed="false" version="24.7.17">
|
||||||
|
<diagram id="Complete-application-domain:-health,-access-and-guidance" name="Complete application domain: health, access and guidance">
|
||||||
|
<mxGraphModel grid="1" gridSize="10" page="1" pageWidth="2550" pageHeight="2100">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="c1" value="Complete application domain: health, access and guidance" style="text;html=0;fontSize=26;fontStyle=1;align=left;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="20" width="2470" height="60" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c2" value="Account Stable account identifier Trusted Patient / HealthcareProfessional role Pre-created credentials; no registration" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#d5e8d4;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="50" y="170" width="480" height="195" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c3" value="Patient profile Patient identifier; name; date of birth Optional contact information Persistently associated with patient account" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#dae8fc;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="675" y="170" width="480" height="195" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c4" value="Professional assignment Professional account ↔ patient identifier Predefined, read-only entitlement Multiple patients / multiple professionals" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#d5e8d4;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1300" y="170" width="480" height="195" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c5" value="Authentication grant Account identity and trusted role Issue/expiry instants; time limited No patient health information" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#d5e8d4;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1925" y="170" width="480" height="195" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c6" value="Blood-pressure observation Observation and patient identifiers Measurement instant; original recording time Systolic/diastolic pressure and pulse Optional original context text and note" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#dae8fc;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="50" y="510" width="480" height="195" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c7" value="Measurement context Setting; activity condition Optional preparation/technique details Optional additional circumstances Unknown retained; no inferred compliance" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#fff2cc;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="675" y="510" width="480" height="195" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c8" value="Context selection Optional setting and/or activity Both selected dimensions must match Unknown is an explicit selectable category" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#fff2cc;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1300" y="510" width="480" height="195" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c9" value="Measurement period Inclusive start and end instants Equal bounds valid; reversed invalid Measurement instants interpreted as UTC" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#fff2cc;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1925" y="510" width="480" height="195" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c10" value="Numerical health insight Systolic/diastolic/pulse arithmetic means Blood-pressure minima and maxima Contributing count; selected basis Context explanation; derived, not stored" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#dae8fc;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="50" y="850" width="480" height="195" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c11" value="Trend assessment Patient, period and context selection Contributing observation count Three separate metric assessments Recorded comparability and limitations" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#dae8fc;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="675" y="850" width="480" height="195" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c12" value="Recorded comparability Known similarities and differences Missing details and narrative conflicts Evidence/explanation; not certification" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#fff2cc;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1300" y="850" width="480" height="195" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c13" value="Measurement assessment Metric and unit; mean/minimum/maximum/range Temporal and overall direction; slope Reversals/successive variation Interpretation, reference comparison and hint" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#fff2cc;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1925" y="850" width="480" height="195" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c14" value="Health overview Patient profile Optional latest overall observation Optional selected-period numerical insight Explicit separate bases and absence reasons" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#dae8fc;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="50" y="1190" width="480" height="195" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c15" value="Clinical reference Applicable scope and measurement conditions Lower/upper boundaries and operators Source provenance; applicability limits General reference ≠ individual treatment goal" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#fff2cc;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="675" y="1190" width="480" height="195" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c16" value="Reference source Publication title and URL Publication update/review dates where supplied Provenance, not a patient record No automatic live source refresh" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#fff2cc;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1300" y="1190" width="480" height="195" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c17" value="Measurement guidance Requested setting/activity Applicable home/resting basis or unavailable Ordered instructions; explanations/limits Review date and source provenance" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#dae8fc;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1925" y="1190" width="480" height="195" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c18" value="Guidance instruction Sequence order; topic; instruction Preparation/equipment/position/measurement/ planned monitoring/recording No stored compliance state" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#fff2cc;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1925" y="1530" width="480" height="195" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c19" value="Patient account 1 ↔ profile 0..1; legacy profile account 0..1" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c2" target="c3">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c20" value="Professional account 1 ↔ assignments 0..*" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c2" target="c4">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c21" value="Assignments 0..* ↔ patient 1 (identifier may outlive data)" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c4" target="c3">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c22" value="Account 1 ↔ issued grants 0..*" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c2" target="c5">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c23" value="Patient 1 ↔ observations 0..*" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c3" target="c6">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c24" value="Observation 1 ↔ owned context 1" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;startArrow=diamond;startFill=1;endArrow=none;" edge="1" parent="1" source="c6" target="c7">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c25" value="Selects recorded setting/activity; does not change them" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="c8" target="c7">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c26" value="Selects by measurement instant" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="c9" target="c6">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c27" value="Derived from 1..* selected observations" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="c6" target="c10">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c28" value="Derived from 0..* selected observations" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="c6" target="c11">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c29" value="Applied selection 1" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c8" target="c10">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c30" value="Applied selection 1" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c8" target="c11">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c31" value="Requested period 1" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c9" target="c10">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c32" value="Requested period 1" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c9" target="c11">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c33" value="Assessment 1 ↔ recorded comparability 1" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;startArrow=diamond;startFill=1;endArrow=none;" edge="1" parent="1" source="c11" target="c12">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c34" value="Assessment 1 ↔ metric assessments 3" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;startArrow=diamond;startFill=1;endArrow=none;" edge="1" parent="1" source="c11" target="c13">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c35" value="Metric assessment 1 ↔ applicable reference 0..1" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c13" target="c15">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c36" value="Reference 1 ↔ sources 1..*" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c15" target="c16">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c37" value="Overview 1 ↔ profile 1" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c14" target="c3">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c38" value="Overview 1 ↔ latest overall 0..1" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c14" target="c6">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c39" value="Overview 1 ↔ insight 0..1" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c14" target="c10">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c40" value="Guidance 1 ↔ ordered instructions 0..*" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;startArrow=diamond;startFill=1;endArrow=none;" edge="1" parent="1" source="c17" target="c18">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c41" value="Guidance 1 ↔ cited sources 0..*" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c17" target="c16">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c42" value="Explains actual circumstances; never sets/saves context" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="c17" target="c7">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c43" value="Scope spans the responsibilities of all five application services: access/accounts/assignments, patient profiles, observation/context/history, numerical insights, metric trends/comparability/references, overview and public guidance. These are business concepts, not controllers, DTOs, repositories or framework classes. Derived views are values, not persisted entities. Professional role is an Account role; there is no separate stored professional profile. Measurement device/cuff are recorded descriptions, not independently managed device entities." style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#f5f5f5;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="45" y="1900" width="2460" height="145" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
<diagram id="Deployment-administration-concepts-(separate-supporting-domain)" name="Deployment administration concepts (separate supporting domain)">
|
||||||
|
<mxGraphModel grid="1" gridSize="10" page="1" pageWidth="2100" pageHeight="1450">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="c1" value="Deployment administration concepts (separate supporting domain)" style="text;html=0;fontSize=26;fontStyle=1;align=left;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="20" width="2020" height="60" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c2" value="Deployment topology Selected service names Reachable host/platform/port assignments Colocated or distributed" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#d5e8d4;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="45" y="170" width="575" height="200" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c3" value="Deployment node Host and native platform Administrative access prerequisites One or more selected service installations" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#d5e8d4;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="730" y="170" width="575" height="200" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c4" value="Service installation Independent executable/process identity Listening endpoint; local configuration Lifecycle independent of peers" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#d5e8d4;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1415" y="170" width="575" height="200" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c5" value="Deployment material Deployment identifier Compatible service settings and account secrets Protected files, scoped to selected nodes" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#d5e8d4;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="45" y="500" width="575" height="200" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c6" value="Service configuration Listening address; dependencies/endpoints Credentials; certificate paths Own database connection where applicable" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#d5e8d4;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="730" y="500" width="575" height="200" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c7" value="Credential Service incoming/callback keys Synthetic account password/hash Separate database owner credential Private administrative material" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#d5e8d4;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1415" y="500" width="575" height="200" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c8" value="Owned database Owning persistent service Dedicated role and schema No database for derived-data services" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#d5e8d4;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="45" y="830" width="575" height="200" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c9" value="Service certificate Endpoint DNS/IP identity Private key and protected PFX Validity interval and trust chain" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#d5e8d4;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="730" y="830" width="575" height="200" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c10" value="Prototype certificate authority Public trust anchor Issues service certificates at preparation Generated signing key not retained" style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#d5e8d4;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1415" y="830" width="575" height="200" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c11" value="Topology 1 ↔ nodes 1..*" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c2" target="c3">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c12" value="Node 1 ↔ installations 1..*" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c3" target="c4">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c13" value="Material 1 ↔ planned configurations 5" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c5" target="c6">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c14" value="Installation 1 ↔ configuration 1" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c4" target="c6">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c15" value="Configuration references appropriate credentials" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c6" target="c7">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c16" value="Persistent installation 1 ↔ owned database 1; others 0" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c4" target="c8">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c17" value="Configuration 1 ↔ service certificate 1" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c6" target="c9">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c18" value="Authority 1 ↔ issued service certificates 1..*" style="edgeStyle=orthogonalEdgeStyle;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c10" target="c9">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c19" value="Supporting deployment concepts describe existing installer data and administrator responsibilities; they do not create extra application microservices or change the health domain. Source evidence: Deployment.cs, DatabaseProvisioning.cs, ConfigurationWriter.cs and native installers. External certificates are also supported. Experiment tools and operating-system frameworks remain infrastructure, not invented clinical entities." style="rounded=0;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=14;spacing=12;strokeColor=#555555;fillColor=#f5f5f5;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="45" y="1260" width="2010" height="140" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
</mxfile>
|
||||||
@@ -0,0 +1,374 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<mxfile host="app.diagrams.net" version="24.7.17" compressed="false">
|
||||||
|
<diagram name="ApiGateway — implementation classes" id="ApiGateway---implementation-classes">
|
||||||
|
<mxGraphModel grid="1" gridSize="10" page="1" pageWidth="2660" pageHeight="2476" pageScale="1">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="n1" value="ApiGateway — implementation classes" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fontSize=24;fontStyle=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="25" width="2580" height="45" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n2" value="UML: + public, - private, # protected, ~ internal. Three compartments = classifier / attributes / operations. Hollow triangle: inheritance; dashed hollow triangle: interface realization. Solid line: attribute reference; dashed arrow: dependency; filled diamond: verified owned context. Each source type has its own classifier. Primary-constructor parameters are constructor operations, not invented fields." style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="85" width="2580" height="100" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n3" value="«class» AuthenticationController ApiGateway.Controllers" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#dae8fc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ApiGateway.Controllers.AuthenticationController" sourceFiles="src/ApiGateway/Controllers/AuthenticationController.cs" link="../../src/ApiGateway/Controllers/AuthenticationController.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="210" width="520" height="190" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n4" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n3">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n5" value="+ AuthenticationController(PrototypeAccounts accounts, IOptionsMonitor<BearerTokenOptions> options) + Login(LoginRequest request): IActionResult" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n3">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n3-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n3">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n6" value="«record» LoginRequest ApiGateway.Controllers.AuthenticationController" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#dae8fc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ApiGateway.Controllers.AuthenticationController.LoginRequest" sourceFiles="src/ApiGateway/Controllers/AuthenticationController.cs" link="../../src/ApiGateway/Controllers/AuthenticationController.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="210" width="520" height="172" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n7" value="+ AccountId: string {get, init} + Password: string {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n6">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="54" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n8" value="+ LoginRequest(string AccountId, string Password)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n6">
|
||||||
|
<mxGeometry as="geometry" x="0" y="136" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n6-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n6">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="136" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="136" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n9" value="«class» HealthOverviewController ApiGateway.Controllers" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#dae8fc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ApiGateway.Controllers.HealthOverviewController" sourceFiles="src/ApiGateway/Controllers/HealthOverviewController.cs" link="../../src/ApiGateway/Controllers/HealthOverviewController.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="210" width="520" height="226" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n10" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n9">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n11" value="+ HealthOverviewController(IHttpClientFactory clients) + GetOverview(Guid patientId, CancellationToken cancellationToken): Task - ForwardAsync(HttpMethod method, string path, CancellationToken cancellationToken): Task - WriteFailureAsync(int status): Task" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n9">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="108" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n9-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n9">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n12" value="«class» InsightsController ApiGateway.Controllers" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#dae8fc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ApiGateway.Controllers.InsightsController" sourceFiles="src/ApiGateway/Controllers/InsightsController.cs" link="../../src/ApiGateway/Controllers/InsightsController.cs">
|
||||||
|
<mxGeometry as="geometry" x="2050" y="210" width="520" height="244" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n13" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n12">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n14" value="+ InsightsController(IHttpClientFactory clients) + GetSummary(Guid patientId, CancellationToken cancellationToken): Task + GetTrend(Guid patientId, CancellationToken cancellationToken): Task - ForwardAsync(HttpMethod method, string path, CancellationToken cancellationToken): Task - WriteFailureAsync(int status): Task" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n12">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="126" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n12-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n12">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n15" value="«class» MeasurementGuidanceController ApiGateway.Controllers" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#dae8fc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ApiGateway.Controllers.MeasurementGuidanceController" sourceFiles="src/ApiGateway/Controllers/MeasurementGuidanceController.cs" link="../../src/ApiGateway/Controllers/MeasurementGuidanceController.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="634" width="520" height="154" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n16" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n15">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n17" value="+ Get(string? setting, string? activityCondition): IActionResult" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n15">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n15-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n15">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n18" value="«record» GuidanceSource ApiGateway.Controllers.MeasurementGuidanceController" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#dae8fc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ApiGateway.Controllers.MeasurementGuidanceController.GuidanceSource" sourceFiles="src/ApiGateway/Controllers/MeasurementGuidanceController.cs" link="../../src/ApiGateway/Controllers/MeasurementGuidanceController.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="634" width="520" height="190" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n19" value="+ Title: string {get, init} + Url: string {get, init} + UpdatedOn: string {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n18">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n20" value="+ GuidanceSource(string Title, string Url, string UpdatedOn)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n18">
|
||||||
|
<mxGeometry as="geometry" x="0" y="154" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n18-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n18">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="154" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="154" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n21" value="«record» GuidanceStep ApiGateway.Controllers.MeasurementGuidanceController" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#dae8fc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ApiGateway.Controllers.MeasurementGuidanceController.GuidanceStep" sourceFiles="src/ApiGateway/Controllers/MeasurementGuidanceController.cs" link="../../src/ApiGateway/Controllers/MeasurementGuidanceController.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="634" width="520" height="190" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n22" value="+ Order: int {get, init} + Topic: string {get, init} + Instruction: string {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n21">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n23" value="+ GuidanceStep(int Order, string Topic, string Instruction)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n21">
|
||||||
|
<mxGeometry as="geometry" x="0" y="154" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n21-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n21">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="154" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="154" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n24" value="«class» ObservationController ApiGateway.Controllers" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#dae8fc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ApiGateway.Controllers.ObservationController" sourceFiles="src/ApiGateway/Controllers/ObservationController.cs" link="../../src/ApiGateway/Controllers/ObservationController.cs">
|
||||||
|
<mxGeometry as="geometry" x="2050" y="634" width="520" height="424" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n25" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n24">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n26" value="+ ObservationController(IHttpClientFactory clients) + RecordObservation(Guid patientId, CancellationToken cancellationToken): Task + DeleteObservation(Guid observationId, CancellationToken cancellationToken): Task + UpdateObservation(Guid observationId, CancellationToken cancellationToken): Task + PatchObservation(Guid observationId, CancellationToken cancellationToken): Task + GetObservation(Guid observationId, CancellationToken cancellationToken): Task + GetLatest(Guid patientId, CancellationToken cancellationToken): Task + GetByPeriod(Guid patientId, CancellationToken cancellationToken): Task - ForwardAsync(HttpMethod method, string path, CancellationToken cancellationToken): Task - WriteFailureAsync(int status): Task" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n24">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="306" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n24-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n24">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n27" value="«class» PatientController ApiGateway.Controllers" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#dae8fc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ApiGateway.Controllers.PatientController" sourceFiles="src/ApiGateway/Controllers/PatientController.cs" link="../../src/ApiGateway/Controllers/PatientController.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="1238" width="520" height="280" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n28" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n27">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n29" value="+ PatientController(IHttpClientFactory clients) + CreatePatient(CancellationToken cancellationToken): Task + GetOwnPatient(CancellationToken cancellationToken): Task + GetPatient(Guid patientId, CancellationToken cancellationToken): Task + UpdatePatient(Guid patientId, CancellationToken cancellationToken): Task - ForwardAsync(HttpMethod method, string path, CancellationToken cancellationToken): Task - WriteFailureAsync(int status): Task" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n27">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="162" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n27-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n27">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n30" value="«class» ProfessionalController ApiGateway.Controllers" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#dae8fc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ApiGateway.Controllers.ProfessionalController" sourceFiles="src/ApiGateway/Controllers/ProfessionalController.cs" link="../../src/ApiGateway/Controllers/ProfessionalController.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="1238" width="520" height="172" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n31" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n30">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n32" value="+ ProfessionalController(ProfessionalAssignments assignments) + GetAssignedPatients(): IActionResult" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n30">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="54" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n30-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n30">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n33" value="«class» InternalServiceAuthenticationHandler ApiGateway.Security" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#f8cecc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ApiGateway.Security.InternalServiceAuthenticationHandler" sourceFiles="src/ApiGateway/Security/InternalServiceAuthenticationHandler.cs" link="../../src/ApiGateway/Security/InternalServiceAuthenticationHandler.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="1238" width="520" height="226" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n34" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n33">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n35" value="+ InternalServiceAuthenticationHandler(IOptionsMonitor<AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder encoder, IConfiguration configuration) # HandleAuthenticateAsync(): Task<AuthenticateResult>" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n33">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="108" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n33-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n33">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n36" value="«class» PatientAccessMiddleware ApiGateway.Security" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#f8cecc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ApiGateway.Security.PatientAccessMiddleware" sourceFiles="src/ApiGateway/Security/PatientAccessMiddleware.cs" link="../../src/ApiGateway/Security/PatientAccessMiddleware.cs">
|
||||||
|
<mxGeometry as="geometry" x="2050" y="1238" width="520" height="208" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n37" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n36">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n38" value="+ PatientAccessMiddleware(RequestDelegate next) + InvokeAsync(HttpContext context, IHttpClientFactory clients, IAuthorizationService authorization, ProfessionalAssignments assignments): Task" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n36">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="90" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n36-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n36">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n39" value="«class» ProfessionalAssignments ApiGateway.Security" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#f8cecc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ApiGateway.Security.ProfessionalAssignments" sourceFiles="src/ApiGateway/Security/ProfessionalAssignments.cs" link="../../src/ApiGateway/Security/ProfessionalAssignments.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="1698" width="520" height="190" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n40" value="- assignments: Dictionary<string, Guid[]> {readonly}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n39">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n41" value="+ ProfessionalAssignments(IConfiguration configuration) + GetPatients(string accountId): IReadOnlyList<Guid> + IsAssigned(string accountId, Guid patientId): bool" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n39">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n39-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n39">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n42" value="«class» PrototypeAccount ApiGateway.Security" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#f8cecc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ApiGateway.Security.PrototypeAccount" sourceFiles="src/ApiGateway/Security/PrototypeAccounts.cs" link="../../src/ApiGateway/Security/PrototypeAccounts.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="1698" width="520" height="190" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n43" value="+ AccountId: string {get, set} + Role: string {get, set} + PasswordHash: string {get, set}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n42">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n44" value="(no declared operations)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n42">
|
||||||
|
<mxGeometry as="geometry" x="0" y="154" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n42-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n42">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="154" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="154" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n45" value="«class» PrototypeAccounts ApiGateway.Security" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#f8cecc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ApiGateway.Security.PrototypeAccounts" sourceFiles="src/ApiGateway/Security/PrototypeAccounts.cs" link="../../src/ApiGateway/Security/PrototypeAccounts.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="1698" width="520" height="208" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n46" value="- accounts: Dictionary<string, PrototypeAccount> {readonly} - hasher: PasswordHasher<PrototypeAccount> {readonly} - dummy: PrototypeAccount {readonly}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n45">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n47" value="+ PrototypeAccounts(IConfiguration configuration) + Verify(string accountId, string password): PrototypeAccount?" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n45">
|
||||||
|
<mxGeometry as="geometry" x="0" y="154" width="520" height="54" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n45-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n45">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="154" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="154" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n48" value="«class» Program ApiGateway" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#f5f5f5;strokeColor=#444444;" vertex="1" parent="1" sourceType="ApiGateway.Program" sourceFiles="src/ApiGateway/Program.cs" link="../../src/ApiGateway/Program.cs">
|
||||||
|
<mxGeometry as="geometry" x="2050" y="1698" width="520" height="172" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n49" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n48">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n50" value="+ Main(string[] args): void {static} - GetBaseUri(IConfiguration configuration, string service): Uri {static}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n48">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="54" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n48-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n48">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n51" value="«framework reference» ControllerBase" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="70" y="2086" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n52" value="«framework reference» AuthenticationHandler<AuthenticationSchemeOptions>" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="730" y="2086" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n53" value="«framework reference» IHttpClientFactory" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="2086" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n54" value="«framework reference» IConfiguration" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="2050" y="2086" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n55" value="«framework reference» ILoggerFactory" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="70" y="2196" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n56" value="«framework reference» UrlEncoder" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="730" y="2196" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n57" value="«framework reference» RequestDelegate" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="2196" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-0" value="nested classifier" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n3" target="n6" relationship="nested">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-1" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n3" target="n45" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-2" value="nested classifier" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n15" target="n21" relationship="nested">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-3" value="nested classifier" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n15" target="n18" relationship="nested">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-4" value="creates / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n21" target="n18" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-5" value="creates / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n18" target="n21" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-6" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n30" target="n39" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-7" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n36" target="n39" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-8" value="accounts [0..*]; hasher [1]; dummy [1]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n45" target="n42" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-9" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n48" target="n33" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-10" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n48" target="n36" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-11" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n48" target="n39" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-12" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n48" target="n45" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-13" value="constructor dependency" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n9" target="n53" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-14" value="constructor dependency" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n12" target="n53" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-15" value="constructor dependency" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n24" target="n53" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-16" value="constructor dependency" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n27" target="n53" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-17" value="constructor dependency" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n33" target="n54" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-18" value="constructor dependency" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n39" target="n54" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-19" value="constructor dependency" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n45" target="n54" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-20" value="constructor dependency" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n33" target="n55" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-21" value="constructor dependency" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n33" target="n56" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-22" value="constructor dependency" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n36" target="n57" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-23" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n3" target="n51" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-24" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n9" target="n51" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-25" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n12" target="n51" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-26" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n15" target="n51" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-27" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n24" target="n51" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-28" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n27" target="n51" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-29" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n30" target="n51" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e57-30" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n33" target="n52" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n58" value="Source-linked classifier headers. All declared members shown; compiler-generated record members and inherited framework members are omitted. Partial declarations are merged. Framework base/reference boxes are distinguished from service-defined types. A dependency is not ownership or a cross-service in-process call. See class-diagram-coverage.md for exact file/type coverage." style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="2341" width="2580" height="110" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
</mxfile>
|
||||||
@@ -0,0 +1,359 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<mxfile host="app.diagrams.net" version="24.7.17" compressed="false">
|
||||||
|
<diagram name="HealthOverviewService — implementation classes" id="HealthOverviewService---implementation-classes">
|
||||||
|
<mxGraphModel grid="1" gridSize="10" page="1" pageWidth="2660" pageHeight="2402" pageScale="1">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="n459" value="HealthOverviewService — implementation classes" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fontSize=24;fontStyle=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="25" width="2580" height="45" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n460" value="UML: + public, - private, # protected, ~ internal. Three compartments = classifier / attributes / operations. Hollow triangle: inheritance; dashed hollow triangle: interface realization. Solid line: attribute reference; dashed arrow: dependency; filled diamond: verified owned context. Each source type has its own classifier. Primary-constructor parameters are constructor operations, not invented fields." style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="85" width="2580" height="100" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n461" value="«class» HealthOverviewController HealthOverviewService.Controllers" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#dae8fc;strokeColor=#444444;" vertex="1" parent="1" sourceType="HealthOverviewService.Controllers.HealthOverviewController" sourceFiles="src/HealthOverviewService/Controllers/HealthOverviewController.cs" link="../../src/HealthOverviewService/Controllers/HealthOverviewController.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="210" width="520" height="208" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n462" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n461">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n463" value="+ HealthOverviewController(HealthOverviewApplicationService service) + GetOverview(Guid patientId, DateTime from, DateTime to, ContextSelection selection, CancellationToken cancellationToken): Task<ActionResult<HealthOverviewDto>>" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n461">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="90" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n461-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n461">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n464" value="«class» HealthOverviewApplicationService HealthOverviewService.Application" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#e1d5e7;strokeColor=#444444;" vertex="1" parent="1" sourceType="HealthOverviewService.Application.HealthOverviewApplicationService" sourceFiles="src/HealthOverviewService/Application/HealthOverviewApplicationService.cs" link="../../src/HealthOverviewService/Application/HealthOverviewApplicationService.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="210" width="520" height="244" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n465" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n464">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n466" value="+ HealthOverviewApplicationService(PatientProfileServiceClient patients, ObservationServiceClient observations, InsightsServiceClient insights) + GetOverviewAsync(Guid patientId, DateTime from, DateTime to, ContextSelection selection, CancellationToken cancellationToken): Task<HealthOverviewDto?> - NormalizeTimestamp(DateTime value): DateTime {static}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n464">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="126" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n464-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n464">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n467" value="«record» ContextSelection HealthOverviewService.Contracts" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#ffe6cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="HealthOverviewService.Contracts.ContextSelection" sourceFiles="src/HealthOverviewService/Contracts/HealthOverviewDto.cs" link="../../src/HealthOverviewService/Contracts/HealthOverviewDto.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="210" width="520" height="172" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n468" value="+ Setting: string? {get, init} + ActivityCondition: string? {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n467">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="54" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n469" value="(no declared operations)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n467">
|
||||||
|
<mxGeometry as="geometry" x="0" y="136" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n467-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n467">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="136" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="136" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n470" value="«record» HealthInsightDto HealthOverviewService.Contracts" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#ffe6cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="HealthOverviewService.Contracts.HealthInsightDto" sourceFiles="src/HealthOverviewService/Contracts/HealthOverviewDto.cs" link="../../src/HealthOverviewService/Contracts/HealthOverviewDto.cs">
|
||||||
|
<mxGeometry as="geometry" x="2050" y="210" width="520" height="442" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n471" value="+ PatientId: Guid {get, init} + PeriodStart: DateTime {get, init} + PeriodEnd: DateTime {get, init} + AverageSystolic: decimal {get, init} + AverageDiastolic: decimal {get, init} + AveragePulse: decimal {get, init} + MinSystolic: int {get, init} + MaxSystolic: int {get, init} + MinDiastolic: int {get, init} + MaxDiastolic: int {get, init} + AppliedSelection: ContextSelection {get, init} + ContributingCount: int {get, init} + ContextExplanation: string {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n470">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="252" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n472" value="+ HealthInsightDto(Guid PatientId, DateTime PeriodStart, DateTime PeriodEnd, decimal AverageSystolic, decimal AverageDiastolic, decimal AveragePulse, int MinSystolic, int MaxSystolic, int MinDiastolic, int MaxDiastolic, ContextSelection AppliedSelection, int ContributingCount, string ContextExplanation)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n470">
|
||||||
|
<mxGeometry as="geometry" x="0" y="334" width="520" height="108" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n470-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n470">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="334" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="334" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n473" value="«record» HealthOverviewDto HealthOverviewService.Contracts" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#ffe6cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="HealthOverviewService.Contracts.HealthOverviewDto" sourceFiles="src/HealthOverviewService/Contracts/HealthOverviewDto.cs" link="../../src/HealthOverviewService/Contracts/HealthOverviewDto.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="832" width="520" height="370" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n474" value="+ Patient: PatientDto {get, init} + LatestObservation: ObservationDto? {get, init} + Insight: HealthInsightDto? {get, init} + PeriodStart: DateTime {get, init} + PeriodEnd: DateTime {get, init} + InsightSelection: ContextSelection {get, init} + InsightContributingCount: int {get, init} + LatestObservationBasis: string {get, init} + InsightExplanation: string {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n473">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="180" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n475" value="+ HealthOverviewDto(PatientDto Patient, ObservationDto? LatestObservation, HealthInsightDto? Insight, DateTime PeriodStart, DateTime PeriodEnd, ContextSelection InsightSelection, int InsightContributingCount, string LatestObservationBasis, string InsightExplanation)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n473">
|
||||||
|
<mxGeometry as="geometry" x="0" y="262" width="520" height="108" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n473-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n473">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="262" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="262" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n476" value="«record» MeasurementContextDto HealthOverviewService.Contracts" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#ffe6cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="HealthOverviewService.Contracts.MeasurementContextDto" sourceFiles="src/HealthOverviewService/Contracts/HealthOverviewDto.cs" link="../../src/HealthOverviewService/Contracts/HealthOverviewDto.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="832" width="520" height="316" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n477" value="+ Setting: string {get, init} + ActivityCondition: string {get, init} + RestDurationMinutes: decimal? {get, init} + BodyPosition: string? {get, init} + MeasuredArm: string? {get, init} + DeviceDetails: string? {get, init} + CuffDetails: string? {get, init} + AdditionalCircumstances: string? {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n476">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="162" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n478" value="+ MeasurementContextDto(string Setting, string ActivityCondition, decimal? RestDurationMinutes, string? BodyPosition, string? MeasuredArm, string? DeviceDetails, string? CuffDetails, string? AdditionalCircumstances)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n476">
|
||||||
|
<mxGeometry as="geometry" x="0" y="244" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n476-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n476">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="244" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="244" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n479" value="«record» ObservationDto HealthOverviewService.Contracts" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#ffe6cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="HealthOverviewService.Contracts.ObservationDto" sourceFiles="src/HealthOverviewService/Contracts/HealthOverviewDto.cs" link="../../src/HealthOverviewService/Contracts/HealthOverviewDto.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="832" width="520" height="334" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n480" value="+ ObservationId: Guid {get, init} + PatientId: Guid {get, init} + MeasuredAt: DateTime {get, init} + Systolic: int {get, init} + Diastolic: int {get, init} + Pulse: int {get, init} + Context: string? {get, init} + Note: string? {get, init} + MeasurementContext: MeasurementContextDto {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n479">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="180" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n481" value="+ ObservationDto(Guid ObservationId, Guid PatientId, DateTime MeasuredAt, int Systolic, int Diastolic, int Pulse, string? Context, string? Note, MeasurementContextDto MeasurementContext)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n479">
|
||||||
|
<mxGeometry as="geometry" x="0" y="262" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n479-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n479">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="262" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="262" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n482" value="«record» PatientDto HealthOverviewService.Contracts" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#ffe6cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="HealthOverviewService.Contracts.PatientDto" sourceFiles="src/HealthOverviewService/Contracts/HealthOverviewDto.cs" link="../../src/HealthOverviewService/Contracts/HealthOverviewDto.cs">
|
||||||
|
<mxGeometry as="geometry" x="2050" y="832" width="520" height="226" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n483" value="+ PatientId: Guid {get, init} + Name: string {get, init} + DateOfBirth: DateOnly {get, init} + ContactInfo: string? {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n482">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="90" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n484" value="+ PatientDto(Guid PatientId, string Name, DateOnly DateOfBirth, string? ContactInfo)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n482">
|
||||||
|
<mxGeometry as="geometry" x="0" y="172" width="520" height="54" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n482-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n482">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="172" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="172" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n485" value="«class» HttpInsightsServiceClient HealthOverviewService.Clients" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#d5e8d4;strokeColor=#444444;" vertex="1" parent="1" sourceType="HealthOverviewService.Clients.HttpInsightsServiceClient" sourceFiles="src/HealthOverviewService/Clients/InsightsServiceClient.cs" link="../../src/HealthOverviewService/Clients/InsightsServiceClient.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="1382" width="520" height="208" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n486" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n485">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n487" value="+ HttpInsightsServiceClient(HttpClient client) + GetSummaryAsync(Guid patientId, DateTime from, DateTime to, ContextSelection selection, CancellationToken cancellationToken): Task<HealthInsightDto?>" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n485">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="90" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n485-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n485">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n488" value="«class» HttpObservationServiceClient HealthOverviewService.Clients" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#d5e8d4;strokeColor=#444444;" vertex="1" parent="1" sourceType="HealthOverviewService.Clients.HttpObservationServiceClient" sourceFiles="src/HealthOverviewService/Clients/ObservationServiceClient.cs" link="../../src/HealthOverviewService/Clients/ObservationServiceClient.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="1382" width="520" height="190" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n489" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n488">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n490" value="+ HttpObservationServiceClient(HttpClient client) + GetLatestAsync(Guid patientId, CancellationToken cancellationToken): Task<ObservationDto?>" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n488">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n488-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n488">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n491" value="«class» HttpPatientProfileServiceClient HealthOverviewService.Clients" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#d5e8d4;strokeColor=#444444;" vertex="1" parent="1" sourceType="HealthOverviewService.Clients.HttpPatientProfileServiceClient" sourceFiles="src/HealthOverviewService/Clients/PatientProfileServiceClient.cs" link="../../src/HealthOverviewService/Clients/PatientProfileServiceClient.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="1382" width="520" height="190" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n492" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n491">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n493" value="+ HttpPatientProfileServiceClient(HttpClient client) + GetPatientAsync(Guid patientId, CancellationToken cancellationToken): Task<PatientDto?>" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n491">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n491-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n491">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n494" value="«abstract class» InsightsServiceClient HealthOverviewService.Clients" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#d5e8d4;strokeColor=#444444;" vertex="1" parent="1" sourceType="HealthOverviewService.Clients.InsightsServiceClient" sourceFiles="src/HealthOverviewService/Clients/InsightsServiceClient.cs" link="../../src/HealthOverviewService/Clients/InsightsServiceClient.cs">
|
||||||
|
<mxGeometry as="geometry" x="2050" y="1382" width="520" height="190" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n495" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n494">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n496" value="+ GetSummaryAsync(Guid patientId, DateTime from, DateTime to, ContextSelection selection, CancellationToken cancellationToken): Task<HealthInsightDto?> {abstract}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n494">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n494-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n494">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n497" value="«abstract class» ObservationServiceClient HealthOverviewService.Clients" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#d5e8d4;strokeColor=#444444;" vertex="1" parent="1" sourceType="HealthOverviewService.Clients.ObservationServiceClient" sourceFiles="src/HealthOverviewService/Clients/ObservationServiceClient.cs" link="../../src/HealthOverviewService/Clients/ObservationServiceClient.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="1770" width="520" height="172" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n498" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n497">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n499" value="+ GetLatestAsync(Guid patientId, CancellationToken cancellationToken): Task<ObservationDto?> {abstract}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n497">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="54" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n497-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n497">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n500" value="«abstract class» PatientProfileServiceClient HealthOverviewService.Clients" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#d5e8d4;strokeColor=#444444;" vertex="1" parent="1" sourceType="HealthOverviewService.Clients.PatientProfileServiceClient" sourceFiles="src/HealthOverviewService/Clients/PatientProfileServiceClient.cs" link="../../src/HealthOverviewService/Clients/PatientProfileServiceClient.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="1770" width="520" height="172" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n501" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n500">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n502" value="+ GetPatientAsync(Guid patientId, CancellationToken cancellationToken): Task<PatientDto?> {abstract}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n500">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="54" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n500-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n500">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n503" value="«class» Program HealthOverviewService" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#f5f5f5;strokeColor=#444444;" vertex="1" parent="1" sourceType="HealthOverviewService.Program" sourceFiles="src/HealthOverviewService/Program.cs" link="../../src/HealthOverviewService/Program.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="1770" width="520" height="172" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n504" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n503">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n505" value="+ Main(string[] args): void {static} - GetGatewayUri(IConfiguration configuration): Uri {static}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n503">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="54" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n503-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n503">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n506" value="«framework reference» ControllerBase" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="70" y="2122" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n507" value="«framework reference» HttpClient" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="730" y="2122" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-0" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n464" target="n494" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-1" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n464" target="n497" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-2" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n464" target="n500" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-3" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n464" target="n467" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-4" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n464" target="n473" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-5" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n494" target="n467" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-6" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n494" target="n470" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-7" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n485" target="n494" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-8" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n485" target="n467" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-9" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n485" target="n470" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-10" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n497" target="n479" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-11" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n488" target="n497" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-12" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n488" target="n479" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-13" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n500" target="n482" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-14" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n491" target="n500" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-15" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n491" target="n482" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-16" value="MeasurementContext [1]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n479" target="n476" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-17" value="AppliedSelection [1]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n470" target="n467" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-18" value="InsightSelection [1]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n473" target="n467" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-19" value="Patient [1]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n473" target="n482" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-20" value="LatestObservation [0..1]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n473" target="n479" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-21" value="Insight [0..1]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n473" target="n470" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-22" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n461" target="n464" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-23" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n461" target="n467" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-24" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n461" target="n473" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-25" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n503" target="n464" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-26" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n503" target="n494" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-27" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n503" target="n485" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-28" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n503" target="n497" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-29" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n503" target="n488" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-30" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n503" target="n500" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-31" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n503" target="n491" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-32" value="constructor dependency" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n485" target="n507" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-33" value="constructor dependency" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n488" target="n507" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-34" value="constructor dependency" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n491" target="n507" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e507-35" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n461" target="n506" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n508" value="Source-linked classifier headers. All declared members shown; compiler-generated record members and inherited framework members are omitted. Partial declarations are merged. Framework base/reference boxes are distinguished from service-defined types. A dependency is not ownership or a cross-service in-process call. See class-diagram-coverage.md for exact file/type coverage." style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="2267" width="2580" height="110" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
</mxfile>
|
||||||
@@ -0,0 +1,368 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<mxfile host="app.diagrams.net" version="24.7.17" compressed="false">
|
||||||
|
<diagram name="InsightsService — implementation classes" id="InsightsService---implementation-classes">
|
||||||
|
<mxGraphModel grid="1" gridSize="10" page="1" pageWidth="2660" pageHeight="2816" pageScale="1">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="n353" value="InsightsService — implementation classes" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fontSize=24;fontStyle=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="25" width="2580" height="45" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n354" value="UML: + public, - private, # protected, ~ internal. Three compartments = classifier / attributes / operations. Hollow triangle: inheritance; dashed hollow triangle: interface realization. Solid line: attribute reference; dashed arrow: dependency; filled diamond: verified owned context. Each source type has its own classifier. Primary-constructor parameters are constructor operations, not invented fields." style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="85" width="2580" height="100" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n355" value="«class» InsightsController InsightsService.Controllers" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#dae8fc;strokeColor=#444444;" vertex="1" parent="1" sourceType="InsightsService.Controllers.InsightsController" sourceFiles="src/InsightsService/Controllers/InsightsController.cs" link="../../src/InsightsService/Controllers/InsightsController.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="210" width="520" height="262" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n356" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n355">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n357" value="+ InsightsController(InsightsApplicationService service) + GetSummary(Guid patientId, DateTime from, DateTime to, ContextSelection selection, CancellationToken cancellationToken): Task<ActionResult<HealthInsightDto>> + GetTrend(Guid patientId, DateTime from, DateTime to, ContextSelection selection, CancellationToken cancellationToken): Task<ActionResult<TrendAssessment>>" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n355">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="144" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n355-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n355">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n358" value="«class» InsightsApplicationService InsightsService.Application" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#e1d5e7;strokeColor=#444444;" vertex="1" parent="1" sourceType="InsightsService.Application.InsightsApplicationService" sourceFiles="src/InsightsService/Application/InsightsApplicationService.cs" link="../../src/InsightsService/Application/InsightsApplicationService.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="210" width="520" height="298" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n359" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n358">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n360" value="+ InsightsApplicationService(ObservationServiceClient observations, InsightCalculator calculator) + GetSummaryAsync(Guid patientId, DateTime from, DateTime to, ContextSelection selection, CancellationToken cancellationToken): Task<HealthInsight?> + GetTrendAsync(Guid patientId, DateTime from, DateTime to, ContextSelection selection, CancellationToken cancellationToken): Task<TrendAssessment> - NormalizeTimestamp(DateTime value): DateTime {static}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n358">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="180" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n358-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n358">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n361" value="«record» ClinicalReference InsightsService.Domain" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#fff2cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="InsightsService.Domain.ClinicalReference" sourceFiles="src/InsightsService/Domain/TrendAssessment.cs" link="../../src/InsightsService/Domain/TrendAssessment.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="210" width="520" height="298" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n362" value="+ Scope: string {get, init} + LowerBoundary: decimal? {get, init} + LowerComparison: string? {get, init} + UpperBoundary: decimal {get, init} + UpperComparison: string {get, init} + Sources: IReadOnlyList<ReferenceSource> {get, init} + Limitation: string {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n361">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="144" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n363" value="+ ClinicalReference(string Scope, decimal? LowerBoundary, string? LowerComparison, decimal UpperBoundary, string UpperComparison, IReadOnlyList<ReferenceSource> Sources, string Limitation)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n361">
|
||||||
|
<mxGeometry as="geometry" x="0" y="226" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n361-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n361">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="226" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="226" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n364" value="«record» ComparabilityAssessment InsightsService.Domain" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#fff2cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="InsightsService.Domain.ComparabilityAssessment" sourceFiles="src/InsightsService/Domain/TrendAssessment.cs" link="../../src/InsightsService/Domain/TrendAssessment.cs">
|
||||||
|
<mxGeometry as="geometry" x="2050" y="210" width="520" height="298" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n365" value="+ Status: string {get, init} + KnownSimilarities: IReadOnlyList<string> {get, init} + KnownDifferences: IReadOnlyList<string> {get, init} + MissingDetails: IReadOnlyList<string> {get, init} + Conflicts: IReadOnlyList<string> {get, init} + Explanation: string {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n364">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="126" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n366" value="+ ComparabilityAssessment(string Status, IReadOnlyList<string> KnownSimilarities, IReadOnlyList<string> KnownDifferences, IReadOnlyList<string> MissingDetails, IReadOnlyList<string> Conflicts, string Explanation)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n364">
|
||||||
|
<mxGeometry as="geometry" x="0" y="208" width="520" height="90" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n364-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n364">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="208" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="208" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n367" value="«record» ContextSelection InsightsService.Domain" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#fff2cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="InsightsService.Domain.ContextSelection" sourceFiles="src/InsightsService/Domain/ContextSelection.cs" link="../../src/InsightsService/Domain/ContextSelection.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="688" width="520" height="172" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n368" value="+ Setting: string? {get, init} + ActivityCondition: string? {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n367">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="54" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n369" value="(no declared operations)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n367">
|
||||||
|
<mxGeometry as="geometry" x="0" y="136" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n367-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n367">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="136" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="136" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n370" value="«record» HealthInsight InsightsService.Domain" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#fff2cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="InsightsService.Domain.HealthInsight" sourceFiles="src/InsightsService/Domain/HealthInsight.cs" link="../../src/InsightsService/Domain/HealthInsight.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="688" width="520" height="442" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n371" value="+ PatientId: Guid {get, init} + PeriodStart: DateTime {get, init} + PeriodEnd: DateTime {get, init} + AverageSystolic: decimal {get, init} + AverageDiastolic: decimal {get, init} + AveragePulse: decimal {get, init} + MinSystolic: int {get, init} + MaxSystolic: int {get, init} + MinDiastolic: int {get, init} + MaxDiastolic: int {get, init} + AppliedSelection: ContextSelection {get, init} + ContributingCount: int {get, init} + ContextExplanation: string {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n370">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="252" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n372" value="+ HealthInsight(Guid PatientId, DateTime PeriodStart, DateTime PeriodEnd, decimal AverageSystolic, decimal AverageDiastolic, decimal AveragePulse, int MinSystolic, int MaxSystolic, int MinDiastolic, int MaxDiastolic, ContextSelection AppliedSelection, int ContributingCount, string ContextExplanation)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n370">
|
||||||
|
<mxGeometry as="geometry" x="0" y="334" width="520" height="108" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n370-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n370">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="334" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="334" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n373" value="«class» InsightCalculator InsightsService.Domain" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#fff2cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="InsightsService.Domain.InsightCalculator" sourceFiles="src/InsightsService/Domain/InsightCalculator.Trends.cs|src/InsightsService/Domain/InsightCalculator.cs" link="../../src/InsightsService/Domain/InsightCalculator.Trends.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="688" width="520" height="532" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n374" value="- GeneralLimits: string {static}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n373">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n375" value="+ CalculateTrend(Guid patientId, DateTime from, DateTime to, IReadOnlyList<ObservationDto> observations, ContextSelection selection): TrendAssessment - AssessMeasurement(string metric, string unit, IReadOnlyList<ObservationDto> observations, Func<ObservationDto, int> value, ComparabilityAssessment comparability): MeasurementAssessment {static} - SelectReference(string metric, IReadOnlyList<ObservationDto> observations, ComparabilityAssessment comparability): ClinicalReference? {static} - IsHigh(decimal value, ClinicalReference reference): bool {static} - IsLow(decimal value, ClinicalReference reference): bool {static} - Round(decimal value): decimal {static} - Format(decimal value): string {static} - AssessComparability(IReadOnlyList<ObservationDto> observations): ComparabilityAssessment {static} + CalculateSummary(Guid patientId, DateTime from, DateTime to, IReadOnlyList<ObservationDto> observations, ContextSelection selection): HealthInsight? - DescribeContext(IReadOnlyList<ObservationDto> observations): string {static} - Counts(IEnumerable<string> values): string {static}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n373">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="414" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n373-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n373">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n376" value="«record» MeasurementAssessment InsightsService.Domain" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#fff2cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="InsightsService.Domain.MeasurementAssessment" sourceFiles="src/InsightsService/Domain/TrendAssessment.cs" link="../../src/InsightsService/Domain/TrendAssessment.cs">
|
||||||
|
<mxGeometry as="geometry" x="2050" y="688" width="520" height="532" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n377" value="+ Metric: string {get, init} + Unit: string {get, init} + Mean: decimal? {get, init} + Minimum: int? {get, init} + Maximum: int? {get, init} + Range: int? {get, init} + DistinctTimestampCount: int {get, init} + Direction: string {get, init} + OverallDirection: string {get, init} + SlopePerDay: decimal? {get, init} + ReversalCount: int {get, init} + TotalSuccessiveChange: decimal? {get, init} + NumericalExplanation: string {get, init} + Reference: ClinicalReference? {get, init} + ReferenceComparison: string {get, init} + Interpretation: string {get, init} + Hint: string {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n376">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="324" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n378" value="+ MeasurementAssessment(string Metric, string Unit, decimal? Mean, int? Minimum, int? Maximum, int? Range, int DistinctTimestampCount, string Direction, string OverallDirection, decimal? SlopePerDay, int ReversalCount, decimal? TotalSuccessiveChange, string NumericalExplanation, ClinicalReference? Reference, string ReferenceComparison, string Interpretation, string Hint)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n376">
|
||||||
|
<mxGeometry as="geometry" x="0" y="406" width="520" height="126" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n376-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n376">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="406" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="406" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n379" value="«record» ReferenceSource InsightsService.Domain" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#fff2cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="InsightsService.Domain.ReferenceSource" sourceFiles="src/InsightsService/Domain/TrendAssessment.cs" link="../../src/InsightsService/Domain/TrendAssessment.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="1400" width="520" height="208" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n380" value="+ Title: string {get, init} + Url: string {get, init} + Updated: string {get, init} + Reviewed: string {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n379">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="90" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n381" value="+ ReferenceSource(string Title, string Url, string Updated, string Reviewed)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n379">
|
||||||
|
<mxGeometry as="geometry" x="0" y="172" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n379-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n379">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="172" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="172" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n382" value="«record» TrendAssessment InsightsService.Domain" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#fff2cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="InsightsService.Domain.TrendAssessment" sourceFiles="src/InsightsService/Domain/TrendAssessment.cs" link="../../src/InsightsService/Domain/TrendAssessment.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="1400" width="520" height="370" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n383" value="+ PatientId: Guid {get, init} + PeriodStart: DateTime {get, init} + PeriodEnd: DateTime {get, init} + AppliedSelection: ContextSelection {get, init} + ContributingCount: int {get, init} + Comparability: ComparabilityAssessment {get, init} + Systolic: MeasurementAssessment {get, init} + Diastolic: MeasurementAssessment {get, init} + Pulse: MeasurementAssessment {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n382">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="180" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n384" value="+ TrendAssessment(Guid PatientId, DateTime PeriodStart, DateTime PeriodEnd, ContextSelection AppliedSelection, int ContributingCount, ComparabilityAssessment Comparability, MeasurementAssessment Systolic, MeasurementAssessment Diastolic, MeasurementAssessment Pulse)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n382">
|
||||||
|
<mxGeometry as="geometry" x="0" y="262" width="520" height="108" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n382-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n382">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="262" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="262" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n385" value="«record» HealthInsightDto InsightsService.Contracts" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#ffe6cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="InsightsService.Contracts.HealthInsightDto" sourceFiles="src/InsightsService/Contracts/HealthInsightDto.cs" link="../../src/InsightsService/Contracts/HealthInsightDto.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="1400" width="520" height="442" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n386" value="+ PatientId: Guid {get, init} + PeriodStart: DateTime {get, init} + PeriodEnd: DateTime {get, init} + AverageSystolic: decimal {get, init} + AverageDiastolic: decimal {get, init} + AveragePulse: decimal {get, init} + MinSystolic: int {get, init} + MaxSystolic: int {get, init} + MinDiastolic: int {get, init} + MaxDiastolic: int {get, init} + AppliedSelection: ContextSelection {get, init} + ContributingCount: int {get, init} + ContextExplanation: string {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n385">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="252" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n387" value="+ HealthInsightDto(Guid PatientId, DateTime PeriodStart, DateTime PeriodEnd, decimal AverageSystolic, decimal AverageDiastolic, decimal AveragePulse, int MinSystolic, int MaxSystolic, int MinDiastolic, int MaxDiastolic, ContextSelection AppliedSelection, int ContributingCount, string ContextExplanation)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n385">
|
||||||
|
<mxGeometry as="geometry" x="0" y="334" width="520" height="108" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n385-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n385">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="334" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="334" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n388" value="«record» MeasurementContextDto InsightsService.Contracts" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#ffe6cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="InsightsService.Contracts.MeasurementContextDto" sourceFiles="src/InsightsService/Contracts/ObservationDto.cs" link="../../src/InsightsService/Contracts/ObservationDto.cs">
|
||||||
|
<mxGeometry as="geometry" x="2050" y="1400" width="520" height="316" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n389" value="+ Setting: string? {get, init} + ActivityCondition: string? {get, init} + RestDurationMinutes: decimal? {get, init} + BodyPosition: string? {get, init} + MeasuredArm: string? {get, init} + DeviceDetails: string? {get, init} + CuffDetails: string? {get, init} + AdditionalCircumstances: string? {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n388">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="162" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n390" value="+ MeasurementContextDto(string? Setting, string? ActivityCondition, decimal? RestDurationMinutes, string? BodyPosition, string? MeasuredArm, string? DeviceDetails, string? CuffDetails, string? AdditionalCircumstances)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n388">
|
||||||
|
<mxGeometry as="geometry" x="0" y="244" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n388-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n388">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="244" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="244" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n391" value="«record» ObservationDto InsightsService.Contracts" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#ffe6cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="InsightsService.Contracts.ObservationDto" sourceFiles="src/InsightsService/Contracts/ObservationDto.cs" link="../../src/InsightsService/Contracts/ObservationDto.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="2022" width="520" height="334" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n392" value="+ ObservationId: Guid {get, init} + PatientId: Guid {get, init} + MeasuredAt: DateTime {get, init} + Systolic: int {get, init} + Diastolic: int {get, init} + Pulse: int {get, init} + MeasurementContext: MeasurementContextDto? {get, init} + Context: string? {get, init} + Note: string? {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n391">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="180" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n393" value="+ ObservationDto(Guid ObservationId, Guid PatientId, DateTime MeasuredAt, int Systolic, int Diastolic, int Pulse, MeasurementContextDto? MeasurementContext = null, string? Context = null, string? Note = null)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n391">
|
||||||
|
<mxGeometry as="geometry" x="0" y="262" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n391-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n391">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="262" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="262" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n394" value="«class» HttpObservationServiceClient InsightsService.Clients" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#d5e8d4;strokeColor=#444444;" vertex="1" parent="1" sourceType="InsightsService.Clients.HttpObservationServiceClient" sourceFiles="src/InsightsService/Clients/HttpObservationServiceClient.cs" link="../../src/InsightsService/Clients/HttpObservationServiceClient.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="2022" width="520" height="208" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n395" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n394">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n396" value="+ HttpObservationServiceClient(HttpClient client) + GetByPeriodAsync(Guid patientId, DateTime from, DateTime to, ContextSelection selection, CancellationToken cancellationToken): Task<List<ObservationDto>>" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n394">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="90" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n394-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n394">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n397" value="«interface» ObservationServiceClient InsightsService.Clients" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#d5e8d4;strokeColor=#444444;" vertex="1" parent="1" sourceType="InsightsService.Clients.ObservationServiceClient" sourceFiles="src/InsightsService/Clients/ObservationServiceClient.cs" link="../../src/InsightsService/Clients/ObservationServiceClient.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="2022" width="520" height="190" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n398" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n397">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n399" value="+ GetByPeriodAsync(Guid patientId, DateTime from, DateTime to, ContextSelection selection, CancellationToken cancellationToken): Task<List<ObservationDto>> {abstract}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n397">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n397-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n397">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n400" value="«class» Program InsightsService" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#f5f5f5;strokeColor=#444444;" vertex="1" parent="1" sourceType="InsightsService.Program" sourceFiles="src/InsightsService/Program.cs" link="../../src/InsightsService/Program.cs">
|
||||||
|
<mxGeometry as="geometry" x="2050" y="2022" width="520" height="172" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n401" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n400">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n402" value="+ Main(string[] args): void {static} - GetGatewayUri(IConfiguration configuration): Uri {static}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n400">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="54" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n400-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n400">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n403" value="«framework reference» ControllerBase" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="70" y="2536" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n404" value="«framework reference» HttpClient" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="730" y="2536" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-0" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n358" target="n397" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-1" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n358" target="n367" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-2" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n358" target="n370" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-3" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n358" target="n373" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-4" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n358" target="n382" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-5" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=block;endFill=0;" edge="1" parent="1" source="n394" target="n397" relationship="realization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-6" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n394" target="n391" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-7" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n394" target="n367" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-8" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n397" target="n391" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-9" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n397" target="n367" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-10" value="AppliedSelection [1]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n385" target="n367" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-11" value="MeasurementContext [0..1]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n391" target="n388" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-12" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n355" target="n358" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-13" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n355" target="n385" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-14" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n355" target="n367" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-15" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n355" target="n382" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-16" value="AppliedSelection [1]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n370" target="n367" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-17" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n373" target="n391" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-18" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n373" target="n367" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-19" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n373" target="n370" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-20" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n373" target="n382" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-21" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n373" target="n364" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-22" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n373" target="n376" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-23" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n373" target="n361" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-24" value="AppliedSelection [1]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n382" target="n367" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-25" value="Comparability [1]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n382" target="n364" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-26" value="Systolic [1]; Diastolic [1]; Pulse [1]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n382" target="n376" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-27" value="Reference [0..1]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n376" target="n361" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-28" value="Sources [0..*]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n361" target="n379" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-29" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n400" target="n358" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-30" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n400" target="n394" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-31" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n400" target="n373" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-32" value="constructor dependency" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n394" target="n404" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e404-33" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n355" target="n403" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n405" value="Source-linked classifier headers. All declared members shown; compiler-generated record members and inherited framework members are omitted. Partial declarations are merged. Framework base/reference boxes are distinguished from service-defined types. A dependency is not ownership or a cross-service in-process call. See class-diagram-coverage.md for exact file/type coverage." style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="2681" width="2580" height="110" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
</mxfile>
|
||||||
@@ -0,0 +1,436 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<mxfile host="app.diagrams.net" version="24.7.17" compressed="false">
|
||||||
|
<diagram name="ObservationService — implementation classes" id="ObservationService---implementation-classes">
|
||||||
|
<mxGraphModel grid="1" gridSize="10" page="1" pageWidth="2660" pageHeight="2888" pageScale="1">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="n225" value="ObservationService — implementation classes" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fontSize=24;fontStyle=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="25" width="2580" height="45" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n226" value="UML: + public, - private, # protected, ~ internal. Three compartments = classifier / attributes / operations. Hollow triangle: inheritance; dashed hollow triangle: interface realization. Solid line: attribute reference; dashed arrow: dependency; filled diamond: verified owned context. Each source type has its own classifier. Primary-constructor parameters are constructor operations, not invented fields." style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="85" width="2580" height="100" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n227" value="«class» ObservationController ObservationService.Controllers" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#dae8fc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ObservationService.Controllers.ObservationController" sourceFiles="src/ObservationService/Controllers/ObservationController.cs" link="../../src/ObservationService/Controllers/ObservationController.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="210" width="520" height="496" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n228" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n227">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n229" value="+ ObservationController(ObservationApplicationService service) + RecordObservation(Guid patientId, RecordObservationRequest request, CancellationToken cancellationToken): Task<ActionResult<ObservationDto>> + DeleteObservation(Guid observationId, CancellationToken cancellationToken): Task<IActionResult> + UpdateObservation(Guid observationId, UpdateObservationRequest request, CancellationToken cancellationToken): Task<ActionResult<ObservationDto>> + PatchObservation(Guid observationId, PatchObservationRequest request, CancellationToken cancellationToken): Task<ActionResult<ObservationDto>> + GetObservation(Guid observationId, CancellationToken cancellationToken): Task<ActionResult<ObservationDto>> + GetLatest(Guid patientId, CancellationToken cancellationToken): Task<ActionResult<ObservationDto>> + GetByPeriod(Guid patientId, DateTime from, DateTime to, ContextSelection selection, CancellationToken cancellationToken): Task<ActionResult<List<ObservationDto>>> - ToDto(BloodPressureObservation observation): ObservationDto {static}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n227">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="378" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n227-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n227">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n230" value="«class» ObservationApplicationService ObservationService.Application" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#e1d5e7;strokeColor=#444444;" vertex="1" parent="1" sourceType="ObservationService.Application.ObservationApplicationService" sourceFiles="src/ObservationService/Application/ObservationApplicationService.cs" link="../../src/ObservationService/Application/ObservationApplicationService.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="210" width="520" height="460" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n231" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n230">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n232" value="+ ObservationApplicationService(ObservationRepository repository, IHttpClientFactory clients) + DeleteAsync(Guid observationId, CancellationToken cancellationToken): Task<bool> + UpdateAsync(Guid observationId, UpdateObservationRequest request, CancellationToken cancellationToken): Task<BloodPressureObservation?> + PatchAsync(Guid observationId, PatchObservationRequest request, CancellationToken cancellationToken): Task<BloodPressureObservation?> + RecordAsync(Guid patientId, RecordObservationRequest request, CancellationToken cancellationToken): Task<BloodPressureObservation?> + GetByIdAsync(Guid observationId, CancellationToken cancellationToken): Task<BloodPressureObservation?> + GetLatestAsync(Guid patientId, CancellationToken cancellationToken): Task<BloodPressureObservation?> + GetByPeriodAsync(Guid patientId, DateTime from, DateTime to, ContextSelection selection, CancellationToken cancellationToken): Task<List<BloodPressureObservation>> - NormalizeTimestamp(DateTime timestamp): DateTime {static}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n230">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="342" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n230-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n230">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n233" value="«interface» ObservationRepository ObservationService.Application" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#e1d5e7;strokeColor=#444444;" vertex="1" parent="1" sourceType="ObservationService.Application.ObservationRepository" sourceFiles="src/ObservationService/Application/ObservationRepository.cs" link="../../src/ObservationService/Application/ObservationRepository.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="210" width="520" height="388" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n234" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n233">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n235" value="+ DeleteAsync(Guid observationId, CancellationToken cancellationToken): Task<bool> {abstract} + UpdateAsync(Guid observationId, PatchObservationRequest request, DateTime updatedAt, CancellationToken cancellationToken): Task<BloodPressureObservation?> {abstract} + SaveAsync(BloodPressureObservation observation, CancellationToken cancellationToken): Task<BloodPressureObservation> {abstract} + FindByIdAsync(Guid observationId, CancellationToken cancellationToken): Task<BloodPressureObservation?> {abstract} + FindLatestByPatientIdAsync(Guid patientId, CancellationToken cancellationToken): Task<BloodPressureObservation?> {abstract} + FindByPatientIdAndPeriodAsync(Guid patientId, DateTime from, DateTime to, ContextSelection selection, CancellationToken cancellationToken): Task<List<BloodPressureObservation>> {abstract}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n233">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="270" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n233-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n233">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n236" value="«class» ObservationDbContext ObservationService.Persistence" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#d5e8d4;strokeColor=#444444;" vertex="1" parent="1" sourceType="ObservationService.Persistence.ObservationDbContext" sourceFiles="src/ObservationService/Persistence/ObservationDbContext.cs" link="../../src/ObservationService/Persistence/ObservationDbContext.cs">
|
||||||
|
<mxGeometry as="geometry" x="2050" y="210" width="520" height="190" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n237" value="+ Observations: DbSet<BloodPressureObservation> {get}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n236">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n238" value="+ ObservationDbContext(DbContextOptions<ObservationDbContext> options) # OnModelCreating(ModelBuilder modelBuilder): void" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n236">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n236-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n236">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n239" value="«class» SqlObservationRepository ObservationService.Persistence" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#d5e8d4;strokeColor=#444444;" vertex="1" parent="1" sourceType="ObservationService.Persistence.SqlObservationRepository" sourceFiles="src/ObservationService/Persistence/SqlObservationRepository.cs" link="../../src/ObservationService/Persistence/SqlObservationRepository.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="886" width="520" height="406" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n240" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n239">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n241" value="+ SqlObservationRepository(ObservationDbContext db) + DeleteAsync(Guid observationId, CancellationToken cancellationToken): Task<bool> + UpdateAsync(Guid observationId, PatchObservationRequest request, DateTime updatedAt, CancellationToken cancellationToken): Task<BloodPressureObservation?> + SaveAsync(BloodPressureObservation observation, CancellationToken cancellationToken): Task<BloodPressureObservation> + FindByIdAsync(Guid observationId, CancellationToken cancellationToken): Task<BloodPressureObservation?> + FindLatestByPatientIdAsync(Guid patientId, CancellationToken cancellationToken): Task<BloodPressureObservation?> + FindByPatientIdAndPeriodAsync(Guid patientId, DateTime from, DateTime to, ContextSelection selection, CancellationToken cancellationToken): Task<List<BloodPressureObservation>>" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n239">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="288" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n239-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n239">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n242" value="«class» BloodPressureObservation ObservationService.Domain" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#fff2cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ObservationService.Domain.BloodPressureObservation" sourceFiles="src/ObservationService/Domain/BloodPressureObservation.cs" link="../../src/ObservationService/Domain/BloodPressureObservation.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="886" width="520" height="334" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n243" value="+ ObservationId: Guid {get, set} + PatientId: Guid {get, set} + MeasuredAt: DateTime {get, set} + Systolic: int {get, set} + Diastolic: int {get, set} + Pulse: int {get, set} + MeasurementContext: MeasurementContext {get, set} + Context: string? {get, set} + Note: string? {get, set} + CreatedAt: DateTime {get, set} + UpdatedAt: DateTime {get, set}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n242">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="216" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n244" value="(no declared operations)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n242">
|
||||||
|
<mxGeometry as="geometry" x="0" y="298" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n242-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n242">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="298" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="298" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n245" value="«record» ContextSelection ObservationService.Domain" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#fff2cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ObservationService.Domain.ContextSelection" sourceFiles="src/ObservationService/Domain/ContextSelection.cs" link="../../src/ObservationService/Domain/ContextSelection.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="886" width="520" height="172" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n246" value="+ Setting: string? {get, init} + ActivityCondition: string? {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n245">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="54" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n247" value="(no declared operations)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n245">
|
||||||
|
<mxGeometry as="geometry" x="0" y="136" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n245-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n245">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="136" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="136" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n248" value="«record» MeasurementContext ObservationService.Domain" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#fff2cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ObservationService.Domain.MeasurementContext" sourceFiles="src/ObservationService/Domain/MeasurementContext.cs" link="../../src/ObservationService/Domain/MeasurementContext.cs">
|
||||||
|
<mxGeometry as="geometry" x="2050" y="886" width="520" height="280" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n249" value="+ Setting: string? {get, init} + ActivityCondition: string? {get, init} + RestDurationMinutes: decimal? {get, init} + BodyPosition: string? {get, init} + MeasuredArm: string? {get, init} + DeviceDetails: string? {get, init} + CuffDetails: string? {get, init} + AdditionalCircumstances: string? {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n248">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="162" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n250" value="(no declared operations)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n248">
|
||||||
|
<mxGeometry as="geometry" x="0" y="244" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n248-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n248">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="244" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="244" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n251" value="«record» MeasurementContextPatch ObservationService.Contracts" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#ffe6cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ObservationService.Contracts.MeasurementContextPatch" sourceFiles="src/ObservationService/Contracts/MeasurementContextPatch.cs" link="../../src/ObservationService/Contracts/MeasurementContextPatch.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="1472" width="520" height="586" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n252" value="- setting: string? + Setting: string? {get, init} + SettingSpecified: bool {get, private set} - activityCondition: string? + ActivityCondition: string? {get, init} + ActivityConditionSpecified: bool {get, private set} - restDurationMinutes: decimal? + RestDurationMinutes: decimal? {get, init} + RestDurationMinutesSpecified: bool {get, private set} - bodyPosition: string? + BodyPosition: string? {get, init} + BodyPositionSpecified: bool {get, private set} - measuredArm: string? + MeasuredArm: string? {get, init} + MeasuredArmSpecified: bool {get, private set} - deviceDetails: string? + DeviceDetails: string? {get, init} + DeviceDetailsSpecified: bool {get, private set} - cuffDetails: string? + CuffDetails: string? {get, init} + CuffDetailsSpecified: bool {get, private set} - additionalCircumstances: string? + AdditionalCircumstances: string? {get, init} + AdditionalCircumstancesSpecified: bool {get, private set} + HasChanges: bool {get}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n251">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="468" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n253" value="(no declared operations)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n251">
|
||||||
|
<mxGeometry as="geometry" x="0" y="550" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n251-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n251">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="550" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="550" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n254" value="«record» ObservationDto ObservationService.Contracts" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#ffe6cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ObservationService.Contracts.ObservationDto" sourceFiles="src/ObservationService/Contracts/ObservationDto.cs" link="../../src/ObservationService/Contracts/ObservationDto.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="1472" width="520" height="334" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n255" value="+ ObservationId: Guid {get, init} + PatientId: Guid {get, init} + MeasuredAt: DateTime {get, init} + Systolic: int {get, init} + Diastolic: int {get, init} + Pulse: int {get, init} + Context: string? {get, init} + Note: string? {get, init} + MeasurementContext: MeasurementContext {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n254">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="180" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n256" value="+ ObservationDto(Guid ObservationId, Guid PatientId, DateTime MeasuredAt, int Systolic, int Diastolic, int Pulse, string? Context, string? Note, MeasurementContext MeasurementContext)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n254">
|
||||||
|
<mxGeometry as="geometry" x="0" y="262" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n254-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n254">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="262" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="262" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n257" value="«record» PatchObservationRequest ObservationService.Contracts" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#ffe6cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ObservationService.Contracts.PatchObservationRequest" sourceFiles="src/ObservationService/Contracts/PatchObservationRequest.cs" link="../../src/ObservationService/Contracts/PatchObservationRequest.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="1472" width="520" height="478" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n258" value="- systolic: int? + Systolic: int? {get, init} + SystolicSpecified: bool {get, private set} - diastolic: int? + Diastolic: int? {get, init} + DiastolicSpecified: bool {get, private set} - pulse: int? + Pulse: int? {get, init} + PulseSpecified: bool {get, private set} - measurementContext: MeasurementContextPatch? + MeasurementContext: MeasurementContextPatch? {get, init} + MeasurementContextSpecified: bool {get, private set} - context: string? + Context: string? {get, init} + ContextSpecified: bool {get, private set} - note: string? + Note: string? {get, init} + NoteSpecified: bool {get, private set}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n257">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="342" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n259" value="+ Validate(ValidationContext validationContext): IEnumerable<ValidationResult>" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n257">
|
||||||
|
<mxGeometry as="geometry" x="0" y="424" width="520" height="54" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n257-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n257">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="424" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="424" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n260" value="«record» RecordObservationRequest ObservationService.Contracts" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#ffe6cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ObservationService.Contracts.RecordObservationRequest" sourceFiles="src/ObservationService/Contracts/RecordObservationRequest.cs" link="../../src/ObservationService/Contracts/RecordObservationRequest.cs">
|
||||||
|
<mxGeometry as="geometry" x="2050" y="1472" width="520" height="262" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n261" value="+ MeasuredAt: DateTime? {get, init} + Systolic: int? {get, init} + Diastolic: int? {get, init} + Pulse: int? {get, init} + MeasurementContext: MeasurementContext? {get, init} + Context: string? {get, init} + Note: string? {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n260">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="144" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n262" value="(no declared operations)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n260">
|
||||||
|
<mxGeometry as="geometry" x="0" y="226" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n260-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n260">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="226" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="226" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n263" value="«record» UpdateObservationRequest ObservationService.Contracts" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#ffe6cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="ObservationService.Contracts.UpdateObservationRequest" sourceFiles="src/ObservationService/Contracts/UpdateObservationRequest.cs" link="../../src/ObservationService/Contracts/UpdateObservationRequest.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="2238" width="520" height="190" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n264" value="+ Systolic: int? {get, init} + Diastolic: int? {get, init} + Pulse: int? {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n263">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n265" value="(no declared operations)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n263">
|
||||||
|
<mxGeometry as="geometry" x="0" y="154" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n263-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n263">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="154" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="154" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n266" value="«class» Program ObservationService" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#f5f5f5;strokeColor=#444444;" vertex="1" parent="1" sourceType="ObservationService.Program" sourceFiles="src/ObservationService/Program.cs" link="../../src/ObservationService/Program.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="2238" width="520" height="172" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n267" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n266">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n268" value="+ Main(string[] args): Task {static} - GetGatewayUri(IConfiguration configuration): Uri {static}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n266">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="54" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n266-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n266">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n269" value="«framework reference» IValidatableObject" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="70" y="2608" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n270" value="«framework reference» ControllerBase" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="730" y="2608" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n271" value="«framework reference» DbContext" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="2608" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n272" value="«framework reference» IHttpClientFactory" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="2050" y="2608" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-0" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n230" target="n233" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-1" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n230" target="n257" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-2" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n230" target="n260" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-3" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n230" target="n263" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-4" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n230" target="n242" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-5" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n230" target="n245" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-6" value="creates / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n230" target="n248" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-7" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n233" target="n257" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-8" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n233" target="n242" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-9" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n233" target="n245" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-10" value="MeasurementContext [1]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n254" target="n248" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-11" value="measurementContext [0..1]; MeasurementContext [0..1]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n257" target="n251" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-12" value="MeasurementContext [0..1]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n257" target="n248" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-13" value="MeasurementContext [0..1]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n260" target="n248" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-14" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n227" target="n230" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-15" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n227" target="n254" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-16" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n227" target="n257" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-17" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n227" target="n260" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-18" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n227" target="n263" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-19" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n227" target="n242" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-20" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n227" target="n245" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-21" value="MeasurementContext [1]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;startArrow=diamond;startFill=1;endArrow=none;" edge="1" parent="1" source="n242" target="n248" relationship="composition">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-25" value="Observations [0..*]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n236" target="n242" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-26" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=block;endFill=0;" edge="1" parent="1" source="n239" target="n233" relationship="realization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-27" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n239" target="n257" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-28" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n239" target="n242" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-29" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n239" target="n245" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-30" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n239" target="n236" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-31" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n266" target="n230" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-32" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n266" target="n236" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-33" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n266" target="n239" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-34" value="constructor dependency" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n230" target="n272" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-35" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=block;endFill=0;" edge="1" parent="1" source="n257" target="n269" relationship="realization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-36" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n227" target="n270" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e272-37" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n236" target="n271" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n273" value="Source-linked classifier headers. All declared members shown; compiler-generated record members and inherited framework members are omitted. Partial declarations are merged. Framework base/reference boxes are distinguished from service-defined types. A dependency is not ownership or a cross-service in-process call. See class-diagram-coverage.md for exact file/type coverage." style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="2753" width="2580" height="110" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
<diagram name="ObservationService — EF migration classes" id="ObservationService---EF-migration-classes">
|
||||||
|
<mxGraphModel grid="1" gridSize="10" page="1" pageWidth="2660" pageHeight="970" pageScale="1">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="n323" value="ObservationService — EF migration classes" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fontSize=24;fontStyle=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="25" width="2580" height="45" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n324" value="UML: + public, - private, # protected, ~ internal. Three compartments = classifier / attributes / operations. Hollow triangle: inheritance; dashed hollow triangle: interface realization. Solid line: attribute reference; dashed arrow: dependency; filled diamond: verified owned context. Each source type has its own classifier. Primary-constructor parameters are constructor operations, not invented fields." style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="85" width="2580" height="100" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n325" value="«class» InitialObservationSchema ObservationService.Persistence.Migrations" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#d5e8d4;strokeColor=#444444;" vertex="1" parent="1" sourceType="ObservationService.Persistence.Migrations.InitialObservationSchema" sourceFiles="src/ObservationService/Persistence/Migrations/20261001095222_InitialObservationSchema.Designer.cs|src/ObservationService/Persistence/Migrations/20261001095222_InitialObservationSchema.cs" link="../../src/ObservationService/Persistence/Migrations/20261001095222_InitialObservationSchema.Designer.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="210" width="520" height="190" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n326" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n325">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n327" value="# BuildTargetModel(ModelBuilder modelBuilder): void # Up(MigrationBuilder migrationBuilder): void # Down(MigrationBuilder migrationBuilder): void" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n325">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n325-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n325">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n328" value="«class» ObservationDbContextModelSnapshot ObservationService.Persistence.Migrations" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#d5e8d4;strokeColor=#444444;" vertex="1" parent="1" sourceType="ObservationService.Persistence.Migrations.ObservationDbContextModelSnapshot" sourceFiles="src/ObservationService/Persistence/Migrations/ObservationDbContextModelSnapshot.cs" link="../../src/ObservationService/Persistence/Migrations/ObservationDbContextModelSnapshot.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="210" width="520" height="154" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n329" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n328">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n330" value="# BuildModel(ModelBuilder modelBuilder): void" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n328">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n328-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n328">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n331" value="«class» RecordedMeasurementContext ObservationService.Persistence.Migrations" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#d5e8d4;strokeColor=#444444;" vertex="1" parent="1" sourceType="ObservationService.Persistence.Migrations.RecordedMeasurementContext" sourceFiles="src/ObservationService/Persistence/Migrations/20261005094632_RecordedMeasurementContext.Designer.cs|src/ObservationService/Persistence/Migrations/20261005094632_RecordedMeasurementContext.cs" link="../../src/ObservationService/Persistence/Migrations/20261005094632_RecordedMeasurementContext.Designer.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="210" width="520" height="190" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n332" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n331">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n333" value="# BuildTargetModel(ModelBuilder modelBuilder): void # Up(MigrationBuilder migrationBuilder): void # Down(MigrationBuilder migrationBuilder): void" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n331">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n331-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n331">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n334" value="«framework reference» Migration" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="70" y="580" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n335" value="«framework reference» ModelSnapshot" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="730" y="580" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n336" value="«same-service type, other page» ObservationDbContext" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1" referenceType="ObservationService.Persistence.ObservationDbContext">
|
||||||
|
<mxGeometry as="geometry" x="70" y="690" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e336-22" value="creates / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n325" target="n336" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e336-23" value="creates / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n331" target="n336" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e336-24" value="creates / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n328" target="n336" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e336-34" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n325" target="n334" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e336-35" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n331" target="n334" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e336-36" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n328" target="n335" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n337" value="Source-linked classifier headers. All declared members shown; compiler-generated record members and inherited framework members are omitted. Partial declarations are merged. Framework base/reference boxes are distinguished from service-defined types. A dependency is not ownership or a cross-service in-process call. See class-diagram-coverage.md for exact file/type coverage." style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="835" width="2580" height="110" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
</mxfile>
|
||||||
@@ -0,0 +1,349 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<mxfile host="app.diagrams.net" version="24.7.17" compressed="false">
|
||||||
|
<diagram name="PatientProfileService — implementation classes" id="PatientProfileService---implementation-classes">
|
||||||
|
<mxGraphModel grid="1" gridSize="10" page="1" pageWidth="2660" pageHeight="1870" pageScale="1">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="n117" value="PatientProfileService — implementation classes" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fontSize=24;fontStyle=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="25" width="2580" height="45" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n118" value="UML: + public, - private, # protected, ~ internal. Three compartments = classifier / attributes / operations. Hollow triangle: inheritance; dashed hollow triangle: interface realization. Solid line: attribute reference; dashed arrow: dependency; filled diamond: verified owned context. Each source type has its own classifier. Primary-constructor parameters are constructor operations, not invented fields." style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="85" width="2580" height="100" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n119" value="«class» PatientController PatientProfileService.Controllers" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#dae8fc;strokeColor=#444444;" vertex="1" parent="1" sourceType="PatientProfileService.Controllers.PatientController" sourceFiles="src/PatientProfileService/Controllers/PatientController.cs" link="../../src/PatientProfileService/Controllers/PatientController.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="210" width="520" height="316" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n120" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n119">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n121" value="+ PatientController(PatientApplicationService service) + CreatePatient(CreatePatientRequest request, CancellationToken cancellationToken): Task<ActionResult<PatientDto>> + GetByAccount(string accountId, CancellationToken cancellationToken): Task<ActionResult<PatientDto>> + GetPatient(Guid patientId, CancellationToken cancellationToken): Task<ActionResult<PatientDto>> + UpdatePatient(Guid patientId, UpdatePatientRequest request, CancellationToken cancellationToken): Task<ActionResult<PatientDto>> - ToDto(Patient patient): PatientDto {static}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n119">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="198" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n119-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n119">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n122" value="«class» PatientApplicationService PatientProfileService.Application" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#e1d5e7;strokeColor=#444444;" vertex="1" parent="1" sourceType="PatientProfileService.Application.PatientApplicationService" sourceFiles="src/PatientProfileService/Application/PatientApplicationService.cs" link="../../src/PatientProfileService/Application/PatientApplicationService.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="210" width="520" height="298" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n123" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n122">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n124" value="+ PatientApplicationService(PatientRepository repository) + CreatePatientAsync(CreatePatientRequest request, string accountId, CancellationToken cancellationToken): Task<Patient> + GetByAccountAsync(string accountId, CancellationToken cancellationToken): Task<Patient?> + GetPatientAsync(Guid patientId, CancellationToken cancellationToken): Task<Patient?> + UpdatePatientAsync(Guid patientId, UpdatePatientRequest request, CancellationToken cancellationToken): Task<Patient?>" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n122">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="180" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n122-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n122">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n125" value="«interface» PatientRepository PatientProfileService.Application" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#e1d5e7;strokeColor=#444444;" vertex="1" parent="1" sourceType="PatientProfileService.Application.PatientRepository" sourceFiles="src/PatientProfileService/Application/PatientRepository.cs" link="../../src/PatientProfileService/Application/PatientRepository.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="210" width="520" height="280" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n126" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n125">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n127" value="+ FindByAccountIdAsync(string accountId, CancellationToken cancellationToken): Task<Patient?> {abstract} + SaveAsync(Patient patient, CancellationToken cancellationToken): Task<Patient> {abstract} + FindByIdAsync(Guid patientId, CancellationToken cancellationToken): Task<Patient?> {abstract} + UpdateProfileAsync(Guid patientId, string name, string? contactInfo, CancellationToken cancellationToken): Task<bool> {abstract}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n125">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="162" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n125-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n125">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n128" value="«class» ProfileAlreadyExistsException PatientProfileService.Application" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#e1d5e7;strokeColor=#444444;" vertex="1" parent="1" sourceType="PatientProfileService.Application.ProfileAlreadyExistsException" sourceFiles="src/PatientProfileService/Application/ProfileAlreadyExistsException.cs" link="../../src/PatientProfileService/Application/ProfileAlreadyExistsException.cs">
|
||||||
|
<mxGeometry as="geometry" x="2050" y="210" width="520" height="154" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n129" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n128">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n130" value="(no declared operations)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n128">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n128-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n128">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n131" value="«class» PatientDbContext PatientProfileService.Persistence" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#d5e8d4;strokeColor=#444444;" vertex="1" parent="1" sourceType="PatientProfileService.Persistence.PatientDbContext" sourceFiles="src/PatientProfileService/Persistence/PatientDbContext.cs" link="../../src/PatientProfileService/Persistence/PatientDbContext.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="706" width="520" height="172" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n132" value="+ Patients: DbSet<Patient> {get}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n131">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n133" value="+ PatientDbContext(DbContextOptions<PatientDbContext> options) # OnModelCreating(ModelBuilder modelBuilder): void" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n131">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="54" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n131-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n131">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n134" value="«class» SqlPatientRepository PatientProfileService.Persistence" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#d5e8d4;strokeColor=#444444;" vertex="1" parent="1" sourceType="PatientProfileService.Persistence.SqlPatientRepository" sourceFiles="src/PatientProfileService/Persistence/SqlPatientRepository.cs" link="../../src/PatientProfileService/Persistence/SqlPatientRepository.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="706" width="520" height="298" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n135" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n134">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n136" value="+ SqlPatientRepository(PatientDbContext db) + SaveAsync(Patient patient, CancellationToken cancellationToken): Task<Patient> + FindByAccountIdAsync(string accountId, CancellationToken cancellationToken): Task<Patient?> + FindByIdAsync(Guid patientId, CancellationToken cancellationToken): Task<Patient?> + UpdateProfileAsync(Guid patientId, string name, string? contactInfo, CancellationToken cancellationToken): Task<bool>" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n134">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="180" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n134-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n134">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n137" value="«class» Patient PatientProfileService.Domain" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#fff2cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="PatientProfileService.Domain.Patient" sourceFiles="src/PatientProfileService/Domain/Patient.cs" link="../../src/PatientProfileService/Domain/Patient.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="706" width="520" height="262" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n138" value="+ AccountId: string? {get, set} + PatientId: Guid {get, set} + Name: string {get, set} + DateOfBirth: DateOnly {get, set} + ContactInfo: string? {get, set} + CreatedAt: DateTime {get, set} + UpdatedAt: DateTime {get, set}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n137">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="144" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n139" value="(no declared operations)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n137">
|
||||||
|
<mxGeometry as="geometry" x="0" y="226" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n137-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n137">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="226" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="226" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n140" value="«record» CreatePatientRequest PatientProfileService.Contracts" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#ffe6cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="PatientProfileService.Contracts.CreatePatientRequest" sourceFiles="src/PatientProfileService/Contracts/CreatePatientRequest.cs" link="../../src/PatientProfileService/Contracts/CreatePatientRequest.cs">
|
||||||
|
<mxGeometry as="geometry" x="2050" y="706" width="520" height="190" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n141" value="+ Name: string? {get, init} + DateOfBirth: DateOnly? {get, init} + ContactInfo: string? {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n140">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n142" value="(no declared operations)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n140">
|
||||||
|
<mxGeometry as="geometry" x="0" y="154" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n140-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n140">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="154" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="154" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n143" value="«record» PatientDto PatientProfileService.Contracts" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#ffe6cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="PatientProfileService.Contracts.PatientDto" sourceFiles="src/PatientProfileService/Contracts/PatientDto.cs" link="../../src/PatientProfileService/Contracts/PatientDto.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="1184" width="520" height="226" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n144" value="+ PatientId: Guid {get, init} + Name: string {get, init} + DateOfBirth: DateOnly {get, init} + ContactInfo: string? {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n143">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="90" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n145" value="+ PatientDto(Guid PatientId, string Name, DateOnly DateOfBirth, string? ContactInfo)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n143">
|
||||||
|
<mxGeometry as="geometry" x="0" y="172" width="520" height="54" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n143-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n143">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="172" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="172" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n146" value="«record» UpdatePatientRequest PatientProfileService.Contracts" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#ffe6cc;strokeColor=#444444;" vertex="1" parent="1" sourceType="PatientProfileService.Contracts.UpdatePatientRequest" sourceFiles="src/PatientProfileService/Contracts/UpdatePatientRequest.cs" link="../../src/PatientProfileService/Contracts/UpdatePatientRequest.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="1184" width="520" height="172" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n147" value="+ Name: string? {get, init} + ContactInfo: string? {get, init}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n146">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="54" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n148" value="(no declared operations)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n146">
|
||||||
|
<mxGeometry as="geometry" x="0" y="136" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n146-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n146">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="136" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="136" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n149" value="«class» Program PatientProfileService" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#f5f5f5;strokeColor=#444444;" vertex="1" parent="1" sourceType="PatientProfileService.Program" sourceFiles="src/PatientProfileService/Program.cs" link="../../src/PatientProfileService/Program.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="1184" width="520" height="154" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n150" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n149">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n151" value="+ Main(string[] args): Task {static}" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n149">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n149-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n149">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n152" value="«framework reference» Exception" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="70" y="1590" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n153" value="«framework reference» ControllerBase" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="730" y="1590" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n154" value="«framework reference» DbContext" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="1590" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-0" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n122" target="n125" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-1" value="creates / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n122" target="n128" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-2" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n122" target="n140" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-3" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n122" target="n146" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-4" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n122" target="n137" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-5" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n125" target="n137" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-6" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n119" target="n122" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-7" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n119" target="n140" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-8" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n119" target="n143" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-9" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n119" target="n146" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-10" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n119" target="n137" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-14" value="Patients [0..*]" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="n131" target="n137" relationship="association">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-15" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=block;endFill=0;" edge="1" parent="1" source="n134" target="n125" relationship="realization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-16" value="creates / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n134" target="n128" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-17" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n134" target="n137" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-18" value="signature / constructor" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n134" target="n131" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-19" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n149" target="n122" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-20" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n149" target="n131" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-21" value="registers / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n149" target="n134" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-22" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n128" target="n152" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-23" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n119" target="n153" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e154-24" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n131" target="n154" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n155" value="Source-linked classifier headers. All declared members shown; compiler-generated record members and inherited framework members are omitted. Partial declarations are merged. Framework base/reference boxes are distinguished from service-defined types. A dependency is not ownership or a cross-service in-process call. See class-diagram-coverage.md for exact file/type coverage." style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="1735" width="2580" height="110" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
<diagram name="PatientProfileService — EF migration classes" id="PatientProfileService---EF-migration-classes">
|
||||||
|
<mxGraphModel grid="1" gridSize="10" page="1" pageWidth="2660" pageHeight="970" pageScale="1">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="n195" value="PatientProfileService — EF migration classes" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fontSize=24;fontStyle=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="25" width="2580" height="45" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n196" value="UML: + public, - private, # protected, ~ internal. Three compartments = classifier / attributes / operations. Hollow triangle: inheritance; dashed hollow triangle: interface realization. Solid line: attribute reference; dashed arrow: dependency; filled diamond: verified owned context. Each source type has its own classifier. Primary-constructor parameters are constructor operations, not invented fields." style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="85" width="2580" height="100" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n197" value="«class» AccountProfileAssociation PatientProfileService.Persistence.Migrations" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#d5e8d4;strokeColor=#444444;" vertex="1" parent="1" sourceType="PatientProfileService.Persistence.Migrations.AccountProfileAssociation" sourceFiles="src/PatientProfileService/Persistence/Migrations/20261005082209_AccountProfileAssociation.Designer.cs|src/PatientProfileService/Persistence/Migrations/20261005082209_AccountProfileAssociation.cs" link="../../src/PatientProfileService/Persistence/Migrations/20261005082209_AccountProfileAssociation.Designer.cs">
|
||||||
|
<mxGeometry as="geometry" x="70" y="210" width="520" height="190" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n198" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n197">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n199" value="# BuildTargetModel(ModelBuilder modelBuilder): void # Up(MigrationBuilder migrationBuilder): void # Down(MigrationBuilder migrationBuilder): void" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n197">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n197-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n197">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n200" value="«class» InitialPatientSchema PatientProfileService.Persistence.Migrations" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#d5e8d4;strokeColor=#444444;" vertex="1" parent="1" sourceType="PatientProfileService.Persistence.Migrations.InitialPatientSchema" sourceFiles="src/PatientProfileService/Persistence/Migrations/20260930200031_InitialPatientSchema.Designer.cs|src/PatientProfileService/Persistence/Migrations/20260930200031_InitialPatientSchema.cs" link="../../src/PatientProfileService/Persistence/Migrations/20260930200031_InitialPatientSchema.Designer.cs">
|
||||||
|
<mxGeometry as="geometry" x="730" y="210" width="520" height="190" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n201" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n200">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n202" value="# BuildTargetModel(ModelBuilder modelBuilder): void # Up(MigrationBuilder migrationBuilder): void # Down(MigrationBuilder migrationBuilder): void" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n200">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="72" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n200-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n200">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n203" value="«class» PatientDbContextModelSnapshot PatientProfileService.Persistence.Migrations" style="swimlane;startSize=82;horizontal=1;html=0;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontStyle=1;spacing=7;fillColor=#d5e8d4;strokeColor=#444444;" vertex="1" parent="1" sourceType="PatientProfileService.Persistence.Migrations.PatientDbContextModelSnapshot" sourceFiles="src/PatientProfileService/Persistence/Migrations/PatientDbContextModelSnapshot.cs" link="../../src/PatientProfileService/Persistence/Migrations/PatientDbContextModelSnapshot.cs">
|
||||||
|
<mxGeometry as="geometry" x="1390" y="210" width="520" height="154" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n204" value="(no declared attributes)" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n203">
|
||||||
|
<mxGeometry as="geometry" x="0" y="82" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n205" value="# BuildModel(ModelBuilder modelBuilder): void" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;fillColor=none;strokeColor=none;" vertex="1" parent="n203">
|
||||||
|
<mxGeometry as="geometry" x="0" y="118" width="520" height="36" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n203-sep" style="endArrow=none;strokeColor=#444444;" edge="1" parent="n203">
|
||||||
|
<mxGeometry as="geometry" relative="1">
|
||||||
|
<mxPoint as="sourcePoint" x="0" y="118" />
|
||||||
|
<mxPoint as="targetPoint" x="520" y="118" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n206" value="«framework reference» Migration" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="70" y="580" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n207" value="«framework reference» ModelSnapshot" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="730" y="580" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n208" value="«same-service type, other page» PatientDbContext" style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;align=center;fillColor=#ffffff;strokeColor=#777777;dashed=1;" vertex="1" parent="1" referenceType="PatientProfileService.Persistence.PatientDbContext">
|
||||||
|
<mxGeometry as="geometry" x="70" y="690" width="520" height="80" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e208-11" value="creates / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n200" target="n208" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e208-12" value="creates / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n197" target="n208" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e208-13" value="creates / configures" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;dashed=1;endArrow=open;" edge="1" parent="1" source="n203" target="n208" relationship="dependency">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e208-22" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n200" target="n206" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e208-23" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n197" target="n206" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e208-24" value="" style="edgeStyle=orthogonalEdgeStyle;html=0;rounded=0;fontSize=11;labelBackgroundColor=#ffffff;endArrow=block;endFill=0;" edge="1" parent="1" source="n203" target="n207" relationship="generalization">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n209" value="Source-linked classifier headers. All declared members shown; compiler-generated record members and inherited framework members are omitted. Partial declarations are merged. Framework base/reference boxes are distinguished from service-defined types. A dependency is not ownership or a cross-service in-process call. See class-diagram-coverage.md for exact file/type coverage." style="text;html=0;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;spacing=8;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="835" width="2580" height="110" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
</mxfile>
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,47 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<mxfile host="app.diagrams.net" version="24.7.17" compressed="false">
|
||||||
|
<diagram id="p1" name="Ownership and physical persistence">
|
||||||
|
<mxGraphModel dx="1700" dy="1500" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1700" pageHeight="1400" math="0" shadow="0">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="c1" value="Ownership and physical persistence" style="text;html=0;fontSize=24;fontStyle=1;align=left;verticalAlign=middle;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="15" width="1640" height="45" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c2" value="Patient/Profile process PatientDbContext / SqlPatientRepository Own credentials only" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#d5e8d4;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="120" width="450" height="160" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c3" value="Observation process ObservationDbContext / SqlObservationRepository Own credentials only" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#d5e8d4;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="900" y="120" width="450" height="160" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c4" value="Patient database: patient PK patient_id UUID account_id TEXT nullable; UNIQUE name VARCHAR NOT NULL date_of_birth DATE NOT NULL contact_info VARCHAR nullable created_at / updated_at TIMESTAMP NOT NULL + __EFMigrationsHistory" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#fff2cc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="420" width="520" height="310" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c5" value="Observation database: blood_pressure_observation PK observation_id UUID; external patient_id UUID measured_at / created_at / updated_at TIMESTAMP systolic / diastolic / pulse INTEGER NOT NULL context / note VARCHAR nullable setting / activity_condition TEXT NOT NULL = Unknown rest_duration_minutes NUMERIC nullable body_position / measured_arm / device_details / cuff_details / additional_circumstances TEXT nullable + __EFMigrationsHistory" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#fff2cc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="900" y="420" width="650" height="350" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c6" value="EF Core / own role" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c2" target="c4">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c7" value="EF Core / own role" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c3" target="c5">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c8" value="Logical patient_id reference ONLY No SQL access / FK / join" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=none;" edge="1" parent="1" source="c5" target="c4">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c9" value="Gateway-owned files/configuration Configured password hashes + roles Configured professional assignment IDs Persistent Data Protection XML key ring No Gateway clinical database" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#dae8fc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="900" width="520" height="220" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c10" value="Insights / Overview Deserialize local wire DTOs Calculate/compose results in request memory No result database, stored IDs or cache No source-database credentials" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#dae8fc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="640" y="900" width="490" height="220" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c11" value="Administrative deployment material Manifest/service.env/JSON/PFX Generated account passwords and service/DB keys Protected root/admin files; scoped distribution Public CA exported; signing key not retained" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#f5f5f5;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1180" y="900" width="450" height="220" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c12" value="TIMESTAMP means timestamp without time zone, interpreted as UTC clock values. MeasurementContext uses columns in the observation row, not a separate table. Only PK and account uniqueness indexes are declared. Diagram shows logical database owners; PostgreSQL servers may be colocated or separate. Sources: DbContexts, migrations, Deployment/DatabaseProvisioning." style="rounded=0;whiteSpace=wrap;html=0;fillColor=#fff2cc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="1220" width="1630" height="100" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
</mxfile>
|
||||||
@@ -0,0 +1,165 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<mxfile host="app.diagrams.net" version="24.7.17" compressed="false">
|
||||||
|
<diagram id="p1" name="Colocated Linux: separate native processes">
|
||||||
|
<mxGraphModel dx="1700" dy="1500" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1700" pageHeight="1250" math="0" shadow="0">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="c1" value="Colocated Linux: separate native processes" style="text;html=0;fontSize=24;fontStyle=1;align=left;verticalAlign=middle;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="15" width="1640" height="45" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c2" value="Client machine HTTPS trust in public CA Token-bearing requests → Gateway" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#d5e8d4;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="110" width="350" height="170" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c3" value="One Linux host: Debian/Ubuntu family + apt + systemd .NET 10 ASP.NET Core runtime; local PostgreSQL for selected persistent services Same service DLLs as distributed deployment; all ports configurable" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#f5f5f5;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="460" y="110" width="1190" height="160" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c4" value="healthapp-api-gateway.service Dedicated healthapp-api-gateway identity Independent dotnet process HTTPS 0.0.0.0:5443 /opt/healthapp/api-gateway /etc/healthapp/api-gateway/service.env" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#dae8fc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="40" y="410" width="300" height="240" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c5" value="healthapp-patient-profile.service Dedicated healthapp-patient-profile identity Independent dotnet process HTTPS 0.0.0.0:5081 /opt/healthapp/patient-profile /etc/healthapp/patient-profile/service.env" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#dae8fc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="375" y="410" width="300" height="240" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c6" value="healthapp-observation.service Dedicated healthapp-observation identity Independent dotnet process HTTPS 0.0.0.0:5082 /opt/healthapp/observation /etc/healthapp/observation/service.env" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#dae8fc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="710" y="410" width="300" height="240" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c7" value="healthapp-insights.service Dedicated healthapp-insights identity Independent dotnet process HTTPS 0.0.0.0:5083 /opt/healthapp/insights /etc/healthapp/insights/service.env" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#dae8fc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1045" y="410" width="300" height="240" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c8" value="healthapp-health-overview.service Dedicated healthapp-health-overview identity Independent dotnet process HTTPS 0.0.0.0:5084 /opt/healthapp/health-overview /etc/healthapp/health-overview/service.env" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#dae8fc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1380" y="410" width="300" height="240" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c9" value="HTTPS :5443" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c2" target="c4">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c10" value="HTTPS + incoming key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c4" target="c5">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c11" value="HTTPS + incoming key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c4" target="c6">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c12" value="HTTPS + incoming key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c4" target="c7">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c13" value="HTTPS + incoming key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c4" target="c8">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c14" value="HTTPS + callback key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c6" target="c4">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c15" value="HTTPS + callback key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c7" target="c4">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c16" value="HTTPS + callback key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c8" target="c4">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c17" value="Local PostgreSQL server Separate profile DB and observation DB Separate roles; no cross-database rights" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#fff2cc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="390" y="830" width="610" height="180" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c18" value="Profile DB" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c5" target="c17">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c19" value="Observation DB" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c6" target="c17">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c20" value="Private administrative plan + public CA trust Gateway key ring: /var/lib/healthapp-api-gateway/keys Per-service PFX; env supplied by systemd" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#f5f5f5;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1090" y="820" width="540" height="180" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c21" value="Topology is supported configuration, not a fresh inspection of a live host. Peer units are not PartOf/Requires/BindsTo one another. Default port numbers come from Deployment.cs, not hard-coded application routing. Stopping a process does not directly stop peers; dependent API workflows can fail." style="rounded=0;whiteSpace=wrap;html=0;fillColor=#fff2cc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="1100" width="1620" height="100" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
<diagram id="p2" name="Distributed Linux: supported topology">
|
||||||
|
<mxGraphModel dx="1700" dy="1500" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1800" pageHeight="1350" math="0" shadow="0">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="c22" value="Distributed Linux: supported topology" style="text;html=0;fontSize=24;fontStyle=1;align=left;verticalAlign=middle;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="15" width="1740" height="45" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c23" value="Machine A Gateway process / systemd HTTPS :5443 Local account/assignment configuration Own key ring + certificate No clinical DB" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#dae8fc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="700" y="110" width="380" height="210" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c24" value="Machine B Patient/Profile process / systemd HTTPS :5081 Own profile DB + role Local PostgreSQL or configured remote DB" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#d5e8d4;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="550" width="380" height="220" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c25" value="Machine C Observation process / systemd HTTPS :5082 Own observation DB + role Local PostgreSQL or configured remote DB" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#d5e8d4;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="470" y="550" width="380" height="220" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c26" value="Machine D Insights process / systemd HTTPS :5083 No DB History client origin = Gateway" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#d5e8d4;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="910" y="550" width="380" height="220" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c27" value="Machine E Overview process / systemd HTTPS :5084 No DB All three client origins = Gateway" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#d5e8d4;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1350" y="550" width="380" height="220" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c28" value="HTTPS + X-Gateway-Key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c23" target="c24">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c29" value="HTTPS + X-Gateway-Key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c23" target="c25">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c30" value="HTTPS + X-Gateway-Key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c23" target="c26">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c31" value="HTTPS + X-Gateway-Key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c23" target="c27">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c32" value="HTTPS + X-Service-Key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c25" target="c23">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c33" value="HTTPS + X-Service-Key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c26" target="c23">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c34" value="HTTPS + X-Service-Key" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c27" target="c23">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c35" value="Administrative preparation / distribution One topology plan → scoped files per host SSH/SCP and noninteractive native install OS CA trust + dedicated service identities Final HTTPS topology verification" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#f5f5f5;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="490" y="970" width="760" height="230" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c36" value="SSH/SCP administration (not app traffic)" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=open;dashed=1;" edge="1" parent="1" source="c35" target="c23">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c37" value="Each process uses its own local config/private certificate. No shared runtime directory or common process memory across machines. All origin hosts/ports configurable. Real multi-machine deployment remains an evidence limit; tests use separate loopback origins and transport doubles." style="rounded=0;whiteSpace=wrap;html=0;fillColor=#fff2cc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="1240" width="1720" height="100" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
<diagram id="p3" name="Native platform adapters: same application DLLs">
|
||||||
|
<mxGraphModel dx="1700" dy="1500" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1700" pageHeight="1200" math="0" shadow="0">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="c38" value="Native platform adapters: same application DLLs" style="text;html=0;fontSize=24;fontStyle=1;align=left;verticalAlign=middle;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="15" width="1640" height="45" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c39" value="Build machine .NET 10 SDK + package feeds Publish separate framework-dependent DLLs No OS-specific apphost; no containers Bundle includes provisioner + installers" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#dae8fc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="570" y="110" width="560" height="200" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c40" value="Linux target Debian/Ubuntu ancestry, apt, systemd Install aspnetcore-runtime-10.0 if absent PostgreSQL when persistent service selected Per-service Unix users/env/PFX Native unit + restart-on-failure" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#d5e8d4;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="540" width="490" height="270" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c41" value="Windows target Windows Services / virtual service identities .NET runtime download if absent EDB PostgreSQL 17 manifest/checksum %ProgramData%/HealthApp paths JSON/PFX ACLs + selected firewall rules UseWindowsService lifetime" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#d5e8d4;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="600" y="540" width="490" height="270" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c42" value="macOS target launchd / hidden service identities .NET runtime download if absent Homebrew PostgreSQL 17 / owned cluster Apple tools/Homebrew if needed /Library/Application Support/HealthApp System CA trust; private env/plist" style="rounded=0;whiteSpace=wrap;html=0;fillColor=#d5e8d4;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="1170" y="540" width="490" height="270" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c43" value="Same DLLs; native adapter" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c39" target="c40">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c44" value="Same DLLs; native adapter" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c39" target="c41">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c45" value="Same DLLs; native adapter" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;fontSize=12;labelBackgroundColor=#ffffff;endArrow=classic;" edge="1" parent="1" source="c39" target="c42">
|
||||||
|
<mxGeometry as="geometry" relative="1" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c46" value="Verified code paths/config-format tests ≠ proven native execution on every target. Manual GitHub Actions workflow exists; run outcomes unknown. Linux --root performs offline staging only. Native adapters need administrator/network access; distribution does not provision host SSH permissions. Evidence: deploy/build-release.*, installer/*, ConfigurationWriter, LaunchdWriter." style="rounded=0;whiteSpace=wrap;html=0;fillColor=#fff2cc;strokeColor=#666666;fontSize=14;align=left;verticalAlign=top;spacing=12;" vertex="1" parent="1">
|
||||||
|
<mxGeometry as="geometry" x="30" y="970" width="1630" height="100" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
</mxfile>
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,40 @@
|
|||||||
|
# Documented design versus implementation
|
||||||
|
|
||||||
|
Scope: repository snapshot 2026-10-12, commit `5d9371388c15066eeb2bc124ed227659c644dab5`. **Difference** is not automatically a defect. Current `.drawio` authority and explicit corrections supersede same-stem historical JPEGs under [Architecture README](../Docs/Architecture/README.md). No authoritative document was edited and no conflicting design was silently selected for implementation.
|
||||||
|
|
||||||
|
## Verified differences and elaborations
|
||||||
|
|
||||||
|
| ID | Original/current documentation | As-built evidence and interpretation |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| D-01 | Original [domain model](../Docs/Architecture/01_domain_model.jpg) and [duplicate domain image](../Docs/Architecture/personal_health_measurement_all_diagrams-Domain%20Model.jpg) show Patient, Observation and Health Summary only | Account/profile lifecycle, professional assignments, measurement context, selections, trend assessments and overview concepts now exist. `HealthInsight` is a transient summary without stored summary ID. This is an expanded as-built model, not a claim that the original three concepts were replaced. [domains](../src/InsightsService/Domain/HealthInsight.cs), [assignments](../src/ApiGateway/Security/ProfessionalAssignments.cs) |
|
||||||
|
| D-02 | [Patient class](../Docs/Architecture/03_class_patient_profile_service.jpg) and [Patient ER](../Docs/Architecture/07_er_patient_profile_service.jpg) omit account association and account lookup | `Patient.AccountId`, nullable `account_id` and unique index plus by-account API now implement US-01/13. [migration](../src/PatientProfileService/Persistence/Migrations/20261005082209_AccountProfileAssociation.cs), [controller](../src/PatientProfileService/Controllers/PatientController.cs). Existing null associations are retained; no migration backfill assigns old rows to credentials. |
|
||||||
|
| D-03 | Original authentication design's opening/Section 10 says token format, lifetime, persistence owner and gateway protection are open; final paragraph permits minimum established mechanisms | Concrete opaque framework Bearer tokens, default 30-minute lifetime, Patient-owned association and shared-key HTTPS boundaries are implemented and described in [AUTHENTICATION.md](../src/AUTHENTICATION.md). Opening/open-decision text was not updated, so the document has residual status ambiguity. The final permission is consistent with selecting simple mechanisms; this task does not infer an unrecorded formal approval history. |
|
||||||
|
| D-04 | Historical Insights ER showed persisted HealthSummary; old Overview ER showed an overview persistence concept | Current [Insights correction](../Docs/Architecture/us10-insights-correction.md), [Insights drawio](../Docs/Architecture/09_er_insights_service.drawio) and [Overview drawio](../Docs/Architecture/06_class_health_overview_service.drawio) already supersede those concepts. Code has no DB/repository in either service. Historical inconsistency is resolved by current baseline; do not report it as a new implementation violation. |
|
||||||
|
| D-05 | Updated logical diagrams use schematic methods/names (`activity`, preparation details, HealthOverview/DTO) and sometimes combine domain/DTO boxes | Code uses `ActivityCondition`, `RestDurationMinutes`, flattened owned columns; separate local consumer DTOs; Overview client abstractions are abstract classes whereas Insights' client is an interface. Observation DTO does not expose creation/update timestamps although its domain entity contains them. These are implementation details permitted by Architecture README, not unexplained new services/tables. [context mapping](../src/ObservationService/Persistence/ObservationDbContext.cs), [DTO](../src/ObservationService/Contracts/ObservationDto.cs) |
|
||||||
|
| D-06 | Original class diagrams omit EF contexts, framework authentication, patch-presence fields and detailed trend result types | As-built class pages show those actual dependencies/attributes and responsibilities. No shared runtime contracts or direct class links across service boundaries were found. [patch](../src/ObservationService/Contracts/PatchObservationRequest.cs), [trend records](../src/InsightsService/Domain/TrendAssessment.cs), [Gateway startup](../src/ApiGateway/Program.cs) |
|
||||||
|
| D-07 | US-16 and its addendum describe Linux/systemd; later implementation guide also describes Windows/macOS | Native Windows Services/launchd adapters and WindowsServices package are present. This expands implemented platform support beyond the Linux wording while retaining service boundaries. Whether formal requirements should be updated is outside this assignment. Native success on every advertised platform is unknown. [adapters](../deploy/installer/install.ps1), [macOS](../deploy/installer/install-macos.sh) |
|
||||||
|
| D-08 | Committed systemd templates use `User=healthapp` and `/etc/healthapp/NAME.env`; installer guide describes dedicated users/nested files | Installer rewrites templates into `healthapp-NAME` user/group and `/etc/healthapp/NAME/service.env`. Using templates manually without that transform differs from normal installed behavior. [template](../deploy/systemd/healthapp-observation.service), [installer](../deploy/installer/install.sh) |
|
||||||
|
| D-09 | Original topology depicts client Web/Mobile | No product frontend is present. This repository implements the API backend; JMeter/curl/test clients are actual consumers. It is unknown whether a client lives in another repository. Backend stories do not establish a frontend deliverable. |
|
||||||
|
| D-10 | Installation prose broadly says native verification checks independent processes; US-16 AC-I includes stop/restart demonstration | Linux and Windows adapters check running state/distinct PIDs. macOS adapter calls `launchctl print` and HTTPS probes but does not explicitly compare PIDs. Live verification does not cycle stop/restart; test suite does so with direct processes. This is a runtime-verification limitation, not proof that services cannot restart independently. [Linux verifier](../deploy/installer/verify.sh), [macOS](../deploy/installer/install-macos.sh), [tests](../tests/Deployment.AcceptanceTests/InstallationTests.cs) |
|
||||||
|
| D-11 | Early ownership section of [AUTHENTICATION.md](../src/AUTHENTICATION.md) says trend/overview endpoints remain unimplemented; later sections say they are implemented | Both endpoint sets, client permissions and integration tests exist. The earlier sentence is stale and contradicts later sections of that same implementation document. Earlier service-protection text names only Observation/Insights callbacks, while the later US-12 section/code also provides Overview callbacks. [routes](../src/ApiGateway/Controllers/HealthOverviewController.cs), [trend controller](../src/InsightsService/Controllers/InsightsController.cs) |
|
||||||
|
|
||||||
|
## Current behavior with requirements or evidence limits
|
||||||
|
|
||||||
|
| ID | Verified behavior | Requirement/evidence implication |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| U-01 | Narrative conflict detection is a finite substring list, including documented English/Danish phrases. [calculator](../src/InsightsService/Domain/InsightCalculator.Trends.cs) | US-04/11 broadly require relevant conflicts to be apparent; cited example `during exercise` is covered. Arbitrary wording/negation is not semantically understood. Exhaustive natural-language fulfillment is unknown and not proven by existing fixtures. |
|
||||||
|
| U-02 | Reference thresholds and development labels have compiled sources/limits; favourable/concerning logic is coded locally. [TRENDS](../src/TRENDS.md) | Numerical behavior is testable. Whether every inference is clinically supported under all input combinations needs an independent domain assessment; this documentation does not assert clinical validation. |
|
||||||
|
| U-03 | Ownership middleware compares most path segments case-sensitively; routing accepts conventional case variants | Canonical routes work. A case-varied route can return 404/403 instead of the controller behavior. Requirements do not prescribe casing; observable interface inconsistency, not a confirmed missing story. [middleware](../src/ApiGateway/Security/PatientAccessMiddleware.cs) |
|
||||||
|
| U-04 | Missing expected ownership JSON fields/invalid JSON lack dedicated upstream 502 mapping; general exception handling applies | Such malformed responses may yield 500, unlike explicit Insights/Overview invalid-JSON 502 handling. Upstream failure-injection tests do not prove every malformed shape/status path. |
|
||||||
|
| U-05 | Assignments are startup configuration, no installer assignment population; generated professional has none | US-14 assigned reads exist and are tested with predefined test assignments. A normal fresh installation cannot demonstrate a populated professional review workflow until assignments are configured. This does not require an out-of-scope assignment-management API. |
|
||||||
|
| U-06 | Deployment tests use different loopback addresses, controlled SSH/SCP and package doubles | These establish interfaces/scoping/command intent, not actual multi-machine routing, network/firewall policy or native package/service-manager success. Manual CI workflow exists; execution results are unknown in this task. |
|
||||||
|
| U-07 | Generated DB connections use `Pooling=false;SslMode=Prefer`; normal Linux startup bootstrap checks local PostgreSQL even if an external admin file is supplied | This is the actual configuration. Mandatory verified DB TLS is not implemented. External-DB Linux installation can still provision/check an unnecessary local server; the guide's general external-DB description does not mention this coupling. [bootstrap call](../deploy/installer/install.sh), [connection builder](../deploy/HealthApp.Provisioning/Deployment.cs) |
|
||||||
|
| U-08 | Installer detects existing app/config and refuses; failure retains partial output | No safe resumable upgrade/uninstall/transactional rollback is implemented. First-install retries may require administrative handling of retained material. This is documented prototype scope, not a silently repaired behavior. |
|
||||||
|
| U-09 | Complete flag in local installers/verifier is selected by literal `all` | Explicitly listing all five service names installs them but does not trigger the complete synthetic workflow in those wrappers. Distribution uses selected count for completeness. This is an observable verification asymmetry under US-16, without changing the application topology. |
|
||||||
|
| U-10 | Overview does sequential reads; no concurrency token or snapshot; history unbounded | Concurrent-write snapshot, conditional-edit protection, pagination and load resilience are absent. They are not explicit baseline story requirements; do not reclassify them as missing accepted features. |
|
||||||
|
| U-11 | Filesystem key ring has no explicitly configured encryption-at-rest; no immediate bearer revocation or account-record recheck | The prototype has persistent protected tickets and file permissions, not a full identity lifecycle. Registration/recovery/MFA/refresh/administration are explicitly outside scope. Production security compliance is not established. |
|
||||||
|
| U-12 | Supplied PFX is checked for a private key, then runtime verifies endpoints; generated leaf/CA expiry not automatically renewed | Early preflight, rotation, renewal and universal third-party chain support are not proven. Replacing certificates is an administrative first-install facility, not an implemented renewal service. |
|
||||||
|
|
||||||
|
## Unresolved unknowns
|
||||||
|
|
||||||
|
Live installed software/configuration may differ from this checkout; no server, device or administrative session was accessed. Native Windows/macOS CI runs, actual deployment firewall rules, backup/restore behavior, multi-instance Gateway behavior, certificate renewal procedures, production security/clinical approval and external client implementations cannot be established from this repository. [Traceability](requirements-traceability.md) separates these from observed functional support.
|
||||||
@@ -0,0 +1,486 @@
|
|||||||
|
# Evidence inventory
|
||||||
|
|
||||||
|
Snapshot: 2026-10-12; source commit `5d9371388c15066eeb2bc124ed227659c644dab5`. This inventory lists tracked specification, application, deployment and acceptance-test files used to bound the review. SHA-256 prefixes identify file content, not a test result. Source links remain repository-relative.
|
||||||
|
|
||||||
|
## Inspection boundaries
|
||||||
|
|
||||||
|
Production source, contracts, persistence mappings/migrations, startup/security configuration, installer/provisioner, relevant acceptance fixtures/assertions and specification text were inspected. Current Draw.io cell content and original context/domain/Patient class/Patient ER images were examined. Same-stem historical JPEGs are superseded by current editable diagrams; their authority is governed by Architecture README. Test code is evidence of intended verification, not a fresh execution claim.
|
||||||
|
|
||||||
|
Experiment scripts/plans and their README were inspected for ancillary architecture. Private credentials and ignored raw load-test results were deliberately excluded; they are not needed to document production responsibilities. No live server or native installer was executed. No dependency versions were looked up externally; project declarations define this snapshot.
|
||||||
|
|
||||||
|
## File evidence
|
||||||
|
|
||||||
|
| File | Kind | SHA-256 prefix |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| [.github/workflows/prototype-native-install.yml](../.github/workflows/prototype-native-install.yml) | Deployment / configuration / native validation | `de4240167653b10b` |
|
||||||
|
| [.gitignore](../.gitignore) | Repository / build / instructions | `5ff2245aafc37c27` |
|
||||||
|
| [AGENTS.md](../AGENTS.md) | Repository / build / instructions | `02330ed17811077c` |
|
||||||
|
| [Docs/Architecture/01_domain_model.jpg](../Docs/Architecture/01_domain_model.jpg) | Specification / context | `43354c405b637578` |
|
||||||
|
| [Docs/Architecture/02_microservice_architecture.jpg](../Docs/Architecture/02_microservice_architecture.jpg) | Specification / context | `67862bb8e9c1029f` |
|
||||||
|
| [Docs/Architecture/03_class_patient_profile_service.jpg](../Docs/Architecture/03_class_patient_profile_service.jpg) | Specification / context | `4abc364239a97b0d` |
|
||||||
|
| [Docs/Architecture/04_class_observation_service.drawio](../Docs/Architecture/04_class_observation_service.drawio) | Specification / context | `0b48a2760252607d` |
|
||||||
|
| [Docs/Architecture/04_class_observation_service.jpg](../Docs/Architecture/04_class_observation_service.jpg) | Specification / context | `749647606ee3a5a7` |
|
||||||
|
| [Docs/Architecture/05_class_insights_service.drawio](../Docs/Architecture/05_class_insights_service.drawio) | Specification / context | `8c5837f38eb745e1` |
|
||||||
|
| [Docs/Architecture/05_class_insights_service.jpg](../Docs/Architecture/05_class_insights_service.jpg) | Specification / context | `18d5fbeec5db5947` |
|
||||||
|
| [Docs/Architecture/06_class_health_overview_service.drawio](../Docs/Architecture/06_class_health_overview_service.drawio) | Specification / context | `8c401510f8c0a2e8` |
|
||||||
|
| [Docs/Architecture/06_class_health_overview_service.jpg](../Docs/Architecture/06_class_health_overview_service.jpg) | Specification / context | `1c2751c7fdbf123b` |
|
||||||
|
| [Docs/Architecture/07_er_patient_profile_service.jpg](../Docs/Architecture/07_er_patient_profile_service.jpg) | Specification / context | `8074f734e3e4e28e` |
|
||||||
|
| [Docs/Architecture/08_er_observation_service.drawio](../Docs/Architecture/08_er_observation_service.drawio) | Specification / context | `88cc97c26ff40650` |
|
||||||
|
| [Docs/Architecture/08_er_observation_service.jpg](../Docs/Architecture/08_er_observation_service.jpg) | Specification / context | `e6b02064ba2019ac` |
|
||||||
|
| [Docs/Architecture/09_er_insights_service-overruled no persistence here to give an idea of what data is needed to be able to use from other services or calculate.jpg](../Docs/Architecture/09_er_insights_service-overruled%20no%20persistence%20here%20to%20give%20an%20idea%20of%20what%20data%20is%20needed%20to%20be%20able%20to%20use%20from%20other%20services%20or%20calculate.jpg) | Specification / context | `6f01585a506f84ef` |
|
||||||
|
| [Docs/Architecture/09_er_insights_service.drawio](../Docs/Architecture/09_er_insights_service.drawio) | Specification / context | `534ba79368ac79eb` |
|
||||||
|
| [Docs/Architecture/10_er_health_overview_service-overruled no persistence here to give an idea of what data is needed to be able to use from other services or calculate.jpg](../Docs/Architecture/10_er_health_overview_service-overruled%20no%20persistence%20here%20to%20give%20an%20idea%20of%20what%20data%20is%20needed%20to%20be%20able%20to%20use%20from%20other%20services%20or%20calculate.jpg) | Specification / context | `b27db286ce26cbc1` |
|
||||||
|
| [Docs/Architecture/README.md](../Docs/Architecture/README.md) | Specification / context | `3754fa7ed95a6ef5` |
|
||||||
|
| [Docs/Architecture/personal_health_measurement_all_diagrams-Domain Model.jpg](../Docs/Architecture/personal_health_measurement_all_diagrams-Domain%20Model.jpg) | Specification / context | `285c4c52440a3000` |
|
||||||
|
| [Docs/Architecture/us10-insights-correction.md](../Docs/Architecture/us10-insights-correction.md) | Specification / context | `259d59ee31518068` |
|
||||||
|
| [Docs/Design/authentication-and-access-control-design.md](../Docs/Design/authentication-and-access-control-design.md) | Specification / context | `b044d0f78d542be0` |
|
||||||
|
| [Docs/Requirements/00-common-requirements.md](../Docs/Requirements/00-common-requirements.md) | Specification / context | `1f056a53699e0875` |
|
||||||
|
| [Docs/Requirements/US16 easy installation and deployment installer.txt](../Docs/Requirements/US16%20easy%20installation%20and%20deployment%20installer.txt) | Specification / context | `07416edc16ce034a` |
|
||||||
|
| [Docs/Requirements/us01-create-patient-profile.md](../Docs/Requirements/us01-create-patient-profile.md) | Specification / context | `52872490bd37b15e` |
|
||||||
|
| [Docs/Requirements/us02-view-patient-profile.md](../Docs/Requirements/us02-view-patient-profile.md) | Specification / context | `8af9e4e55ddb9bb4` |
|
||||||
|
| [Docs/Requirements/us03-update-patient-profile.md](../Docs/Requirements/us03-update-patient-profile.md) | Specification / context | `0825a974cea87924` |
|
||||||
|
| [Docs/Requirements/us04-record-observation.md](../Docs/Requirements/us04-record-observation.md) | Specification / context | `894e99dac4e05604` |
|
||||||
|
| [Docs/Requirements/us05-view-observation.md](../Docs/Requirements/us05-view-observation.md) | Specification / context | `3632aebd02b34996` |
|
||||||
|
| [Docs/Requirements/us06-latest-observation.md](../Docs/Requirements/us06-latest-observation.md) | Specification / context | `dfec3b4fcb1c8410` |
|
||||||
|
| [Docs/Requirements/us07-observation-history.md](../Docs/Requirements/us07-observation-history.md) | Specification / context | `dec0f06cee54e713` |
|
||||||
|
| [Docs/Requirements/us08-update-observation.md](../Docs/Requirements/us08-update-observation.md) | Specification / context | `1e65e62813db4e50` |
|
||||||
|
| [Docs/Requirements/us09-delete-observation.md](../Docs/Requirements/us09-delete-observation.md) | Specification / context | `28e4dc1cbc92f60b` |
|
||||||
|
| [Docs/Requirements/us10-calculated-insight.md](../Docs/Requirements/us10-calculated-insight.md) | Specification / context | `ed2f03e69d460ef5` |
|
||||||
|
| [Docs/Requirements/us11-health-trend.md](../Docs/Requirements/us11-health-trend.md) | Specification / context | `7121bb4890e70621` |
|
||||||
|
| [Docs/Requirements/us12-health-overview.md](../Docs/Requirements/us12-health-overview.md) | Specification / context | `58db5d95b70b09f7` |
|
||||||
|
| [Docs/Requirements/us13-patient-authentication.md](../Docs/Requirements/us13-patient-authentication.md) | Specification / context | `d2584876fbb17ecd` |
|
||||||
|
| [Docs/Requirements/us14-professional-access.md](../Docs/Requirements/us14-professional-access.md) | Specification / context | `bb451f00e4bad5d7` |
|
||||||
|
| [Docs/Requirements/us15-measurement-guidance.md](../Docs/Requirements/us15-measurement-guidance.md) | Specification / context | `1aa52764ac93fcdb` |
|
||||||
|
| [Docs/Requirements/us16-addendum](../Docs/Requirements/us16-addendum) | Specification / context | `61f88829b2501050` |
|
||||||
|
| [Docs/requirements-reconciliation-changelog.md](../Docs/requirements-reconciliation-changelog.md) | Specification / context | `318c4e2c9f3c1137` |
|
||||||
|
| [HealthApp.slnx](../HealthApp.slnx) | Repository / build / instructions | `3b070ed1a967e900` |
|
||||||
|
| [README.MD](../README.MD) | Repository / build / instructions | `fd783476366adf4c` |
|
||||||
|
| [deploy/HealthApp.Provisioning/ConfigurationWriter.cs](../deploy/HealthApp.Provisioning/ConfigurationWriter.cs) | Deployment / configuration / native validation | `702f4a646eac3dd6` |
|
||||||
|
| [deploy/HealthApp.Provisioning/DatabaseProvisioning.cs](../deploy/HealthApp.Provisioning/DatabaseProvisioning.cs) | Deployment / configuration / native validation | `e1c8e252642b12f8` |
|
||||||
|
| [deploy/HealthApp.Provisioning/Deployment.cs](../deploy/HealthApp.Provisioning/Deployment.cs) | Deployment / configuration / native validation | `8f3e6fc3761fe731` |
|
||||||
|
| [deploy/HealthApp.Provisioning/Distribution.cs](../deploy/HealthApp.Provisioning/Distribution.cs) | Deployment / configuration / native validation | `d9b7c467172e3156` |
|
||||||
|
| [deploy/HealthApp.Provisioning/HealthApp.Provisioning.csproj](../deploy/HealthApp.Provisioning/HealthApp.Provisioning.csproj) | Deployment / configuration / native validation | `5f18785a17f78d01` |
|
||||||
|
| [deploy/HealthApp.Provisioning/InstallationVerification.cs](../deploy/HealthApp.Provisioning/InstallationVerification.cs) | Deployment / configuration / native validation | `094877cb5e6ff6e8` |
|
||||||
|
| [deploy/HealthApp.Provisioning/LaunchdWriter.cs](../deploy/HealthApp.Provisioning/LaunchdWriter.cs) | Deployment / configuration / native validation | `b1d9b620ade4b525` |
|
||||||
|
| [deploy/HealthApp.Provisioning/Program.cs](../deploy/HealthApp.Provisioning/Program.cs) | Deployment / configuration / native validation | `e42034fedec2c3c1` |
|
||||||
|
| [deploy/INSTALLATION.md](../deploy/INSTALLATION.md) | Deployment / configuration / native validation | `94e8e3b7a7bcdf6f` |
|
||||||
|
| [deploy/api-gateway.env.example](../deploy/api-gateway.env.example) | Deployment / configuration / native validation | `e8137593d4710953` |
|
||||||
|
| [deploy/build-release.ps1](../deploy/build-release.ps1) | Deployment / configuration / native validation | `d85375f5a7392fe3` |
|
||||||
|
| [deploy/build-release.sh](../deploy/build-release.sh) | Deployment / configuration / native validation | `7de7fb0ffe963671` |
|
||||||
|
| [deploy/health-overview.env.example](../deploy/health-overview.env.example) | Deployment / configuration / native validation | `b7883d73a34da16a` |
|
||||||
|
| [deploy/insights.env.example](../deploy/insights.env.example) | Deployment / configuration / native validation | `8fff870eede50c4f` |
|
||||||
|
| [deploy/installer/bootstrap.sh](../deploy/installer/bootstrap.sh) | Deployment / configuration / native validation | `db52696d484fe728` |
|
||||||
|
| [deploy/installer/distribute.sh](../deploy/installer/distribute.sh) | Deployment / configuration / native validation | `bda6aa53146a3d4d` |
|
||||||
|
| [deploy/installer/install-macos.sh](../deploy/installer/install-macos.sh) | Deployment / configuration / native validation | `bd78d0ec3be482ce` |
|
||||||
|
| [deploy/installer/install.ps1](../deploy/installer/install.ps1) | Deployment / configuration / native validation | `4c1bbaac58c99539` |
|
||||||
|
| [deploy/installer/install.sh](../deploy/installer/install.sh) | Deployment / configuration / native validation | `ccc35b5764e96a7d` |
|
||||||
|
| [deploy/installer/services.sh](../deploy/installer/services.sh) | Deployment / configuration / native validation | `6a21a5c213fbe7b2` |
|
||||||
|
| [deploy/installer/verify.sh](../deploy/installer/verify.sh) | Deployment / configuration / native validation | `62d50b2bcd40b04a` |
|
||||||
|
| [deploy/observation.env.example](../deploy/observation.env.example) | Deployment / configuration / native validation | `c18f0f6abb1f32e9` |
|
||||||
|
| [deploy/patient-profile.env.example](../deploy/patient-profile.env.example) | Deployment / configuration / native validation | `f01a3ba42d22dbcf` |
|
||||||
|
| [deploy/systemd/healthapp-api-gateway.service](../deploy/systemd/healthapp-api-gateway.service) | Deployment / configuration / native validation | `15a9b7bc43a72940` |
|
||||||
|
| [deploy/systemd/healthapp-health-overview.service](../deploy/systemd/healthapp-health-overview.service) | Deployment / configuration / native validation | `d8841c4b04c74f3b` |
|
||||||
|
| [deploy/systemd/healthapp-insights.service](../deploy/systemd/healthapp-insights.service) | Deployment / configuration / native validation | `8ec5dbfa6e1a9fbd` |
|
||||||
|
| [deploy/systemd/healthapp-observation.service](../deploy/systemd/healthapp-observation.service) | Deployment / configuration / native validation | `a61518322838ca14` |
|
||||||
|
| [deploy/systemd/healthapp-patient-profile.service](../deploy/systemd/healthapp-patient-profile.service) | Deployment / configuration / native validation | `262b269a997923aa` |
|
||||||
|
| [src/AUTHENTICATION.md](../src/AUTHENTICATION.md) | Application / implementation documentation | `38e4a3580e1cc8aa` |
|
||||||
|
| [src/ApiGateway/ApiGateway.csproj](../src/ApiGateway/ApiGateway.csproj) | Application / implementation documentation | `6e81c32841f12d91` |
|
||||||
|
| [src/ApiGateway/Controllers/AuthenticationController.cs](../src/ApiGateway/Controllers/AuthenticationController.cs) | Application / implementation documentation | `f76ec4f393c55ee6` |
|
||||||
|
| [src/ApiGateway/Controllers/HealthOverviewController.cs](../src/ApiGateway/Controllers/HealthOverviewController.cs) | Application / implementation documentation | `0a05ccd0dd9b763e` |
|
||||||
|
| [src/ApiGateway/Controllers/InsightsController.cs](../src/ApiGateway/Controllers/InsightsController.cs) | Application / implementation documentation | `810c906f771ce01e` |
|
||||||
|
| [src/ApiGateway/Controllers/MeasurementGuidanceController.cs](../src/ApiGateway/Controllers/MeasurementGuidanceController.cs) | Application / implementation documentation | `1be2c32f56a5cda6` |
|
||||||
|
| [src/ApiGateway/Controllers/ObservationController.cs](../src/ApiGateway/Controllers/ObservationController.cs) | Application / implementation documentation | `2a33302f8d8158e2` |
|
||||||
|
| [src/ApiGateway/Controllers/PatientController.cs](../src/ApiGateway/Controllers/PatientController.cs) | Application / implementation documentation | `2b416bb49e98c400` |
|
||||||
|
| [src/ApiGateway/Controllers/ProfessionalController.cs](../src/ApiGateway/Controllers/ProfessionalController.cs) | Application / implementation documentation | `87f7c5830215673a` |
|
||||||
|
| [src/ApiGateway/Program.cs](../src/ApiGateway/Program.cs) | Application / implementation documentation | `9e6ba8e51c837719` |
|
||||||
|
| [src/ApiGateway/Security/InternalServiceAuthenticationHandler.cs](../src/ApiGateway/Security/InternalServiceAuthenticationHandler.cs) | Application / implementation documentation | `985ee505d8e38d15` |
|
||||||
|
| [src/ApiGateway/Security/PatientAccessMiddleware.cs](../src/ApiGateway/Security/PatientAccessMiddleware.cs) | Application / implementation documentation | `497c7f69c179fa04` |
|
||||||
|
| [src/ApiGateway/Security/ProfessionalAssignments.cs](../src/ApiGateway/Security/ProfessionalAssignments.cs) | Application / implementation documentation | `7883c801dcdec8df` |
|
||||||
|
| [src/ApiGateway/Security/PrototypeAccounts.cs](../src/ApiGateway/Security/PrototypeAccounts.cs) | Application / implementation documentation | `a4cbcaa6db514439` |
|
||||||
|
| [src/ApiGateway/appsettings.json](../src/ApiGateway/appsettings.json) | Application / implementation documentation | `817db0bf2ecca783` |
|
||||||
|
| [src/HealthOverviewService/Application/HealthOverviewApplicationService.cs](../src/HealthOverviewService/Application/HealthOverviewApplicationService.cs) | Application / implementation documentation | `234190b299f0487c` |
|
||||||
|
| [src/HealthOverviewService/Clients/InsightsServiceClient.cs](../src/HealthOverviewService/Clients/InsightsServiceClient.cs) | Application / implementation documentation | `1087c1ac57605ae7` |
|
||||||
|
| [src/HealthOverviewService/Clients/ObservationServiceClient.cs](../src/HealthOverviewService/Clients/ObservationServiceClient.cs) | Application / implementation documentation | `f6cef0c6f78e04ea` |
|
||||||
|
| [src/HealthOverviewService/Clients/PatientProfileServiceClient.cs](../src/HealthOverviewService/Clients/PatientProfileServiceClient.cs) | Application / implementation documentation | `7bba92bc1b382c3d` |
|
||||||
|
| [src/HealthOverviewService/Contracts/HealthOverviewDto.cs](../src/HealthOverviewService/Contracts/HealthOverviewDto.cs) | Application / implementation documentation | `d95e27f230cfeeb1` |
|
||||||
|
| [src/HealthOverviewService/Controllers/HealthOverviewController.cs](../src/HealthOverviewService/Controllers/HealthOverviewController.cs) | Application / implementation documentation | `c3e9bc2e646527a4` |
|
||||||
|
| [src/HealthOverviewService/HealthOverviewService.csproj](../src/HealthOverviewService/HealthOverviewService.csproj) | Application / implementation documentation | `6e81c32841f12d91` |
|
||||||
|
| [src/HealthOverviewService/Program.cs](../src/HealthOverviewService/Program.cs) | Application / implementation documentation | `63a799d09cdeaf1e` |
|
||||||
|
| [src/HealthOverviewService/appsettings.json](../src/HealthOverviewService/appsettings.json) | Application / implementation documentation | `817db0bf2ecca783` |
|
||||||
|
| [src/InsightsService/Application/InsightsApplicationService.cs](../src/InsightsService/Application/InsightsApplicationService.cs) | Application / implementation documentation | `7319a7f8057b1906` |
|
||||||
|
| [src/InsightsService/Clients/HttpObservationServiceClient.cs](../src/InsightsService/Clients/HttpObservationServiceClient.cs) | Application / implementation documentation | `91677b578eddbd12` |
|
||||||
|
| [src/InsightsService/Clients/ObservationServiceClient.cs](../src/InsightsService/Clients/ObservationServiceClient.cs) | Application / implementation documentation | `802b8cc66f58441d` |
|
||||||
|
| [src/InsightsService/Contracts/HealthInsightDto.cs](../src/InsightsService/Contracts/HealthInsightDto.cs) | Application / implementation documentation | `001d24e7d2b0dedf` |
|
||||||
|
| [src/InsightsService/Contracts/ObservationDto.cs](../src/InsightsService/Contracts/ObservationDto.cs) | Application / implementation documentation | `fd37572e721ba288` |
|
||||||
|
| [src/InsightsService/Controllers/InsightsController.cs](../src/InsightsService/Controllers/InsightsController.cs) | Application / implementation documentation | `0304dc102bb192ab` |
|
||||||
|
| [src/InsightsService/Domain/ContextSelection.cs](../src/InsightsService/Domain/ContextSelection.cs) | Application / implementation documentation | `82b9acd07e6b4de0` |
|
||||||
|
| [src/InsightsService/Domain/HealthInsight.cs](../src/InsightsService/Domain/HealthInsight.cs) | Application / implementation documentation | `fc634cb3b99905c3` |
|
||||||
|
| [src/InsightsService/Domain/InsightCalculator.Trends.cs](../src/InsightsService/Domain/InsightCalculator.Trends.cs) | Application / implementation documentation | `ef196331aad4cf12` |
|
||||||
|
| [src/InsightsService/Domain/InsightCalculator.cs](../src/InsightsService/Domain/InsightCalculator.cs) | Application / implementation documentation | `2575a8f7641f6f23` |
|
||||||
|
| [src/InsightsService/Domain/TrendAssessment.cs](../src/InsightsService/Domain/TrendAssessment.cs) | Application / implementation documentation | `5ba75fba606fa7ca` |
|
||||||
|
| [src/InsightsService/InsightsService.csproj](../src/InsightsService/InsightsService.csproj) | Application / implementation documentation | `6e81c32841f12d91` |
|
||||||
|
| [src/InsightsService/Program.cs](../src/InsightsService/Program.cs) | Application / implementation documentation | `3aceaf19cc216790` |
|
||||||
|
| [src/InsightsService/appsettings.json](../src/InsightsService/appsettings.json) | Application / implementation documentation | `817db0bf2ecca783` |
|
||||||
|
| [src/OVERVIEW.md](../src/OVERVIEW.md) | Application / implementation documentation | `aa7f4ca1ffca79de` |
|
||||||
|
| [src/ObservationService/Application/ObservationApplicationService.cs](../src/ObservationService/Application/ObservationApplicationService.cs) | Application / implementation documentation | `4ceaa7d67b391b0a` |
|
||||||
|
| [src/ObservationService/Application/ObservationRepository.cs](../src/ObservationService/Application/ObservationRepository.cs) | Application / implementation documentation | `a1c21ef7e0700b4f` |
|
||||||
|
| [src/ObservationService/Contracts/MeasurementContextPatch.cs](../src/ObservationService/Contracts/MeasurementContextPatch.cs) | Application / implementation documentation | `fae0cad81e9bec85` |
|
||||||
|
| [src/ObservationService/Contracts/ObservationDto.cs](../src/ObservationService/Contracts/ObservationDto.cs) | Application / implementation documentation | `989312e16eaa4306` |
|
||||||
|
| [src/ObservationService/Contracts/PatchObservationRequest.cs](../src/ObservationService/Contracts/PatchObservationRequest.cs) | Application / implementation documentation | `3be4db307b24e5c8` |
|
||||||
|
| [src/ObservationService/Contracts/RecordObservationRequest.cs](../src/ObservationService/Contracts/RecordObservationRequest.cs) | Application / implementation documentation | `7430845925f6ae9c` |
|
||||||
|
| [src/ObservationService/Contracts/UpdateObservationRequest.cs](../src/ObservationService/Contracts/UpdateObservationRequest.cs) | Application / implementation documentation | `f1d987f3d0d996ce` |
|
||||||
|
| [src/ObservationService/Controllers/ObservationController.cs](../src/ObservationService/Controllers/ObservationController.cs) | Application / implementation documentation | `68fe89a643bf1ff0` |
|
||||||
|
| [src/ObservationService/Domain/BloodPressureObservation.cs](../src/ObservationService/Domain/BloodPressureObservation.cs) | Application / implementation documentation | `a968856d9d9a7e8d` |
|
||||||
|
| [src/ObservationService/Domain/ContextSelection.cs](../src/ObservationService/Domain/ContextSelection.cs) | Application / implementation documentation | `1d7eeba19330a191` |
|
||||||
|
| [src/ObservationService/Domain/MeasurementContext.cs](../src/ObservationService/Domain/MeasurementContext.cs) | Application / implementation documentation | `500c7e2c02213fc1` |
|
||||||
|
| [src/ObservationService/ObservationService.csproj](../src/ObservationService/ObservationService.csproj) | Application / implementation documentation | `2a14c125f601d5fa` |
|
||||||
|
| [src/ObservationService/Persistence/Migrations/20261001095222_InitialObservationSchema.Designer.cs](../src/ObservationService/Persistence/Migrations/20261001095222_InitialObservationSchema.Designer.cs) | Application / implementation documentation | `9f24f074d1c49343` |
|
||||||
|
| [src/ObservationService/Persistence/Migrations/20261001095222_InitialObservationSchema.cs](../src/ObservationService/Persistence/Migrations/20261001095222_InitialObservationSchema.cs) | Application / implementation documentation | `1a44e09a08a6045f` |
|
||||||
|
| [src/ObservationService/Persistence/Migrations/20261005094632_RecordedMeasurementContext.Designer.cs](../src/ObservationService/Persistence/Migrations/20261005094632_RecordedMeasurementContext.Designer.cs) | Application / implementation documentation | `1cb88c86e7a13a5c` |
|
||||||
|
| [src/ObservationService/Persistence/Migrations/20261005094632_RecordedMeasurementContext.cs](../src/ObservationService/Persistence/Migrations/20261005094632_RecordedMeasurementContext.cs) | Application / implementation documentation | `da719484aab8eff2` |
|
||||||
|
| [src/ObservationService/Persistence/Migrations/ObservationDbContextModelSnapshot.cs](../src/ObservationService/Persistence/Migrations/ObservationDbContextModelSnapshot.cs) | Application / implementation documentation | `fb9c5c7d874f4b23` |
|
||||||
|
| [src/ObservationService/Persistence/ObservationDbContext.cs](../src/ObservationService/Persistence/ObservationDbContext.cs) | Application / implementation documentation | `6d9f0c6106db8b2f` |
|
||||||
|
| [src/ObservationService/Persistence/SqlObservationRepository.cs](../src/ObservationService/Persistence/SqlObservationRepository.cs) | Application / implementation documentation | `f77e38151d481cc3` |
|
||||||
|
| [src/ObservationService/Program.cs](../src/ObservationService/Program.cs) | Application / implementation documentation | `7ad86451a63a7b49` |
|
||||||
|
| [src/ObservationService/appsettings.json](../src/ObservationService/appsettings.json) | Application / implementation documentation | `8cd0df652a9a4966` |
|
||||||
|
| [src/PatientProfileService/Application/PatientApplicationService.cs](../src/PatientProfileService/Application/PatientApplicationService.cs) | Application / implementation documentation | `8f673a37101bd11a` |
|
||||||
|
| [src/PatientProfileService/Application/PatientRepository.cs](../src/PatientProfileService/Application/PatientRepository.cs) | Application / implementation documentation | `4d9d0ee890f2ce9e` |
|
||||||
|
| [src/PatientProfileService/Application/ProfileAlreadyExistsException.cs](../src/PatientProfileService/Application/ProfileAlreadyExistsException.cs) | Application / implementation documentation | `96ee280d51c6996f` |
|
||||||
|
| [src/PatientProfileService/Contracts/CreatePatientRequest.cs](../src/PatientProfileService/Contracts/CreatePatientRequest.cs) | Application / implementation documentation | `dd75326c9d723b9a` |
|
||||||
|
| [src/PatientProfileService/Contracts/PatientDto.cs](../src/PatientProfileService/Contracts/PatientDto.cs) | Application / implementation documentation | `2886340d45231135` |
|
||||||
|
| [src/PatientProfileService/Contracts/UpdatePatientRequest.cs](../src/PatientProfileService/Contracts/UpdatePatientRequest.cs) | Application / implementation documentation | `27528295eccdb708` |
|
||||||
|
| [src/PatientProfileService/Controllers/PatientController.cs](../src/PatientProfileService/Controllers/PatientController.cs) | Application / implementation documentation | `ac2c59bf16c70ea7` |
|
||||||
|
| [src/PatientProfileService/Domain/Patient.cs](../src/PatientProfileService/Domain/Patient.cs) | Application / implementation documentation | `7eaeee54560d9754` |
|
||||||
|
| [src/PatientProfileService/PatientProfileService.csproj](../src/PatientProfileService/PatientProfileService.csproj) | Application / implementation documentation | `2a14c125f601d5fa` |
|
||||||
|
| [src/PatientProfileService/Persistence/Migrations/20260930200031_InitialPatientSchema.Designer.cs](../src/PatientProfileService/Persistence/Migrations/20260930200031_InitialPatientSchema.Designer.cs) | Application / implementation documentation | `721fdc07915da2fa` |
|
||||||
|
| [src/PatientProfileService/Persistence/Migrations/20260930200031_InitialPatientSchema.cs](../src/PatientProfileService/Persistence/Migrations/20260930200031_InitialPatientSchema.cs) | Application / implementation documentation | `715e32ae82b3133a` |
|
||||||
|
| [src/PatientProfileService/Persistence/Migrations/20261005082209_AccountProfileAssociation.Designer.cs](../src/PatientProfileService/Persistence/Migrations/20261005082209_AccountProfileAssociation.Designer.cs) | Application / implementation documentation | `7d58aae8acc9e4e1` |
|
||||||
|
| [src/PatientProfileService/Persistence/Migrations/20261005082209_AccountProfileAssociation.cs](../src/PatientProfileService/Persistence/Migrations/20261005082209_AccountProfileAssociation.cs) | Application / implementation documentation | `d61827e783580644` |
|
||||||
|
| [src/PatientProfileService/Persistence/Migrations/PatientDbContextModelSnapshot.cs](../src/PatientProfileService/Persistence/Migrations/PatientDbContextModelSnapshot.cs) | Application / implementation documentation | `4137f40f98d3de0d` |
|
||||||
|
| [src/PatientProfileService/Persistence/PatientDbContext.cs](../src/PatientProfileService/Persistence/PatientDbContext.cs) | Application / implementation documentation | `c3ae81375a6973bb` |
|
||||||
|
| [src/PatientProfileService/Persistence/SqlPatientRepository.cs](../src/PatientProfileService/Persistence/SqlPatientRepository.cs) | Application / implementation documentation | `637d9a788b95ced0` |
|
||||||
|
| [src/PatientProfileService/Program.cs](../src/PatientProfileService/Program.cs) | Application / implementation documentation | `087178aa8c556e97` |
|
||||||
|
| [src/PatientProfileService/appsettings.json](../src/PatientProfileService/appsettings.json) | Application / implementation documentation | `8cd0df652a9a4966` |
|
||||||
|
| [src/README.md](../src/README.md) | Application / implementation documentation | `8779152d2a416c51` |
|
||||||
|
| [src/TRENDS.md](../src/TRENDS.md) | Application / implementation documentation | `0506cb4fef1e36e8` |
|
||||||
|
| [tests/Deployment.AcceptanceTests/BootstrapTests.cs](../tests/Deployment.AcceptanceTests/BootstrapTests.cs) | Acceptance / fixture / test support | `fe3dc46f5c127bb3` |
|
||||||
|
| [tests/Deployment.AcceptanceTests/Deployment.AcceptanceTests.csproj](../tests/Deployment.AcceptanceTests/Deployment.AcceptanceTests.csproj) | Acceptance / fixture / test support | `aa3bee15a11bd295` |
|
||||||
|
| [tests/Deployment.AcceptanceTests/DeploymentFixture.cs](../tests/Deployment.AcceptanceTests/DeploymentFixture.cs) | Acceptance / fixture / test support | `7138d67f1ab0def4` |
|
||||||
|
| [tests/Deployment.AcceptanceTests/InstallationTests.cs](../tests/Deployment.AcceptanceTests/InstallationTests.cs) | Acceptance / fixture / test support | `b771a4ffdd667eb1` |
|
||||||
|
| [tests/Observation.AcceptanceTests/ContextFilteredHistoryTests.cs](../tests/Observation.AcceptanceTests/ContextFilteredHistoryTests.cs) | Acceptance / fixture / test support | `0995b4980a55c1cd` |
|
||||||
|
| [tests/Observation.AcceptanceTests/ContextSelectedInsightTests.cs](../tests/Observation.AcceptanceTests/ContextSelectedInsightTests.cs) | Acceptance / fixture / test support | `ce8e908a3ff10c01` |
|
||||||
|
| [tests/Observation.AcceptanceTests/DeleteContextualisedObservationTests.cs](../tests/Observation.AcceptanceTests/DeleteContextualisedObservationTests.cs) | Acceptance / fixture / test support | `2709163cd782fee2` |
|
||||||
|
| [tests/Observation.AcceptanceTests/DeleteObservationTests.cs](../tests/Observation.AcceptanceTests/DeleteObservationTests.cs) | Acceptance / fixture / test support | `916ebbcc0f5d3737` |
|
||||||
|
| [tests/Observation.AcceptanceTests/HealthInsightTests.cs](../tests/Observation.AcceptanceTests/HealthInsightTests.cs) | Acceptance / fixture / test support | `b6e1cfac712455f3` |
|
||||||
|
| [tests/Observation.AcceptanceTests/HealthOverviewTests.cs](../tests/Observation.AcceptanceTests/HealthOverviewTests.cs) | Acceptance / fixture / test support | `0e7874fde9943828` |
|
||||||
|
| [tests/Observation.AcceptanceTests/HealthTrendTests.cs](../tests/Observation.AcceptanceTests/HealthTrendTests.cs) | Acceptance / fixture / test support | `48266f7b71838fe9` |
|
||||||
|
| [tests/Observation.AcceptanceTests/LatestObservationTests.cs](../tests/Observation.AcceptanceTests/LatestObservationTests.cs) | Acceptance / fixture / test support | `d4cb653d7fc0999b` |
|
||||||
|
| [tests/Observation.AcceptanceTests/MeasurementContextMigrationTests.cs](../tests/Observation.AcceptanceTests/MeasurementContextMigrationTests.cs) | Acceptance / fixture / test support | `7cf4d025ac906cce` |
|
||||||
|
| [tests/Observation.AcceptanceTests/Observation.AcceptanceTests.csproj](../tests/Observation.AcceptanceTests/Observation.AcceptanceTests.csproj) | Acceptance / fixture / test support | `68f9427df8b24b70` |
|
||||||
|
| [tests/Observation.AcceptanceTests/ObservationApiFixture.cs](../tests/Observation.AcceptanceTests/ObservationApiFixture.cs) | Acceptance / fixture / test support | `a26195b246a37547` |
|
||||||
|
| [tests/Observation.AcceptanceTests/ObservationHistoryTests.cs](../tests/Observation.AcceptanceTests/ObservationHistoryTests.cs) | Acceptance / fixture / test support | `17299fb041080f2a` |
|
||||||
|
| [tests/Observation.AcceptanceTests/PatchObservationTests.cs](../tests/Observation.AcceptanceTests/PatchObservationTests.cs) | Acceptance / fixture / test support | `84cbd448712e3b32` |
|
||||||
|
| [tests/Observation.AcceptanceTests/PatientAuthenticationTests.cs](../tests/Observation.AcceptanceTests/PatientAuthenticationTests.cs) | Acceptance / fixture / test support | `466ae0a234bb5deb` |
|
||||||
|
| [tests/Observation.AcceptanceTests/ProfessionalAccessTests.cs](../tests/Observation.AcceptanceTests/ProfessionalAccessTests.cs) | Acceptance / fixture / test support | `1e3c87b0666c6a87` |
|
||||||
|
| [tests/Observation.AcceptanceTests/RecordMeasurementContextTests.cs](../tests/Observation.AcceptanceTests/RecordMeasurementContextTests.cs) | Acceptance / fixture / test support | `d582410cd6b277a7` |
|
||||||
|
| [tests/Observation.AcceptanceTests/RecordObservationTests.cs](../tests/Observation.AcceptanceTests/RecordObservationTests.cs) | Acceptance / fixture / test support | `2cb26f6bed1d3c8e` |
|
||||||
|
| [tests/Observation.AcceptanceTests/UpdateObservationTests.cs](../tests/Observation.AcceptanceTests/UpdateObservationTests.cs) | Acceptance / fixture / test support | `ad18354dc70dbe42` |
|
||||||
|
| [tests/Observation.AcceptanceTests/ViewObservationContextTests.cs](../tests/Observation.AcceptanceTests/ViewObservationContextTests.cs) | Acceptance / fixture / test support | `3b25fb13e3582bdf` |
|
||||||
|
| [tests/PatientProfile.AcceptanceTests/AuthenticationIntegrationTests.cs](../tests/PatientProfile.AcceptanceTests/AuthenticationIntegrationTests.cs) | Acceptance / fixture / test support | `60dbf89fd22f9e75` |
|
||||||
|
| [tests/PatientProfile.AcceptanceTests/CreatePatientTests.cs](../tests/PatientProfile.AcceptanceTests/CreatePatientTests.cs) | Acceptance / fixture / test support | `2b0bb2b9b727a178` |
|
||||||
|
| [tests/PatientProfile.AcceptanceTests/MeasurementGuidanceTests.cs](../tests/PatientProfile.AcceptanceTests/MeasurementGuidanceTests.cs) | Acceptance / fixture / test support | `b4de9f53f067bf7d` |
|
||||||
|
| [tests/PatientProfile.AcceptanceTests/PatientApiFixture.cs](../tests/PatientProfile.AcceptanceTests/PatientApiFixture.cs) | Acceptance / fixture / test support | `e54c213453683996` |
|
||||||
|
| [tests/PatientProfile.AcceptanceTests/PatientProfile.AcceptanceTests.csproj](../tests/PatientProfile.AcceptanceTests/PatientProfile.AcceptanceTests.csproj) | Acceptance / fixture / test support | `d224cf5a084478bf` |
|
||||||
|
| [tests/PatientProfile.AcceptanceTests/UpdatePatientTests.cs](../tests/PatientProfile.AcceptanceTests/UpdatePatientTests.cs) | Acceptance / fixture / test support | `2bfebdf5fceaf2fc` |
|
||||||
|
| [tests/Support/AuthenticatedTestClient.cs](../tests/Support/AuthenticatedTestClient.cs) | Acceptance / fixture / test support | `112bb94396a6272b` |
|
||||||
|
|
||||||
|
## Test behavior index
|
||||||
|
|
||||||
|
This index records declared test method names so that claims can be cross-checked against concrete assertions/setup. Theory case counts are not enumerated; method count is not the executed test count.
|
||||||
|
|
||||||
|
### BootstrapTests.cs
|
||||||
|
|
||||||
|
Source: [tests/Deployment.AcceptanceTests/BootstrapTests.cs](../tests/Deployment.AcceptanceTests/BootstrapTests.cs).
|
||||||
|
|
||||||
|
- `Package_provisioning_detects_runtime_and_postgresql_and_installs_only_needed_dependencies`
|
||||||
|
|
||||||
|
### InstallationTests.cs
|
||||||
|
|
||||||
|
Source: [tests/Deployment.AcceptanceTests/InstallationTests.cs](../tests/Deployment.AcceptanceTests/InstallationTests.cs).
|
||||||
|
|
||||||
|
- `A_selected_service_release_can_be_built_into_a_relative_output_directory`
|
||||||
|
- `Only_selected_payloads_configuration_and_independent_units_are_installed`
|
||||||
|
- `Configuration_and_certificates_are_generated_with_matching_credentials_and_private_permissions`
|
||||||
|
- `Dedicated_database_roles_cannot_access_each_others_data_or_administer_the_server`
|
||||||
|
- `New_deployments_get_new_secrets_and_do_not_overwrite_existing_material`
|
||||||
|
- `Native_configuration_adapters_use_the_same_service_values_and_independent_paths`
|
||||||
|
- `Invalid_service_selection_is_rejected_without_creating_an_installation`
|
||||||
|
- `Invalid_topology_fails_before_generating_configuration_or_credentials`
|
||||||
|
- `A_single_installed_service_starts_and_stops_without_other_local_service_processes`
|
||||||
|
- `Two_colocated_installed_services_run_with_independent_configuration_and_processes`
|
||||||
|
- `Installed_complete_system_runs_in_five_processes_and_preserves_network_and_persistence_boundaries`
|
||||||
|
|
||||||
|
### ContextFilteredHistoryTests.cs
|
||||||
|
|
||||||
|
Source: [tests/Observation.AcceptanceTests/ContextFilteredHistoryTests.cs](../tests/Observation.AcceptanceTests/ContextFilteredHistoryTests.cs).
|
||||||
|
|
||||||
|
- `Independent_and_combined_selections_return_matching_context_and_metadata`
|
||||||
|
- `Unknown_selections_match_unknown_categories_without_interpreting_legacy_text`
|
||||||
|
- `No_selection_retains_all_contexts_in_chronological_order_after_restart`
|
||||||
|
- `Empty_filtered_history_is_an_empty_array_with_applied_selection_metadata`
|
||||||
|
- `Filtered_history_preserves_patient_scope_inclusive_boundaries_and_equal_bounds`
|
||||||
|
- `Unsupported_selections_are_rejected_without_changing_observations`
|
||||||
|
- `Professional_reads_follow_assignments_and_other_patient_tokens_cannot_use_filters_to_gain_access`
|
||||||
|
|
||||||
|
### ContextSelectedInsightTests.cs
|
||||||
|
|
||||||
|
Source: [tests/Observation.AcceptanceTests/ContextSelectedInsightTests.cs](../tests/Observation.AcceptanceTests/ContextSelectedInsightTests.cs).
|
||||||
|
|
||||||
|
- `Independent_and_combined_selections_use_only_matching_observations_and_report_their_basis`
|
||||||
|
- `Unfiltered_insight_includes_unknown_context_and_explains_mixed_and_missing_conditions`
|
||||||
|
- `Unknown_selection_is_explicit_and_legacy_narrative_does_not_create_known_membership`
|
||||||
|
- `Means_round_only_the_final_value_to_two_decimals_with_half_up_rounding`
|
||||||
|
- `Corrections_clearing_and_deletion_change_membership_and_fresh_summary_results_after_restart`
|
||||||
|
- `Filtered_insight_preserves_patient_scope_inclusive_bounds_and_equal_instants`
|
||||||
|
- `Unsupported_selection_is_rejected_with_validation_details`
|
||||||
|
- `Professional_selection_requires_assignment_and_other_patient_access_is_rejected`
|
||||||
|
|
||||||
|
### DeleteContextualisedObservationTests.cs
|
||||||
|
|
||||||
|
Source: [tests/Observation.AcceptanceTests/DeleteContextualisedObservationTests.cs](../tests/Observation.AcceptanceTests/DeleteContextualisedObservationTests.cs).
|
||||||
|
|
||||||
|
- `Deleted_context_stays_absent_from_retrieval_filtered_history_and_latest_after_restart`
|
||||||
|
- `New_numerical_summary_excludes_deleted_values_and_retains_current_remaining_observations`
|
||||||
|
- `Deleting_only_contextualised_observation_leaves_empty_filtered_history_and_no_summary`
|
||||||
|
- `Unauthorised_deletions_preserve_the_observation_and_all_context`
|
||||||
|
|
||||||
|
### DeleteObservationTests.cs
|
||||||
|
|
||||||
|
Source: [tests/Observation.AcceptanceTests/DeleteObservationTests.cs](../tests/Observation.AcceptanceTests/DeleteObservationTests.cs).
|
||||||
|
|
||||||
|
- `Deleted_observation_stays_absent_after_restart_and_other_observations_are_preserved`
|
||||||
|
- `Deleting_the_only_observation_leaves_empty_history_and_no_latest_observation`
|
||||||
|
- `Missing_observation_returns_not_found_without_changing_existing_data`
|
||||||
|
|
||||||
|
### HealthInsightTests.cs
|
||||||
|
|
||||||
|
Source: [tests/Observation.AcceptanceTests/HealthInsightTests.cs](../tests/Observation.AcceptanceTests/HealthInsightTests.cs).
|
||||||
|
|
||||||
|
- `Averages_use_only_the_requested_patient_and_period_after_restart`
|
||||||
|
- `Minimum_and_maximum_values_are_calculated`
|
||||||
|
- `Fractional_averages_are_preserved_and_recalculated_after_correction_and_deletion`
|
||||||
|
- `No_matching_observations_reports_insufficient_data`
|
||||||
|
- `Invalid_or_missing_period_is_rejected`
|
||||||
|
- `Equal_bounds_and_offsets_match_recording_timestamp_semantics`
|
||||||
|
- `Unavailable_observations_report_failure_instead_of_insufficient_data`
|
||||||
|
|
||||||
|
### HealthOverviewTests.cs
|
||||||
|
|
||||||
|
Source: [tests/Observation.AcceptanceTests/HealthOverviewTests.cs](../tests/Observation.AcceptanceTests/HealthOverviewTests.cs).
|
||||||
|
|
||||||
|
- `Overview_preserves_profile_latest_context_and_selected_insight_with_different_bases`
|
||||||
|
- `No_observations_returns_profile_and_explicit_insight_absence`
|
||||||
|
- `Empty_selected_insight_preserves_profile_latest_and_applied_selection`
|
||||||
|
- `Unfiltered_pooled_insight_preserves_mixed_and_unknown_context_explanations`
|
||||||
|
- `Equal_offset_instants_are_valid_and_single_observation_insight_is_sufficient`
|
||||||
|
- `Latest_tie_rules_and_current_corrections_deletions_and_profile_edits_survive_restart`
|
||||||
|
- `Invalid_period_or_context_is_rejected_with_details`
|
||||||
|
- `Assigned_missing_patient_reports_absence_without_exposing_other_patients`
|
||||||
|
- `Overview_requires_owner_or_assigned_professional_and_blocks_direct_bypass`
|
||||||
|
- `Overview_service_credential_is_restricted_to_required_reads`
|
||||||
|
- `Unavailable_source_or_overview_is_a_failure_not_absent_insight`
|
||||||
|
|
||||||
|
### HealthTrendTests.cs
|
||||||
|
|
||||||
|
Source: [tests/Observation.AcceptanceTests/HealthTrendTests.cs](../tests/Observation.AcceptanceTests/HealthTrendTests.cs).
|
||||||
|
|
||||||
|
- `Full_period_direction_and_separate_units_and_levels`
|
||||||
|
- `Equal_endpoints_do_not_hide_intermediate_excursion_or_reversal`
|
||||||
|
- `Overall_decrease_can_coexist_with_reversals_and_large_variation`
|
||||||
|
- `Low_variation_outside_reference_is_not_healthy`
|
||||||
|
- `Favourable_pressure_decrease_can_still_be_high_while_falling_pulse_is_concerning`
|
||||||
|
- `Moving_low_pulse_up_or_high_pulse_down_is_not_automatically_concerning`
|
||||||
|
- `Opposite_pulse_excursions_within_timestamp_ties_are_not_hidden_by_their_mean`
|
||||||
|
- `References_are_setting_specific_sourced_and_not_treatment_targets`
|
||||||
|
- `Pulse_reference_boundaries_are_exclusive`
|
||||||
|
- `Missing_context_preserves_numerical_direction_but_not_resting_interpretation`
|
||||||
|
- `Known_categories_with_missing_preparation_support_limited_reference_comparison`
|
||||||
|
- `Missing_optional_circumstances_do_not_block_supported_comparison`
|
||||||
|
- `Conflicting_rest_narrative_withholds_resting_interpretation`
|
||||||
|
- `Different_conditions_and_preparation_are_visible_and_limit_combined_trajectory`
|
||||||
|
- `Known_inadequate_pressure_preparation_does_not_block_resting_pulse_reference`
|
||||||
|
- `Timestamp_ties_do_not_manufacture_direction_or_hide_descriptive_range`
|
||||||
|
- `Empty_and_single_series_report_each_unavailable_part`
|
||||||
|
- `Retrieval_and_identifier_order_do_not_change_results_including_ties`
|
||||||
|
- `Inclusive_patient_period_and_equal_offset_instants_apply_before_sufficiency`
|
||||||
|
- `Labelled_home_and_clinic_selections_and_independent_dimensions_use_only_matches`
|
||||||
|
- `Unknown_empty_and_one_selected_observation_do_not_borrow_excluded_data`
|
||||||
|
- `Corrected_values_context_and_deletions_are_used_on_every_request_after_restart`
|
||||||
|
- `Invalid_period_or_selection_is_rejected_with_explanation`
|
||||||
|
- `Trend_access_requires_authentication_ownership_or_professional_assignment`
|
||||||
|
- `Upstream_failure_is_not_misreported_as_empty_data`
|
||||||
|
|
||||||
|
### LatestObservationTests.cs
|
||||||
|
|
||||||
|
Source: [tests/Observation.AcceptanceTests/LatestObservationTests.cs](../tests/Observation.AcceptanceTests/LatestObservationTests.cs).
|
||||||
|
|
||||||
|
- `Latest_is_selected_by_measurement_time_for_the_requested_patient_after_restart`
|
||||||
|
- `Patient_without_observations_returns_not_found_even_when_another_patient_has_observations`
|
||||||
|
- `Newer_after_activity_observation_is_returned_with_its_own_context`
|
||||||
|
- `Missing_context_does_not_replace_latest_with_an_older_complete_observation`
|
||||||
|
- `Measurement_timestamp_ties_use_original_recording_time_and_ignore_later_edits`
|
||||||
|
- `Complete_timestamp_ties_choose_greatest_identifier_reproducibly_across_restart`
|
||||||
|
|
||||||
|
### MeasurementContextMigrationTests.cs
|
||||||
|
|
||||||
|
Source: [tests/Observation.AcceptanceTests/MeasurementContextMigrationTests.cs](../tests/Observation.AcceptanceTests/MeasurementContextMigrationTests.cs).
|
||||||
|
|
||||||
|
- `Upgrading_an_existing_observation_retains_values_and_text_without_inventing_context`
|
||||||
|
|
||||||
|
### ObservationHistoryTests.cs
|
||||||
|
|
||||||
|
Source: [tests/Observation.AcceptanceTests/ObservationHistoryTests.cs](../tests/Observation.AcceptanceTests/ObservationHistoryTests.cs).
|
||||||
|
|
||||||
|
- `Selected_period_returns_only_the_matching_observation_after_restart`
|
||||||
|
- `Results_are_chronological_and_include_both_period_boundaries`
|
||||||
|
- `No_matching_observations_returns_an_empty_array`
|
||||||
|
- `Invalid_or_missing_period_is_rejected_without_changing_observations`
|
||||||
|
- `Offset_bounds_are_normalized_consistently_with_recorded_measurements`
|
||||||
|
|
||||||
|
### PatchObservationTests.cs
|
||||||
|
|
||||||
|
Source: [tests/Observation.AcceptanceTests/PatchObservationTests.cs](../tests/Observation.AcceptanceTests/PatchObservationTests.cs).
|
||||||
|
|
||||||
|
- `Context_can_be_added_to_a_historical_observation_without_changing_its_measurements`
|
||||||
|
- `Correcting_one_context_field_preserves_omitted_data_and_changes_selection_after_restart`
|
||||||
|
- `Individual_optional_fields_can_be_corrected_or_cleared_without_erasing_other_context`
|
||||||
|
- `Explicit_null_context_object_clears_structured_context_but_preserves_legacy_text_and_numbers`
|
||||||
|
- `Single_numerical_and_legacy_text_updates_preserve_other_values`
|
||||||
|
- `Invalid_patches_reject_the_whole_update_without_changes`
|
||||||
|
- `Unsupported_context_in_a_legacy_put_does_not_silently_apply_its_numerical_changes`
|
||||||
|
- `Missing_observation_is_not_created_by_a_context_patch`
|
||||||
|
- `Other_patients_professionals_and_unauthenticated_clients_cannot_patch_context`
|
||||||
|
|
||||||
|
### PatientAuthenticationTests.cs
|
||||||
|
|
||||||
|
Source: [tests/Observation.AcceptanceTests/PatientAuthenticationTests.cs](../tests/Observation.AcceptanceTests/PatientAuthenticationTests.cs).
|
||||||
|
|
||||||
|
- `Login_without_profile_returns_normalized_identity_and_no_patient_data`
|
||||||
|
- `Invalid_account_and_invalid_password_have_same_rejection`
|
||||||
|
- `Missing_and_invalid_tokens_reject_every_existing_patient_operation`
|
||||||
|
- `Own_observations_and_insights_are_available_but_another_patients_reads_and_writes_are_rejected`
|
||||||
|
- `Caller_supplied_account_identity_cannot_replace_authenticated_identity`
|
||||||
|
- `Profile_creation_retries_and_concurrency_preserve_one_persistent_association`
|
||||||
|
- `Failed_creation_can_be_retried_without_an_orphan_profile`
|
||||||
|
- `Expired_token_is_rejected_and_login_produces_a_fresh_token`
|
||||||
|
- `Tampering_with_a_valid_token_is_rejected`
|
||||||
|
- `Database_failure_rolls_back_profile_and_association_together`
|
||||||
|
- `Direct_services_reject_client_tokens_missing_keys_and_forged_keys`
|
||||||
|
- `Service_credentials_are_limited_to_their_documented_read_calls`
|
||||||
|
- `Healthcare_professional_cannot_create_profiles`
|
||||||
|
|
||||||
|
### ProfessionalAccessTests.cs
|
||||||
|
|
||||||
|
Source: [tests/Observation.AcceptanceTests/ProfessionalAccessTests.cs](../tests/Observation.AcceptanceTests/ProfessionalAccessTests.cs).
|
||||||
|
|
||||||
|
- `Login_recognizes_professional_identity_and_does_not_put_assignments_in_the_token_response`
|
||||||
|
- `Professionals_list_only_their_own_assignments_and_can_share_patients`
|
||||||
|
- `Assigned_profiles_observations_context_history_latest_and_insights_are_readable`
|
||||||
|
- `Unassigned_patients_and_observations_are_rejected_even_with_a_supplied_assigned_patient_id`
|
||||||
|
- `Missing_information_for_assigned_patients_follows_existing_retrieval_behaviour`
|
||||||
|
- `Professionals_cannot_create_update_or_delete_any_patient_information`
|
||||||
|
- `Missing_invalid_and_expired_tokens_do_not_disclose_assignments_or_patient_data`
|
||||||
|
- `Incorrect_professional_secret_and_unknown_account_have_identical_login_rejections`
|
||||||
|
- `Patient_cannot_list_professional_assignments_and_retains_own_access`
|
||||||
|
- `Assignment_removal_is_used_after_restart_even_with_an_existing_token`
|
||||||
|
- `Observation_ownership_lookup_failure_fails_closed_while_assignment_list_remains_available`
|
||||||
|
|
||||||
|
### RecordMeasurementContextTests.cs
|
||||||
|
|
||||||
|
Source: [tests/Observation.AcceptanceTests/RecordMeasurementContextTests.cs](../tests/Observation.AcceptanceTests/RecordMeasurementContextTests.cs).
|
||||||
|
|
||||||
|
- `Complete_context_is_saved_with_the_correct_values_and_retrievable_after_restart`
|
||||||
|
- `Setting_and_activity_are_independent_and_departures_from_guidance_are_valid`
|
||||||
|
- `Partial_and_absent_context_remain_unknown_without_reinterpreting_legacy_text`
|
||||||
|
- `Conflicting_categories_and_narrative_are_preserved_without_relabelling`
|
||||||
|
- `Invalid_context_is_rejected_with_validation_details_without_saving`
|
||||||
|
- `Context_is_protected_against_other_patient_reads_and_submissions_and_professional_writes`
|
||||||
|
- `Assigned_professional_can_retrieve_saved_context`
|
||||||
|
|
||||||
|
### RecordObservationTests.cs
|
||||||
|
|
||||||
|
Source: [tests/Observation.AcceptanceTests/RecordObservationTests.cs](../tests/Observation.AcceptanceTests/RecordObservationTests.cs).
|
||||||
|
|
||||||
|
- `Valid_observation_is_assigned_an_identifier_associated_with_the_patient_and_retrievable_after_restart`
|
||||||
|
- `Optional_fields_can_be_omitted_and_identifiers_are_distinct`
|
||||||
|
- `Non_positive_values_are_rejected_without_saving`
|
||||||
|
- `Missing_or_malformed_information_is_rejected_without_saving`
|
||||||
|
- `Missing_patient_is_rejected_without_saving`
|
||||||
|
- `Missing_observation_returns_not_found`
|
||||||
|
- `Failed_patient_lookup_is_rejected_without_saving`
|
||||||
|
|
||||||
|
### UpdateObservationTests.cs
|
||||||
|
|
||||||
|
Source: [tests/Observation.AcceptanceTests/UpdateObservationTests.cs](../tests/Observation.AcceptanceTests/UpdateObservationTests.cs).
|
||||||
|
|
||||||
|
- `Correction_preserves_other_information_and_is_visible_in_all_retrievals_after_restart`
|
||||||
|
- `All_three_measured_values_can_be_corrected`
|
||||||
|
- `Non_positive_values_are_rejected_without_changing_observation`
|
||||||
|
- `Missing_or_malformed_values_are_rejected_without_changes`
|
||||||
|
- `Missing_observation_is_rejected_without_inserting_a_new_observation`
|
||||||
|
|
||||||
|
### ViewObservationContextTests.cs
|
||||||
|
|
||||||
|
Source: [tests/Observation.AcceptanceTests/ViewObservationContextTests.cs](../tests/Observation.AcceptanceTests/ViewObservationContextTests.cs).
|
||||||
|
|
||||||
|
- `Complete_saved_context_is_returned_with_its_measurements_and_timestamp_after_restart`
|
||||||
|
- `Partial_saved_context_distinguishes_known_setting_from_unknown_condition_and_details`
|
||||||
|
- `Historical_free_text_is_returned_without_inventing_setting_or_activity`
|
||||||
|
- `Missing_observation_reports_not_found_without_disclosing_saved_context`
|
||||||
|
- `Unauthorised_callers_cannot_read_observation_context`
|
||||||
|
- `Assigned_professional_reads_the_same_context_as_the_owner`
|
||||||
|
|
||||||
|
### AuthenticationIntegrationTests.cs
|
||||||
|
|
||||||
|
Source: [tests/PatientProfile.AcceptanceTests/AuthenticationIntegrationTests.cs](../tests/PatientProfile.AcceptanceTests/AuthenticationIntegrationTests.cs).
|
||||||
|
|
||||||
|
- `Production_gateway_rejects_plain_http_even_for_login_and_public_guidance`
|
||||||
|
- `Standard_replacement_handler_with_same_identity_retains_ownership_policy`
|
||||||
|
|
||||||
|
### CreatePatientTests.cs
|
||||||
|
|
||||||
|
Source: [tests/PatientProfile.AcceptanceTests/CreatePatientTests.cs](../tests/PatientProfile.AcceptanceTests/CreatePatientTests.cs).
|
||||||
|
|
||||||
|
- `Valid_profile_is_assigned_an_identifier_and_can_be_retrieved_after_restart`
|
||||||
|
- `Missing_required_information_is_rejected_without_persisting`
|
||||||
|
- `Malformed_information_is_rejected`
|
||||||
|
- `Separate_creations_have_distinct_identifiers_and_contact_information_is_optional`
|
||||||
|
- `Unknown_identifier_returns_not_found`
|
||||||
|
|
||||||
|
### MeasurementGuidanceTests.cs
|
||||||
|
|
||||||
|
Source: [tests/PatientProfile.AcceptanceTests/MeasurementGuidanceTests.cs](../tests/PatientProfile.AcceptanceTests/MeasurementGuidanceTests.cs).
|
||||||
|
|
||||||
|
- `Public_guidance_without_patient_records_is_labelled_and_has_ordered_sourced_instructions`
|
||||||
|
- `Activity_is_not_relabelled_as_rest_or_certified`
|
||||||
|
- `Unsupported_guidance_is_explicitly_unavailable_without_unverified_instructions`
|
||||||
|
- `Invalid_categories_return_explained_rejections`
|
||||||
|
|
||||||
|
### UpdatePatientTests.cs
|
||||||
|
|
||||||
|
Source: [tests/PatientProfile.AcceptanceTests/UpdatePatientTests.cs](../tests/PatientProfile.AcceptanceTests/UpdatePatientTests.cs).
|
||||||
|
|
||||||
|
- `Updated_profile_preserves_identity_and_date_of_birth_and_survives_restart`
|
||||||
|
- `Updating_a_missing_patient_is_rejected_without_creating_a_profile`
|
||||||
|
- `Invalid_name_is_rejected_without_changing_the_profile`
|
||||||
|
|
||||||
|
## Ancillary tool evidence
|
||||||
|
|
||||||
|
| Tool | Responsibility |
|
||||||
|
| --- | --- |
|
||||||
|
| [PasswordHash](../tools/PasswordHash/Program.cs) | Established framework hashing utility; reads stdin |
|
||||||
|
| [energy-jmeter README](../tools/energy-jmeter/README.md) | Experiment topology, data/config boundaries and metric collection |
|
||||||
|
| [run.py](../tools/energy-jmeter/run.py) | Orchestrates warmup/measurement, validates telemetry and generates reports |
|
||||||
|
| [generate-plans.py](../tools/energy-jmeter/generate-plans.py) | Native JMX sessions, Gaussian delays, token renewals, live power/PerfMon |
|
||||||
|
| [perfmon.py](../tools/energy-jmeter/perfmon.py) / [shelly.py](../tools/energy-jmeter/shelly.py) | Metric interpretation/validation and measured-window summaries |
|
||||||
|
| [report.py](../tools/energy-jmeter/report.py) | Aligned per-second reporting, separate from application runtime |
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
# Requirements-to-implementation traceability
|
||||||
|
|
||||||
|
Authoritative scope: [common requirements](../Docs/Requirements/00-common-requirements.md), numbered US-01–US-15, [US-16](<../Docs/Requirements/US16 easy installation and deployment installer.txt>) and [installer addendum](../Docs/Requirements/us16-addendum). This is a static implementation/test review, not a new acceptance-test execution report.
|
||||||
|
|
||||||
|
**Implemented** means required behavior is visible in source and mapped tests. **Implemented with limits** means mechanisms exist but some scope/operational evidence is incomplete. No whole US-01–US-15 was found absent. That does not certify every clinical statement or possible deployment/input case. Test coverage references are evidence of checks present, not a claim they passed during this task.
|
||||||
|
|
||||||
|
## Story mapping
|
||||||
|
|
||||||
|
| Story | Observable implementation / acceptance behavior | Source and relevant tests | Status / limits |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| [US-01 create profile](../Docs/Requirements/us01-create-patient-profile.md) | Authenticated initial creation; required name/birth date; generated ID and atomic account association; repeat 409; unique index handles concurrent creation; persistence/retry/DB rollback | [application](../src/PatientProfileService/Application/PatientApplicationService.cs), [repository](../src/PatientProfileService/Persistence/SqlPatientRepository.cs), [CreatePatientTests](../tests/PatientProfile.AcceptanceTests/CreatePatientTests.cs), [PatientAuthenticationTests](../tests/Observation.AcceptanceTests/PatientAuthenticationTests.cs) | Implemented. Interrupted DB writes are checked with a trigger; lost response is approximated by retry after success. No separate process-kill-at-every-write-boundary test. |
|
||||||
|
| [US-02 view profile](../Docs/Requirements/us02-view-patient-profile.md) | Persisted DTO includes ID/name/date/contact; protected own/assigned reads; absent 404 | [controller](../src/PatientProfileService/Controllers/PatientController.cs), [CreatePatientTests](../tests/PatientProfile.AcceptanceTests/CreatePatientTests.cs), [ProfessionalAccessTests](../tests/Observation.AcceptanceTests/ProfessionalAccessTests.cs) | Implemented. Covered in creation/access suites rather than a separate ViewPatientTests file. |
|
||||||
|
| [US-03 update profile](../Docs/Requirements/us03-update-patient-profile.md) | Update name/contact; ID/birth/account/original creation preserved; missing does not create | [SQL repository](../src/PatientProfileService/Persistence/SqlPatientRepository.cs), [UpdatePatientTests](../tests/PatientProfile.AcceptanceTests/UpdatePatientTests.cs) | Implemented. Birth-date editing is not an accepted story behavior. |
|
||||||
|
| [US-04 record observation](../Docs/Requirements/us04-record-observation.md) | Timestamp and positive numerical values; patient lookup before own DB save; independent context dimensions, optional details, unknown defaults, legacy text retained, later read | [application](../src/ObservationService/Application/ObservationApplicationService.cs), [mapping](../src/ObservationService/Persistence/ObservationDbContext.cs), [RecordObservationTests](../tests/Observation.AcceptanceTests/RecordObservationTests.cs), [RecordMeasurementContextTests](../tests/Observation.AcceptanceTests/RecordMeasurementContextTests.cs), [migration test](../tests/Observation.AcceptanceTests/MeasurementContextMigrationTests.cs) | Implemented with limits: preservation is general; narrative conflict interpretation uses US-11 finite phrases. No arbitrary-language conflict detector. |
|
||||||
|
| [US-05 view observation](../Docs/Requirements/us05-view-observation.md) | Read by observation ID includes current measurements/time/context/note; owner/assignment lookup before access; missing 404 | [controller](../src/ObservationService/Controllers/ObservationController.cs), [ViewObservationContextTests](../tests/Observation.AcceptanceTests/ViewObservationContextTests.cs) | Implemented. Directly seeded Given states verify retrieval independently of creating a reading. |
|
||||||
|
| [US-06 latest](../Docs/Requirements/us06-latest-observation.md) | Greatest measurement time, then original recording time, then greatest UUID; context completeness ignored; no observations 404 | [repository](../src/ObservationService/Persistence/SqlObservationRepository.cs), [LatestObservationTests](../tests/Observation.AcceptanceTests/LatestObservationTests.cs) | Implemented, including deterministic complete ties across restart. |
|
||||||
|
| [US-07 history](../Docs/Requirements/us07-observation-history.md) | Inclusive/equal periods, ascending time/UUID, selected dimensions AND, explicit Unknown, no-selection includes all, empty array, metadata headers, invalid selections rejected | [controller](../src/ObservationService/Controllers/ObservationController.cs), [repository](../src/ObservationService/Persistence/SqlObservationRepository.cs), [ObservationHistoryTests](../tests/Observation.AcceptanceTests/ObservationHistoryTests.cs), [ContextFilteredHistoryTests](../tests/Observation.AcceptanceTests/ContextFilteredHistoryTests.cs) | Implemented. Full unpaginated result is actual contract; no requirement for pagination. |
|
||||||
|
| [US-08 correction](../Docs/Requirements/us08-update-observation.md) | Numeric PUT; partial PATCH adds/corrects/clears individual context fields; omitted fields preserved; unsupported fields/category rejected before save; current selection/calculation membership | [patch](../src/ObservationService/Contracts/PatchObservationRequest.cs), [repository](../src/ObservationService/Persistence/SqlObservationRepository.cs), [UpdateObservationTests](../tests/Observation.AcceptanceTests/UpdateObservationTests.cs), [PatchObservationTests](../tests/Observation.AcceptanceTests/PatchObservationTests.cs) | Implemented. No concurrent-update conflict detection, outside explicit story criteria. |
|
||||||
|
| [US-09 delete](../Docs/Requirements/us09-delete-observation.md) | Physical row/context deletion; no later read/history/statistics contribution; unaffected remaining data; access controls | [repository](../src/ObservationService/Persistence/SqlObservationRepository.cs), [DeleteObservationTests](../tests/Observation.AcceptanceTests/DeleteObservationTests.cs), [DeleteContextualisedObservationTests](../tests/Observation.AcceptanceTests/DeleteContextualisedObservationTests.cs) | Implemented. No separate stored result/context lifecycle to clean up. |
|
||||||
|
| [US-10 numerical insight](../Docs/Requirements/us10-calculated-insight.md) | Current filtered observations; arithmetic means/final two-decimal half-up; BP extrema; single sufficient; empty insufficient 404; explicit selection/count/context limitations | [calculator](../src/InsightsService/Domain/InsightCalculator.cs), [HealthInsightTests](../tests/Observation.AcceptanceTests/HealthInsightTests.cs), [ContextSelectedInsightTests](../tests/Observation.AcceptanceTests/ContextSelectedInsightTests.cs) | Implemented. No stored summary per baseline correction. |
|
||||||
|
| [US-11 trend](../Docs/Requirements/us11-health-trend.md) | Three separate metric assessments, full-period direction/OLS/variation, reversals and timestamp ties, reference scopes/limits, context comparability, selections and unavailable parts; corrections/deletions fresh | [calculator](../src/InsightsService/Domain/InsightCalculator.Trends.cs), [HealthTrendTests](../tests/Observation.AcceptanceTests/HealthTrendTests.cs), [method documentation](../src/TRENDS.md) | Implemented with limits: finite narrative phrases and locally coded clinical inferences need separate clinical review for broader claims; not independently validated here. |
|
||||||
|
| [US-12 overview](../Docs/Requirements/us12-health-overview.md) | Profile + latest overall + selected-period insight; latest context distinct; no-match keeps available parts; unknown/mixed explanations; invalid period/access/failures | [application](../src/HealthOverviewService/Application/HealthOverviewApplicationService.cs), [HealthOverviewTests](../tests/Observation.AcceptanceTests/HealthOverviewTests.cs) | Implemented. No trend component and no cross-service snapshot, both documented. |
|
||||||
|
| [US-13 patient authentication](../Docs/Requirements/us13-patient-authentication.md) | Valid generic login; opaque expiry/tamper checks; own-data restrictions by actual owner; profile-less login/create; persistence/bypass protection | [security](../src/ApiGateway/Security/PatientAccessMiddleware.cs), [PatientAuthenticationTests](../tests/Observation.AcceptanceTests/PatientAuthenticationTests.cs), [AuthenticationIntegrationTests](../tests/PatientProfile.AcceptanceTests/AuthenticationIntegrationTests.cs) | Implemented. Test clocks/replacement handlers are test-only; native secrets/files/network remain deployment responsibilities. |
|
||||||
|
| [US-14 professional reads](../Docs/Requirements/us14-professional-access.md) | Login role, own assignment list, many-to-many assignment reading including context/trends/overview; empty/missing results; unassigned concealment; all writes rejected | [assignments](../src/ApiGateway/Security/ProfessionalAssignments.cs), [ProfessionalAccessTests](../tests/Observation.AcceptanceTests/ProfessionalAccessTests.cs), [trend](../tests/Observation.AcceptanceTests/HealthTrendTests.cs), [overview](../tests/Observation.AcceptanceTests/HealthOverviewTests.cs) | Implemented. Fresh installer professional has no assignments; configured examples/tests demonstrate assigned workflow. Assignment administration is excluded. |
|
||||||
|
| [US-15 guidance](../Docs/Requirements/us15-measurement-guidance.md) | Public ordered sourced home/rest instructions, applicability/review dates, pulse/activity limits, unavailable setting explanation, no record/certification side effects; valid submission independent of viewing | [controller](../src/ApiGateway/Controllers/MeasurementGuidanceController.cs), [MeasurementGuidanceTests](../tests/PatientProfile.AcceptanceTests/MeasurementGuidanceTests.cs), [record-context tests](../tests/Observation.AcceptanceTests/RecordMeasurementContextTests.cs) | Implemented. Clinical references are compiled metadata, not dynamically refreshed guidance or evidence of current source validation in this task. |
|
||||||
|
| US-16 independent installation plus addendum | Selected payloads/processes/config; matching keys/HTTPS trust; runtime/PostgreSQL provisioning, separate DBs/roles/migrations; colocated/distributed origins; verification | [installer](../deploy/installer/install.sh), [provisioner](../deploy/HealthApp.Provisioning/Program.cs), [InstallationTests](../tests/Deployment.AcceptanceTests/InstallationTests.cs), [BootstrapTests](../tests/Deployment.AcceptanceTests/BootstrapTests.cs) | Implemented with operational/verification limits detailed below. Windows/macOS extend the Linux requirement text. |
|
||||||
|
|
||||||
|
## US-11 acceptance groups
|
||||||
|
|
||||||
|
| Criteria | Implementation/test basis |
|
||||||
|
| --- | --- |
|
||||||
|
| A/B/C: separate metrics, patient/period, direction | `CalculateTrend`, `AssessMeasurement`; separate units and all-timepoint calculations; tests `Full_period_direction_and_separate_units_and_levels`, `Inclusive_patient_period_and_equal_offset_instants_apply_before_sufficiency` |
|
||||||
|
| D/E: intermediate excursion and reversal | Raw range plus grouped adjacent absolute change/sign reversals; tests `Equal_endpoints_do_not_hide_intermediate_excursion_or_reversal`, `Overall_decrease_can_coexist_with_reversals_and_large_variation` |
|
||||||
|
| F/G/H/I: levels/interpretations/conflicting metrics | Applicable reference comparisons and separate hints; tests `Low_variation_outside_reference_is_not_healthy`, `Favourable_pressure_decrease_can_still_be_high_while_falling_pulse_is_concerning`, pulse boundary/tie excursion tests; independent clinical assessment remains unperformed |
|
||||||
|
| J/K/L: missing context, insufficiency, reference values | `AssessComparability`/`SelectReference`, explicit unavailable parts and provisional references; missing preparation/inadequate rest/setting-specific reference tests |
|
||||||
|
| M/N: ordering independence and freshness | Timestamp grouping/sorting; fresh HTTP history on each call; tests `Retrieval_and_identifier_order_do_not_change_results_including_ties`, `Corrected_values_context_and_deletions_are_used_on_every_request_after_restart` |
|
||||||
|
| Context additions | Filtered history retrieval, metadata and comparability evidence; selected Home/Clinic/Unknown, empty/single series and contradictory phrase tests |
|
||||||
|
|
||||||
|
All named tests above are in [HealthTrendTests.cs](../tests/Observation.AcceptanceTests/HealthTrendTests.cs).
|
||||||
|
|
||||||
|
## US-16 acceptance groups and operational gaps
|
||||||
|
|
||||||
|
| Criterion | Evidence | Remaining uncertainty / incomplete verification |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| A/B/C selected/single/multiple/all | Release selection, installer selection, distinct payloads/units, direct independent processes | Normal single-node partial installation must reuse a plan with reachable remote dependencies or defer final topology check; creating a new default plan is not discovery of an existing deployment. |
|
||||||
|
| D independent config | Per-service env/JSON/certificates/origins/DB values; native configuration tests | Source templates and generated units differ; document generated behavior. |
|
||||||
|
| E separate machines | Runtime origins and HTTP are location-independent; scoped SSH/SCP distribution tests | Real separate-machine native deployment/network evidence not established by loopback/double tests. |
|
||||||
|
| F independent service management | Native registrations have no peer coupling; direct process stop/restart tests | Linux/Windows/macOS manager behavior must be demonstrated on native hosts; no new native run was performed here. |
|
||||||
|
| G persistence ownership | Separate DB/role generation, PUBLIC revocation, dedicated credential checks | Normal DB credentials own schema for migrations; mandatory encrypted DB transport is not implemented. |
|
||||||
|
| H preserve architecture | Same DLLs and Gateway-routed APIs on all layouts | No container/shared-memory/merged-service runtime path present. |
|
||||||
|
| I installation verification | Native active/PID checks (Linux/Windows), HTTPS/DB/callback probes, complete synthetic workflow | Live verifier does not explicitly stop/restart each service; macOS has no explicit distinct-PID comparison. Literal `all` enables complete verification in local wrappers; listing all five names does not. |
|
||||||
|
| Addendum dependencies/config | Apt ancestry/package checks; generated secrets/CA/PFX/roles/config/migration/native startup | Package doubles do not prove every distro/version/CPU; Linux automation limited to Debian/Ubuntu family; Windows/macOS packages/native execution require native evidence. |
|
||||||
|
|
||||||
|
## Missing functionality versus scope exclusions
|
||||||
|
|
||||||
|
No wholly unimplemented accepted backend user story was identified by this static review. Concrete incomplete **verification** items are native stop/restart demonstration in the live verifier, explicit macOS PID separation, complete-workflow verification for the five-name selection form, and actual multi-machine/native-platform evidence. General narrative understanding and independent clinical applicability remain **unknown**, rather than established complete capabilities. See [discrepancies](discrepancies.md) for exact evidence.
|
||||||
|
|
||||||
|
Registration, recovery, MFA, refresh tokens, professional credential verification, consent/emergency access, professional writes, assignment administration, a product frontend, pagination, optimistic concurrency, backup/restore, HA and production hardening are not accepted features established by the inspected stories. Their absence is recorded without adding scope or treating suggestions as approved requirements.
|
||||||
|
|
||||||
|
## Shared constraints
|
||||||
|
|
||||||
|
Ownership/professional access applies across all patient-specific routes; guidance alone is public. Inclusive/equal periods and offset normalization apply consistently to history, summary, trend and overview insight. `Unknown` is independently selectable; legacy narrative is never converted to a definite category. Persistence/restart tests and migration tests check ownership and context continuity. The snapshot is backend/source complete but not a claim that tests, external clinical sources or every deployment platform were freshly validated.
|
||||||
@@ -0,0 +1,291 @@
|
|||||||
|
# HealthApp software architecture — as built
|
||||||
|
|
||||||
|
## 1. Scope and evidence
|
||||||
|
|
||||||
|
This is a source-level snapshot dated 2026-10-12 at commit `5d9371388c15066eeb2bc124ed227659c644dab5`. The system is a prototype REST backend for synthetic patient profiles, blood-pressure observations and derived assessments. It includes an installer and separate experiment tools. A web/mobile client is a context actor in the original diagrams; no product frontend is implemented in this repository.
|
||||||
|
|
||||||
|
Descriptions below are verified from source unless explicitly labelled inferred or unknown. Evidence links resolve to the inspected repository. Existing specifications supply context, especially [architecture authority](../Docs/Architecture/README.md), [common requirements](../Docs/Requirements/00-common-requirements.md), [Insights correction](../Docs/Architecture/us10-insights-correction.md) and [authentication design](../Docs/Design/authentication-and-access-control-design.md). Their differences from the implementation are catalogued in [discrepancies](discrepancies.md).
|
||||||
|
|
||||||
|
The [evidence inventory](evidence-inventory.md) records the inspected files. Automated tests were read, not rerun; this document makes no new test-pass, performance, clinical-validation or native-platform deployment claim.
|
||||||
|
|
||||||
|
## 2. Style, boundaries and structure
|
||||||
|
|
||||||
|
The implementation uses five independently buildable ASP.NET Core controller projects and operating-system processes. The topology is synchronous request/response microservices with a central API Gateway, service-owned persistence, and conventional controller/application/repository layering in the two persistent services. There is no application message bus, event processing, background synchronization or shared production implementation library. See [solution](../HealthApp.slnx), [logical diagram](diagrams/02-logical-services.drawio) and each service's `Program.cs` below.
|
||||||
|
|
||||||
|
| Process / project | Responsibility | Local implementation | State |
|
||||||
|
| --- | --- | --- | --- |
|
||||||
|
| [ApiGateway](../src/ApiGateway/Program.cs) | Client login, token authentication, ownership/assignment authorization, explicit API forwarding, public guidance | Controllers, security middleware, framework authentication and named HTTP clients | Startup account/assignment configuration; persistent token-protection key files |
|
||||||
|
| [PatientProfileService](../src/PatientProfileService/Program.cs) | Initial profile/account association, profile reads and updates | Controller → scoped application service → repository interface → SQL repository → EF context | Own PostgreSQL database, `patient` table |
|
||||||
|
| [ObservationService](../src/ObservationService/Program.cs) | Record/read/latest/history/correct/delete observations and their context | Controller → scoped application service → repository interface → SQL repository → EF context; gateway HTTP client for patient existence | Own PostgreSQL database, `blood_pressure_observation` table |
|
||||||
|
| [InsightsService](../src/InsightsService/Program.cs) | On-demand numerical summaries and context-aware trend assessment | Controller → scoped application service → observation HTTP client and singleton stateless calculator | No database or generated-result persistence |
|
||||||
|
| [HealthOverviewService](../src/HealthOverviewService/Program.cs) | Compose profile, latest overall observation and selected-period numerical insight | Controller → scoped application service → three typed HTTP clients | No database or generated-result persistence |
|
||||||
|
|
||||||
|
Every business call between services passes through the Gateway. The Gateway sends `X-Gateway-Key` to a target service; Observation, Insights and Overview call the Gateway using their own `X-Service-Key`. The Patient/Profile service has no outgoing business HTTP dependency. There are no direct Insights→Observation or Overview→Patient/Profile network calls: client class names denote the resource consumed, while their configured origin is the Gateway. This matches the [original service topology](../Docs/Architecture/02_microservice_architecture.jpg).
|
||||||
|
|
||||||
|
Within a service, dependencies are ordinary dependency injection calls. Between services, dependencies are actual HTTP/JSON calls; production projects do not reference each other's implementations. Tests do reference multiple projects and create hosts in one test runner, which is a testing arrangement, not the deployed process model.
|
||||||
|
|
||||||
|
The separate [HealthApp.Provisioning](../deploy/HealthApp.Provisioning/Program.cs) executable prepares deployment material, provisions databases and verifies the installed system. It is an administrative utility, not an additional microservice. [PasswordHash](../tools/PasswordHash/Program.cs) is another standalone utility for hashing input passwords, outside the solution's service topology.
|
||||||
|
|
||||||
|
## 3. Domain and ownership
|
||||||
|
|
||||||
|
The [domain diagram](diagrams/03-domain-model.drawio) uses business concepts, while [class diagrams](diagrams/04-design-classes.drawio) use actual implementation types.
|
||||||
|
|
||||||
|
The complete domain view includes authentication grants, professional assignments, guidance instructions and reference provenance as well as profiles, observations and calculated views. Deployment administration has a separate supporting-domain page. Each service also has its own implementation class-diagram file, linked from [README](README.md). Each declared class, record and interface is an individual UML classifier, including nested records, startup and generated EF support types. [Class-diagram coverage](class-diagram-coverage.md) maps all 78 source types and explains visibility, members and relationship notation.
|
||||||
|
|
||||||
|
A pre-created **account** identifies a Patient or HealthcareProfessional. A Patient account has zero associated profiles initially and one after creation. A **patient profile** has a generated identifier, name, date of birth and optional contact information. The association is persisted in the profile's row, separate from credential configuration. Legacy rows can have null account association.
|
||||||
|
|
||||||
|
A **blood-pressure observation** belongs to one patient by external patient identifier. It records measurement time, systolic/diastolic pressure, device-reported pulse, original free-text context and note, and one structured **measurement context**. Setting and activity categories remain independent; missing values become `Unknown`. Optional preparation/technique details remain unknown/null rather than being inferred from legacy text. Context has no independent persisted identifier or lifecycle.
|
||||||
|
|
||||||
|
A **context selection** optionally restricts setting and/or activity. Both supplied dimensions must match; omitted dimensions are unrestricted. An explicit `Unknown` is a filter value, not omission. A **health insight** summarizes current selected observations. A **trend assessment** contains separate systolic, diastolic and pulse assessments plus comparability evidence. A **health overview** combines a profile, optional latest observation and optional numerical insight. These are calculated values, not stored domain entities.
|
||||||
|
|
||||||
|
HealthcareProfessional **assignments** form a configured many-to-many account/patient relationship. No professional profile or assignment table exists. General **measurement guidance** has no patient association and does not write observations.
|
||||||
|
|
||||||
|
Evidence: [Patient](../src/PatientProfileService/Domain/Patient.cs), [observation](../src/ObservationService/Domain/BloodPressureObservation.cs), [measurement context](../src/ObservationService/Domain/MeasurementContext.cs), [selection](../src/ObservationService/Domain/ContextSelection.cs), [insight](../src/InsightsService/Domain/HealthInsight.cs), [trend types](../src/InsightsService/Domain/TrendAssessment.cs), [overview contracts](../src/HealthOverviewService/Contracts/HealthOverviewDto.cs), [assignments](../src/ApiGateway/Security/ProfessionalAssignments.cs).
|
||||||
|
|
||||||
|
## 4. Public API and contracts
|
||||||
|
|
||||||
|
All routes below are exposed by Gateway controllers. IDs are GUID route values. JSON uses the standard ASP.NET Core serializer conventions. Authentication applies to patient-specific routes; professionals can only read assigned patients, and only professionals can list their own assignments.
|
||||||
|
|
||||||
|
| Method and route | Input / result | Owning component |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `POST /api/authentication/login` | Required `accountId`, `password`; 200 access token, token type, lifetime, account ID, role; invalid credentials 401 | Gateway |
|
||||||
|
| `GET /api/measurement-guidance` | Optional setting/activity; 200 ordered guidance or explained unavailability; unsupported values 400 | Gateway; public |
|
||||||
|
| `GET /api/professionals/me/patients` | 200 array of `{patientId}` assignments, possibly empty | Gateway |
|
||||||
|
| `POST /api/patients` | Required name/dateOfBirth, optional contactInfo; 201 profile and Location; existing profile 409 | Patient/Profile |
|
||||||
|
| `GET /api/patients/me` | 200 authenticated account's profile; unavailable 404 | Patient/Profile via Gateway account lookup |
|
||||||
|
| `GET /api/patients/{patientId}` | 200 profile; missing/unauthorized owner 404 | Patient/Profile |
|
||||||
|
| `PUT /api/patients/{patientId}` | Required name, optional contactInfo; 200 updated profile; date of birth is not editable | Patient/Profile |
|
||||||
|
| `POST /api/patients/{patientId}/observations` | Required measuredAt and positive integer systolic/diastolic/pulse; optional structured context, context text and note; 201 observation and Location | Observation |
|
||||||
|
| `GET /api/observations/{observationId}` | 200 observation with recorded context; unavailable 404 | Observation |
|
||||||
|
| `PUT /api/observations/{observationId}` | All three positive measured values required; 200 corrected observation; other fields preserved | Observation |
|
||||||
|
| `PATCH /api/observations/{observationId}` | At least one supported measured/context/note field; 200 patched observation | Observation |
|
||||||
|
| `DELETE /api/observations/{observationId}` | 204 deleted; unavailable 404 | Observation |
|
||||||
|
| `GET /api/patients/{patientId}/observations/latest` | 200 latest overall observation; none 404 | Observation |
|
||||||
|
| `GET /api/patients/{patientId}/observations` | Required from/to, optional context selection; 200 array, empty `[]` allowed | Observation |
|
||||||
|
| `GET /api/patients/{patientId}/insights` | Required from/to, optional context selection; 200 numerical insight; no matching data 404 Problem | Insights |
|
||||||
|
| `GET /api/patients/{patientId}/trends` | Same query; 200 assessment, including explicit unavailable parts for empty/insufficient data | Insights |
|
||||||
|
| `GET /api/patients/{patientId}/overview` | Same query applied to insight only; 200 overview with nullable latest/insight; missing patient 404 Problem | Overview |
|
||||||
|
|
||||||
|
Gateway route evidence: [Patient](../src/ApiGateway/Controllers/PatientController.cs), [Observation](../src/ApiGateway/Controllers/ObservationController.cs), [Insights](../src/ApiGateway/Controllers/InsightsController.cs), [Overview](../src/ApiGateway/Controllers/HealthOverviewController.cs), [Professional](../src/ApiGateway/Controllers/ProfessionalController.cs), [Authentication](../src/ApiGateway/Controllers/AuthenticationController.cs), [Guidance](../src/ApiGateway/Controllers/MeasurementGuidanceController.cs). Backend-specific statuses/validation are defined by the corresponding controllers and contracts, not by a general reverse-proxy engine.
|
||||||
|
|
||||||
|
### 4.1 Forwarding and internal contracts
|
||||||
|
|
||||||
|
Gateway forwarding constructs a new HTTP request with a configured target and key. It streams POST/PUT/PATCH bodies and forwards Content-Type, not arbitrary client headers. It does not forward client tokens, client-selected account identities or callback keys. Profile creation explicitly derives `X-Account-Id` from the authenticated claim. Response forwarding preserves status, Content-Type and Location (absolute locations are reduced to path/query). Observation forwarding also preserves `X-Measurement-Setting` and `X-Activity-Condition`. The rest of upstream headers are not generically copied. Redirect following is disabled on all configured business HTTP clients.
|
||||||
|
|
||||||
|
Backend endpoints mostly mirror the Gateway routes. Patient/Profile additionally exposes `GET /api/patients/by-account/{accountId}` behind its key boundary; Gateway uses it internally and does not expose a corresponding controller route. `/api/patients/me`, login, guidance and assignment listing are Gateway-owned routes.
|
||||||
|
|
||||||
|
DTOs are defined locally within each service; consumers deserialize equivalent wire shapes without shared service project references. Insights duplicates an observation/context DTO; Overview duplicates patient, observation, insight and selection DTOs. These are structural JSON contracts, not references to remote domain objects. There is no OpenAPI/Swagger endpoint, API-versioning mechanism or generated client in the application setup.
|
||||||
|
|
||||||
|
### 4.2 Validation, patch and period semantics
|
||||||
|
|
||||||
|
`[ApiController]`, data annotations and JSON parsing reject invalid model input with 400 validation details. Categories are case-sensitive for recording/filtering/patching: settings `Home`, `Clinic`, `Other`, `Unknown`; activities `AtRest`, `DuringActivity`, `AfterActivity`, `Unknown`. General guidance trims and compares categories without case sensitivity. Numeric observation values must be positive integers; optional rest duration is a nonnegative decimal in minutes. There are no documented clinical upper/lower plausibility checks beyond those input constraints.
|
||||||
|
|
||||||
|
PATCH uses setter-maintained `...Specified` flags marked `[JsonIgnore]`. Omitted fields remain unchanged; explicit null clears optional text/details; null setting/activity becomes `Unknown`; null entire context resets it to unknown categories/null details. Numeric values cannot be cleared. Empty or unknown-field patches are rejected. Observation PUT accepts only the three numerical fields and rejects unmapped fields. Profile update preserves identifier, birth date, original creation time and account association; omitted/null contact information clears it. These behaviors are implemented in [patch contracts](../src/ObservationService/Contracts/PatchObservationRequest.cs), [context patch](../src/ObservationService/Contracts/MeasurementContextPatch.cs), [PUT contract](../src/ObservationService/Contracts/UpdateObservationRequest.cs) and [repositories](../src/ObservationService/Persistence/SqlObservationRepository.cs).
|
||||||
|
|
||||||
|
Period boundaries are inclusive. Reversed bounds are rejected; equal bounds are valid. Offset-free timestamp values are interpreted as UTC clock values, independent of host timezone. Offset-bearing values are normalized to UTC and stored as `DateTimeKind.Unspecified` in PostgreSQL `timestamp without time zone`. Responses therefore need not contain a trailing `Z`; clients must retain the documented UTC interpretation. `DateOnly` represents birth dates. Evidence: [record/period normalization](../src/ObservationService/Application/ObservationApplicationService.cs), [Insights normalization](../src/InsightsService/Application/InsightsApplicationService.cs), [Overview normalization](../src/HealthOverviewService/Application/HealthOverviewApplicationService.cs), [implementation timestamp documentation](../src/README.md), [offset/boundary tests](../tests/Observation.AcceptanceTests/ContextFilteredHistoryTests.cs).
|
||||||
|
|
||||||
|
## 5. Persistence and consistency
|
||||||
|
|
||||||
|
See [data diagram](diagrams/05-data-ownership.drawio). Each persistent service has a scoped EF Core DbContext and SQL repository. Reads generally use `AsNoTracking`; observation patches load a tracked entity and save it. Patient updates use `ExecuteUpdateAsync`, observation deletes use `ExecuteDeleteAsync`. There is no shared database access between application services.
|
||||||
|
|
||||||
|
| Owner/table | Columns and constraints |
|
||||||
|
| --- | --- |
|
||||||
|
| Patient/Profile `patient` | `patient_id uuid` PK generated by application; `account_id text NULL` with unique index `IX_patient_account_id`; required `name varchar`, `date_of_birth date`; optional `contact_info varchar`; required `created_at`, `updated_at timestamp without time zone` |
|
||||||
|
| Observation `blood_pressure_observation` | `observation_id uuid` PK generated by application; external `patient_id uuid`; `measured_at timestamp without time zone`; integer `systolic`, `diastolic`, `pulse`; optional `context`, `note varchar`; required original/update timestamps; required text `setting`, `activity_condition` default `Unknown`; nullable numeric `rest_duration_minutes` and text body position/arm/device/cuff/circumstances |
|
||||||
|
| Each EF-owned database | Framework `__EFMigrationsHistory`; no patient/observation cross-database foreign key |
|
||||||
|
|
||||||
|
`MeasurementContext` is an EF owned value flattened into the observation row. There is no separate context/preparation table. Database mappings declare PKs and the account uniqueness index, but no observation patient/time/filter indexes or category/positive-value check constraints. Input validation is enforced by APIs/application services; database credentials remain a separate trust boundary.
|
||||||
|
|
||||||
|
Evidence: [PatientDbContext](../src/PatientProfileService/Persistence/PatientDbContext.cs), [ObservationDbContext](../src/ObservationService/Persistence/ObservationDbContext.cs), [profile initial migration](../src/PatientProfileService/Persistence/Migrations/20260930200031_InitialPatientSchema.cs), [association migration](../src/PatientProfileService/Persistence/Migrations/20261005082209_AccountProfileAssociation.cs), [observation initial migration](../src/ObservationService/Persistence/Migrations/20261001095222_InitialObservationSchema.cs), [context migration](../src/ObservationService/Persistence/Migrations/20261005094632_RecordedMeasurementContext.cs).
|
||||||
|
|
||||||
|
### 5.1 Profile creation
|
||||||
|
|
||||||
|
Profile creation and account association are a single row insert. The application checks for an existing account first, but the unique database index is the final concurrency guard. A conflicting PostgreSQL `23505` for that index is translated into `ProfileAlreadyExistsException` and 409. Database failure leaves no separate association step to recover; a lost successful response followed by retry returns the existing-profile conflict, and `/api/patients/me` retrieves the association. Legacy null-account rows remain possible, with no automatic credential association/backfill.
|
||||||
|
|
||||||
|
Evidence: [application](../src/PatientProfileService/Application/PatientApplicationService.cs), [repository](../src/PatientProfileService/Persistence/SqlPatientRepository.cs), [concurrency/retry/trigger rollback tests](../tests/Observation.AcceptanceTests/PatientAuthenticationTests.cs).
|
||||||
|
|
||||||
|
### 5.2 Observation queries and changes
|
||||||
|
|
||||||
|
Recording first verifies patient existence by Observation→Gateway→Patient/Profile. Only then does it save the observation in its own database. This is not a distributed transaction or database foreign key. There is no patient deletion endpoint, but the runtime lookup and write still occur at different instants.
|
||||||
|
|
||||||
|
Latest orders by descending measurement time, then original `created_at`, then observation UUID under PostgreSQL ordering. Edits never update original recording time. History filters one patient, inclusive period and both requested context predicates; it orders measurement time ascending then UUID ascending. It returns all matching rows as a list with no pagination or result-size cap. Patch updates preserve omitted values; physical deletion removes the row and all its flattened context.
|
||||||
|
|
||||||
|
New insights/trends/overviews read current data. No invalidation event is needed because no generated result is stored. This does **not** imply a cross-service snapshot: overview profile, latest and insight are separate reads. A write between them can produce a composition from different instants.
|
||||||
|
|
||||||
|
## 6. Calculation and aggregation behavior
|
||||||
|
|
||||||
|
### 6.1 Numerical insight
|
||||||
|
|
||||||
|
Insights requests filtered history through the Gateway and calculates arithmetic decimal means for systolic/diastolic/pulse; only final means are rounded to two decimals, midpoint away from zero (half-up for the permitted positive inputs). Blood-pressure minima/maxima retain original integer values. One observation suffices. Zero returns no insight and a 404 Problem; it is not an upstream failure.
|
||||||
|
|
||||||
|
The response includes patient, normalized period, applied selection, contributing count and descriptive context explanation. Mixed/unknown settings, activities and optional details are disclosed. Source data is neither relabelled nor persisted by Insights. Evidence: [summary calculator](../src/InsightsService/Domain/InsightCalculator.cs), [HTTP observation client](../src/InsightsService/Clients/HttpObservationServiceClient.cs), [summary tests](../tests/Observation.AcceptanceTests/ContextSelectedInsightTests.cs).
|
||||||
|
|
||||||
|
### 6.2 Trends and comparability
|
||||||
|
|
||||||
|
Each metric retains mean/min/max/range over every selected raw observation. Temporal calculations group identical measurement timestamps into arithmetic means, then sort by timestamp. At least two distinct timestamps are needed for direction. Adjacent nonzero changes determine Increasing, Decreasing, Mixed or NoClearDirection; sign changes count reversals. Total successive change sums absolute adjacent changes. An ordinary least-squares fit across all distinct timestamp means supplies OverallDirection and SlopePerDay; each timestamp group has equal weight. Time is scaled to the observed span for calculation; slope output is rounded to six decimals. Empty or single-timestamp data returns explicit unavailable portions, not fabricated direction.
|
||||||
|
|
||||||
|
Recorded comparability inspects setting/activity/rest/posture/arm/device/cuff similarities, missing details and differences, plus differing additional circumstances. A finite list of case-insensitive narrative phrases detects conflicts between declared Home/Clinic/AtRest and preserved text. This is deterministic phrase matching, not NLP; unrecognized text does not establish correctness, and negations can still match.
|
||||||
|
|
||||||
|
The compiled reference metadata supports resting pulse comparisons below 50 or above 100 beats/min, and high blood-pressure comparisons at or above home 135/85 or clinic 140/90 mmHg. Blood-pressure reference selection requires a single known Home/Clinic setting and recorded AtRest, without detected conflicts or explicitly inadequate rest/posture. Missing preparation details can permit a limited provisional reference comparison. These figures describe the **implemented reference selection**, not new medical advice or an independent verification of the sources.
|
||||||
|
|
||||||
|
Interpretation distinguishes supported numerical findings from cautiously labelled PotentiallyFavourable, PotentiallyConcerning, Mixed or CannotInterpret. It requires additional comparability/temporal support for development interpretations, never combines the three metrics into one good/bad score, and includes reference scope, operators, sources, dates and limitations. Current guidance/reference text is compiled into the application; no clinical website is called at runtime.
|
||||||
|
|
||||||
|
Evidence: [trend calculator](../src/InsightsService/Domain/InsightCalculator.Trends.cs), [result types](../src/InsightsService/Domain/TrendAssessment.cs), [documented method/rationale](../src/TRENDS.md), [numerical/context/reference tests](../tests/Observation.AcceptanceTests/HealthTrendTests.cs). This task checks architectural consistency, not clinical validity.
|
||||||
|
|
||||||
|
### 6.3 Health overview
|
||||||
|
|
||||||
|
Overview performs three **sequential** awaits: profile, latest overall observation, selected-period numerical insight. A missing profile returns no overview; a 404 latest or insight becomes null and preserves the available profile/other component. Non-404 failures do not silently become absent data. Latest remains independent of the insight's period and context selection. The result explicitly states both bases and contributes no trend component.
|
||||||
|
|
||||||
|
The insight request adds another chain: Overview→Gateway→Insights→Gateway→Observation. Each network leg uses the caller's configured service credential; original user tokens do not flow down the chain. Evidence: [overview application](../src/HealthOverviewService/Application/HealthOverviewApplicationService.cs), [client handling](../src/HealthOverviewService/Clients/InsightsServiceClient.cs), [overview tests](../tests/Observation.AcceptanceTests/HealthOverviewTests.cs), [overview sequence](diagrams/07-sequences.drawio).
|
||||||
|
|
||||||
|
## 7. Authentication, authorization and security
|
||||||
|
|
||||||
|
### 7.1 Client identity
|
||||||
|
|
||||||
|
Gateway validates pre-created credentials using ASP.NET Core Identity's `PasswordHasher<PrototypeAccount>`. Accounts are external configuration bound once into a singleton dictionary. Roles are limited to Patient and HealthcareProfessional; account IDs permit ASCII letters/digits/hyphen/underscore, with a maximum length of 128. Unknown accounts still execute hash verification against a dummy hash. Invalid/incorrect credentials share one generic response. Malformed hash verification is rejected; successful hashes that would benefit from rehashing are not persisted back to configuration.
|
||||||
|
|
||||||
|
Login issues the framework's protected opaque Bearer authentication ticket, **not a JWT**, using Data Protection application name `HealthApp.ApiGateway`. Claims contain stable account ID and role, not patient health records or patient ownership. Default lifetime is 30 minutes, configurable from 1–1440. Subsequent requests validate the token without password verification. There is no refresh, logout/revocation endpoint, session database, registration or identity-provider integration. Successful login responses carry `no-store` and `no-cache`.
|
||||||
|
|
||||||
|
Gateway persists its Data Protection key ring to configured `Authentication:KeyDirectory`. No explicit `ProtectKeysWith...` key-at-rest encryption is configured; filesystem permissions are the deployment protection visible in this implementation. Persistent compatible keys allow tokens to survive a normal Gateway restart. Multi-instance Gateway key coordination, immediate account-change token revocation and external identity-provider behavior are not implemented or verified. See [accounts](../src/ApiGateway/Security/PrototypeAccounts.cs), [login](../src/ApiGateway/Controllers/AuthenticationController.cs), [Gateway startup](../src/ApiGateway/Program.cs), [authentication tests](../tests/Observation.AcceptanceTests/PatientAuthenticationTests.cs).
|
||||||
|
|
||||||
|
### 7.2 Per-request access control
|
||||||
|
|
||||||
|
Fallback authorization requires authentication; login and general guidance explicitly permit anonymous callers. Role policies require the stable NameIdentifier claim. `PatientAccessMiddleware` then establishes actual access:
|
||||||
|
|
||||||
|
- A Patient can POST its initial profile and GET `/api/patients/me` before knowing its patient ID. The profile service enforces uniqueness.
|
||||||
|
- Other patient operations obtain the account's current persisted profile through the protected by-account API. Requested patient routes must match its ID.
|
||||||
|
- Observation-ID routes first fetch the observation from Observation to establish the actual owning patient. This additional read occurs before returning/modifying/deleting it.
|
||||||
|
- Professionals may only GET and must have the patient ID in their configured assignment set. The assignment-list route returns only that professional's configured IDs. Assignments are read once, deduplicated and sorted; edits require restart to affect the singleton.
|
||||||
|
- Unauthorized ownership/unassigned/missing ownership gives an empty 404 to avoid exposing another patient's existence. Missing/invalid token is 401; authenticated forbidden role/method is 403.
|
||||||
|
|
||||||
|
Ownership data is not cached between requests. Patient-specific responses do not receive a global explicit no-store directive in the code. Middleware path-segment comparisons are case-sensitive, despite routing's normal case-insensitive behavior and a few case-insensitive special routes; canonical lower-case routes are used throughout tests/clients. Evidence: [middleware](../src/ApiGateway/Security/PatientAccessMiddleware.cs), [assignments](../src/ApiGateway/Security/ProfessionalAssignments.cs), [professional tests](../tests/Observation.AcceptanceTests/ProfessionalAccessTests.cs), [replacement-handler test](../tests/PatientProfile.AcceptanceTests/AuthenticationIntegrationTests.cs).
|
||||||
|
|
||||||
|
### 7.3 Internal trust boundary
|
||||||
|
|
||||||
|
Every backend checks `X-Gateway-Key` with fixed-time comparison before controllers. A client bearer token alone cannot call a backend. The key grants the Gateway-level trusted caller boundary; backend controllers do not re-evaluate patient ownership or professional assignment. Compromise/disclosure of a backend incoming key therefore bypasses client authorization for that backend's exposed API.
|
||||||
|
|
||||||
|
Gateway chooses InternalService authentication whenever `X-Service-Key` is present; otherwise it chooses Bearer. An invalid callback key does not fall back to a valid bearer token. Three distinct configured callback identities have the following GET-only permissions:
|
||||||
|
|
||||||
|
| Callback identity | Allowed Gateway reads |
|
||||||
|
| --- | --- |
|
||||||
|
| Observation | `/api/patients/{patientId}` |
|
||||||
|
| Insights | `/api/patients/{patientId}/observations` with period/selection query |
|
||||||
|
| HealthOverview | Patient profile, latest observation and numerical insight for `{patientId}` |
|
||||||
|
|
||||||
|
Service identities do not carry end-user ownership; permitted reads can address any valid patient ID. They cannot write, list professional assignments, read individual observation IDs or call unlisted aggregation routes. Backend incoming and callback keys are independently generated; length ≥32 is required at startup, while installer-generated secrets are 32 random bytes rendered as 64 hex characters. The unused incoming-key field generated for Gateway is not a Gateway authentication mechanism.
|
||||||
|
|
||||||
|
Evidence: [internal handler](../src/ApiGateway/Security/InternalServiceAuthenticationHandler.cs), [service whitelist](../src/ApiGateway/Security/PatientAccessMiddleware.cs), [backend guard example](../src/ObservationService/Program.cs), [bypass/permission tests](../tests/Observation.AcceptanceTests/PatientAuthenticationTests.cs), [Overview restrictions](../tests/Observation.AcceptanceTests/HealthOverviewTests.cs).
|
||||||
|
|
||||||
|
### 7.4 Transport and secrets
|
||||||
|
|
||||||
|
Non-Development modes require HTTPS business origins. Plain HTTP is rejected with 400 by Gateway and 401 by backends; requests are not redirected to HTTPS. Development permits HTTP for local tests/development while still requiring authentication keys. Base origins must be absolute HTTP(S), root-path URLs without userinfo, query or fragment. There is no application mTLS, forwarded-header trust setup, CORS configuration or rate limiter.
|
||||||
|
|
||||||
|
The installer configures Kestrel PFX certificates and OS trust. Client machines independently need trust in the exported public CA or a supplied trusted certificate chain. Server certificates authenticate endpoint names; internal application keys authenticate callers. PostgreSQL-generated connections use `SslMode=Prefer`, not mandatory verified TLS, and default to local database hosts. This is a different boundary from mandatory production HTTPS between application processes.
|
||||||
|
|
||||||
|
Generated deployment manifests/account files contain secrets and are protected administratively. Linux uses private deployment files/root-readable environment files and service-group-readable certificates; Windows ACLs and macOS permissions are described below. Application logging uses framework logging/stdout/stderr. No explicit sensitive-data logging is enabled, but request paths can contain patient/observation identifiers. No audit-log store or patient-data log redaction facility is implemented. These are observable limits, not an expansion of the prototype's stated scope.
|
||||||
|
|
||||||
|
## 8. Concurrency, caching and runtime behavior
|
||||||
|
|
||||||
|
ASP.NET handles concurrent HTTP requests; database and network work uses async Task/CancellationToken. Scoped application services/repositories/contexts are per request. The singleton calculator has no mutable per-request state; accounts/assignments are startup snapshots. Gateway re-entrant callback HTTP traffic is handled as new requests, not recursive in-process calls. Inferred consequence: aggregate workflows add Gateway hops and dependent-service load even when only one external request is counted.
|
||||||
|
|
||||||
|
There is no application response/data cache, output-cache middleware, distributed cache, stored statistics or materialized view. Static guidance and loaded account/assignment dictionaries are configuration/reference state rather than caches of clinical data. Framework HTTP handler reuse and database connection behavior are separate infrastructure concerns. The generated database connection strings explicitly set `Pooling=false` and a 10-second connection timeout; externally supplied connection strings can choose different settings. No business HttpClient timeout override or resilience/retry/circuit-breaker policy is configured. The verifier's retry policy does not apply to ordinary application requests.
|
||||||
|
|
||||||
|
Profile creation uniqueness is explicitly concurrency-safe. Other updates have no EF concurrency token, version/ETag or conditional-write contract. Inferred: concurrent edits can overwrite each other's changes, especially owned context replacement after reading its previous value; the read following a profile update can observe a later writer's values. There is no multi-service transaction, request idempotency key for observation creation or guaranteed atomic overview snapshot.
|
||||||
|
|
||||||
|
History and calculation clients materialize full matching arrays in memory. Overview awaits sources sequentially rather than parallelizing them. Request cancellation is passed through normal HTTP/database operations; connection/HTTP timeouts can happen independently, and client-disconnect cancellation is not deliberately converted to 504.
|
||||||
|
|
||||||
|
Runtime evidence: all five `Program.cs` files, [Observation repository](../src/ObservationService/Persistence/SqlObservationRepository.cs), [Patient repository](../src/PatientProfileService/Persistence/SqlPatientRepository.cs), [overview application](../src/HealthOverviewService/Application/HealthOverviewApplicationService.cs), [connection-string generation](../deploy/HealthApp.Provisioning/Deployment.cs).
|
||||||
|
|
||||||
|
## 9. Deployment architecture and dependencies
|
||||||
|
|
||||||
|
### 9.1 Build and runtime
|
||||||
|
|
||||||
|
All five service projects target `net10.0`. Services include `Microsoft.Extensions.Hosting.WindowsServices` 10.0.12. The persistent services use Npgsql EF provider 10.0.3 and EF Relational/Design 10.0.12; Design is private tooling. Provisioning uses Npgsql 10.0.3 and the ASP.NET shared framework. Versions are those declared by the inspected project files, not a latest-version recommendation. xUnit, ASP.NET testing support and PostgreSQL are acceptance-test dependencies.
|
||||||
|
|
||||||
|
[build-release.sh](../deploy/build-release.sh) and [build-release.ps1](../deploy/build-release.ps1) publish selected projects separately in Release, framework-dependent (`--self-contained false`) without an apphost (`UseAppHost=false`), plus the provisioner. The bundle carries installer scripts, systemd templates, safe examples and installation documentation. Build requires .NET 10 SDK and package access. Target machines require the .NET 10 ASP.NET Core runtime and PostgreSQL only for persistent services; automatic provisioning supplies missing supported dependencies.
|
||||||
|
|
||||||
|
### 9.2 Topology and configuration
|
||||||
|
|
||||||
|
Colocated and distributed layouts use the same DLLs and HTTP interfaces. [deployment diagrams](diagrams/06-deployment.drawio) show both supported layouts, not a claim about current physical hosts. Defaults are Gateway HTTPS 5443 and Patient/Profile/Observation/Insights/Overview HTTPS 5081/5082/5083/5084. Generated bindings are `https://0.0.0.0:PORT`; origins and certificate names use configured hosts. Ports must be 1024–65535; services at the same literal host need different ports. IPv6-reachable binding behavior and alias equivalence are not explicitly tested by this documentation task.
|
||||||
|
|
||||||
|
Standard .NET configuration loads JSON, environment and command-line values. Committed `appsettings.json` contains logging only. Required external values are:
|
||||||
|
|
||||||
|
| Service | Configuration |
|
||||||
|
| --- | --- |
|
||||||
|
| Gateway | `Authentication:Accounts`, `Authentication:KeyDirectory`, optional token lifetime; `Access:ProfessionalAssignments`; four `Services:{name}:BaseUrl/Key`; callback keys `InternalAccess:{Observation,Insights,HealthOverview}:Key` |
|
||||||
|
| Patient/Profile | `ConnectionStrings:PatientDatabase`, `InternalAccess:GatewayKey` |
|
||||||
|
| Observation | `ConnectionStrings:ObservationDatabase`, incoming Gateway key, `Services:ApiGateway:BaseUrl/Key` |
|
||||||
|
| Insights and Overview | Incoming Gateway key, `Services:ApiGateway:BaseUrl/Key`; no database settings |
|
||||||
|
| Each HTTPS host | Binding plus `Kestrel:Certificates:Default:Path/Password`, environment |
|
||||||
|
|
||||||
|
Environment-file keys use `__` for configuration sections. Missing/invalid required origins, keys, accounts and connection strings stop startup; startup validation is not a dependency reachability check. Patient/Profile and Observation support `--migrate`: migrations run and the process exits before normal host security/origin startup checks. Normal startup never migrates.
|
||||||
|
|
||||||
|
### 9.3 Provisioning stages
|
||||||
|
|
||||||
|
1. Validate selected service names, payloads and absence of existing installation/configuration. A repeated first-install command refuses overwrite; no upgrade/uninstall engine exists.
|
||||||
|
2. Detect supported native platform/dependencies. Linux accepts Debian/Ubuntu `ID`/`ID_LIKE`, apt and running systemd/root access. Package availability, not fixed release numbers, controls provisioning. Only actual Debian can receive a Microsoft Debian runtime repository fallback. Required package names are `aspnetcore-runtime-10.0` and, where needed, `postgresql`.
|
||||||
|
3. Prepare one private plan covering all five services, even for a subset. Generate per-service keys, database settings for the two owners, synthetic `prototype-patient`, `prototype-professional`, `installation-check` accounts and hashed Gateway account config. The professional initially has no assignments.
|
||||||
|
4. Generate a prototype CA (two-year validity) and service-name/IP SAN certificates (one-year validity). Only public CA material is retained; its generated signing private key is disposed. Alternatively accept externally supplied public CA and all service PFX/password files. Supplied material is not preflighted against every runtime requirement; endpoint verification checks trust/name later.
|
||||||
|
5. Create selected persistent services' separate DBs/roles, revoke public database/schema access and give the owner schema rights for migrations. Reuse a consistent generated plan, not independently generated incompatible secrets. Database roles cannot administer/create databases/roles/replicate. An external PostgreSQL admin connection can be supplied; generated service endpoint settings adopt its host/port.
|
||||||
|
6. Install selected payloads, protected configuration/certificates, native identities and registrations; apply migrations and start each selected process.
|
||||||
|
7. Verify local native status/distinct PIDs where implemented, HTTPS reachability, DB service identity, callback credentials and topology. Complete-system verification logs in and creates/reuses a labelled synthetic check profile/observation, then retrieves overview through all five services. Verification is therefore not entirely read-only.
|
||||||
|
|
||||||
|
Evidence: [Linux installer](../deploy/installer/install.sh), [bootstrap](../deploy/installer/bootstrap.sh), [deployment preparation](../deploy/HealthApp.Provisioning/Deployment.cs), [DB provisioning](../deploy/HealthApp.Provisioning/DatabaseProvisioning.cs), [config adapter](../deploy/HealthApp.Provisioning/ConfigurationWriter.cs), [verifier](../deploy/HealthApp.Provisioning/InstallationVerification.cs).
|
||||||
|
|
||||||
|
### 9.4 Native execution and paths
|
||||||
|
|
||||||
|
| Platform | Runtime management and paths | Important boundaries |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| Linux | `healthapp-NAME.service`; `/opt/healthapp/NAME`; `/etc/healthapp/NAME/service.env`; Gateway `/var/lib/healthapp-api-gateway/keys`; default plan `/var/lib/healthapp-installation/deployment` | Dedicated `healthapp-NAME` users/groups; env root-only, certificates root/service group; systemd supplies env; default local PostgreSQL |
|
||||||
|
| Windows | Independent Windows Services/virtual `NT SERVICE\healthapp-NAME` identities; `%ProgramData%\HealthApp` with services/config/state | Private administrative ACLs plus own-service read/state rights; production JSON copied into application directory; selected HTTPS firewall rules; runtime downloaded if absent; EDB PostgreSQL 17 installer resolved from maintained package manifest and SHA-256 checked |
|
||||||
|
| macOS | Independent launchd daemons/hidden `_healthapp_NAME` identities; `/Library/Application Support/HealthApp` with services/config/state | System-keychain CA trust; Homebrew PostgreSQL 17 and installer-owned cluster if no external server; Apple command-line tools/Homebrew provisioning; private plist contains environment secrets |
|
||||||
|
|
||||||
|
Systemd source templates still show a shared `healthapp` user and old flat env paths. The installer rewrites them to per-service identities and nested env paths; the generated units are the as-built installed behavior. Units request network-online, restart on failure after five seconds, use SIGINT and a 30-second stop timeout. They do not couple peers via Requires/PartOf/BindsTo or impose explicit resource limits/sandbox directives. Backend DB unavailability does not necessarily stop a host before its first DB request. Independent stopping means process independence, not availability of workflows that depend on it.
|
||||||
|
|
||||||
|
Windows uses standard WindowsServices lifetime integration and restart-on-failure configuration. macOS `RunAtLoad`/`KeepAlive` launchd registration keeps daemons alive. The repository supplies a manual [native-install workflow](../.github/workflows/prototype-native-install.yml); its existence is not evidence that Windows/macOS live registration or CI execution succeeded.
|
||||||
|
|
||||||
|
### 9.5 Distributed administration and verification limits
|
||||||
|
|
||||||
|
One prepared topology can be grouped by host and installed through SSH/SCP using [Distribution](../deploy/HealthApp.Provisioning/Distribution.cs). Each node receives selected applications/private material and necessary remote origins, not all unrelated keys/DB passwords. The Gateway legitimately needs outgoing backend keys and callback authentication keys. Unix installation needs administrative SSH with noninteractive sudo; Windows requires an elevated SSH session. Host-administration access is a prerequisite separate from generated application credentials.
|
||||||
|
|
||||||
|
Node startup can defer cross-topology verification until other hosts start. Final verification probes actual origins. There is no remote runtime file-sharing dependency after installation. Failed installation retains existing/generated material and reports the failed step; it has no cross-host rollback transaction or remote-artifact cleanup guarantee. Linux `--root` is offline staging, not live package/service deployment.
|
||||||
|
|
||||||
|
Verification contains short startup retry loops for transient 502/503/504/connectivity failures, uses custom-root TLS validation with server-name checking, and tests actual database identity. Linux installer/verifier checks native active state and distinct MainPID values. Neither live verifier deliberately cycles every service through stop/restart. Independent stop/restart is exercised by deployment acceptance tests, with direct process control; native manager execution is a separate evidence limit. See [traceability](requirements-traceability.md).
|
||||||
|
|
||||||
|
## 10. Failure behavior
|
||||||
|
|
||||||
|
| Trigger | Implemented outcome |
|
||||||
|
| --- | --- |
|
||||||
|
| Missing/malformed model, unsupported category, reversed/missing period | 400 validation response; no intended partial write |
|
||||||
|
| Invalid login / missing, forged or expired bearer | 401; invalid login response does not identify which credential failed |
|
||||||
|
| Incorrect backend incoming key / production backend HTTP | 401 before controller |
|
||||||
|
| Production Gateway HTTP | Empty 400, including public/login routes |
|
||||||
|
| Forbidden professional write, role or internal service route | 403 |
|
||||||
|
| Cross-patient ownership, unassigned patient, no own profile, absent observation | Generally empty Gateway 404; authorized missing backend resources follow their own API response |
|
||||||
|
| Second/concurrent profile creation | 409 existing-profile condition, protected by unique DB index |
|
||||||
|
| No history / summary / temporal data | History 200 `[]`; summary 404 insufficient data; trends 200 explicit unavailable parts; overview keeps available profile/latest with null insight |
|
||||||
|
| Gateway forwarding connection failure | 502 Problem; upstream status responses otherwise forwarded |
|
||||||
|
| Local non-client-cancelled upstream timeout | 504 Problem; an upstream 504 already received remains an upstream response and can be mapped by a consuming service |
|
||||||
|
| Observation patient-lookup failure | 502/504, no saved observation |
|
||||||
|
| Insights/Overview upstream non-success or malformed JSON | 502; a local timeout 504; appropriate 404 treated as absence only in Overview clients |
|
||||||
|
| Ownership lookup invalid JSON/missing expected field, unhandled DB error or other exception | Generic exception-handler path, normally 500; not all invalid upstream shapes have an explicit 502 mapping |
|
||||||
|
| Gateway stream fails after response has started | Connection aborted; response cannot be replaced safely with a new error body |
|
||||||
|
| Required config invalid / packages unavailable / certificate or provisioning failure | Startup or installer fails; step diagnostics; retained data/material rather than automatic rollback |
|
||||||
|
|
||||||
|
Every host installs `AddProblemDetails`/`UseExceptionHandler`; response shapes are not entirely uniform (empty status responses, login `{title}`, validation Problems and explicit Problems coexist). Overview interprets any 404 from its designated insight route as absent insight; it does not inspect the upstream problem title to distinguish all possible causes. Gateway ownership lookup is an extra availability dependency on Patient/Profile for patient requests, even when the requested operation is otherwise Observation- or Insights-owned.
|
||||||
|
|
||||||
|
No automatic business retry, circuit breaker, overload shedding, rate limit, dedicated readiness/liveness API or fault-tolerant replica configuration is implemented. Inferred: a Gateway outage prevents all normal external operations and aggregation callbacks; a source outage may leave peer processes running while dependent workflows fail. Runtime failure tests: [patient failures](../tests/Observation.AcceptanceTests/PatientAuthenticationTests.cs), [insight failures](../tests/Observation.AcceptanceTests/HealthInsightTests.cs), [trend failures](../tests/Observation.AcceptanceTests/HealthTrendTests.cs), [overview failures](../tests/Observation.AcceptanceTests/HealthOverviewTests.cs).
|
||||||
|
|
||||||
|
## 11. Test and experiment architecture
|
||||||
|
|
||||||
|
Application acceptance fixtures use real PostgreSQL databases and HTTP hosts, standard credential hashing/protected tokens, controlled identities and an injectable token clock. They check persistence across host restarts, isolation, ownership, professional restrictions, period/category semantics and failures. Some tests seed directly into an owning DbContext to establish Given state; that is not production cross-service DB access. Test-specific replacement authentication verifies policy separation but is not the deployment mechanism.
|
||||||
|
|
||||||
|
Deployment acceptance builds/publishes a release, invokes the real offline installer/provisioner, creates isolated DBs/roles and launches five separate Production HTTPS processes at distinct loopback origins. It checks native config formats, secrets/certificate output, DB isolation, migrations, restart independence and representative workflows. SSH/SCP distribution and apt bootstrap commands use controlled doubles. Such tests cannot establish a real five-machine topology or native Windows/macOS service-manager operation. Evidence: [application fixture](../tests/Observation.AcceptanceTests/ObservationApiFixture.cs), [test token helper](../tests/Support/AuthenticatedTestClient.cs), [deployment fixture](../tests/Deployment.AcceptanceTests/DeploymentFixture.cs), [installation tests](../tests/Deployment.AcceptanceTests/InstallationTests.cs), [bootstrap tests](../tests/Deployment.AcceptanceTests/BootstrapTests.cs).
|
||||||
|
|
||||||
|
The optional [energy/JMeter tooling](../tools/energy-jmeter/README.md) runs outside the product processes. Generated JMX plans exercise synthetic API sessions, renew opaque tokens by login, and include Gaussian interaction delays. PerfMon ServerAgent host telemetry and Shelly plug HTTP power readings are collected live into JMeter, defaulting to one-second intervals. The runner separates warmup from the measured duration and reports request latency/throughput and CPU/RAM/power on aligned timelines. Idle sends no application requests. These agents/devices are experimental dependencies, not a sixth HealthApp service or a production monitoring/security guarantee. Private credentials and ignored raw experiment results were not inspected for this assignment.
|
||||||
|
|
||||||
|
## 12. Significant constraints and decisions
|
||||||
|
|
||||||
|
The architecture preserves independent process/persistence boundaries, Gateway-routed REST, controller APIs, external configuration and on-demand derived results. It deliberately uses pre-created accounts/assignments and synthetic data. No account administration, assignment-management UI, consent/emergency workflows, medication recommendations, professional edits or production identity-provider implementation is present; these are documented exclusions, not implicitly missing stories.
|
||||||
|
|
||||||
|
[Architecture decisions](architecture-decisions.md) distinguishes explicitly documented rationale from inferred consequences. [Requirements traceability](requirements-traceability.md) identifies implementation/verification limits without silently adding requirements. [Discrepancies](discrepancies.md) distinguishes superseded diagrams, current elaborations and unresolved evidence gaps. This documentation proposes no architectural or implementation changes.
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
# Documentation validation
|
||||||
|
|
||||||
|
Validated on 2026-10-12 against source commit `5d9371388c15066eeb2bc124ed227659c644dab5`.
|
||||||
|
|
||||||
|
## Deliverables
|
||||||
|
|
||||||
|
- Required architecture narrative, README, observable decisions, requirements traceability and discrepancies are present.
|
||||||
|
- Twelve native editable Draw.io files cover all required views. Five are standalone service class diagrams; the combined class file contains the same service views plus provisioning. The complete domain diagram has an application-domain page and a separate deployment-domain page.
|
||||||
|
- Every one of the 78 source-declared service classes, records and interfaces is an individual UML classifier in its service diagram. Classifiers have separate name, attribute and operation compartments; nested types and partial declarations are accounted for. Migrations/designer members/snapshots appear on distinct EF-support pages.
|
||||||
|
- Domain concepts and implementation classes are on separate diagrams.
|
||||||
|
- The evidence inventory links source, configuration, requirements and concrete test methods.
|
||||||
|
|
||||||
|
## Checks performed
|
||||||
|
|
||||||
|
Native XML was parsed for every diagram. Checks verified `mxfile`/`mxGraphModel` structure, unique cell IDs, existing connector endpoints, positive shape geometry, free-edge message/lifeline endpoints and absence of embedded raster-image diagram content. Native boxes do not overlap. A font-metric estimate checked wrapped label height against every shape; no estimated text overflow was found. Relative source links attached to diagram nodes and local Markdown links resolve to existing files.
|
||||||
|
|
||||||
|
Following the class-diagram correction, declarations were independently enumerated from each service's source files and compared against the diagram's fully qualified `sourceType` values. Exact per-service coverage is required: Gateway 16, Patient/Profile 14, Observation 17, Insights 16 and Overview 15. Member signatures were checked for arrays, nullable/default record parameters, visibility/private setters and merged partial migration methods. The earlier grouped class views were replaced, not retained as complete service diagrams.
|
||||||
|
|
||||||
|
Content was checked against actual service startup, controllers, client origins/headers, security middleware, domain/contracts, repositories, EF mappings/migrations, provisioning/native adapters and relevant acceptance assertions. The diagrams use the same Gateway-routed communication, separate database ownership, opaque-token mechanism, context semantics and sequential overview behavior as the narrative. Historic superseded diagrams and stale implementation prose are distinguished from current-baseline differences.
|
||||||
|
|
||||||
|
The directory contains documentation and `.drawio` source only. No application code, configuration, tests or existing documentation was changed. A SHA-256 comparison confirmed all **229 pre-existing tracked files** retain their original contents; Git reports only the new `AsBuiltArchitecture/` directory.
|
||||||
|
|
||||||
|
## Evidence limits
|
||||||
|
|
||||||
|
Application/deployment suites were inspected rather than rerun: this assignment authorizes documentation, not changes to existing implementation/build artifacts or live installation. No native installer, remote host, device or external clinical source was exercised. Test doubles and loopback origins are not described as real multi-machine/native deployment evidence.
|
||||||
|
|
||||||
|
Draw.io XML/geometry/source-link validation was automated; the Draw.io desktop/browser GUI was not available here, so GUI round-trip/import rendering was not separately exercised. Each file is uncompressed native Draw.io XML with editable labels, shapes and connectors, not an image-only export. The document records uncertainties rather than presenting these limits as verified runtime behavior.
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
<mxfile host="Electron">
|
||||||
|
<diagram id="04_class_observation_service" name="Observation Service — updated class model">
|
||||||
|
<mxGraphModel dx="2090" dy="1240" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1740" pageHeight="1280" math="0" shadow="0">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="title" parent="1" style="text;html=0;fontSize=24;fontStyle=1;align=center;" value="Observation Service — updated class model" vertex="1">
|
||||||
|
<mxGeometry height="50" width="1660" x="40" y="10" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e0" edge="1" parent="1" source="c" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="a" value="uses">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e1" edge="1" parent="1" source="a" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="r" value="uses">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e2" edge="1" parent="1" source="r" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="sql" value="implemented by">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e3" edge="1" parent="1" source="o" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="ctx" value="contains">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="ObservationController" vertex="1">
|
||||||
|
<mxGeometry height="260" width="500" x="40" y="100" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="cbody" parent="c" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="record(request): acknowledgement
getById(id): ObservationDto
getLatest(patientId): ObservationDto?
getByPeriod(patientId, period, selection)
update(id, patch): acknowledgement
delete(id): acknowledgement" vertex="1">
|
||||||
|
<mxGeometry height="224" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="a" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="ObservationApplicationService" vertex="1">
|
||||||
|
<mxGeometry height="260" width="500" x="620" y="100" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="abody" parent="a" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="record / getById / getLatest
getByPeriod(period, selection)
update(id, patch) / delete(id)
Validate context categories and values
Preserve omitted values in partial updates" vertex="1">
|
||||||
|
<mxGeometry height="224" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="r" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="ObservationRepository «interface»" vertex="1">
|
||||||
|
<mxGeometry height="260" width="500" x="1200" y="100" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="rbody" parent="r" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="save(observation)
findById(id) / findLatest(patientId)
findByPeriod(patientId, period, selection)
update(id, patch) / delete(id)
Persist context and original recording time" vertex="1">
|
||||||
|
<mxGeometry height="224" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="o" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="BloodPressureObservation / ObservationDto" vertex="1">
|
||||||
|
<mxGeometry height="360" width="500" x="40" y="520" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="obody" parent="o" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="observationId: UUID; patientId: UUID
measuredAt: DateTime
systolic, diastolic, pulse: int
measurementContext: MeasurementContext
context: String? (legacy text)
note: String?
createdAt: DateTime (original recording)
updatedAt: DateTime" vertex="1">
|
||||||
|
<mxGeometry height="324" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="ctx" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="MeasurementContext «value object»" vertex="1">
|
||||||
|
<mxGeometry height="360" width="500" x="620" y="520" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="ctxbody" parent="ctx" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="setting: Home / Clinic / Other / Unknown
activity: Rest / During / After / Unknown
restDuration: optional
bodyPosition: optional
measuredArm: optional
device / cuff details: optional
additionalCircumstances: optional
Missing details remain unknown" vertex="1">
|
||||||
|
<mxGeometry height="324" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="sql" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="SqlObservationRepository" vertex="1">
|
||||||
|
<mxGeometry height="200" width="500" x="1200" y="520" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="sqlbody" parent="sql" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="Implements ObservationRepository
Owns persistence within Observation Service
No other service accesses its database" vertex="1">
|
||||||
|
<mxGeometry height="164" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="sel" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="ContextSelection «request value»" vertex="1">
|
||||||
|
<mxGeometry height="180" width="500" x="620" y="930" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="selbody" parent="sel" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="optional setting; optional activity
Both supplied: match both
Unknown is selectable
Omitted selections include all contexts" vertex="1">
|
||||||
|
<mxGeometry height="144" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="note0" parent="1" style="text;html=0;align=left;fontSize=15;" value="Latest = measurement time, then original recording time, then documented deterministic tie rule." vertex="1">
|
||||||
|
<mxGeometry height="25" width="1660" x="40" y="1175" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="note1" parent="1" style="text;html=0;align=left;fontSize=15;" value="Gateway enforces access. Other services consume Observation APIs through the gateway." vertex="1">
|
||||||
|
<mxGeometry height="25" width="1660" x="40" y="1200" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
</mxfile>
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
<mxfile host="Electron">
|
||||||
|
<diagram id="05_class_insights_service" name="Insights Service — updated class and result model">
|
||||||
|
<mxGraphModel dx="1951" dy="1157" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1740" pageHeight="1220" math="0" shadow="0">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="title" parent="1" style="text;html=0;fontSize=24;fontStyle=1;align=center;" value="Insights Service — updated class and result model" vertex="1">
|
||||||
|
<mxGeometry height="50" width="1660" x="40" y="10" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e0" edge="1" parent="1" source="c" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="a" value="uses">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e1" edge="1" parent="1" source="a" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="http" value="uses">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e2" edge="1" parent="1" source="a" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="calc" value="uses">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e3" edge="1" parent="1" source="http" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="dto" value="returns">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e4" edge="1" parent="1" source="calc" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="trend" value="creates">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e5" edge="1" parent="1" source="trend" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="ma" value="contains three">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="InsightsController" vertex="1">
|
||||||
|
<mxGeometry height="190" width="500" x="40" y="90" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="cbody" parent="c" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="getSummary(patientId, period, selection)
getTrend(patientId, period, selection)
Return result metadata and limitations" vertex="1">
|
||||||
|
<mxGeometry height="154" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="a" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="InsightsApplicationService" vertex="1">
|
||||||
|
<mxGeometry height="190" width="500" x="620" y="90" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="abody" parent="a" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="Obtain current observations
Apply requested selection
Invoke summary / trend calculations" vertex="1">
|
||||||
|
<mxGeometry height="154" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="http" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="ObservationServiceClient «interface»" vertex="1">
|
||||||
|
<mxGeometry height="190" width="500" x="1200" y="90" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="httpbody" parent="http" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="getByPeriod(patientId, period, selection)
HttpObservationServiceClient implements it
HTTP requests pass through API Gateway" vertex="1">
|
||||||
|
<mxGeometry height="154" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="calc" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="InsightCalculator" vertex="1">
|
||||||
|
<mxGeometry height="190" width="500" x="620" y="390" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="calcbody" parent="calc" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="calculateSummary(observations, selection)
calculateTrend(observations, selection)
Document mathematical methods
No stored summaries or trend results" vertex="1">
|
||||||
|
<mxGeometry height="154" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="dto" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="ObservationDto" vertex="1">
|
||||||
|
<mxGeometry height="230" width="500" x="1200" y="390" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="dtobody" parent="dto" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="observationId, patientId, measuredAt
systolic, diastolic, pulse
measurementContext (setting / conditions)
legacy context text and note
Carry unknown or conflicting context" vertex="1">
|
||||||
|
<mxGeometry height="194" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="sum" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="HealthInsight" vertex="1">
|
||||||
|
<mxGeometry height="340" width="500" x="40" y="740" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="sumbody" parent="sum" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="patientId; periodStart; periodEnd
appliedSelection; contributingCount
averageSystolic / Diastolic / Pulse
minimumSystolic / maximumSystolic
minimumDiastolic / maximumDiastolic
context explanation
Final means: 2 decimals, half-up
No summary persistence identifier" vertex="1">
|
||||||
|
<mxGeometry height="304" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="trend" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="TrendAssessment" vertex="1">
|
||||||
|
<mxGeometry height="340" width="500" x="620" y="740" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="trendbody" parent="trend" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="patientId; periodStart; periodEnd
appliedSelection; contributingCount
systolic: MeasurementAssessment
diastolic: MeasurementAssessment
pulse: MeasurementAssessment
comparability evidence and limitations
Unavailable parts explained explicitly" vertex="1">
|
||||||
|
<mxGeometry height="304" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="ma" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="MeasurementAssessment «value object»" vertex="1">
|
||||||
|
<mxGeometry height="340" width="500" x="1260" y="740" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="mabody" parent="ma" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="measurement name and unit
observed level / numerical description
direction and variation when supported
interpretation and explanatory hint
reference values / guidance basis
data sufficiency and limitations
No direction inferred from storage order" vertex="1">
|
||||||
|
<mxGeometry height="304" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="note0" parent="1" style="text;html=0;align=left;fontSize=15;" value="HealthInsight is also created by InsightCalculator. All results reflect current observations." vertex="1">
|
||||||
|
<mxGeometry height="25" width="1660" x="40" y="1115" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
</mxfile>
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
<mxfile host="Electron">
|
||||||
|
<diagram id="06_class_health_overview_service" name="Health Overview Service — updated class model">
|
||||||
|
<mxGraphModel dx="1721" dy="1021" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1740" pageHeight="840" math="0" shadow="0">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="title" parent="1" style="text;html=0;fontSize=24;fontStyle=1;align=center;" value="Health Overview Service — updated class model" vertex="1">
|
||||||
|
<mxGeometry height="50" width="1660" x="40" y="10" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e0" edge="1" parent="1" source="c" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="a" value="uses">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e1" edge="1" parent="1" source="a" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;exitX=1;exitY=0.25;exitDx=0;exitDy=0;" target="v" value="creates">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e2" edge="1" parent="1" source="a" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="p" value="uses">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e3" edge="1" parent="1" source="a" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="o" value="uses">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e4" edge="1" parent="1" source="a" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="i" value="uses">
|
||||||
|
<mxGeometry relative="1" x="0.0255" y="-5" as="geometry">
|
||||||
|
<mxPoint as="offset" />
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="1160.06" y="185" />
|
||||||
|
<mxPoint x="1160.06" y="545" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="c" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="HealthOverviewController" vertex="1">
|
||||||
|
<mxGeometry height="190" width="500" x="40" y="90" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="cbody" parent="c" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="getOverview(patientId, period, selection)
selection applies to insight only
Returns HealthOverviewDto" vertex="1">
|
||||||
|
<mxGeometry height="154" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="a" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="HealthOverviewApplicationService" vertex="1">
|
||||||
|
<mxGeometry height="190" width="500" x="620" y="90" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="abody" parent="a" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="Load profile
Load latest overall observation
Load selected-period numerical insight
Aggregate without own persistence" vertex="1">
|
||||||
|
<mxGeometry height="154" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="v" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="HealthOverview / HealthOverviewDto" vertex="1">
|
||||||
|
<mxGeometry height="240" width="500" x="1280" y="20" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="vbody" parent="v" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="patient: PatientDto
latestObservation: ObservationDto?
insight: HealthInsightDto?
Preserve context, selection and limitations
Explain unavailable insight
No implicit trend component" vertex="1">
|
||||||
|
<mxGeometry height="204" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="p" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="PatientProfileServiceClient" vertex="1">
|
||||||
|
<mxGeometry height="210" width="500" x="40" y="440" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pbody" parent="p" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="getPatient(patientId): PatientDto
Implemented by HTTP client
Calls through API Gateway" vertex="1">
|
||||||
|
<mxGeometry height="174" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="o" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="ObservationServiceClient" vertex="1">
|
||||||
|
<mxGeometry height="210" width="500" x="620" y="440" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="obody" parent="o" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="getLatest(patientId): ObservationDto?
Implemented by HTTP client
Calls through API Gateway
Latest remains unfiltered by context" vertex="1">
|
||||||
|
<mxGeometry height="174" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="i" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="InsightsServiceClient" vertex="1">
|
||||||
|
<mxGeometry height="210" width="500" x="1200" y="440" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="ibody" parent="i" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="getSummary(patientId, period, selection)
Implemented by HTTP client
Calls through API Gateway
Propagate selection and contributing count" vertex="1">
|
||||||
|
<mxGeometry height="174" width="500" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="note0" parent="1" style="text;html=0;align=left;fontSize=15;" value="Only client abstractions are shown; arrows do not represent direct links between service-domain classes." vertex="1">
|
||||||
|
<mxGeometry height="25" width="1660" x="40" y="735" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="note1" parent="1" style="text;html=0;align=left;fontSize=15;" value="No matching insight data does not remove an available profile or latest observation." vertex="1">
|
||||||
|
<mxGeometry height="25" width="1660" x="40" y="760" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
</mxfile>
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<mxfile host="Electron">
|
||||||
|
<diagram id="08_er_observation_service" name="Observation Service — updated logical persistence model">
|
||||||
|
<mxGraphModel dx="1721" dy="1021" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1740" pageHeight="900" math="0" shadow="0">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="title" parent="1" style="text;html=0;fontSize=24;fontStyle=1;align=center;" value="Observation Service — updated logical persistence model" vertex="1">
|
||||||
|
<mxGeometry height="50" width="1660" x="40" y="10" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="e0" edge="1" parent="1" source="o" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="p" value="contains optional value">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="o" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="BloodPressureObservation «owned record»" vertex="1">
|
||||||
|
<mxGeometry height="550" width="700" x="60" y="110" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="obody" parent="o" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="PK observation_id: UUID
patient_id: UUID (external identifier)
measured_at: timestamp
systolic / diastolic / pulse: integers
context: optional original text
note: optional text
setting: category or unknown
activity_condition: category or unknown
preparation_details: optional owned value
additional_circumstances: optional text
created_at: original recording timestamp
updated_at: update timestamp" vertex="1">
|
||||||
|
<mxGeometry height="514" width="700" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="p" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="Preparation details «logical value»" vertex="1">
|
||||||
|
<mxGeometry height="320" width="650" x="970" y="110" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="pbody" parent="p" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="rest duration (with unit), if recorded
body position, if recorded
measured arm, if recorded
device details, if recorded
cuff details, if recorded
Unknown is not presumed correct technique" vertex="1">
|
||||||
|
<mxGeometry height="284" width="650" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="note0" parent="1" style="text;html=0;align=left;fontSize=15;" value="This logical model supersedes the old field list; it does not mandate a separate preparation table." vertex="1">
|
||||||
|
<mxGeometry height="25" width="1660" x="40" y="795" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="note1" parent="1" style="text;html=0;align=left;fontSize=15;" value="Patient identifier is not a cross-service database foreign key." vertex="1">
|
||||||
|
<mxGeometry height="25" width="1660" x="40" y="820" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
</mxfile>
|
||||||
File renamed without changes.
@@ -0,0 +1,28 @@
|
|||||||
|
<mxfile host="Electron">
|
||||||
|
<diagram id="09_er_insights_service" name="Insights Service — no persisted summary entities">
|
||||||
|
<mxGraphModel dx="1721" dy="1021" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1740" pageHeight="600" math="0" shadow="0">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="title" parent="1" style="text;html=0;fontSize=24;fontStyle=1;align=center;" value="Insights Service — no persisted summary entities" vertex="1">
|
||||||
|
<mxGeometry height="50" width="1660" x="40" y="10" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="n" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="Baseline persistence decision" vertex="1">
|
||||||
|
<mxGeometry height="310" width="720" x="80" y="120" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="nbody" parent="n" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="Insights owns no database or repository.
HealthSummary is not a persisted table.
No generated-summary persistence ID.
Summaries and trends use current observations.
Recalculate on request in the baseline.
Corrections and deletions affect new results." vertex="1">
|
||||||
|
<mxGeometry height="274" width="720" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="v" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="Calculated response objects" vertex="1">
|
||||||
|
<mxGeometry height="310" width="720" x="920" y="120" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="vbody" parent="v" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="HealthInsight: numerical summary
TrendAssessment: three metric assessments
Neither object represents a stored entity.
Observation data remains Observation-owned.
HTTP observation access passes through gateway." vertex="1">
|
||||||
|
<mxGeometry height="274" width="720" y="36" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="note0" parent="1" style="text;html=0;align=left;fontSize=15;" value="Supersedes the HealthSummary table in the former ER JPEG." vertex="1">
|
||||||
|
<mxGeometry height="25" width="1660" x="40" y="495" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
</mxfile>
|
||||||
File renamed without changes.
@@ -0,0 +1,13 @@
|
|||||||
|
# Architecture diagrams
|
||||||
|
|
||||||
|
The editable draw.io files below are the current definitions for the changed diagrams. Open them in draw.io / diagrams.net. Their same-stem JPEGs are retained historical snapshots and are superseded, including where they show older fields or signatures.
|
||||||
|
|
||||||
|
- [04_class_observation_service.drawio](04_class_observation_service.drawio)
|
||||||
|
- [05_class_insights_service.drawio](05_class_insights_service.drawio)
|
||||||
|
- [06_class_health_overview_service.drawio](06_class_health_overview_service.drawio)
|
||||||
|
- [08_er_observation_service.drawio](08_er_observation_service.drawio)
|
||||||
|
- [09_er_insights_service.drawio](09_er_insights_service.drawio)
|
||||||
|
|
||||||
|
Unlisted diagrams remain as supplied. The changes preserve independent processes, service-owned persistence and gateway-routed communication. New shapes express required context and assessment data; logical optional values do not mandate additional tables or services.
|
||||||
|
|
||||||
|
The baseline Insights persistence decision is recorded in [us10-insights-correction.md](us10-insights-correction.md). Updated functional requirements are in ../Requirements. Exact contract field names, physical mapping and mathematical methods can be developed within those requirements and the repository's implementation rules.
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# US-10 Insights architecture correction
|
||||||
|
|
||||||
|
This document is the baseline architecture decision for US-10 and US-11. It incorporates the former `Docs/Requirements/US_10_Correction`; that duplicate requirement file has been retired. Functional requirements are in `../Requirements/us10-calculated-insight.md` and `../Requirements/us11-health-trend.md`.
|
||||||
|
|
||||||
|
The Insights Service is an independent process and calculates summaries on demand. Its HTTP observation client retrieves observations through the API Gateway. `InsightsController`, `InsightsApplicationService`, `InsightCalculator`, and the observation client follow `05_class_insights_service.drawio`.
|
||||||
|
|
||||||
|
The service has no database, repository, stored summary identifier, or generated-summary persistence. `HealthInsight` is a calculated response object. The `HealthSummary` table shown in `09_er_insights_service.jpg` is an architectural inconsistency and does not apply; `09_er_insights_service.drawio` and this correction supersede that table. The absence of an Insights database in `02_microservice_architecture.jpg` is intentional.
|
||||||
|
|
||||||
|
Each summary request uses current observations, including corrections and deletions. Trend calculation remains under US-11.
|
||||||
|
|
||||||
|
Trend assessments also use current observations and are calculated on demand without storing generated assessments. This is a baseline design constraint, not an invariant persistence constraint on all architectural variants. Any experimental variant must retain the required freshness and access behaviour.
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
Prototype authentication and access-control design
|
||||||
|
Date: 2026-10-01
|
||||||
|
System: Personal Health Measurement System
|
||||||
|
Related requirements: US-01, US-13 and US-14
|
||||||
|
1. Status and purpose
|
||||||
|
This document records the authentication and access-control decisions agreed for the thesis prototype. It replaces the proposed HTTP Basic mechanism in replaceable-prototype-authentication.md with token-based authentication and clarifies initial patient-profile creation.
|
||||||
|
The token format is deliberately undecided. This document does not select JWT, a particular identity provider, or an additional service or database. Open implementation decisions are listed in Section 10 and must not be treated as already approved.
|
||||||
|
The purpose is to provide credible patient and healthcare-professional access restrictions without turning the prototype into a production identity-management project. The system uses synthetic patient data and pre-created test accounts. No production-readiness or regulatory-compliance claim is made.
|
||||||
|
Reconciliation update (2026-10-04): account/profile lifecycle and access wording have been aligned with the consolidated US-01, US-13, US-14, and public general guidance in US-15. Open token, persistence ownership, and deployment choices in Section 10 remain open; this requirements reconciliation does not select them.
|
||||||
|
2. Decision summary
|
||||||
|
Topic Decision
|
||||||
|
Authentication Validate account credentials at login; issue a time-limited authentication token for subsequent requests.
|
||||||
|
Token format Open; a concrete mechanism and library must be proposed separately.
|
||||||
|
Framework integration Use ASP.NET Core authentication handlers, authenticated identities (ClaimsPrincipal) and authorization policies.
|
||||||
|
Enforcement point The API gateway handles client authentication and authorization. Protected service APIs must not allow clients to bypass it.
|
||||||
|
Account provisioning Use pre-created patient and healthcare-professional test accounts.
|
||||||
|
Patient association A patient account may initially have no profile. It can create its own profile once; the generated patient identifier is persistently associated with that account.
|
||||||
|
Patient access Existing story-defined operations on the patient's own information only.
|
||||||
|
Professional access Read-only access to assigned patients and access to the professional's own assignment list.
|
||||||
|
Assignments Predefined; assignment-management functionality is outside scope.
|
||||||
|
Replacement Keep credential validation and token handling separate from application access policies.
|
||||||
|
|
||||||
|
|
||||||
|
3. Authentication flow and token boundary
|
||||||
|
1. A client submits credentials to a login endpoint over HTTPS.
|
||||||
|
2. The gateway validates them against trusted pre-created account data using an established password-hashing facility.
|
||||||
|
3. Successful login issues a time-limited token. Invalid credentials do not issue a token, and the rejection does not identify which credential component was incorrect.
|
||||||
|
4. The client presents its token on subsequent protected requests.
|
||||||
|
5. The gateway validates the token using the selected standard framework/library mechanism and establishes the application account identifier and role.
|
||||||
|
6. The gateway applies the relevant authorization policy before returning or changing patient information.
|
||||||
|
7. Missing, invalid or expired tokens are rejected. On expiration, the client authenticates again. Refresh tokens are outside scope.
|
||||||
|
Credential verification must not be repeated for every protected operation. Token validation and authorization still occur on every protected request.
|
||||||
|
The chosen mechanism must protect against token forgery and enforce expiration and the intended trust boundary. If signed self-contained tokens are selected, validation must include signature, trusted issuer and intended audience. Equivalent checks must be specified for any alternative mechanism. Custom cryptography or a custom authentication framework is outside the design.
|
||||||
|
The normalized authenticated identity contains a stable application account identifier and a trusted role: Patient or HealthcareProfessional. The token either carries this validated identity or securely references it, depending on the selected format. Client-supplied role values are never authoritative.
|
||||||
|
Patient health information must not be included in tokens. Patient ownership and professional assignments remain application access data, separate from token contents, and are evaluated by authorization policies.
|
||||||
|
4. Access policy
|
||||||
|
Actor and state Permitted access Restriction
|
||||||
|
Unauthenticated client Submit credentials to the login endpoint and read general US-15 measurement guidance. No patient information or professional assignment lists.
|
||||||
|
Patient account without a profile Create its own initial profile under US-01. Cannot select another patient's identity or access another patient's data.
|
||||||
|
Patient account with a profile Perform operations permitted by the existing stories on its own profile, observations, insights and overview. Cannot create a second profile or use professional-only operations.
|
||||||
|
Healthcare professional List its own assigned patients; read their profiles, observations, insights and overviews. Cannot access unassigned patients or create, modify or delete patient information.
|
||||||
|
|
||||||
|
|
||||||
|
An authenticated identity alone is not sufficient for access. The requested operation and the actual patient associated with the resource must also be checked.
|
||||||
|
For requests addressed by an observation identifier or another resource identifier, the gateway must establish the actual owning patient through documented service APIs. A patient identifier supplied by the client is not proof of ownership. No direct access to another service's database or reliance on shared process memory is permitted.
|
||||||
|
Rejected requests must not return protected patient information or change patient data. Existing retrieval requirements continue to govern genuinely missing information after access has been established. An empty professional assignment list must not expose other patients.
|
||||||
|
5. Initial profile creation and persistent association
|
||||||
|
A patient account and a patient profile are distinct concepts. A pre-created patient account may exist before its profile. Once profile creation succeeds, that account is associated with exactly one generated patient identifier.
|
||||||
|
The association must derive from the authenticated account, not an account identifier chosen by the caller. An account with an existing profile cannot create another profile or replace its association through profile creation.
|
||||||
|
The association must survive process restarts. Repeated or concurrent creation attempts must not result in multiple profiles associated with the same account. The implementation proposal must explain recovery if profile creation succeeds but recording the association fails, so retries do not silently create duplicate or inaccessible profiles.
|
||||||
|
These are required outcomes, not a choice of persistence technology or cross-service coordination mechanism. The owning component, persistence location and recovery mechanism remain open. Static external mappings alone do not satisfy the complete creation lifecycle.
|
||||||
|
US-01 and US-13 now define zero profiles before initial creation and exactly one afterwards. US-14 defines professional assignments. See the consolidated numbered files in Docs/Requirements. Retries after completed creation report the existing-profile condition; interrupted operations must recover without duplicate or inaccessible profiles.
|
||||||
|
6. Responsibility and deployment boundaries
|
||||||
|
Use standard ASP.NET Core extension points so controllers and access policies consume normalized identities rather than passwords or token-format details. This decision does not introduce a new identity microservice or shared authentication implementation library across services.
|
||||||
|
Services remain independently runnable processes and may be deployed on separate machines. The deployment must prevent untrusted clients from reaching protected service operations through a route that bypasses gateway authorization. Arbitrary client-supplied identity headers must not establish trusted identity.
|
||||||
|
The concrete protection of gateway-to-service access is an open deployment decision. It must be documented before claiming that gateway-only enforcement satisfies the access requirements. It must preserve the established independent-service boundaries.
|
||||||
|
Actual credentials, signing or protection keys, tokens and authorization headers must not be committed to the repository or written to logs. Provide safe example configuration and load operational secrets externally. Use HTTPS for client login and authenticated requests. Document any additional transport requirements in the deployment decision.
|
||||||
|
7. Replaceability
|
||||||
|
A future identity provider should replace credential validation and token integration without requiring a redesign of patient ownership or professional-assignment policies.
|
||||||
|
Map the provider's validated identity explicitly to the stable application account identifier and trusted application role. Do not assume a provider subject automatically equals an application account identifier.
|
||||||
|
Provider replacement may change the client's login flow and credential transport. Replaceability does not promise an unchanged client. A replacement must not silently enable the prototype mechanism as a fallback.
|
||||||
|
8. Thesis measurement implications
|
||||||
|
Authentication and authorization are part of the implemented system and its measured workload. Using login followed by token validation avoids deliberately repeating password verification for every business operation. This is a design rationale, not evidence of an energy reduction; any energy effect remains to be measured.
|
||||||
|
Before baseline measurement, record the authentication implementation, token lifetime, validation settings, account and role mix, patient assignments, login frequency and treatment of expiration. State whether login is included in the measured workload or occurs during setup. Account for re-authentication if tokens expire during a run.
|
||||||
|
Keep these factors consistent across compared architectural variants unless an explicitly scoped experimental change concerns them. Preserve equivalent access behaviour in all variants. Do not substitute a test authentication handler in measured runs while describing results as those of the implemented authentication mechanism.
|
||||||
|
Authentication-related work can affect bottlenecks and measured energy, even when configuration is identical. Interpret results in the context of the selected workload; lower authentication latency or CPU use alone does not demonstrate lower energy consumption.
|
||||||
|
9. Verification and exclusions
|
||||||
|
Automated verification must cover the US-13 and US-14 acceptance criteria, including valid login, invalid credentials, missing/invalid/expired tokens, cross-patient access attempts, professional assignment restrictions and prohibited professional writes. Include resource-identifier ownership checks and verify that rejected operations do not disclose or modify patient data.
|
||||||
|
Verify initial profile creation, rejection of subsequent creation, persistence of the account association, and the agreed retry/concurrency behaviour. Verify gateway-bypass protection in the intended deployment. Check that authorization policies behave equivalently when a test handler supplies the same normalized identity; this is a replaceability test, not a measurement configuration.
|
||||||
|
Outside scope: public registration, password recovery, multifactor authentication, account-administration interfaces, refresh tokens, professional credential verification, assignment-management interfaces, consent workflows, emergency access and professional editing of patient information. No full production identity-provider integration is required.
|
||||||
|
10. Open implementation decisions
|
||||||
|
Decision Required follow-up
|
||||||
|
Token format and library Propose a standard implementation, validation rules, client transport and necessary key or state management. JWT is not preselected.
|
||||||
|
Token lifetime Select and document a lifetime together with experimental login and expiration behaviour.
|
||||||
|
Account-to-patient persistence Identify the owning component and persistent storage without silently adding a service or violating database ownership.
|
||||||
|
Profile creation consistency Specify duplicate prevention and recovery across profile creation and association recording.
|
||||||
|
Gateway-to-service protection Specify a concrete deployment control that works across separate machines.
|
||||||
|
API contract details Reconcile endpoint contracts and rejection responses with the repository's existing conventions and acceptance criteria.
|
||||||
|
|
||||||
|
|
||||||
|
The agent may propose these details, but this decision record does not approve an unselected token format or undocumented architectural additions. Update the relevant requirements and architecture records when the remaining choices are accepted.
|
||||||
|
|
||||||
|
|
||||||
|
The prototype shall implement the minimum authentication, ownership, profile-creation consistency, and deployment protection needed to satisfy US-01, US-13, and US-14. The implementation may select and document simple, established mechanisms within the agreed architecture. Production hardening and capabilities outside these user stories are deferred until a decision is made to develop the system further.
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
# Common requirements
|
||||||
|
|
||||||
|
## Authority and scope
|
||||||
|
|
||||||
|
This directory contains one current definition for each user story US-01 through US-15. These files consolidate the supplied requirements and addenda. The replacement mapping is in `../requirements-reconciliation-changelog.md`; retired filenames are not additional active requirements.
|
||||||
|
|
||||||
|
Requirements describe observable behaviour. Baseline service decomposition, gateway routing, persistence, and token mechanism decisions belong in Architecture and Design. All compared architectural variants must satisfy the same functional requirements under equivalent data and conditions.
|
||||||
|
|
||||||
|
## Access and profile lifecycle
|
||||||
|
|
||||||
|
US-13 governs authenticated patient access and US-14 governs assigned, read-only healthcare-professional access. These rules apply to every patient-specific operation, including context, filtered statistics, trends, and overview results. Professionals may read assigned-patient information but cannot create, update, or delete it. Assignment lists remain protected. General US-15 guidance is public and discloses no patient-specific information.
|
||||||
|
|
||||||
|
A patient account has zero profiles before initial creation and exactly one afterwards. US-01 defines creation and retry outcomes. Accounts without profiles may authenticate and create their own initial profile; other own-data requests report that the requested information is unavailable and do not expose other patients.
|
||||||
|
|
||||||
|
Unless a scenario explicitly tests access rejection, it assumes an authenticated caller authorised for the operation. Missing-resource scenarios apply after access checks, without disclosing another patient's existence or information. Authentication and ownership are not established by caller-supplied patient identifiers alone.
|
||||||
|
|
||||||
|
## Periods and ordering
|
||||||
|
|
||||||
|
US-07, US-10, US-11, and the selected-period insight in US-12 use inclusive boundaries: start <= measurement timestamp <= end. An end before the start is rejected. Equal bounds are valid and include observations exactly at that instant; valid periods do not guarantee sufficient data for an assessment.
|
||||||
|
|
||||||
|
Times denote measurement instants. Equivalent instants expressed with different offsets are treated equally. A timestamp without an offset must have a documented interpretation; it must not change with the machine running the service. No particular wire format is prescribed.
|
||||||
|
|
||||||
|
Observation history is ordered by ascending measurement timestamp. US-06 separately defines latest-observation ties. Recording order never determines US-11 direction.
|
||||||
|
|
||||||
|
## Measurement context and selection
|
||||||
|
|
||||||
|
US-04 defines the recordable setting, activity condition, and optional details. Missing or ambiguous context stays unknown; original text and notes are preserved. Similar values do not prove comparable conditions.
|
||||||
|
|
||||||
|
US-07, US-10, US-11, and US-12 insight support setting and activity selections. When both are selected, both must match. Unknown is a selectable category distinct from known values. Without selections, context alone excludes nothing. Each result identifies applied selections. Individual stories define empty-result and sufficiency behaviour.
|
||||||
|
|
||||||
|
## Acceptance-test conventions
|
||||||
|
|
||||||
|
Each scenario can establish its own state directly. It need not run another user story for setup. Create, update, and delete success does not require returning a complete object or a particular HTTP status. Persistence and subsequent-read assertions may be verified using independent read scenarios with the required state established in Given.
|
||||||
|
|
||||||
|
Documented numerical methods and their concrete test fixtures must satisfy the functional criteria. No specific trend formula is prescribed. Clinical claims require applicable Danish/European guidance; mathematical-method freedom does not authorise invented clinical cutoffs.
|
||||||
|
|
||||||
|
## Shared period acceptance criteria
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: Inclusive periods
|
||||||
|
|
||||||
|
Scenario Outline: Include both boundaries
|
||||||
|
Given an authorised patient has eligible observations exactly at the start and end and outside the period
|
||||||
|
When <operation> is requested for that period
|
||||||
|
Then both boundary observations contribute
|
||||||
|
And observations outside the period do not contribute
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
| operation |
|
||||||
|
| history |
|
||||||
|
| numerical insight |
|
||||||
|
| trend assessment |
|
||||||
|
| overview insight |
|
||||||
|
|
||||||
|
Scenario Outline: Equal bounds are valid
|
||||||
|
Given eligible observations exist exactly at the selected instant and elsewhere
|
||||||
|
When <operation> is requested with start and end equal to that instant
|
||||||
|
Then the period is accepted
|
||||||
|
And only observations at that instant are selected
|
||||||
|
And the operation applies its own data-sufficiency rules
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
| operation |
|
||||||
|
| history |
|
||||||
|
| numerical insight |
|
||||||
|
| trend assessment |
|
||||||
|
| overview insight |
|
||||||
|
|
||||||
|
Scenario Outline: Reject reversed bounds
|
||||||
|
Given the caller is authorised
|
||||||
|
When <operation> is requested with end before start
|
||||||
|
Then the request is rejected
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
| operation |
|
||||||
|
| history |
|
||||||
|
| numerical insight |
|
||||||
|
| trend assessment |
|
||||||
|
| overview insight |
|
||||||
|
```
|
||||||
@@ -0,0 +1,142 @@
|
|||||||
|
# US-16 – Install and Deploy Services Independently
|
||||||
|
|
||||||
|
## User Story
|
||||||
|
|
||||||
|
As a system administrator,
|
||||||
|
I want to install one or more HealthApp services on a Linux system,
|
||||||
|
so that each service can be deployed independently or multiple services can be colocated on the same machine without losing their independent service boundaries.
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
The HealthApp consists of independently deployable services.
|
||||||
|
|
||||||
|
The installation mechanism must support both:
|
||||||
|
|
||||||
|
1. installing an individual service on a machine; and
|
||||||
|
2. installing multiple or all HealthApp services on the same machine.
|
||||||
|
|
||||||
|
When multiple services are installed on the same machine, each service must remain an independent operating-system process with its own configuration and service registration.
|
||||||
|
|
||||||
|
Installing services together must not combine them into a single process or otherwise remove the architectural separation between services.
|
||||||
|
|
||||||
|
The installation mechanism must support the services defined by the current architecture, including the API Gateway and application microservices.
|
||||||
|
|
||||||
|
## Acceptance Criteria
|
||||||
|
|
||||||
|
### AC-16-A – Install a Single Service
|
||||||
|
|
||||||
|
**Given** a supported Linux system
|
||||||
|
**When** the administrator selects one HealthApp service for installation
|
||||||
|
**Then** only the selected service is installed
|
||||||
|
**And** it can be started and stopped independently
|
||||||
|
**And** installation does not require the other HealthApp services to be installed on the same machine.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### AC-16-B – Install Multiple Services on One Machine
|
||||||
|
|
||||||
|
**Given** a supported Linux system
|
||||||
|
**When** the administrator selects multiple HealthApp services for installation
|
||||||
|
**Then** all selected services are installed
|
||||||
|
**And** each service runs as an independent operating-system process
|
||||||
|
**And** each service can be started, stopped and restarted independently.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### AC-16-C – Install the Complete System on One Machine
|
||||||
|
|
||||||
|
**Given** a supported Linux system
|
||||||
|
**When** the administrator chooses to install the complete HealthApp system
|
||||||
|
**Then** all required HealthApp services are installed
|
||||||
|
**And** every service remains an independently managed service/process
|
||||||
|
**And** the services can communicate using the same network interfaces used when deployed on separate machines.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### AC-16-D – Independent Configuration
|
||||||
|
|
||||||
|
**Given** an installed HealthApp service
|
||||||
|
**When** its deployment configuration is provided
|
||||||
|
**Then** service-specific configuration can be supplied independently of the configuration of other services.
|
||||||
|
|
||||||
|
This includes configuration required by that service, such as:
|
||||||
|
|
||||||
|
- network address and port;
|
||||||
|
- dependent service endpoints;
|
||||||
|
- database connection information where applicable;
|
||||||
|
- service credentials and other deployment-specific settings.
|
||||||
|
|
||||||
|
No service may require hard-coded knowledge that another service is installed on the same machine.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### AC-16-E – Separate-Machine Deployment
|
||||||
|
|
||||||
|
**Given** HealthApp services installed on different machines
|
||||||
|
**When** their service endpoints and required credentials are configured correctly
|
||||||
|
**Then** the services can communicate according to the documented architecture
|
||||||
|
**Without** requiring shared process memory, shared local files, or localhost-specific assumptions.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### AC-16-F – Service Management
|
||||||
|
|
||||||
|
**Given** an installed service
|
||||||
|
**When** the operating system starts, stops or restarts that service
|
||||||
|
**Then** the service can be managed independently from the other HealthApp services.
|
||||||
|
|
||||||
|
Stopping or restarting one service must not directly stop or restart another service.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### AC-16-G – Persistence Independence
|
||||||
|
|
||||||
|
**Given** a service that owns persistent data
|
||||||
|
**When** that service is installed
|
||||||
|
**Then** its persistence configuration is independent of the persistence configuration of other services.
|
||||||
|
|
||||||
|
Installing multiple services on one machine must not cause services to share persistence that the documented architecture defines as separately owned.
|
||||||
|
|
||||||
|
Services without persistence must not gain persistence merely because they are installed together with persistent services.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### AC-16-H – Installation Does Not Change Architecture
|
||||||
|
|
||||||
|
**Given** any supported installation arrangement
|
||||||
|
**When** services are installed individually or together
|
||||||
|
**Then** the logical service boundaries, communication paths, persistence ownership and responsibilities defined by the architecture remain unchanged.
|
||||||
|
|
||||||
|
Deployment location must not change the behaviour or responsibility of a service.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### AC-16-I – Installation Verification
|
||||||
|
|
||||||
|
**Given** a completed installation
|
||||||
|
**When** installation verification is performed
|
||||||
|
**Then** each installed service can be shown to:
|
||||||
|
|
||||||
|
- start successfully;
|
||||||
|
- run as its own process;
|
||||||
|
- accept its configured network traffic where applicable;
|
||||||
|
- use its configured dependencies;
|
||||||
|
- stop and restart independently.
|
||||||
|
|
||||||
|
For a complete-system installation, representative application operations must successfully pass through the deployed services.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
This user story concerns deployment and installation only.
|
||||||
|
|
||||||
|
It does not authorize:
|
||||||
|
|
||||||
|
- merging microservices;
|
||||||
|
- changing service responsibilities;
|
||||||
|
- introducing shared persistence;
|
||||||
|
- changing the documented communication architecture;
|
||||||
|
- changing existing functional user stories.
|
||||||
|
|
||||||
|
The same application executables should support both colocated and distributed deployment through configuration rather than separate implementations.
|
||||||
@@ -1,479 +0,0 @@
|
|||||||
# Personal Health Measurement System — User Stories and Acceptance Criteria
|
|
||||||
|
|
||||||
## Purpose
|
|
||||||
|
|
||||||
This document defines the externally observable behaviour of the Personal Health Measurement System.
|
|
||||||
|
|
||||||
The user stories and acceptance criteria are intentionally architecture-neutral. They do not prescribe microservices, databases, controllers, repositories, communication mechanisms, or deployment choices.
|
|
||||||
|
|
||||||
For the thesis experiment, these requirements should remain stable across architectural variants so that functional behaviour is held constant while architecture changes.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## US-01 — Create a patient profile
|
|
||||||
|
|
||||||
**User story**
|
|
||||||
|
|
||||||
> As a patient, I want to create a patient profile so that my health measurements can be associated with me.
|
|
||||||
|
|
||||||
### Acceptance criteria
|
|
||||||
|
|
||||||
```gherkin
|
|
||||||
Feature: Create patient profile
|
|
||||||
|
|
||||||
Scenario: Create a patient with valid information
|
|
||||||
Given no patient exists with the generated patient identifier
|
|
||||||
When a patient profile is created with
|
|
||||||
| name | Steffen Example |
|
|
||||||
| dateOfBirth | 1980-01-01 |
|
|
||||||
| contactInfo | steffen@example.test |
|
|
||||||
Then the patient profile is created successfully
|
|
||||||
And a patient identifier is assigned
|
|
||||||
And the patient profile can be retrieved using that identifier
|
|
||||||
|
|
||||||
Scenario: A patient name is required
|
|
||||||
When a patient profile is created without a name
|
|
||||||
Then the patient profile is rejected
|
|
||||||
|
|
||||||
Scenario: A date of birth is required
|
|
||||||
When a patient profile is created without a date of birth
|
|
||||||
Then the patient profile is rejected
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## US-02 — View a patient profile
|
|
||||||
|
|
||||||
**User story**
|
|
||||||
|
|
||||||
> As a patient, I want to view my patient profile so that I can verify the information associated with my measurements.
|
|
||||||
|
|
||||||
### Acceptance criteria
|
|
||||||
|
|
||||||
```gherkin
|
|
||||||
Feature: View patient profile
|
|
||||||
|
|
||||||
Scenario: Retrieve an existing patient
|
|
||||||
Given a patient exists
|
|
||||||
When the patient profile is requested using the patient identifier
|
|
||||||
Then the patient profile is returned
|
|
||||||
And the returned patient identifier matches the requested patient
|
|
||||||
And the patient's name is included
|
|
||||||
And the patient's date of birth is included
|
|
||||||
And the patient's contact information is included
|
|
||||||
|
|
||||||
Scenario: Request a patient that does not exist
|
|
||||||
Given no patient exists with the requested patient identifier
|
|
||||||
When the patient profile is requested
|
|
||||||
Then the request reports that the patient does not exist
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## US-03 — Update a patient profile
|
|
||||||
|
|
||||||
**User story**
|
|
||||||
|
|
||||||
> As a patient, I want to update my profile information so that the system contains my current information.
|
|
||||||
|
|
||||||
### Acceptance criteria
|
|
||||||
|
|
||||||
```gherkin
|
|
||||||
Feature: Update patient profile
|
|
||||||
|
|
||||||
Scenario: Update an existing patient
|
|
||||||
Given a patient exists with
|
|
||||||
| name | Steffen Example |
|
|
||||||
| contactInfo | old@example.test |
|
|
||||||
When the patient profile is updated with
|
|
||||||
| name | Steffen Example |
|
|
||||||
| contactInfo | new@example.test |
|
|
||||||
Then the update succeeds
|
|
||||||
And the patient identifier is unchanged
|
|
||||||
And the patient profile contains contact information "new@example.test"
|
|
||||||
|
|
||||||
Scenario: Update a patient that does not exist
|
|
||||||
Given no patient exists with the requested patient identifier
|
|
||||||
When an update is requested for that patient
|
|
||||||
Then the update is rejected
|
|
||||||
And no new patient is created
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## US-04 — Record a blood-pressure observation
|
|
||||||
|
|
||||||
**User story**
|
|
||||||
|
|
||||||
> As a patient, I want to record a blood-pressure observation so that I can maintain a history of my measurements.
|
|
||||||
|
|
||||||
### Acceptance criteria
|
|
||||||
|
|
||||||
```gherkin
|
|
||||||
Feature: Record blood-pressure observation
|
|
||||||
|
|
||||||
Scenario: Record a valid observation
|
|
||||||
Given a patient exists
|
|
||||||
When the patient records a blood-pressure observation with
|
|
||||||
| measuredAt | 2026-09-12T08:00:00 |
|
|
||||||
| systolic | 128 |
|
|
||||||
| diastolic | 82 |
|
|
||||||
| pulse | 68 |
|
|
||||||
| context | Resting |
|
|
||||||
| note | Before breakfast |
|
|
||||||
Then the observation is accepted
|
|
||||||
And an observation identifier is assigned
|
|
||||||
And the observation is associated with the patient
|
|
||||||
And the observation can be retrieved later
|
|
||||||
|
|
||||||
Scenario: Record an observation without optional fields
|
|
||||||
Given a patient exists
|
|
||||||
When the patient records a blood-pressure observation with
|
|
||||||
| measuredAt | 2026-09-12T08:00:00 |
|
|
||||||
| systolic | 128 |
|
|
||||||
| diastolic | 82 |
|
|
||||||
| pulse | 68 |
|
|
||||||
Then the observation is accepted
|
|
||||||
|
|
||||||
Scenario Outline: Reject an observation containing a non-positive measured value
|
|
||||||
Given a patient exists
|
|
||||||
When the patient records a blood-pressure observation with
|
|
||||||
| measuredAt | 2026-09-12T08:00:00 |
|
|
||||||
| systolic | <systolic> |
|
|
||||||
| diastolic | <diastolic> |
|
|
||||||
| pulse | <pulse> |
|
|
||||||
Then the observation is rejected
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
| systolic | diastolic | pulse |
|
|
||||||
| 0 | 82 | 68 |
|
|
||||||
| -1 | 82 | 68 |
|
|
||||||
| 128 | 0 | 68 |
|
|
||||||
| 128 | -1 | 68 |
|
|
||||||
| 128 | 82 | 0 |
|
|
||||||
| 128 | 82 | -1 |
|
|
||||||
|
|
||||||
Scenario: Reject an observation without a measurement timestamp
|
|
||||||
Given a patient exists
|
|
||||||
When the patient records a blood-pressure observation without a measurement timestamp
|
|
||||||
Then the observation is rejected
|
|
||||||
|
|
||||||
Scenario: Record an observation for a patient that does not exist
|
|
||||||
Given no patient exists with the requested patient identifier
|
|
||||||
When a blood-pressure observation is recorded for that patient
|
|
||||||
Then the observation is rejected
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## US-05 — View a specific blood-pressure observation
|
|
||||||
|
|
||||||
**User story**
|
|
||||||
|
|
||||||
> As a patient, I want to retrieve a specific blood-pressure observation so that I can review a previously recorded measurement.
|
|
||||||
|
|
||||||
### Acceptance criteria
|
|
||||||
|
|
||||||
```gherkin
|
|
||||||
Feature: View specific blood-pressure observation
|
|
||||||
|
|
||||||
Scenario: Retrieve an existing observation
|
|
||||||
Given a patient has recorded a blood-pressure observation with
|
|
||||||
| systolic | 128 |
|
|
||||||
| diastolic | 82 |
|
|
||||||
| pulse | 68 |
|
|
||||||
When that observation is requested using its observation identifier
|
|
||||||
Then the observation is returned
|
|
||||||
And the systolic value is 128
|
|
||||||
And the diastolic value is 82
|
|
||||||
And the pulse value is 68
|
|
||||||
|
|
||||||
Scenario: Retrieve an observation that does not exist
|
|
||||||
Given no observation exists with the requested observation identifier
|
|
||||||
When the observation is requested
|
|
||||||
Then the request reports that the observation does not exist
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## US-06 — View the latest blood-pressure observation
|
|
||||||
|
|
||||||
**User story**
|
|
||||||
|
|
||||||
> As a patient, I want to see my latest blood-pressure observation so that I can quickly review my most recent measurement.
|
|
||||||
|
|
||||||
### Acceptance criteria
|
|
||||||
|
|
||||||
```gherkin
|
|
||||||
Feature: View latest blood-pressure observation
|
|
||||||
|
|
||||||
Scenario: Return the most recent observation
|
|
||||||
Given a patient has observations recorded at
|
|
||||||
| measuredAt | systolic | diastolic | pulse |
|
|
||||||
| 2026-09-10T08:00:00 | 130 | 84 | 70 |
|
|
||||||
| 2026-09-12T08:00:00 | 126 | 80 | 66 |
|
|
||||||
| 2026-09-11T08:00:00 | 128 | 82 | 68 |
|
|
||||||
When the latest observation is requested
|
|
||||||
Then the observation measured at "2026-09-12T08:00:00" is returned
|
|
||||||
|
|
||||||
Scenario: Patient has no observations
|
|
||||||
Given a patient exists
|
|
||||||
And the patient has no recorded observations
|
|
||||||
When the latest observation is requested
|
|
||||||
Then the result indicates that no observation is available
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## US-07 — View blood-pressure observation history
|
|
||||||
|
|
||||||
**User story**
|
|
||||||
|
|
||||||
> As a patient, I want to view my blood-pressure observations for a selected period so that I can review my measurement history.
|
|
||||||
|
|
||||||
### Acceptance criteria
|
|
||||||
|
|
||||||
```gherkin
|
|
||||||
Feature: View blood-pressure observation history
|
|
||||||
|
|
||||||
Scenario: Retrieve observations within a period
|
|
||||||
Given a patient has observations recorded at
|
|
||||||
| measuredAt | systolic | diastolic | pulse |
|
|
||||||
| 2026-09-01T08:00:00 | 120 | 80 | 60 |
|
|
||||||
| 2026-09-05T08:00:00 | 125 | 82 | 65 |
|
|
||||||
| 2026-09-10T08:00:00 | 130 | 84 | 70 |
|
|
||||||
When observations are requested from "2026-09-03T00:00:00" to "2026-09-08T23:59:59"
|
|
||||||
Then exactly 1 observation is returned
|
|
||||||
And the returned observation was measured at "2026-09-05T08:00:00"
|
|
||||||
|
|
||||||
Scenario: Return observations in chronological order
|
|
||||||
Given a patient has multiple observations within the requested period
|
|
||||||
When the observation history is requested
|
|
||||||
Then the observations are returned in chronological order by measurement timestamp
|
|
||||||
|
|
||||||
Scenario: No observations exist within the requested period
|
|
||||||
Given a patient exists
|
|
||||||
And no observations exist within the requested period
|
|
||||||
When the observation history is requested
|
|
||||||
Then an empty observation collection is returned
|
|
||||||
|
|
||||||
Scenario: Reject an invalid period
|
|
||||||
Given a patient exists
|
|
||||||
When observations are requested with an end time earlier than the start time
|
|
||||||
Then the request is rejected
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## US-08 — Update a blood-pressure observation
|
|
||||||
|
|
||||||
**User story**
|
|
||||||
|
|
||||||
> As a patient, I want to correct a previously recorded observation so that accidental entry errors can be fixed.
|
|
||||||
|
|
||||||
### Acceptance criteria
|
|
||||||
|
|
||||||
```gherkin
|
|
||||||
Feature: Update blood-pressure observation
|
|
||||||
|
|
||||||
Scenario: Correct an existing observation
|
|
||||||
Given a patient has an observation with
|
|
||||||
| systolic | 182 |
|
|
||||||
| diastolic | 82 |
|
|
||||||
| pulse | 68 |
|
|
||||||
When the systolic value is corrected to 128
|
|
||||||
Then the update succeeds
|
|
||||||
And the observation identifier is unchanged
|
|
||||||
And the observation contains systolic value 128
|
|
||||||
|
|
||||||
Scenario Outline: Reject an update containing a non-positive measured value
|
|
||||||
Given a patient has an existing observation
|
|
||||||
When the observation is updated with
|
|
||||||
| systolic | <systolic> |
|
|
||||||
| diastolic | <diastolic> |
|
|
||||||
| pulse | <pulse> |
|
|
||||||
Then the update is rejected
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
| systolic | diastolic | pulse |
|
|
||||||
| 0 | 82 | 68 |
|
|
||||||
| 128 | 0 | 68 |
|
|
||||||
| 128 | 82 | 0 |
|
|
||||||
|
|
||||||
Scenario: Update an observation that does not exist
|
|
||||||
Given no observation exists with the requested observation identifier
|
|
||||||
When an update is requested
|
|
||||||
Then the update is rejected
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## US-09 — Delete a blood-pressure observation
|
|
||||||
|
|
||||||
**User story**
|
|
||||||
|
|
||||||
> As a patient, I want to delete an incorrectly recorded observation so that it is no longer part of my measurement history.
|
|
||||||
|
|
||||||
### Acceptance criteria
|
|
||||||
|
|
||||||
```gherkin
|
|
||||||
Feature: Delete blood-pressure observation
|
|
||||||
|
|
||||||
Scenario: Delete an existing observation
|
|
||||||
Given a patient has a recorded observation
|
|
||||||
When that observation is deleted
|
|
||||||
Then the deletion succeeds
|
|
||||||
And the observation can no longer be retrieved
|
|
||||||
And the observation no longer appears in the patient's observation history
|
|
||||||
|
|
||||||
Scenario: Delete an observation that does not exist
|
|
||||||
Given no observation exists with the requested observation identifier
|
|
||||||
When deletion is requested
|
|
||||||
Then the request reports that the observation does not exist
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## US-10 — View calculated health insight for a period
|
|
||||||
|
|
||||||
**User story**
|
|
||||||
|
|
||||||
> As a patient, I want to see calculated statistics for my observations over a selected period so that I can understand the measurements I have recorded.
|
|
||||||
|
|
||||||
### Acceptance criteria
|
|
||||||
|
|
||||||
```gherkin
|
|
||||||
Feature: View calculated health insight
|
|
||||||
|
|
||||||
Scenario: Calculate averages for a period
|
|
||||||
Given a patient has the following observations within the requested period
|
|
||||||
| systolic | diastolic | pulse |
|
|
||||||
| 120 | 80 | 60 |
|
|
||||||
| 130 | 84 | 70 |
|
|
||||||
When health insight is requested for that period
|
|
||||||
Then the average systolic value is 125
|
|
||||||
And the average diastolic value is 82
|
|
||||||
And the average pulse value is 65
|
|
||||||
|
|
||||||
Scenario: Calculate minimum and maximum blood-pressure values
|
|
||||||
Given a patient has the following observations within the requested period
|
|
||||||
| systolic | diastolic | pulse |
|
|
||||||
| 118 | 76 | 61 |
|
|
||||||
| 130 | 84 | 70 |
|
|
||||||
| 124 | 80 | 66 |
|
|
||||||
When health insight is requested for that period
|
|
||||||
Then the minimum systolic value is 118
|
|
||||||
And the maximum systolic value is 130
|
|
||||||
And the minimum diastolic value is 76
|
|
||||||
And the maximum diastolic value is 84
|
|
||||||
|
|
||||||
Scenario: Insight uses only observations in the requested period
|
|
||||||
Given a patient has observations both inside and outside the requested period
|
|
||||||
When health insight is requested for that period
|
|
||||||
Then only observations within the requested period contribute to the calculated values
|
|
||||||
|
|
||||||
Scenario: No observations exist in the requested period
|
|
||||||
Given a patient exists
|
|
||||||
And no observations exist within the requested period
|
|
||||||
When health insight is requested
|
|
||||||
Then the result indicates that insufficient observation data is available for calculation
|
|
||||||
|
|
||||||
Scenario: Reject an invalid insight period
|
|
||||||
Given a patient exists
|
|
||||||
When health insight is requested with an end time earlier than the start time
|
|
||||||
Then the request is rejected
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## US-11 — View a health trend
|
|
||||||
|
|
||||||
**User story**
|
|
||||||
|
|
||||||
> As a patient, I want to see how my recorded measurements change over time so that I can identify the direction of my measured values.
|
|
||||||
|
|
||||||
### Acceptance criteria
|
|
||||||
|
|
||||||
```gherkin
|
|
||||||
Feature: View health trend
|
|
||||||
|
|
||||||
Scenario: Calculate a trend from observations
|
|
||||||
Given a patient has sufficient observations within the requested period
|
|
||||||
When a health trend is requested for that period
|
|
||||||
Then a trend result is returned
|
|
||||||
And the trend is derived only from observations within the requested period
|
|
||||||
|
|
||||||
Scenario: No observations exist for trend calculation
|
|
||||||
Given a patient exists
|
|
||||||
And no observations exist within the requested period
|
|
||||||
When a health trend is requested
|
|
||||||
Then the result indicates that insufficient observation data is available for trend calculation
|
|
||||||
|
|
||||||
Scenario: Reject an invalid trend period
|
|
||||||
Given a patient exists
|
|
||||||
When a health trend is requested with an end time earlier than the start time
|
|
||||||
Then the request is rejected
|
|
||||||
```
|
|
||||||
|
|
||||||
> **Note:** The exact mathematical definition of a trend should be specified before implementation if this story is retained. The acceptance criteria deliberately avoid prescribing an algorithm at this stage.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## US-12 — View a consolidated health overview
|
|
||||||
|
|
||||||
**User story**
|
|
||||||
|
|
||||||
> As a patient, I want a consolidated overview of my profile, latest observation, and calculated insight so that I can review the most important information in one place.
|
|
||||||
|
|
||||||
### Acceptance criteria
|
|
||||||
|
|
||||||
```gherkin
|
|
||||||
Feature: View consolidated health overview
|
|
||||||
|
|
||||||
Scenario: View an overview for a patient with observations
|
|
||||||
Given a patient exists
|
|
||||||
And the patient has recorded blood-pressure observations
|
|
||||||
And health insight can be calculated for the requested period
|
|
||||||
When the health overview is requested for that period
|
|
||||||
Then the patient's profile is included
|
|
||||||
And the latest blood-pressure observation is included
|
|
||||||
And the calculated health insight is included
|
|
||||||
|
|
||||||
Scenario: View an overview for a patient without observations
|
|
||||||
Given a patient exists
|
|
||||||
And the patient has no recorded observations
|
|
||||||
When the health overview is requested
|
|
||||||
Then the patient's profile is included
|
|
||||||
And no latest blood-pressure observation is returned
|
|
||||||
And the overview indicates that no calculated health insight is available
|
|
||||||
|
|
||||||
Scenario: Request an overview for a patient that does not exist
|
|
||||||
Given no patient exists with the requested patient identifier
|
|
||||||
When the health overview is requested
|
|
||||||
Then the request reports that the patient does not exist
|
|
||||||
|
|
||||||
Scenario: Reject an invalid overview period
|
|
||||||
Given a patient exists
|
|
||||||
When the health overview is requested with an end time earlier than the start time
|
|
||||||
Then the request is rejected
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Functional invariance requirement for the experiment
|
|
||||||
|
|
||||||
All architecture variants evaluated in the thesis should satisfy the same user stories and acceptance criteria.
|
|
||||||
|
|
||||||
A modified architecture should not be considered functionally equivalent to the baseline unless the same acceptance-test suite passes against both systems under equivalent test data and conditions.
|
|
||||||
|
|
||||||
The acceptance criteria define required observable behaviour. They intentionally do not require any particular:
|
|
||||||
|
|
||||||
- service decomposition,
|
|
||||||
- internal class structure,
|
|
||||||
- database technology,
|
|
||||||
- persistence implementation,
|
|
||||||
- communication mechanism,
|
|
||||||
- deployment model,
|
|
||||||
- caching strategy,
|
|
||||||
- concurrency mechanism,
|
|
||||||
- or other architectural implementation choice.
|
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
# US-01 — Create a patient profile
|
||||||
|
|
||||||
|
The [common requirements](00-common-requirements.md) apply to this story.
|
||||||
|
|
||||||
|
**User story**
|
||||||
|
|
||||||
|
> As a patient, I want to create a patient profile so that my health measurements can be associated with me.
|
||||||
|
|
||||||
|
## Functional requirements
|
||||||
|
|
||||||
|
A patient must be authenticated to create their own initial profile. A patient account has no associated profile before successful initial creation and exactly one afterwards. The association derives from the authenticated account, never an account or patient identity selected by the caller.
|
||||||
|
|
||||||
|
Creation assigns a patient identifier and persistently associates it with the account. The association survives process restart. A later create request shall report that a profile already exists and shall neither create a second profile nor replace the association.
|
||||||
|
|
||||||
|
Concurrent requests and retries after a lost response or an interrupted creation shall not produce duplicate or inaccessible profiles. After recovery, at most one profile exists for the account and a successful outcome leaves that profile accessible to it. The implementation may choose the recovery and concurrency mechanisms. It shall not report successful creation before both profile creation and association are complete.
|
||||||
|
|
||||||
|
Healthcare professionals cannot create patient profiles. Unauthenticated requests are rejected. Account registration remains outside scope.
|
||||||
|
|
||||||
|
## Acceptance criteria
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: Create patient profile
|
||||||
|
|
||||||
|
Scenario: Create a patient with valid information
|
||||||
|
Given an authenticated patient account has no associated profile
|
||||||
|
When a patient profile is created with
|
||||||
|
| name | Steffen Example |
|
||||||
|
| dateOfBirth | 1980-01-01 |
|
||||||
|
| contactInfo | steffen@example.test |
|
||||||
|
Then the patient profile is created successfully
|
||||||
|
And a patient identifier is assigned
|
||||||
|
And the identifier is associated with the authenticated account
|
||||||
|
|
||||||
|
Scenario: A patient name is required
|
||||||
|
When a patient profile is created without a name
|
||||||
|
Then the patient profile is rejected
|
||||||
|
|
||||||
|
Scenario: A date of birth is required
|
||||||
|
When a patient profile is created without a date of birth
|
||||||
|
Then the patient profile is rejected
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Reject a second profile
|
||||||
|
Given an authenticated patient account already has a profile
|
||||||
|
When another profile creation is requested
|
||||||
|
Then the request reports that a profile already exists
|
||||||
|
And no second profile is created and the association is unchanged
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Persistent account association
|
||||||
|
Given a profile and its account association were successfully created
|
||||||
|
And the application processes have restarted
|
||||||
|
When the authenticated account requests its profile
|
||||||
|
Then the same associated profile is returned
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Retry after a successful creation response was lost
|
||||||
|
Given profile creation and account association succeeded but the response was lost
|
||||||
|
When the authenticated account retries creation
|
||||||
|
Then the result indicates that the profile already exists
|
||||||
|
And no duplicate profile or replacement association is created
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Concurrent initial creation
|
||||||
|
Given an authenticated patient account has no profile
|
||||||
|
When two valid initial-creation requests are made concurrently
|
||||||
|
Then at most one profile is created and associated with the account
|
||||||
|
And no request reports a second profile as created
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Recovery after interrupted creation
|
||||||
|
Given initial profile creation was interrupted before profile creation and association both completed
|
||||||
|
And the system is able to process requests again
|
||||||
|
When the authenticated account retries creation
|
||||||
|
Then the operation recovers to one accessible associated profile or reports that creation remains incomplete
|
||||||
|
And it neither produces duplicate profiles nor reports an inaccessible profile as successfully created
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Unauthenticated initial creation
|
||||||
|
Given the caller is not authenticated
|
||||||
|
When initial profile creation is requested
|
||||||
|
Then the request is rejected and no profile is created
|
||||||
|
```
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
# US-02 — View a patient profile
|
||||||
|
|
||||||
|
The [common requirements](00-common-requirements.md) apply to this story.
|
||||||
|
|
||||||
|
**User story**
|
||||||
|
|
||||||
|
> As a patient, I want to view my patient profile so that I can verify the information associated with my measurements.
|
||||||
|
|
||||||
|
## Acceptance criteria
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: View patient profile
|
||||||
|
|
||||||
|
Scenario: Retrieve an existing patient
|
||||||
|
Given a patient exists
|
||||||
|
When the patient profile is requested using the patient identifier
|
||||||
|
Then the patient profile is returned
|
||||||
|
And the returned patient identifier matches the requested patient
|
||||||
|
And the patient's name is included
|
||||||
|
And the patient's date of birth is included
|
||||||
|
And the patient's contact information is included
|
||||||
|
|
||||||
|
Scenario: Request a patient that does not exist
|
||||||
|
Given no patient exists with the requested patient identifier
|
||||||
|
When the patient profile is requested
|
||||||
|
Then the request reports that the patient does not exist
|
||||||
|
```
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
# US-03 — Update a patient profile
|
||||||
|
|
||||||
|
The [common requirements](00-common-requirements.md) apply to this story.
|
||||||
|
|
||||||
|
**User story**
|
||||||
|
|
||||||
|
> As a patient, I want to update my profile information so that the system contains my current information.
|
||||||
|
|
||||||
|
## Acceptance criteria
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: Update patient profile
|
||||||
|
|
||||||
|
Scenario: Update an existing patient
|
||||||
|
Given a patient exists with
|
||||||
|
| name | Steffen Example |
|
||||||
|
| contactInfo | old@example.test |
|
||||||
|
When the patient profile is updated with
|
||||||
|
| name | Steffen Example |
|
||||||
|
| contactInfo | new@example.test |
|
||||||
|
Then the update succeeds
|
||||||
|
And the patient identifier is unchanged
|
||||||
|
And the patient profile contains contact information "new@example.test"
|
||||||
|
|
||||||
|
Scenario: Update a patient that does not exist
|
||||||
|
Given no patient exists with the requested patient identifier
|
||||||
|
When an update is requested for that patient
|
||||||
|
Then the update is rejected
|
||||||
|
And no new patient is created
|
||||||
|
```
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
# US-04 — Record a blood-pressure observation
|
||||||
|
|
||||||
|
The [common requirements](00-common-requirements.md) apply to this story.
|
||||||
|
|
||||||
|
**User story**
|
||||||
|
|
||||||
|
> As a patient, I want to record a blood-pressure observation so that I can maintain a history of my measurements.
|
||||||
|
|
||||||
|
## Functional requirements
|
||||||
|
|
||||||
|
The patient shall be able to record and save the following information with an observation:
|
||||||
|
|
||||||
|
| Information | Required supported distinctions |
|
||||||
|
| --- | --- |
|
||||||
|
| Setting | Home, clinic, other, unknown/not recorded |
|
||||||
|
| Activity condition | At rest, during activity, after activity, unknown/not recorded |
|
||||||
|
| Preparation and technique | Optional details about rest duration, body position, measured arm, and device/cuff used |
|
||||||
|
| Additional circumstances | Optional descriptions such as recent activity, stress, pain, or a departure from the usual measurement routine |
|
||||||
|
|
||||||
|
Setting and activity condition shall be independently recordable and usable for subsequent selection and comparison; users shall not have to encode both solely in an undifferentiated note. The representation and storage design are implementation choices.
|
||||||
|
|
||||||
|
Partial context shall be accepted. Missing information shall remain unknown, without defaulting to home, resting, or correct technique. Existing observations and valid submissions without context shall remain supported.
|
||||||
|
|
||||||
|
The existing optional context text and note shall be preserved. Ambiguous historical text shall not be converted into definite categories. Where recorded categories and narrative descriptions conflict, the system shall retain the supplied information and make the conflict apparent when relevant to interpretation.
|
||||||
|
|
||||||
|
Users shall record the actual circumstances, including departures from guidance. A measurement taken after activity is valid to record; it is not a validation error merely because it is unsuitable for a resting comparison.
|
||||||
|
|
||||||
|
Context shall remain associated with its observation and be available on subsequent authorised reads. No separate patient-level context record or manually entered consistency score is required. Comparability is assessed across observations under US-11.
|
||||||
|
|
||||||
|
## Acceptance criteria
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: Record blood-pressure observation
|
||||||
|
|
||||||
|
Scenario: Record a valid observation
|
||||||
|
Given a patient exists
|
||||||
|
When the patient records a blood-pressure observation with
|
||||||
|
| measuredAt | 2026-09-12T08:00:00 |
|
||||||
|
| systolic | 128 |
|
||||||
|
| diastolic | 82 |
|
||||||
|
| pulse | 68 |
|
||||||
|
| context | Resting |
|
||||||
|
| note | Before breakfast |
|
||||||
|
Then the observation is accepted
|
||||||
|
And an observation identifier is assigned
|
||||||
|
And the observation is associated with the patient
|
||||||
|
And the observation can be retrieved later
|
||||||
|
|
||||||
|
Scenario: Record an observation without optional fields
|
||||||
|
Given a patient exists
|
||||||
|
When the patient records a blood-pressure observation with
|
||||||
|
| measuredAt | 2026-09-12T08:00:00 |
|
||||||
|
| systolic | 128 |
|
||||||
|
| diastolic | 82 |
|
||||||
|
| pulse | 68 |
|
||||||
|
Then the observation is accepted
|
||||||
|
|
||||||
|
Scenario Outline: Reject an observation containing a non-positive measured value
|
||||||
|
Given a patient exists
|
||||||
|
When the patient records a blood-pressure observation with
|
||||||
|
| measuredAt | 2026-09-12T08:00:00 |
|
||||||
|
| systolic | <systolic> |
|
||||||
|
| diastolic | <diastolic> |
|
||||||
|
| pulse | <pulse> |
|
||||||
|
Then the observation is rejected
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
| systolic | diastolic | pulse |
|
||||||
|
| 0 | 82 | 68 |
|
||||||
|
| -1 | 82 | 68 |
|
||||||
|
| 128 | 0 | 68 |
|
||||||
|
| 128 | -1 | 68 |
|
||||||
|
| 128 | 82 | 0 |
|
||||||
|
| 128 | 82 | -1 |
|
||||||
|
|
||||||
|
Scenario: Reject an observation without a measurement timestamp
|
||||||
|
Given a patient exists
|
||||||
|
When the patient records a blood-pressure observation without a measurement timestamp
|
||||||
|
Then the observation is rejected
|
||||||
|
|
||||||
|
Scenario: Record an observation for a patient that does not exist
|
||||||
|
Given no patient exists with the requested patient identifier
|
||||||
|
When a blood-pressure observation is recorded for that patient
|
||||||
|
Then the observation is rejected
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: US-04 — Record measurement setting and conditions
|
||||||
|
|
||||||
|
Scenario: Record setting and condition independently
|
||||||
|
Given a patient exists and the submitting patient is authorised
|
||||||
|
When a valid observation is submitted with setting Home and activity condition At rest
|
||||||
|
Then observation creation succeeds
|
||||||
|
|
||||||
|
Scenario: Record partial context
|
||||||
|
Given a patient exists
|
||||||
|
When a valid observation is submitted with setting Clinic and no activity condition
|
||||||
|
Then observation creation succeeds
|
||||||
|
|
||||||
|
Scenario: Retain support for absent context
|
||||||
|
Given a patient exists
|
||||||
|
When an otherwise valid observation is submitted without context
|
||||||
|
Then observation creation succeeds
|
||||||
|
|
||||||
|
Scenario: Record departure from routine
|
||||||
|
Given a patient exists
|
||||||
|
When a valid observation is submitted as After activity with a description of the activity
|
||||||
|
Then observation creation succeeds
|
||||||
|
|
||||||
|
Scenario: Reject unsupported category
|
||||||
|
Given a patient exists
|
||||||
|
When an observation is submitted with a setting category outside the supported distinctions
|
||||||
|
Then the operation is rejected with an explanation of the invalid category
|
||||||
|
|
||||||
|
Scenario: Retrieve previously saved context
|
||||||
|
Given an observation exists with saved setting, activity condition, preparation details, and a note
|
||||||
|
When an authorised user requests that observation
|
||||||
|
Then the returned observation contains those saved details associated with that observation
|
||||||
|
|
||||||
|
Scenario: Reject another patient’s context submission
|
||||||
|
Given the submitting patient is not authorised to record observations for another patient
|
||||||
|
When an observation with measurement context is submitted for that other patient
|
||||||
|
Then the operation is rejected
|
||||||
|
```
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
# US-05 — View a specific blood-pressure observation
|
||||||
|
|
||||||
|
The [common requirements](00-common-requirements.md) apply to this story.
|
||||||
|
|
||||||
|
**User story**
|
||||||
|
|
||||||
|
> As a patient, I want to retrieve a specific blood-pressure observation so that I can review a previously recorded measurement.
|
||||||
|
|
||||||
|
## Functional requirements
|
||||||
|
|
||||||
|
The returned observation shall include its recorded setting, activity condition, optional preparation details, and existing context text and note. Unknown information shall be distinguishable from explicitly recorded values. Context shall remain attached to the correct numerical measurements and timestamp.
|
||||||
|
|
||||||
|
These details are patient observation data and receive the same access protection as the observation itself.
|
||||||
|
|
||||||
|
## Acceptance criteria
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: View specific blood-pressure observation
|
||||||
|
|
||||||
|
Scenario: Retrieve an existing observation
|
||||||
|
Given a patient has recorded a blood-pressure observation with
|
||||||
|
| systolic | 128 |
|
||||||
|
| diastolic | 82 |
|
||||||
|
| pulse | 68 |
|
||||||
|
When that observation is requested using its observation identifier
|
||||||
|
Then the observation is returned
|
||||||
|
And the systolic value is 128
|
||||||
|
And the diastolic value is 82
|
||||||
|
And the pulse value is 68
|
||||||
|
|
||||||
|
Scenario: Retrieve an observation that does not exist
|
||||||
|
Given no observation exists with the requested observation identifier
|
||||||
|
When the observation is requested
|
||||||
|
Then the request reports that the observation does not exist
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: US-05 — View the context of a specific observation
|
||||||
|
|
||||||
|
Scenario: Return complete saved context
|
||||||
|
Given an observation exists with Home, At rest, and preparation details
|
||||||
|
When an authorised user requests the observation
|
||||||
|
Then its saved context is returned with its numerical measurements and timestamp
|
||||||
|
|
||||||
|
Scenario: Return partial context
|
||||||
|
Given an observation exists with Clinic and an unknown activity condition
|
||||||
|
When the observation is requested by an authorised user
|
||||||
|
Then Clinic is returned as the setting
|
||||||
|
And activity condition is represented as unknown
|
||||||
|
|
||||||
|
Scenario: Preserve historical free text
|
||||||
|
Given an observation exists with only the context text "Morning reading"
|
||||||
|
When the observation is requested by an authorised user
|
||||||
|
Then the original text is returned
|
||||||
|
And no definite setting or activity condition is invented
|
||||||
|
|
||||||
|
Scenario: Protect context
|
||||||
|
Given a user is not authorised to access an observation
|
||||||
|
When that user requests the observation
|
||||||
|
Then access is rejected
|
||||||
|
And its context is not disclosed
|
||||||
|
```
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
# US-06 — View the latest blood-pressure observation
|
||||||
|
|
||||||
|
The [common requirements](00-common-requirements.md) apply to this story.
|
||||||
|
|
||||||
|
**User story**
|
||||||
|
|
||||||
|
> As a patient, I want to see my latest blood-pressure observation so that I can quickly review my most recent measurement.
|
||||||
|
|
||||||
|
## Functional requirements
|
||||||
|
|
||||||
|
The latest observation shall include its recorded context as defined in US-04. Select the greatest measurement timestamp. If multiple observations share it, select the latest original recording time. A later edit does not change original recording time. If those times also tie, use a documented deterministic final tie rule so unchanged data yields the same result. This selection is independent of context completeness and does not determine US-11 trend direction. A recent observation shall not be replaced with an older observation merely because the older one has more suitable conditions.
|
||||||
|
|
||||||
|
## Acceptance criteria
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: View latest blood-pressure observation
|
||||||
|
|
||||||
|
Scenario: Return the most recent observation
|
||||||
|
Given a patient has observations recorded at
|
||||||
|
| measuredAt | systolic | diastolic | pulse |
|
||||||
|
| 2026-09-10T08:00:00 | 130 | 84 | 70 |
|
||||||
|
| 2026-09-12T08:00:00 | 126 | 80 | 66 |
|
||||||
|
| 2026-09-11T08:00:00 | 128 | 82 | 68 |
|
||||||
|
When the latest observation is requested
|
||||||
|
Then the observation measured at "2026-09-12T08:00:00" is returned
|
||||||
|
|
||||||
|
Scenario: Patient has no observations
|
||||||
|
Given a patient exists
|
||||||
|
And the patient has no recorded observations
|
||||||
|
When the latest observation is requested
|
||||||
|
Then the result indicates that no observation is available
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: US-06 — Include context with the latest observation
|
||||||
|
|
||||||
|
Scenario: Return context of latest observation
|
||||||
|
Given an authorised patient has an older resting observation and a newer after-activity observation
|
||||||
|
When the latest observation is requested
|
||||||
|
Then the newer observation is returned with its after-activity context
|
||||||
|
|
||||||
|
Scenario: Do not substitute a more complete observation
|
||||||
|
Given the latest observation has no recorded context
|
||||||
|
And an older observation has complete context
|
||||||
|
When the latest observation is requested
|
||||||
|
Then the latest observation is returned
|
||||||
|
And its context is represented as unknown
|
||||||
|
|
||||||
|
Scenario: Preserve timestamp tie selection
|
||||||
|
Given two observations share the latest measurement timestamp and have different settings
|
||||||
|
And the second observation was recorded most recently
|
||||||
|
When the latest observation is requested
|
||||||
|
Then the second observation is returned with its own setting
|
||||||
|
|
||||||
|
Scenario: No observations
|
||||||
|
Given the patient has no observations
|
||||||
|
When the latest observation is requested
|
||||||
|
Then the system reports that no observation is available
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Resolve a complete timestamp tie reproducibly
|
||||||
|
Given two observations share the latest measurement timestamp and original recording time
|
||||||
|
When the latest observation is requested repeatedly without data changes
|
||||||
|
Then the same observation is returned under the documented final tie rule
|
||||||
|
```
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
# US-07 — View blood-pressure observation history
|
||||||
|
|
||||||
|
The [common requirements](00-common-requirements.md) apply to this story.
|
||||||
|
|
||||||
|
**User story**
|
||||||
|
|
||||||
|
> As a patient, I want to view my blood-pressure observations for a selected period so that I can review my measurement history.
|
||||||
|
|
||||||
|
## Functional requirements
|
||||||
|
|
||||||
|
Observation history shall include the recorded context of each observation. Users shall be able to select observations by setting, activity condition, or both, including an explicit unknown/not-recorded selection for either dimension.
|
||||||
|
|
||||||
|
When both dimensions are selected, an observation must match both. Without context selections, all otherwise eligible observations shall be returned, including those with missing context. Results shall identify the applied selections and retain the existing ascending measurement-time order and inclusive period boundaries.
|
||||||
|
|
||||||
|
Ambiguous historical text shall not count as a confirmed match for Home, Clinic, or an activity category. No matching observations shall produce an empty collection. Unsupported selection values shall be rejected with an explanation.
|
||||||
|
|
||||||
|
## Acceptance criteria
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: View blood-pressure observation history
|
||||||
|
|
||||||
|
Scenario: Retrieve observations within a period
|
||||||
|
Given a patient has observations recorded at
|
||||||
|
| measuredAt | systolic | diastolic | pulse |
|
||||||
|
| 2026-09-01T08:00:00 | 120 | 80 | 60 |
|
||||||
|
| 2026-09-05T08:00:00 | 125 | 82 | 65 |
|
||||||
|
| 2026-09-10T08:00:00 | 130 | 84 | 70 |
|
||||||
|
When observations are requested from "2026-09-03T00:00:00" to "2026-09-08T23:59:59"
|
||||||
|
Then exactly 1 observation is returned
|
||||||
|
And the returned observation was measured at "2026-09-05T08:00:00"
|
||||||
|
|
||||||
|
Scenario: Return observations in chronological order
|
||||||
|
Given a patient has multiple observations within the requested period
|
||||||
|
When the observation history is requested
|
||||||
|
Then the observations are returned in chronological order by measurement timestamp
|
||||||
|
|
||||||
|
Scenario: No observations exist within the requested period
|
||||||
|
Given a patient exists
|
||||||
|
And no observations exist within the requested period
|
||||||
|
When the observation history is requested
|
||||||
|
Then an empty observation collection is returned
|
||||||
|
|
||||||
|
Scenario: Reject an invalid period
|
||||||
|
Given a patient exists
|
||||||
|
When observations are requested with an end time earlier than the start time
|
||||||
|
Then the request is rejected
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: US-07 — Distinguish history by setting and conditions
|
||||||
|
|
||||||
|
Scenario: Select home observations
|
||||||
|
Given a patient has home, clinic, and unknown-setting observations within the period
|
||||||
|
When history is requested for Home
|
||||||
|
Then only home observations within the period are returned with their context
|
||||||
|
|
||||||
|
Scenario: Combine setting and activity
|
||||||
|
Given a patient has home-resting, home-after-activity, and clinic-resting observations in the period
|
||||||
|
When history is requested for Home and At rest
|
||||||
|
Then only home-resting observations are returned
|
||||||
|
|
||||||
|
Scenario: Select unknown context
|
||||||
|
Given some observations have no known setting
|
||||||
|
When history is requested for unknown setting
|
||||||
|
Then only observations with unknown setting are returned
|
||||||
|
|
||||||
|
Scenario: No selection excludes nothing on context alone
|
||||||
|
Given observations in the period have complete, partial, and absent context
|
||||||
|
When history is requested without context selections
|
||||||
|
Then all those observations are returned in ascending measurement-time order
|
||||||
|
|
||||||
|
Scenario: No matching observations
|
||||||
|
Given no observations match the selected context and period
|
||||||
|
When history is requested with those selections
|
||||||
|
Then an empty collection is returned
|
||||||
|
|
||||||
|
Scenario: Reject unsupported selection
|
||||||
|
When history is requested with an unsupported activity-condition selection
|
||||||
|
Then the request is rejected with an explanation
|
||||||
|
|
||||||
|
Scenario: Preserve patient and boundary rules
|
||||||
|
Given matching observations exist for the patient exactly at both period boundaries
|
||||||
|
And matching observations also exist outside the period and for another patient
|
||||||
|
When the patient’s history is requested for that period and context
|
||||||
|
Then both boundary observations are returned
|
||||||
|
And the outside-period and other-patient observations are excluded
|
||||||
|
```
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
# US-08 — Update a blood-pressure observation
|
||||||
|
|
||||||
|
The [common requirements](00-common-requirements.md) apply to this story.
|
||||||
|
|
||||||
|
**User story**
|
||||||
|
|
||||||
|
> As a patient, I want to correct a previously recorded observation so that accidental entry errors can be fixed.
|
||||||
|
|
||||||
|
## Functional requirements
|
||||||
|
|
||||||
|
The patient shall be able to add, correct, or clear individual setting, activity-condition, and optional preparation/circumstance details defined in US-04, including on historical observations. Clearing a value makes it unknown; it does not assign a default.
|
||||||
|
|
||||||
|
An update to context alone shall preserve numerical measurements, measurement timestamp, patient association, and all context or note values not explicitly changed. Partial updates shall not erase unrelated information. Unsupported categories shall be rejected without partially applying the requested update.
|
||||||
|
|
||||||
|
Subsequent reads, context selections, and assessments shall use the current recorded context. They shall not retain classifications derived from context that was corrected or cleared.
|
||||||
|
|
||||||
|
## Acceptance criteria
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: Update blood-pressure observation
|
||||||
|
|
||||||
|
Scenario: Correct an existing observation
|
||||||
|
Given a patient has an observation with
|
||||||
|
| systolic | 182 |
|
||||||
|
| diastolic | 82 |
|
||||||
|
| pulse | 68 |
|
||||||
|
When the systolic value is corrected to 128
|
||||||
|
Then the update succeeds
|
||||||
|
And the observation identifier is unchanged
|
||||||
|
And the observation contains systolic value 128
|
||||||
|
|
||||||
|
Scenario Outline: Reject an update containing a non-positive measured value
|
||||||
|
Given a patient has an existing observation
|
||||||
|
When the observation is updated with
|
||||||
|
| systolic | <systolic> |
|
||||||
|
| diastolic | <diastolic> |
|
||||||
|
| pulse | <pulse> |
|
||||||
|
Then the update is rejected
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
| systolic | diastolic | pulse |
|
||||||
|
| 0 | 82 | 68 |
|
||||||
|
| 128 | 0 | 68 |
|
||||||
|
| 128 | 82 | 0 |
|
||||||
|
|
||||||
|
Scenario: Update an observation that does not exist
|
||||||
|
Given no observation exists with the requested observation identifier
|
||||||
|
When an update is requested
|
||||||
|
Then the update is rejected
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: US-08 — Correct or remove recorded measurement context
|
||||||
|
|
||||||
|
Scenario: Add context to historical observation
|
||||||
|
Given an authorised patient has an observation without context
|
||||||
|
When Home and At rest are added
|
||||||
|
Then the update succeeds
|
||||||
|
|
||||||
|
Scenario: Correct one context value
|
||||||
|
Given an authorised patient has an observation recorded as Home and At rest
|
||||||
|
When the setting alone is corrected to Clinic
|
||||||
|
Then the update succeeds
|
||||||
|
|
||||||
|
Scenario: Clear optional context
|
||||||
|
Given an authorised patient has an observation with a known activity condition
|
||||||
|
When that activity condition is cleared
|
||||||
|
Then the update succeeds
|
||||||
|
|
||||||
|
Scenario: Retrieve partially corrected observation
|
||||||
|
Given an observation’s setting was corrected to Clinic without changing its other values
|
||||||
|
When an authorised user requests that observation
|
||||||
|
Then Clinic is returned
|
||||||
|
And the original numerical values, timestamp, activity condition, and note are returned unchanged
|
||||||
|
|
||||||
|
Scenario: Reject invalid context correction
|
||||||
|
Given an observation exists
|
||||||
|
When an update contains an unsupported setting category
|
||||||
|
Then the update is rejected
|
||||||
|
|
||||||
|
Scenario: Nonexistent observation
|
||||||
|
Given the observation does not exist
|
||||||
|
When a context correction is submitted
|
||||||
|
Then the update is rejected
|
||||||
|
|
||||||
|
Scenario: Unauthorised correction
|
||||||
|
Given a user is not authorised to modify an observation
|
||||||
|
When the user submits a context correction
|
||||||
|
Then the operation is rejected
|
||||||
|
```
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
# US-09 — Delete a blood-pressure observation
|
||||||
|
|
||||||
|
The [common requirements](00-common-requirements.md) apply to this story.
|
||||||
|
|
||||||
|
**User story**
|
||||||
|
|
||||||
|
> As a patient, I want to delete an incorrectly recorded observation so that it is no longer part of my measurement history.
|
||||||
|
|
||||||
|
## Functional requirements
|
||||||
|
|
||||||
|
Deleting an observation shall also remove its context from ordinary observation retrieval, history, numerical summaries, and assessments. Context belonging to other observations shall remain unaffected. Context has no separate user-visible lifecycle after its observation is deleted.
|
||||||
|
|
||||||
|
## Acceptance criteria
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: Delete blood-pressure observation
|
||||||
|
|
||||||
|
Scenario: Delete an existing observation
|
||||||
|
Given a patient has a recorded observation
|
||||||
|
When that observation is deleted
|
||||||
|
Then the deletion succeeds
|
||||||
|
And the observation can no longer be retrieved
|
||||||
|
And the observation no longer appears in the patient's observation history
|
||||||
|
|
||||||
|
Scenario: Delete an observation that does not exist
|
||||||
|
Given no observation exists with the requested observation identifier
|
||||||
|
When deletion is requested
|
||||||
|
Then the request reports that the observation does not exist
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: US-09 — Remove context with a deleted observation
|
||||||
|
|
||||||
|
Scenario: Delete contextualised observation
|
||||||
|
Given an authorised patient has an observation with setting and conditions
|
||||||
|
When that observation is deleted
|
||||||
|
Then deletion succeeds
|
||||||
|
|
||||||
|
Scenario: History excludes previously deleted observation
|
||||||
|
Given an observation with Home and At rest was deleted
|
||||||
|
And other home-resting observations remain in the selected period
|
||||||
|
When history is requested for Home and At rest
|
||||||
|
Then the deleted observation and its context are absent
|
||||||
|
And the remaining matching observations are returned
|
||||||
|
|
||||||
|
Scenario: Assessment excludes deleted data
|
||||||
|
Given a contextualised observation was deleted
|
||||||
|
And sufficient remaining observations exist for an assessment
|
||||||
|
When the assessment is requested
|
||||||
|
Then the deleted values and context do not contribute to the result
|
||||||
|
|
||||||
|
Scenario: Reject unauthorised deletion
|
||||||
|
Given a user is not authorised to delete an observation
|
||||||
|
When the user requests its deletion
|
||||||
|
Then the operation is rejected
|
||||||
|
```
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
# US-10 — View calculated health insight for a period
|
||||||
|
|
||||||
|
The [common requirements](00-common-requirements.md) apply to this story.
|
||||||
|
|
||||||
|
**User story**
|
||||||
|
|
||||||
|
> As a patient, I want to see calculated statistics for my observations over a selected period so that I can understand the measurements I have recorded.
|
||||||
|
|
||||||
|
## Functional requirements
|
||||||
|
|
||||||
|
Users shall be able to request the existing numerical insight for a selected setting, activity condition, or both, using the same selection meanings as US-07. Without context selections, the existing all-observations-in-period calculation remains available.
|
||||||
|
|
||||||
|
The returned insight shall identify the applied context selections and number of contributing observations. Calculate arithmetic means for systolic pressure, diastolic pressure, and pulse, and minimum/maximum values for systolic and diastolic pressure. Round final means to two decimal places using half-up rounding, without intermediate rounding. Extrema retain the recorded values. A single observation is sufficient: its values are the means and its blood-pressure values are both the minima and maxima. Numeric representation need not retain trailing zero characters. Unknown context shall not prevent numerical calculations, but shall not match a known category.
|
||||||
|
|
||||||
|
A result spanning different or unknown conditions shall make that fact apparent. A pooled numerical average shall not be labelled a clinically comparable resting or home measurement series unless the supporting context justifies that description. This story does not replace descriptive averages with a diagnostic monitoring protocol.
|
||||||
|
|
||||||
|
If selection leaves no observations, the system shall report that no insight can be calculated for the selection. Context corrections and deletions shall be reflected in subsequent calculations.
|
||||||
|
|
||||||
|
## Acceptance criteria
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: View calculated health insight
|
||||||
|
|
||||||
|
Scenario: Calculate averages for a period
|
||||||
|
Given a patient has the following observations within the requested period
|
||||||
|
| systolic | diastolic | pulse |
|
||||||
|
| 120 | 80 | 60 |
|
||||||
|
| 130 | 84 | 70 |
|
||||||
|
When health insight is requested for that period
|
||||||
|
Then the average systolic value is 125
|
||||||
|
And the average diastolic value is 82
|
||||||
|
And the average pulse value is 65
|
||||||
|
|
||||||
|
Scenario: Calculate minimum and maximum blood-pressure values
|
||||||
|
Given a patient has the following observations within the requested period
|
||||||
|
| systolic | diastolic | pulse |
|
||||||
|
| 118 | 76 | 61 |
|
||||||
|
| 130 | 84 | 70 |
|
||||||
|
| 124 | 80 | 66 |
|
||||||
|
When health insight is requested for that period
|
||||||
|
Then the minimum systolic value is 118
|
||||||
|
And the maximum systolic value is 130
|
||||||
|
And the minimum diastolic value is 76
|
||||||
|
And the maximum diastolic value is 84
|
||||||
|
|
||||||
|
Scenario: Insight uses only observations in the requested period
|
||||||
|
Given a patient has observations both inside and outside the requested period
|
||||||
|
When health insight is requested for that period
|
||||||
|
Then only observations within the requested period contribute to the calculated values
|
||||||
|
|
||||||
|
Scenario: No observations exist in the requested period
|
||||||
|
Given a patient exists
|
||||||
|
And no observations exist within the requested period
|
||||||
|
When health insight is requested
|
||||||
|
Then the result indicates that insufficient observation data is available for calculation
|
||||||
|
|
||||||
|
Scenario: Reject an invalid insight period
|
||||||
|
Given a patient exists
|
||||||
|
When health insight is requested with an end time earlier than the start time
|
||||||
|
Then the request is rejected
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: US-10 — Calculate insight for selected measurement contexts
|
||||||
|
|
||||||
|
Scenario: Calculate from selected context only
|
||||||
|
Given the period contains two home-resting observations with systolic values 120 and 130
|
||||||
|
And a clinic-resting observation with systolic value 160
|
||||||
|
When insight is requested for Home and At rest
|
||||||
|
Then average systolic pressure is 125.00
|
||||||
|
And the result identifies Home, At rest, and two contributing observations
|
||||||
|
|
||||||
|
Scenario: No filter preserves pooled calculation
|
||||||
|
Given the period contains observations with different and unknown conditions
|
||||||
|
When insight is requested without context selections
|
||||||
|
Then all eligible observations contribute to the existing numerical calculations
|
||||||
|
And the mixed or unknown context is made apparent
|
||||||
|
|
||||||
|
Scenario: One selected observation
|
||||||
|
Given exactly one observation matches the selected period and context
|
||||||
|
When insight is requested for that selection
|
||||||
|
Then each mean equals that observation’s corresponding value
|
||||||
|
And each blood-pressure minimum and maximum equals its corresponding value
|
||||||
|
|
||||||
|
Scenario: No matching observations
|
||||||
|
Given observations exist in the period but none match the context selection
|
||||||
|
When insight is requested for that selection
|
||||||
|
Then the system reports that no insight can be calculated for the selection
|
||||||
|
|
||||||
|
Scenario: Correction changes membership
|
||||||
|
Given an observation’s setting was corrected from Home to Clinic
|
||||||
|
When home-only insight is requested for its period
|
||||||
|
Then that observation does not contribute to the home-only calculation
|
||||||
|
|
||||||
|
Scenario: Reject unsupported selection
|
||||||
|
When insight is requested with an unsupported setting selection
|
||||||
|
Then the request is rejected with an explanation
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Round a halfway mean upwards
|
||||||
|
Given eight eligible observations have systolic values 120, 120, 120, 120, 120, 120, 120, and 121
|
||||||
|
When insight is requested for their period
|
||||||
|
Then the average systolic value is 120.13
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Round a repeating fractional mean
|
||||||
|
Given three eligible observations have systolic values 120, 120, and 121
|
||||||
|
When insight is requested for their period
|
||||||
|
Then the average systolic value is 120.33
|
||||||
|
```
|
||||||
@@ -0,0 +1,315 @@
|
|||||||
|
# US-11 — View a health trend
|
||||||
|
|
||||||
|
The [common requirements](00-common-requirements.md) apply to this story.
|
||||||
|
|
||||||
|
**User story**
|
||||||
|
|
||||||
|
As a user reviewing a patient’s health measurements, I want to see how systolic blood pressure, diastolic blood pressure, and pulse develop over a selected period, so that I can understand their direction, variation, and whether the observed development may be favourable or concerning.
|
||||||
|
|
||||||
|
## Functional requirements
|
||||||
|
|
||||||
|
### Measurements and period
|
||||||
|
|
||||||
|
The assessment shall include systolic blood pressure, diastolic blood pressure, and pulse, reported separately with their respective units.
|
||||||
|
|
||||||
|
Only observations belonging to the selected patient and period shall contribute to the assessment. Measurements shall be evaluated according to their measurement timestamps.
|
||||||
|
|
||||||
|
### Measurement levels
|
||||||
|
|
||||||
|
The assessment shall describe the observed measurement levels and compare them with applicable Danish or European clinical reference values.
|
||||||
|
|
||||||
|
Reference values shall be appropriate to the measurement setting. Home blood-pressure measurements shall not automatically be interpreted using clinic-measurement thresholds.
|
||||||
|
|
||||||
|
The explanation shall identify the reference values used and distinguish reference thresholds from individual treatment targets. It shall not imply that a general reference value is a personalised treatment goal.
|
||||||
|
|
||||||
|
### Direction over time
|
||||||
|
|
||||||
|
The assessment shall describe whether each measurement generally increases, decreases, or shows no clear direction over the selected period.
|
||||||
|
|
||||||
|
The direction assessment shall consider measurements throughout the period. It shall not rely solely on the first and last observations.
|
||||||
|
|
||||||
|
Where the measurements show a reversal or conflicting movements, the explanation shall describe this rather than imply a consistent increase or decrease.
|
||||||
|
|
||||||
|
### Observed variation
|
||||||
|
|
||||||
|
The assessment shall describe the amount of variation within the selected period, including intermediate excursions that would be hidden by comparing only the beginning and end.
|
||||||
|
|
||||||
|
Observed variation shall be distinguished from overall direction. A measurement may decrease overall while also showing substantial variation.
|
||||||
|
|
||||||
|
The system shall not classify a period as clinically stable or unstable using an arbitrary maximum–minimum threshold. A clinical classification of variation shall only be provided where an applicable, documented clinical rule supports it.
|
||||||
|
|
||||||
|
### Interpretation and hints
|
||||||
|
|
||||||
|
The assessment shall explain whether the observed development may be favourable, concerning, mixed, or cannot be interpreted from the available information.
|
||||||
|
|
||||||
|
The explanation shall consider measurement levels together with direction and variation. It shall not assume that:
|
||||||
|
|
||||||
|
- Decreasing values are always favourable.
|
||||||
|
- Increasing values are always concerning.
|
||||||
|
- Limited variation means the measurements are healthy.
|
||||||
|
- Equal beginning and ending values mean the period was uneventful.
|
||||||
|
|
||||||
|
Systolic pressure, diastolic pressure, and pulse may support different interpretations. Where they do, the result shall explain the differences rather than force a single overall good/bad conclusion.
|
||||||
|
|
||||||
|
Hints shall describe the basis and limitations of the interpretation without presenting a diagnosis or recommending changes to medication.
|
||||||
|
|
||||||
|
### Measurement conditions and sufficient data
|
||||||
|
|
||||||
|
Clinical interpretation shall account for relevant measurement conditions where these are available, including whether measurements were taken at rest and whether they were recorded at home or in a clinical setting.
|
||||||
|
|
||||||
|
The system shall distinguish between having enough data to describe numerical changes and having enough suitable data to support a clinical interpretation.
|
||||||
|
|
||||||
|
Where the available observations do not support an assessment, the result shall identify which part cannot be assessed and explain why. It shall not silently assume missing measurement conditions or manufacture a conclusion.
|
||||||
|
|
||||||
|
### Current observations
|
||||||
|
|
||||||
|
The assessment shall reflect the current observations, including corrections and deletions. Each requested assessment shall reflect the current observations. The baseline calculation and persistence design is specified under Architecture.
|
||||||
|
|
||||||
|
### Mathematical methods
|
||||||
|
|
||||||
|
The implementation may select or develop mathematical methods for assessing measurement levels, direction, and variation. No particular formula or algorithm is prescribed.
|
||||||
|
|
||||||
|
The chosen methods shall satisfy the functional requirements and acceptance criteria, produce reproducible results, and be documented with their assumptions and limitations.
|
||||||
|
|
||||||
|
Mathematical methods shall not introduce unsupported clinical thresholds or interpretations. Clinical reference values and rules used to describe a result as potentially favourable or concerning shall be grounded in applicable Danish or European guidance. Where that guidance does not support a conclusion, the result shall communicate the limitation.
|
||||||
|
|
||||||
|
### Context selection and comparability
|
||||||
|
|
||||||
|
Users shall be able to request assessments for a selected setting, activity condition, or both, using the same meanings as US-07 and US-10. Each of systolic pressure, diastolic pressure, and pulse shall be assessed separately. Results shall identify their selections and the number of contributing observations.
|
||||||
|
|
||||||
|
Without context selection, the assessment shall cover eligible observations in the period and distinguish any mixed conditions. Users shall be able to compare separate context selections over the same period; each result shall identify its basis. Comparing a clinic series with a home series shall not by itself be described as improvement or deterioration over time.
|
||||||
|
|
||||||
|
Comparability shall be assessed from recorded setting, activity condition, and relevant optional preparation details. The explanation shall distinguish supported comparable conditions, known differences, and insufficient context. It shall identify the evidence or missing information behind that assessment. It shall not infer comparability from similar numerical values or from matching broad categories alone when other relevant details are unknown. No manually supplied consistency score is required.
|
||||||
|
|
||||||
|
Missing optional preparation details limit only claims that depend on those details. They do not automatically prevent a setting-appropriate reference comparison supported by the known information. Applicable Danish or European guidance determines which details are necessary for each clinical claim; the explanation shall distinguish the supported comparison from remaining uncertainty.
|
||||||
|
|
||||||
|
Sufficient numerical observations may still support direction and variation when context is absent. Clinical interpretation shall explain its limits and use applicable Danish/European guidance. The system shall not assume home, rest, or guideline-compliant technique from absent, ambiguous, or conflicting context.
|
||||||
|
|
||||||
|
Selected subsets shall satisfy the mathematical methods’ own sufficiency rules. Empty selections, a single observation, or a series with no temporal separation shall not produce an invented temporal direction. Supported descriptive values may still be returned with an explicit explanation of the unavailable assessment.
|
||||||
|
|
||||||
|
The implementation may develop and document mathematical methods satisfying the agreed requirements. Formula freedom does not authorise inventing clinical thresholds. Equality of first and last values alone shall not establish clinical stability. Direction requires at least two observations at distinct measurement timestamps; the documented method may require more. Equal-timestamp observations shall be handled reproducibly without recording or retrieval order determining direction. Assessments shall use current context and measurements after correction or deletion.
|
||||||
|
|
||||||
|
## Acceptance criteria
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: View health trend
|
||||||
|
|
||||||
|
Scenario: Calculate a trend from observations
|
||||||
|
Given a patient has sufficient observations within the requested period
|
||||||
|
When a health trend is requested for that period
|
||||||
|
Then a trend result is returned
|
||||||
|
And the trend is derived only from observations within the requested period
|
||||||
|
|
||||||
|
Scenario: No observations exist for trend calculation
|
||||||
|
Given a patient exists
|
||||||
|
And no observations exist within the requested period
|
||||||
|
When a health trend is requested
|
||||||
|
Then the result indicates that insufficient observation data is available for trend calculation
|
||||||
|
|
||||||
|
Scenario: Reject an invalid trend period
|
||||||
|
Given a patient exists
|
||||||
|
When a health trend is requested with an end time earlier than the start time
|
||||||
|
Then the request is rejected
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: US-11 — Context selection, comparability, and interpretation
|
||||||
|
|
||||||
|
Scenario: Assess a comparable selection
|
||||||
|
Given sufficient valid home-resting observations with documented comparable preparation details exist
|
||||||
|
When a trend is requested for Home and At rest
|
||||||
|
Then separate systolic, diastolic, and pulse assessments are returned
|
||||||
|
And the result identifies the selection, contributing count, and recorded basis for comparability
|
||||||
|
|
||||||
|
Scenario: Different conditions remain visible
|
||||||
|
Given the selected series includes resting and after-activity observations
|
||||||
|
When an assessment is requested without activity selection
|
||||||
|
Then the result identifies the differing conditions
|
||||||
|
And explains limitations on interpreting their combined trajectory
|
||||||
|
|
||||||
|
Scenario: Unknown details limit comparability
|
||||||
|
Given observations share Home and At rest but have no recorded preparation details
|
||||||
|
When their comparability is assessed
|
||||||
|
Then the explanation identifies the known similarities and missing details
|
||||||
|
And does not certify that all measurement conditions were identical
|
||||||
|
|
||||||
|
Scenario: Missing context preserves numerical information
|
||||||
|
Given sufficient numerical observations exist with no context
|
||||||
|
When an assessment is requested
|
||||||
|
Then supported numerical direction and variation are returned
|
||||||
|
And the limitations on clinical interpretation and comparability are explained
|
||||||
|
|
||||||
|
Scenario: Conflicting descriptions
|
||||||
|
Given an observation is categorised At rest but its narrative states "during exercise"
|
||||||
|
When an assessment includes that observation
|
||||||
|
Then the conflict is identified
|
||||||
|
And an unsupported resting interpretation is not asserted
|
||||||
|
|
||||||
|
Scenario: Compare labelled selections
|
||||||
|
Given sufficient home-resting and clinic-resting series exist in the same period
|
||||||
|
When the user compares assessments for those two selections
|
||||||
|
Then each result identifies its own selection and contributing observations
|
||||||
|
And a difference between settings alone is not labelled improvement or deterioration over time
|
||||||
|
|
||||||
|
Scenario: Insufficient selected series
|
||||||
|
Given many observations exist but only one matches the selected context
|
||||||
|
When a trend is requested for that selection
|
||||||
|
Then the result reports insufficient observations for temporal direction
|
||||||
|
And does not use excluded observations to manufacture a trend
|
||||||
|
|
||||||
|
Scenario: No temporal separation
|
||||||
|
Given all selected observations have the same measurement timestamp
|
||||||
|
When a trend is requested
|
||||||
|
Then temporal direction is reported as unavailable
|
||||||
|
|
||||||
|
Scenario: No matching data
|
||||||
|
Given no observations match the selected period and context
|
||||||
|
When an assessment is requested
|
||||||
|
Then the result reports that no matching observations are available
|
||||||
|
|
||||||
|
Scenario: Updated context is used
|
||||||
|
Given an observation’s activity condition was corrected from At rest to After activity
|
||||||
|
When a resting-only assessment is requested
|
||||||
|
Then that observation no longer contributes to the result
|
||||||
|
|
||||||
|
Scenario: Reject invalid selection
|
||||||
|
When an assessment is requested with an unsupported context selection
|
||||||
|
Then the request is rejected with an explanation
|
||||||
|
```
|
||||||
|
|
||||||
|
### AC-11-A — Separate assessments
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Given sufficient observations containing systolic pressure, diastolic pressure, and pulse
|
||||||
|
When the user requests an assessment for the patient and period
|
||||||
|
Then the result presents each measurement separately
|
||||||
|
And identifies its unit, observed level, direction, and variation
|
||||||
|
```
|
||||||
|
|
||||||
|
### AC-11-B — Patient and period selection
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Given observations exist for multiple patients and periods
|
||||||
|
When the user requests an assessment for one patient and period
|
||||||
|
Then only observations for that patient within the selected period contribute to the result
|
||||||
|
```
|
||||||
|
|
||||||
|
### AC-11-C — Direction across the period
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Given sufficient measurements showing a consistent upward or downward development
|
||||||
|
When the assessment is requested
|
||||||
|
Then the result identifies the corresponding direction
|
||||||
|
And bases that assessment on measurements throughout the period
|
||||||
|
```
|
||||||
|
|
||||||
|
### AC-11-D — Intermediate excursion
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Given the beginning and ending measurements are similar
|
||||||
|
And intermediate measurements differ substantially from them
|
||||||
|
When the assessment is requested
|
||||||
|
Then the result describes the intermediate variation
|
||||||
|
And does not describe the period as clinically stable merely because its endpoints are similar
|
||||||
|
```
|
||||||
|
|
||||||
|
### AC-11-E — Reversal or mixed direction
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Given measurements rise during one part of the period and fall during another
|
||||||
|
When the assessment is requested
|
||||||
|
Then the explanation describes the reversal or mixed development
|
||||||
|
And does not imply that all measurements follow one consistent direction
|
||||||
|
```
|
||||||
|
|
||||||
|
### AC-11-F — Limited variation outside reference values
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Given measurements remain outside the applicable reference values
|
||||||
|
And show limited variation
|
||||||
|
When the assessment is requested
|
||||||
|
Then the explanation identifies their position relative to the reference values
|
||||||
|
And does not describe them as healthy solely because their variation is limited
|
||||||
|
```
|
||||||
|
|
||||||
|
### AC-11-G — Potentially favourable development
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Given suitable measurements show development that applicable clinical guidance supports describing as potentially favourable
|
||||||
|
When the assessment is requested
|
||||||
|
Then the explanation describes that development and its basis
|
||||||
|
And distinguishes improvement from having reached an appropriate level
|
||||||
|
```
|
||||||
|
|
||||||
|
### AC-11-H — Potentially concerning development
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Given suitable measurements show development that applicable clinical guidance supports describing as potentially concerning
|
||||||
|
When the assessment is requested
|
||||||
|
Then the explanation describes the concern and its basis
|
||||||
|
And does not treat a decrease as favourable solely because the values are falling
|
||||||
|
```
|
||||||
|
|
||||||
|
### AC-11-I — Conflicting measurements
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Given systolic pressure, diastolic pressure, or pulse support different interpretations
|
||||||
|
When the assessment is requested
|
||||||
|
Then the result explains the interpretation of each affected measurement
|
||||||
|
And does not force them into a single favourable or concerning classification
|
||||||
|
```
|
||||||
|
|
||||||
|
### AC-11-J — Missing measurement context
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Given numerical changes can be described
|
||||||
|
But measurement conditions needed for clinical interpretation are unavailable
|
||||||
|
When the assessment is requested
|
||||||
|
Then the result presents the supported numerical information
|
||||||
|
And explains that the clinical interpretation is limited by missing context
|
||||||
|
```
|
||||||
|
|
||||||
|
### AC-11-K — Insufficient observations
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Given the observations are insufficient to determine a direction
|
||||||
|
When the assessment is requested
|
||||||
|
Then the result explicitly reports that direction cannot be determined
|
||||||
|
And does not substitute an increasing, decreasing, or unchanged conclusion
|
||||||
|
```
|
||||||
|
|
||||||
|
### AC-11-L — Applicable reference values
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Given sufficient measurement context to select applicable reference values
|
||||||
|
When an interpretation is returned
|
||||||
|
Then the result identifies the reference values used
|
||||||
|
And does not present a general reference threshold as an individual treatment target
|
||||||
|
```
|
||||||
|
|
||||||
|
### AC-11-M — Independence from storage order
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Given the same measurement values and timestamps
|
||||||
|
When their insertion or retrieval order changes
|
||||||
|
Then the assessment remains unchanged
|
||||||
|
```
|
||||||
|
|
||||||
|
### AC-11-N — Corrected or deleted observations
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Given an observation has been corrected or deleted
|
||||||
|
When the user requests a new assessment
|
||||||
|
Then the result reflects the current observations
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Supported reference comparison despite incomplete preparation details
|
||||||
|
Given known measurement context meets the applicable guidance for a particular reference comparison
|
||||||
|
And optional preparation details not required for that comparison are missing
|
||||||
|
When the assessment is requested
|
||||||
|
Then the supported reference comparison is provided
|
||||||
|
And the explanation identifies the remaining limits without rejecting all clinical interpretation
|
||||||
|
```
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
# US-12 — View a consolidated health overview
|
||||||
|
|
||||||
|
The [common requirements](00-common-requirements.md) apply to this story.
|
||||||
|
|
||||||
|
**User story**
|
||||||
|
|
||||||
|
> As a patient, I want a consolidated overview of my profile, latest observation, and calculated insight so that I can review the most important information in one place.
|
||||||
|
|
||||||
|
## Functional requirements
|
||||||
|
|
||||||
|
The latest observation in the overview shall include its recorded context and retain the existing latest-observation selection rules. Its context shall not be presented as applying to every observation contributing to the insight.
|
||||||
|
|
||||||
|
Users shall be able to apply the US-10 setting and activity selections to the overview’s calculated insight. Those selections affect the insight only; the latest observation remains the latest overall observation for the patient. The overview shall identify this distinction, the insight selection, and its contributing count.
|
||||||
|
|
||||||
|
Without selections, the existing overview behaviour remains. Mixed or unknown context explanations accompanying the insight shall remain visible. When a selection has no contributing observations, the profile and available latest observation shall still be returned, with an explanation that no insight is available for that selection. This story does not add a trend component to the overview.
|
||||||
|
|
||||||
|
## Acceptance criteria
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: View consolidated health overview
|
||||||
|
|
||||||
|
Scenario: View an overview for a patient with observations
|
||||||
|
Given a patient exists
|
||||||
|
And the patient has recorded blood-pressure observations
|
||||||
|
And health insight can be calculated for the requested period
|
||||||
|
When the health overview is requested for that period
|
||||||
|
Then the patient's profile is included
|
||||||
|
And the latest blood-pressure observation is included
|
||||||
|
And the calculated health insight is included
|
||||||
|
|
||||||
|
Scenario: View an overview for a patient without observations
|
||||||
|
Given a patient exists
|
||||||
|
And the patient has no recorded observations
|
||||||
|
When the health overview is requested
|
||||||
|
Then the patient's profile is included
|
||||||
|
And no latest blood-pressure observation is returned
|
||||||
|
And the overview indicates that no calculated health insight is available
|
||||||
|
|
||||||
|
Scenario: Request an overview for a patient that does not exist
|
||||||
|
Given no patient exists with the requested patient identifier
|
||||||
|
When the health overview is requested
|
||||||
|
Then the request reports that the patient does not exist
|
||||||
|
|
||||||
|
Scenario: Reject an invalid overview period
|
||||||
|
Given a patient exists
|
||||||
|
When the health overview is requested with an end time earlier than the start time
|
||||||
|
Then the request is rejected
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: US-12 — Preserve measurement context in the health overview
|
||||||
|
|
||||||
|
Scenario: Latest context and insight selection differ
|
||||||
|
Given a patient has a latest after-activity observation and earlier home-resting observations in the period
|
||||||
|
When an overview is requested with Home and At rest selected for insight
|
||||||
|
Then the latest after-activity observation and its context are returned
|
||||||
|
And the insight uses only matching home-resting observations
|
||||||
|
And the result distinguishes their different bases
|
||||||
|
|
||||||
|
Scenario: No matching insight observations
|
||||||
|
Given a patient has a profile and a latest observation
|
||||||
|
And no observations match the selected insight context
|
||||||
|
When the overview is requested for that selection
|
||||||
|
Then the profile and latest observation remain available
|
||||||
|
And the absence of insight for the selection is explained
|
||||||
|
|
||||||
|
Scenario: Unknown context remains unknown
|
||||||
|
Given the latest observation has no context
|
||||||
|
When the overview is requested
|
||||||
|
Then its context is represented as unknown
|
||||||
|
And no context is copied from other observations
|
||||||
|
|
||||||
|
Scenario: Default overview preserves context limitations
|
||||||
|
Given insight spans differing measurement conditions
|
||||||
|
When an overview is requested without context selections
|
||||||
|
Then the original pooled insight is returned
|
||||||
|
And its mixed-context explanation is included
|
||||||
|
```
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
# US-13 — Authenticate and access own health information
|
||||||
|
|
||||||
|
The [common requirements](00-common-requirements.md) apply to this story.
|
||||||
|
|
||||||
|
**As a patient,**
|
||||||
|
I want to authenticate using my credentials and access only my own health information,
|
||||||
|
so that I can use the system while access to my information is restricted to me and healthcare professionals assigned to me.
|
||||||
|
|
||||||
|
## Functional requirements
|
||||||
|
|
||||||
|
The thesis prototype uses pre-created test accounts and synthetic patient data. A patient account has zero profiles before initial creation and exactly one afterwards, as defined in US-01. Healthcare professional accounts use predefined patient assignments under US-14.
|
||||||
|
|
||||||
|
Authentication is required for all patient profile, observation, insight, trend and health overview operations. General US-15 guidance is available without authentication. Patients may perform the operations defined by the existing user stories only on their own information.
|
||||||
|
|
||||||
|
## Acceptance criteria
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Successful authentication
|
||||||
|
Given I have a pre-created account
|
||||||
|
When I authenticate using valid credentials
|
||||||
|
Then the system recognises my account and Patient role
|
||||||
|
And recognises its associated patient profile if one has been created
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Access to my own information
|
||||||
|
Given I am authenticated
|
||||||
|
When I request an available operation on my own health information
|
||||||
|
Then access is permitted
|
||||||
|
And the operation follows its existing acceptance criteria
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Invalid credentials
|
||||||
|
Given I am not authenticated
|
||||||
|
When I attempt to authenticate using an incorrect account identifier or incorrect secret
|
||||||
|
Then authentication is rejected
|
||||||
|
And the response does not reveal which part of the credentials was incorrect
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Missing authentication
|
||||||
|
Given I have not authenticated
|
||||||
|
When I request an operation involving patient information
|
||||||
|
Then the request is rejected
|
||||||
|
And no patient information is returned or changed
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Invalid authentication information
|
||||||
|
Given my request contains authentication information that the system cannot validate
|
||||||
|
When I request an operation involving patient information
|
||||||
|
Then the request is rejected
|
||||||
|
And no patient information is returned or changed
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Access to another patient’s information
|
||||||
|
Given I am authenticated as one patient
|
||||||
|
When I attempt to view or change another patient’s information
|
||||||
|
Then access is rejected
|
||||||
|
And none of that patient’s information is returned or changed
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Own information does not yet exist
|
||||||
|
Given I am authenticated
|
||||||
|
And the requested information does not yet exist for my patient account
|
||||||
|
When I request that information
|
||||||
|
Then the system follows the existing behaviour for missing information
|
||||||
|
And does not return another patient’s information
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Login before profile creation
|
||||||
|
Given I have a pre-created patient account with no associated profile
|
||||||
|
When I authenticate using valid credentials
|
||||||
|
Then authentication succeeds and recognises my account and Patient role
|
||||||
|
And I may create my initial profile under US-01
|
||||||
|
And I gain no access to another patient’s information
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Expired authentication
|
||||||
|
Given my authentication information has expired
|
||||||
|
When I request protected patient information
|
||||||
|
Then the request is rejected
|
||||||
|
And no patient information is returned or changed
|
||||||
|
```
|
||||||
|
|
||||||
|
## Prototype limitations
|
||||||
|
|
||||||
|
Account registration, password recovery, multifactor authentication, account administration, access by unassigned third parties, and writes by healthcare professionals are outside scope. Assigned healthcare professionals have the read-only access defined in US-14.
|
||||||
|
|
||||||
|
These criteria apply to every applicable API operation. The authentication mechanism and internal implementation are separate design decisions. The prototype does not claim production readiness.
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
# US-14 — Read assigned patients’ information
|
||||||
|
|
||||||
|
The [common requirements](00-common-requirements.md) apply to this story.
|
||||||
|
|
||||||
|
**As a healthcare professional,**
|
||||||
|
I want to authenticate using my credentials and view health information for patients assigned to me,
|
||||||
|
so that I can review their measurements and health insights.
|
||||||
|
|
||||||
|
## Functional requirements
|
||||||
|
|
||||||
|
The thesis prototype uses pre-created healthcare professional accounts and predefined patient assignments. A healthcare professional may be assigned to multiple patients, and a patient may be assigned to multiple healthcare professionals.
|
||||||
|
|
||||||
|
Access is read-only and covers the assigned patients’ profiles, observations and their context, numerical insights, trend assessments and health overviews.
|
||||||
|
|
||||||
|
## Acceptance criteria
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Successful authentication
|
||||||
|
Given I have a pre-created healthcare professional account
|
||||||
|
When I authenticate using valid credentials
|
||||||
|
Then the system recognises my identity and healthcare professional role
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: View assigned patients
|
||||||
|
Given I am authenticated as a healthcare professional
|
||||||
|
When I request my assigned patients
|
||||||
|
Then the system returns only patients assigned to me
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: View an assigned patient’s information
|
||||||
|
Given I am authenticated as a healthcare professional
|
||||||
|
And a patient is assigned to me
|
||||||
|
When I request their profile, observations and context, numerical insights, trend assessment or health overview
|
||||||
|
Then access is permitted
|
||||||
|
And the requested information is returned according to the existing retrieval requirements
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: No assigned patients
|
||||||
|
Given I am authenticated as a healthcare professional
|
||||||
|
And no patients are assigned to me
|
||||||
|
When I request my assigned patients
|
||||||
|
Then the system indicates that no patients are assigned
|
||||||
|
And does not return other patients
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Patient information does not yet exist
|
||||||
|
Given I am authenticated as a healthcare professional
|
||||||
|
And a patient is assigned to me
|
||||||
|
And the requested information does not yet exist
|
||||||
|
When I request that information
|
||||||
|
Then the system follows the existing behaviour for missing information
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Access to an unassigned patient
|
||||||
|
Given I am authenticated as a healthcare professional
|
||||||
|
When I request information about a patient who is not assigned to me
|
||||||
|
Then access is rejected
|
||||||
|
And no information about that patient is returned
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Attempt to change patient information
|
||||||
|
Given I am authenticated as a healthcare professional
|
||||||
|
When I attempt to create, modify or delete patient information
|
||||||
|
Then the operation is rejected
|
||||||
|
And the patient information remains unchanged
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Invalid credentials
|
||||||
|
Given I am not authenticated
|
||||||
|
When I attempt to authenticate using an incorrect account identifier or incorrect secret
|
||||||
|
Then authentication is rejected
|
||||||
|
And the response does not reveal which part of the credentials was incorrect
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Missing or invalid authentication
|
||||||
|
Given my request has missing or invalid authentication information
|
||||||
|
When I request assigned patients or patient information
|
||||||
|
Then the request is rejected
|
||||||
|
And no patient information is returned
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: Patient account attempts professional access
|
||||||
|
Given I am authenticated only as a patient
|
||||||
|
When I attempt to use access reserved for healthcare professionals
|
||||||
|
Then access is rejected
|
||||||
|
And my existing access to my own information is unaffected
|
||||||
|
```
|
||||||
|
|
||||||
|
## Prototype limitations
|
||||||
|
|
||||||
|
Patient assignments are predefined. Assignment management, professional credential verification, consent workflows, emergency access and editing by healthcare professionals are outside scope.
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
# US-15 — Follow measurement instructions
|
||||||
|
|
||||||
|
The [common requirements](00-common-requirements.md) apply to this story.
|
||||||
|
|
||||||
|
## User story
|
||||||
|
|
||||||
|
As a patient, I want clear instructions for taking and recording blood-pressure and pulse measurements, so that my observations are as accurate and comparable as practicable.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
Measurement guidance is separate from saving context under US-04. Guidance shall be available before any observation exists and while preparing to record an observation. Existing access rules continue to protect patient data; general guidance is available without authentication and shall neither require nor disclose patient information or assignment lists. Patient-specific records and assessments remain protected under US-13 and US-14.
|
||||||
|
|
||||||
|
## Functional requirements
|
||||||
|
|
||||||
|
The system shall provide clear, ordered instructions for obtaining accurate and repeatable blood-pressure and accompanying pulse measurements, based on applicable Danish or European clinical guidance. The instructions shall identify their source and review date, and distinguish home self-measurement from clinical measurement.
|
||||||
|
|
||||||
|
Home guidance shall cover preparation and rest, a suitable validated device and cuff, posture and arm positioning, remaining still during measurement, repeated readings and timing, and recording actual values and conditions. It shall explain how maintaining comparable conditions helps later comparison. Where numeric waiting times or repeat schedules are given, they shall follow the identified guidance rather than invented values.
|
||||||
|
|
||||||
|
The Danish home protocol described in [Sundhed.dk — Højt blodtryk](https://www.sundhed.dk/sundhedsfaglig/laegehaandbogen/hjerte-kar/symptomer-og-tegn/hoejt-blodtryk/) includes five minutes of seated rest and repeated morning/evening readings over three days. Instructions shall distinguish such a planned monitoring protocol from recording an individual observation. Device and cuff guidance shall be consistent with [Sundhed.dk — Blodtryksmåling](https://www.sundhed.dk/sundhedsfaglig/laegehaandbogen/undersoegelser-og-proever/kliniske-procedurer/hjertekar/blodtryksmaaling/).
|
||||||
|
|
||||||
|
Guidance for accompanying pulse shall explain recording the device-reported pulse and the relevance of rest/activity context; it shall not assume that a single pulse value measures rhythm regularity. The guidance shall not claim to guarantee accuracy or replace the device instructions or individually supplied clinical instructions.
|
||||||
|
|
||||||
|
If the setting is unknown, guidance shall clearly label its applicability rather than assuming home measurement. Departures from recommended conditions shall be recordable; guidance shall advise recording the actual circumstances instead of changing, discarding, or inventing readings.
|
||||||
|
|
||||||
|
Reading or declining guidance shall not create, change, or delete an observation, mark a procedure as followed, or block an otherwise valid observation submission. If guidance cannot be provided, the system shall communicate this without presenting unverified instructions as authoritative. Guidance shall not recommend changes to prescribed medication.
|
||||||
|
|
||||||
|
## Acceptance criteria
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Feature: US-15 — Follow measurement instructions
|
||||||
|
|
||||||
|
Scenario: Access guidance before first observation
|
||||||
|
Given a patient has no observations
|
||||||
|
When measurement guidance is requested
|
||||||
|
Then preparation, measurement, and recording instructions are available
|
||||||
|
And the source, applicability, and review date are identified
|
||||||
|
|
||||||
|
Scenario: Home measurement guidance
|
||||||
|
When home measurement guidance is requested
|
||||||
|
Then the instructions cover rest, equipment and cuff, positioning, repeated readings, and recording conditions
|
||||||
|
And any numeric instructions follow the identified Danish or European guidance
|
||||||
|
|
||||||
|
Scenario: Unknown setting
|
||||||
|
Given no measurement setting has been supplied
|
||||||
|
When guidance is requested
|
||||||
|
Then its supported setting is identified
|
||||||
|
And no measurement setting is saved or assumed on the user’s behalf
|
||||||
|
|
||||||
|
Scenario: Different measurement conditions
|
||||||
|
Given the user is preparing to record an after-activity measurement
|
||||||
|
When guidance is requested
|
||||||
|
Then the guidance distinguishes it from a resting measurement
|
||||||
|
And explains recording the actual conditions without relabelling the result as resting
|
||||||
|
|
||||||
|
Scenario: Pulse context
|
||||||
|
When guidance for accompanying pulse is requested
|
||||||
|
Then it explains recording the pulse value and relevant activity condition
|
||||||
|
And does not describe the single pulse value as a rhythm assessment
|
||||||
|
|
||||||
|
Scenario: Guidance does not certify compliance
|
||||||
|
Given an observation entry is being prepared
|
||||||
|
When measurement guidance is viewed
|
||||||
|
Then no observation is saved or altered
|
||||||
|
And following the procedure is not recorded automatically
|
||||||
|
|
||||||
|
Scenario: Guidance is optional
|
||||||
|
Given otherwise valid observation data is supplied
|
||||||
|
And the patient has not viewed guidance
|
||||||
|
When the observation is submitted
|
||||||
|
Then creation succeeds
|
||||||
|
|
||||||
|
Scenario: Guidance unavailable
|
||||||
|
Given no verified guidance is available for the requested setting
|
||||||
|
When guidance for that setting is requested
|
||||||
|
Then its unavailability is explained
|
||||||
|
And unsupported instructions are not presented as verified guidance
|
||||||
|
```
|
||||||
|
|
||||||
|
```gherkin
|
||||||
|
Scenario: General guidance without login
|
||||||
|
Given I am not authenticated
|
||||||
|
When I request general measurement guidance
|
||||||
|
Then the general guidance is available
|
||||||
|
And no patient-specific information or assignment list is returned
|
||||||
|
```
|
||||||
@@ -0,0 +1,135 @@
|
|||||||
|
## Required installer behaviour
|
||||||
|
|
||||||
|
The installer must support installing:
|
||||||
|
|
||||||
|
- one selected HealthApp service;
|
||||||
|
- multiple selected services;
|
||||||
|
- all HealthApp services on the same machine.
|
||||||
|
|
||||||
|
Each application service must still run as an independent systemd service/process.
|
||||||
|
|
||||||
|
### PostgreSQL
|
||||||
|
|
||||||
|
Where an installed service requires PostgreSQL persistence, the installer must:
|
||||||
|
|
||||||
|
- detect whether PostgreSQL is already available;
|
||||||
|
- install PostgreSQL when necessary on supported Linux distributions;
|
||||||
|
- create the required database(s);
|
||||||
|
- create dedicated database user credentials;
|
||||||
|
- generate suitable passwords rather than using hard-coded credentials;
|
||||||
|
- assign only the permissions required by the owning service;
|
||||||
|
- configure the application service to use its database;
|
||||||
|
- run any required database migrations.
|
||||||
|
|
||||||
|
Patient Profile and Observation persistence must remain separately owned.
|
||||||
|
|
||||||
|
Installing both services on the same PostgreSQL server is allowed, but they must use separate databases and service credentials.
|
||||||
|
|
||||||
|
Services without persistence must not receive databases.
|
||||||
|
|
||||||
|
### Application/service credentials
|
||||||
|
|
||||||
|
The installer must generate the credentials needed for communication between the deployed HealthApp services.
|
||||||
|
|
||||||
|
Credentials must:
|
||||||
|
|
||||||
|
- not be hard-coded in the repository;
|
||||||
|
- be generated during installation;
|
||||||
|
- be stored in files or configuration readable only by the appropriate service account/root where practical;
|
||||||
|
- be configured automatically into the relevant services.
|
||||||
|
|
||||||
|
The administrator should not have to manually invent and distribute inter-service credentials for a normal installation.
|
||||||
|
|
||||||
|
### HTTPS certificates
|
||||||
|
|
||||||
|
The installer must configure HTTPS for the installed services.
|
||||||
|
|
||||||
|
For the prototype, certificates do not need to be publicly trusted.
|
||||||
|
|
||||||
|
The installer may generate a local/self-signed certificate or a small local certificate authority and issue certificates from it.
|
||||||
|
|
||||||
|
The goal is encrypted HTTPS communication, not public PKI validation.
|
||||||
|
|
||||||
|
The installer must:
|
||||||
|
|
||||||
|
- generate the required certificate/key material if none is supplied;
|
||||||
|
- configure each installed service to use HTTPS;
|
||||||
|
- configure the relevant local trust relationships required for HealthApp services to communicate successfully;
|
||||||
|
- protect private key material using appropriate filesystem permissions.
|
||||||
|
|
||||||
|
It should remain possible to replace the generated prototype certificates with externally supplied trusted certificates later.
|
||||||
|
|
||||||
|
### Service configuration
|
||||||
|
|
||||||
|
The installer must generate the configuration necessary for the selected deployment, including as applicable:
|
||||||
|
|
||||||
|
- listening address;
|
||||||
|
- HTTPS port;
|
||||||
|
- URLs of dependent HealthApp services;
|
||||||
|
- database connection strings;
|
||||||
|
- database credentials;
|
||||||
|
- inter-service credentials;
|
||||||
|
- certificate paths;
|
||||||
|
- environment-specific configuration.
|
||||||
|
|
||||||
|
A normal installation must not require manually editing application configuration files after installation.
|
||||||
|
|
||||||
|
### Linux service installation
|
||||||
|
|
||||||
|
For each selected HealthApp service, the installer must:
|
||||||
|
|
||||||
|
- install/publish the application;
|
||||||
|
- create the necessary service account where appropriate;
|
||||||
|
- create its systemd unit;
|
||||||
|
- enable the service;
|
||||||
|
- start the service;
|
||||||
|
- verify that it starts successfully.
|
||||||
|
|
||||||
|
### Verification
|
||||||
|
|
||||||
|
At the end of installation, perform an installation verification that checks at minimum:
|
||||||
|
|
||||||
|
- each selected systemd service is running;
|
||||||
|
- each selected service is listening on its configured HTTPS endpoint;
|
||||||
|
- required PostgreSQL databases are reachable;
|
||||||
|
- service-to-service communication works for the installed topology;
|
||||||
|
- representative application functionality works when the complete system is installed.
|
||||||
|
|
||||||
|
If installation or verification fails, report clearly which step failed.
|
||||||
|
|
||||||
|
## Deployment principle
|
||||||
|
|
||||||
|
The installer should make the selected topology work.
|
||||||
|
|
||||||
|
For example:
|
||||||
|
|
||||||
|
Machine A:
|
||||||
|
- API Gateway
|
||||||
|
- Patient Profile
|
||||||
|
- Observation
|
||||||
|
- Insights
|
||||||
|
- Health Overview
|
||||||
|
- PostgreSQL
|
||||||
|
|
||||||
|
or:
|
||||||
|
|
||||||
|
Machine A:
|
||||||
|
- API Gateway
|
||||||
|
|
||||||
|
Machine B:
|
||||||
|
- Patient Profile
|
||||||
|
- PostgreSQL
|
||||||
|
|
||||||
|
Machine C:
|
||||||
|
- Observation
|
||||||
|
- PostgreSQL
|
||||||
|
|
||||||
|
Machine D:
|
||||||
|
- Insights
|
||||||
|
|
||||||
|
Machine E:
|
||||||
|
- Health Overview
|
||||||
|
|
||||||
|
The application binaries and architectural boundaries must remain the same in either case.
|
||||||
|
|
||||||
|
Do not require the administrator to manually create PostgreSQL databases, application credentials, or prototype HTTPS certificates as a prerequisite for installation.
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
# Requirements reconciliation — 2026-10-04
|
||||||
|
|
||||||
|
## Result
|
||||||
|
|
||||||
|
The supplied Docs.zip was used as the source of truth. Requirements now have one current numbered file per story (US-01–US-15), plus one common-rules file. Compatible original scenarios and addendum criteria are retained; replaced clauses are listed below. The source ZIP was not edited in place.
|
||||||
|
|
||||||
|
Replace the old Docs directory with this corrected Docs directory rather than merely overlaying files: retired addenda and original aggregate requirements must not remain active beside the consolidated definitions. Retain the old version in version control.
|
||||||
|
|
||||||
|
## Review findings resolved
|
||||||
|
|
||||||
|
| Finding | Resolution |
|
||||||
|
| --- | --- |
|
||||||
|
| 1. Clinician exclusion | US-13 permits US-14 assigned read-only professional access and excludes unassigned access/professional writes. |
|
||||||
|
| 2. Account cardinality | US-01/13 define zero then one profile; cover login without profile, initial association, duplicates, restart, concurrency and retry/recovery. US-14 retains predefined assignments. |
|
||||||
|
| 3. Algorithm prerequisite | Removed the requirement for a prescribed preimplementation formula. US-11 permits selecting/developing and documenting methods with reproducibility and evidence constraints. |
|
||||||
|
| 4. Absent v4 references | Removed v4/convention references. The operative full-period, temporal sufficiency, and endpoint limitations stand directly in US-11. |
|
||||||
|
| 5. Latest ties | US-06 explicitly selects latest measurement time, then original recording time, then a documented deterministic final rule. No recording-order dependency for US-11. |
|
||||||
|
| 6. Rounding | US-10 explicitly defines arithmetic means, two-decimal half-up final rounding, no intermediate rounding, extrema and single-observation results. Added exact fractional examples. No implementation was available to verify existing behaviour; this is the intended contract for implementation. |
|
||||||
|
| 7. Periods | Common inclusive boundaries; equal bounds valid; reversed bounds rejected. Added parameterised criteria for every period-based operation. |
|
||||||
|
| 8. Comparability | US-11 permits supported reference comparisons despite missing irrelevant optional details while explaining limits on stronger claims. |
|
||||||
|
| 9. Guidance access | US-15 general guidance public; patient-specific data and assignments remain protected. Authentication design access table aligned. |
|
||||||
|
|
||||||
|
## Replaced clauses and baseline design
|
||||||
|
|
||||||
|
- US-13’s unconditional one-patient-per-account statement and blanket clinician exclusion are replaced by the lifecycle and role rules.
|
||||||
|
- US-14’s instructions to patch US-13 are incorporated; they are no longer a separate competing replacement paragraph.
|
||||||
|
- The US-11 preimplementation-formula note is removed. No unseen endpoint-only definition is treated as a source requirement.
|
||||||
|
- “Existing” rounding and tie behaviour is now specified explicitly rather than assumed.
|
||||||
|
- The US-11 ban on persisting generated assessments is moved to baseline Architecture. Functional freshness remains in requirements.
|
||||||
|
- US_10_Correction is consolidated into the existing Architecture correction; its circular reference back into Requirements is removed.
|
||||||
|
- The authentication design’s technology choices remain open. This reconciliation does not select JWT, token lifetime, association storage, or gateway-to-service controls.
|
||||||
|
- Five editable draw.io diagrams update Observation classes/persistence, Insights classes/results, Overview classes and the no-persistence Insights model. `Architecture/README.md` identifies which JPEG snapshots they supersede. All original JPEG bytes are retained unchanged. Logical data shapes do not prescribe extra services or a specific physical storage mapping.
|
||||||
|
|
||||||
|
## Original-file mapping
|
||||||
|
|
||||||
|
All paths below are relative to Requirements unless stated otherwise. Retired files are replaced in the corrected copy, not retained as competing requirements.
|
||||||
|
|
||||||
|
| Supplied file | Current location |
|
||||||
|
| --- | --- |
|
||||||
|
| `us15-measurement-guidance.md` | `us15-measurement-guidance.md` |
|
||||||
|
| `US_10_Correction` | `../Architecture/us10-insights-correction.md` |
|
||||||
|
| `us06-latest-observation-context-addendum.md` | `us06-latest-observation.md` |
|
||||||
|
| `us11-measurement-context-addendum.md` | `us11-health-trend.md` |
|
||||||
|
| `us04-record-measurement-context-addendum.md` | `us04-record-observation.md` |
|
||||||
|
| `us_13_Authentication_own_Data.md` | `us13-patient-authentication.md` |
|
||||||
|
| `us08-update-measurement-context-addendum.md` | `us08-update-observation.md` |
|
||||||
|
| `us07-filter-observation-history-context-addendum.md` | `us07-observation-history.md` |
|
||||||
|
| `us12-overview-measurement-context-addendum.md` | `us12-health-overview.md` |
|
||||||
|
| `personal_health_user_stories_and_acceptance_criteria.md` | `00-common-requirements.md and US-01–US-12 files` |
|
||||||
|
| `us11-trend-stability-and-interpretation-addendum.md` | `us11-health-trend.md` |
|
||||||
|
| `us10-context-selected-insights-addendum.md` | `us10-calculated-insight.md` |
|
||||||
|
| `us05-view-measurement-context-addendum.md` | `us05-view-observation.md` |
|
||||||
|
| `us09-delete-observation-context-addendum.md` | `us09-delete-observation.md` |
|
||||||
|
| `us_14_Authentication_Healthcare_Professional_Data_Access.md` | `us14-professional-access.md` |
|
||||||
|
|
||||||
|
## Validation and limits
|
||||||
|
|
||||||
|
Checked editable draw.io XML structure and independently rendered shape-layout previews (the draw.io application was not available for an export check); checked story numbering, inclusion of all original scenario titles and all addendum criteria, local Markdown links, absent retired-reference dependencies, balanced Markdown fences, and byte preservation of supplied JPEGs. Added requirements scenarios do not constitute a passing application test suite; application source and AGENTS.md were not included.
|
||||||
|
|
||||||
|
The unapproved endpoint-only suggestion mentioned by the review is outside this archive. If still present in the repository, mark it superseded by the consolidated US-11; it must not govern implementation. No original suggestion file was deleted or modified here.
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<Solution>
|
||||||
|
<Folder Name="/deploy/">
|
||||||
|
<Project Path="deploy/HealthApp.Provisioning/HealthApp.Provisioning.csproj" />
|
||||||
|
</Folder>
|
||||||
|
<Folder Name="/src/">
|
||||||
|
<Project Path="src/HealthOverviewService/HealthOverviewService.csproj" />
|
||||||
|
<Project Path="src/InsightsService/InsightsService.csproj" />
|
||||||
|
<Project Path="src/ApiGateway/ApiGateway.csproj" />
|
||||||
|
<Project Path="src/PatientProfileService/PatientProfileService.csproj" />
|
||||||
|
<Project Path="src/ObservationService/ObservationService.csproj" />
|
||||||
|
</Folder>
|
||||||
|
<Folder Name="/tests/">
|
||||||
|
<Project Path="tests/Deployment.AcceptanceTests/Deployment.AcceptanceTests.csproj" />
|
||||||
|
<Project Path="tests/Observation.AcceptanceTests/Observation.AcceptanceTests.csproj" />
|
||||||
|
<Project Path="tests/PatientProfile.AcceptanceTests/PatientProfile.AcceptanceTests.csproj" />
|
||||||
|
</Folder>
|
||||||
|
</Solution>
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
# HealthApp prototype
|
||||||
|
|
||||||
|
A REST/JSON backend with five independent services. There is no web interface.
|
||||||
|
|
||||||
|
## 1. Compile and package
|
||||||
|
|
||||||
|
Install the **.NET 10 SDK** on the build computer. From this repository's root, run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bash deploy/build-release.sh --output ./healthapp-release
|
||||||
|
```
|
||||||
|
|
||||||
|
On Windows, use PowerShell instead:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
.\deploy\build-release.ps1 -Output .\healthapp-release
|
||||||
|
```
|
||||||
|
|
||||||
|
The script compiles the application and packages its installer. The output directory
|
||||||
|
must not already exist. Copy `healthapp-release` to the test computer.
|
||||||
|
|
||||||
|
## 2. Install
|
||||||
|
|
||||||
|
Open a terminal inside the copied release directory. Replace `192.168.1.20` with
|
||||||
|
the test computer's reachable IP address or DNS name.
|
||||||
|
|
||||||
|
**Debian/Ubuntu-based Linux with systemd** (also the macOS command):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo bash install.sh --services all --host 192.168.1.20
|
||||||
|
```
|
||||||
|
|
||||||
|
**Windows**, from an administrator PowerShell:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 -Services all -HostName 192.168.1.20
|
||||||
|
```
|
||||||
|
|
||||||
|
Internet access is required to download missing dependencies. The installer provisions
|
||||||
|
the runtime, PostgreSQL, databases, credentials, HTTPS and configuration, then starts
|
||||||
|
and verifies the services. Existing installations are not overwritten.
|
||||||
|
|
||||||
|
Native service installation still needs validation on the target operating systems;
|
||||||
|
see the [installation guide](deploy/INSTALLATION.md) for details and distributed deployment.
|
||||||
|
|
||||||
|
## 3. Run and use
|
||||||
|
|
||||||
|
Services start automatically after installation and on boot.
|
||||||
|
|
||||||
|
1. On a client computer, trust the generated public `healthapp-ca.crt` certificate.
|
||||||
|
2. Test the API at `https://192.168.1.20:5443/api/measurement-guidance`.
|
||||||
|
3. Retrieve the generated login details from `accounts.json`:
|
||||||
|
- Linux: `/var/lib/healthapp-installation/deployment/accounts.json`
|
||||||
|
- Windows: `%ProgramData%\HealthApp\deployment\accounts.json`
|
||||||
|
- macOS: `/Library/Application Support/HealthApp/deployment/accounts.json`
|
||||||
|
4. Use `POST /api/authentication/login` with `accountId` and `password`; send the
|
||||||
|
returned `accessToken` as a Bearer token for protected requests.
|
||||||
|
|
||||||
|
On Linux, check or restart a service with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo systemctl status healthapp-api-gateway
|
||||||
|
sudo systemctl restart healthapp-api-gateway
|
||||||
|
```
|
||||||
|
|
||||||
|
Other service names are `healthapp-patient-profile`, `healthapp-observation`,
|
||||||
|
`healthapp-insights` and `healthapp-health-overview`.
|
||||||
|
See [API documentation](src/README.md) for available endpoints.
|
||||||
|
|
||||||
|
For JMeter scenarios and four-hour energy runs, see the [workload guide](tools/energy-jmeter/README.md).
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
using System.Text.Json;
|
||||||
|
|
||||||
|
namespace HealthApp.Provisioning;
|
||||||
|
|
||||||
|
public static class ConfigurationWriter
|
||||||
|
{
|
||||||
|
public static void Configure(string serviceDirectory, string root, string platform)
|
||||||
|
{
|
||||||
|
if (platform is not ("linux" or "windows" or "macos")) throw new InvalidOperationException("Unknown configuration platform.");
|
||||||
|
var service = Deployment.ReadService(serviceDirectory);
|
||||||
|
var directory = platform == "linux" ? Path.Combine(root, "etc", "healthapp", service.Name) : Path.Combine(root, "config", service.Name);
|
||||||
|
Directory.CreateDirectory(directory);
|
||||||
|
var destination = Path.Combine(directory, platform == "windows" ? "appsettings.Production.json" : "service.env");
|
||||||
|
if (File.Exists(destination)) throw new InvalidOperationException("Service configuration already exists; it was not overwritten.");
|
||||||
|
var env = new Dictionary<string, string>(service.Environment);
|
||||||
|
env["Kestrel__Certificates__Default__Path"] = Path.Combine(directory, "service.pfx");
|
||||||
|
if (service.Name == "api-gateway") env["Authentication__KeyDirectory"] = platform == "linux" ?
|
||||||
|
Path.Combine(root, "var", "lib", "healthapp-api-gateway", "keys") : Path.Combine(root, "state", "api-gateway", "keys");
|
||||||
|
File.Copy(Path.Combine(serviceDirectory, "service.pfx"), Path.Combine(directory, "service.pfx"));
|
||||||
|
if (platform == "windows")
|
||||||
|
{
|
||||||
|
var json = new Dictionary<string, object>();
|
||||||
|
foreach (var (key, value) in env)
|
||||||
|
{
|
||||||
|
if (key == "ASPNETCORE_ENVIRONMENT") continue; // Native service command line explicitly selects Production.
|
||||||
|
var parts = (key == "ASPNETCORE_URLS" ? "urls" : key).Split("__");
|
||||||
|
var current = json;
|
||||||
|
foreach (var part in parts[..^1])
|
||||||
|
{
|
||||||
|
if (!current.TryGetValue(part, out var child)) current[part] = child = new Dictionary<string, object>();
|
||||||
|
current = (Dictionary<string, object>)child;
|
||||||
|
}
|
||||||
|
current[parts[^1]] = value;
|
||||||
|
}
|
||||||
|
File.WriteAllText(destination, JsonSerializer.Serialize(json, Deployment.Json));
|
||||||
|
}
|
||||||
|
else File.WriteAllLines(destination, env.Select(p => p.Key + "=\"" + p.Value.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\""));
|
||||||
|
if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())
|
||||||
|
foreach (var file in Directory.GetFiles(directory)) File.SetUnixFileMode(file, UnixFileMode.UserRead | UnixFileMode.UserWrite);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
using System.Diagnostics;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Npgsql;
|
||||||
|
|
||||||
|
namespace HealthApp.Provisioning;
|
||||||
|
|
||||||
|
public static class DatabaseProvisioning
|
||||||
|
{
|
||||||
|
public static async Task Create(string serviceDirectory, string? adminFile)
|
||||||
|
{
|
||||||
|
var service = Deployment.ReadService(serviceDirectory);
|
||||||
|
var database = service.Database ?? throw new InvalidOperationException("This service owns no database.");
|
||||||
|
if (!Regex.IsMatch(database.Name, "^[a-z][a-z0-9_]{1,62}$") || !Regex.IsMatch(database.User, "^[a-z][a-z0-9_]{1,62}$") ||
|
||||||
|
!Regex.IsMatch(database.Password, "^[A-F0-9]{64}$")) throw new InvalidOperationException("Generated database settings are invalid.");
|
||||||
|
var adminConnection = adminFile is null ? null : File.ReadAllText(adminFile).Trim();
|
||||||
|
async Task<string> Sql(string sql, string target = "postgres")
|
||||||
|
{
|
||||||
|
if (adminConnection is not null)
|
||||||
|
{
|
||||||
|
var settings = new NpgsqlConnectionStringBuilder(adminConnection) { Database = target, Pooling = false };
|
||||||
|
await using var connection = new NpgsqlConnection(settings.ConnectionString);
|
||||||
|
await connection.OpenAsync();
|
||||||
|
await using var command = new NpgsqlCommand(sql, connection);
|
||||||
|
var result = await command.ExecuteScalarAsync();
|
||||||
|
return result?.ToString() ?? "";
|
||||||
|
}
|
||||||
|
var start = new ProcessStartInfo("runuser") { RedirectStandardInput = true, RedirectStandardOutput = true,
|
||||||
|
RedirectStandardError = true, UseShellExecute = false };
|
||||||
|
foreach (var argument in new[] { "-u", "postgres", "--", "psql", "--no-psqlrc", "--set=ON_ERROR_STOP=1", "--tuples-only", "--no-align", "--dbname", target })
|
||||||
|
start.ArgumentList.Add(argument);
|
||||||
|
using var process = Process.Start(start) ?? throw new InvalidOperationException("Could not run PostgreSQL administration.");
|
||||||
|
var stdout = process.StandardOutput.ReadToEndAsync();
|
||||||
|
var stderr = process.StandardError.ReadToEndAsync();
|
||||||
|
await process.StandardInput.WriteAsync(sql);
|
||||||
|
process.StandardInput.Close();
|
||||||
|
using var timeout = new CancellationTokenSource(TimeSpan.FromSeconds(30));
|
||||||
|
try { await process.WaitForExitAsync(timeout.Token); }
|
||||||
|
catch (OperationCanceledException) { process.Kill(true); throw; }
|
||||||
|
await stderr; // Never print SQL or passwords, including PostgreSQL error echoes.
|
||||||
|
if (process.ExitCode != 0) throw new InvalidOperationException("PostgreSQL administration failed; existing data was retained.");
|
||||||
|
return (await stdout).Trim();
|
||||||
|
}
|
||||||
|
static bool True(string value) => value is "t" or "True";
|
||||||
|
var userExists = True(await Sql($"SELECT EXISTS(SELECT FROM pg_roles WHERE rolname='{database.User}');"));
|
||||||
|
if (!userExists)
|
||||||
|
await Sql($"CREATE ROLE {database.User} LOGIN PASSWORD '{database.Password}' NOSUPERUSER NOCREATEDB NOCREATEROLE NOREPLICATION;");
|
||||||
|
var exists = True(await Sql($"SELECT EXISTS(SELECT FROM pg_database WHERE datname='{database.Name}');"));
|
||||||
|
if (exists && !True(await Sql($"SELECT pg_get_userbyid(datdba)='{database.User}' FROM pg_database WHERE datname='{database.Name}';")))
|
||||||
|
throw new InvalidOperationException("Existing database has another owner; it was not changed.");
|
||||||
|
if (!exists) await Sql($"CREATE DATABASE {database.Name} OWNER {database.User};");
|
||||||
|
await Sql($"REVOKE ALL ON DATABASE {database.Name} FROM PUBLIC;");
|
||||||
|
await Sql($"REVOKE ALL ON SCHEMA public FROM PUBLIC; ALTER SCHEMA public OWNER TO {database.User}; GRANT USAGE, CREATE ON SCHEMA public TO {database.User};", database.Name);
|
||||||
|
// With an external PostgreSQL admin connection, preserve that endpoint in generated application config.
|
||||||
|
if (adminConnection is not null)
|
||||||
|
{
|
||||||
|
var admin = new NpgsqlConnectionStringBuilder(adminConnection);
|
||||||
|
database = database with { Host = admin.Host!, Port = admin.Port };
|
||||||
|
service = service with { Database = database };
|
||||||
|
var key = service.Name == "patient-profile" ? "ConnectionStrings__PatientDatabase" : "ConnectionStrings__ObservationDatabase";
|
||||||
|
service.Environment[key] = Deployment.ConnectionString(database);
|
||||||
|
File.WriteAllText(Path.Combine(serviceDirectory, "service.json"), System.Text.Json.JsonSerializer.Serialize(service, Deployment.Json));
|
||||||
|
}
|
||||||
|
await Check(database);
|
||||||
|
}
|
||||||
|
public static async Task Check(DatabaseSettings database)
|
||||||
|
{
|
||||||
|
await using var connection = new NpgsqlConnection(Deployment.ConnectionString(database));
|
||||||
|
await connection.OpenAsync();
|
||||||
|
await using var command = new NpgsqlCommand("SELECT current_user", connection);
|
||||||
|
if ((string?)await command.ExecuteScalarAsync() != database.User) throw new InvalidOperationException("Database service identity does not match.");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,157 @@
|
|||||||
|
using System.Net;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Security.Cryptography.X509Certificates;
|
||||||
|
using System.Text.Json;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using Microsoft.AspNetCore.Identity;
|
||||||
|
using Npgsql;
|
||||||
|
|
||||||
|
namespace HealthApp.Provisioning;
|
||||||
|
|
||||||
|
public sealed class Topology
|
||||||
|
{
|
||||||
|
public Dictionary<string, string> Hosts { get; set; } = new();
|
||||||
|
public Dictionary<string, int> Ports { get; set; } = new();
|
||||||
|
public Dictionary<string, string> Platforms { get; set; } = new();
|
||||||
|
}
|
||||||
|
public sealed record DatabaseSettings(string Name, string User, string Password, string Host = "localhost", int Port = 5432);
|
||||||
|
public sealed record Account(string AccountId, string Role, string Password);
|
||||||
|
public sealed record ServiceSettings(string Name, string Host, int Port, string IncomingKey, string? OutgoingKey,
|
||||||
|
string CertificatePassword, DatabaseSettings? Database, Dictionary<string, string> Environment, string Platform = "linux");
|
||||||
|
public sealed record Deployment(string Id, Dictionary<string, ServiceSettings> Services, List<Account> Accounts)
|
||||||
|
{
|
||||||
|
public static readonly string[] Names = ["api-gateway", "patient-profile", "observation", "insights", "health-overview"];
|
||||||
|
public static readonly Dictionary<string, string> ContractNames = new()
|
||||||
|
{
|
||||||
|
["patient-profile"] = "PatientProfile", ["observation"] = "Observation",
|
||||||
|
["insights"] = "Insights", ["health-overview"] = "HealthOverview"
|
||||||
|
};
|
||||||
|
public static readonly JsonSerializerOptions Json = new() { PropertyNameCaseInsensitive = true, WriteIndented = true };
|
||||||
|
public static string Secret() => Convert.ToHexString(RandomNumberGenerator.GetBytes(32));
|
||||||
|
public static string Url(ServiceSettings service) => new UriBuilder("https", service.Host, service.Port).Uri.ToString();
|
||||||
|
public static Deployment Load(string directory) => JsonSerializer.Deserialize<Deployment>(
|
||||||
|
File.ReadAllText(Path.Combine(directory, "deployment.json")), Json) ?? throw new InvalidOperationException("Deployment is invalid.");
|
||||||
|
|
||||||
|
public static void Prepare(string output, string host, string? topologyFile, string? certificates)
|
||||||
|
{
|
||||||
|
if (Directory.Exists(output) || File.Exists(output)) throw new InvalidOperationException("Deployment output already exists; existing credentials were not changed.");
|
||||||
|
var topology = topologyFile is null ? new Topology() : JsonSerializer.Deserialize<Topology>(File.ReadAllText(topologyFile), Json)
|
||||||
|
?? throw new InvalidOperationException("Topology is invalid.");
|
||||||
|
foreach (var name in topology.Hosts.Keys.Concat(topology.Ports.Keys).Concat(topology.Platforms.Keys))
|
||||||
|
if (!Names.Contains(name)) throw new InvalidOperationException("Topology has an unknown service.");
|
||||||
|
var id = Guid.NewGuid().ToString("N")[..12];
|
||||||
|
var services = new Dictionary<string, ServiceSettings>();
|
||||||
|
var defaults = new Dictionary<string, int> { ["api-gateway"] = 5443, ["patient-profile"] = 5081,
|
||||||
|
["observation"] = 5082, ["insights"] = 5083, ["health-overview"] = 5084 };
|
||||||
|
foreach (var name in Names)
|
||||||
|
{
|
||||||
|
var hostname = topology.Hosts.GetValueOrDefault(name, host);
|
||||||
|
if (Uri.CheckHostName(hostname) == UriHostNameType.Unknown || hostname.Contains('%'))
|
||||||
|
throw new InvalidOperationException("Provide a valid DNS name or IP address for each service host.");
|
||||||
|
var port = topology.Ports.GetValueOrDefault(name, defaults[name]);
|
||||||
|
if (port < 1024 || port > 65535) throw new InvalidOperationException("HTTPS ports must be between 1024 and 65535.");
|
||||||
|
DatabaseSettings? database = name switch
|
||||||
|
{
|
||||||
|
"patient-profile" => new("healthapp_" + id + "_profile", "healthapp_" + id + "_profile", Secret()),
|
||||||
|
"observation" => new("healthapp_" + id + "_observation", "healthapp_" + id + "_observation", Secret()), _ => null
|
||||||
|
};
|
||||||
|
var platform = topology.Platforms.GetValueOrDefault(name, OperatingSystem.IsWindows() ? "windows" : OperatingSystem.IsMacOS() ? "macos" : "linux");
|
||||||
|
if (platform is not ("linux" or "windows" or "macos")) throw new InvalidOperationException("Unsupported node platform.");
|
||||||
|
services[name] = new(name, hostname, port, Secret(), name is "api-gateway" or "patient-profile" ? null : Secret(),
|
||||||
|
Secret(), database, new(), platform);
|
||||||
|
}
|
||||||
|
if (services.Values.GroupBy(s => (s.Host.ToLowerInvariant(), s.Port)).Any(g => g.Count() > 1))
|
||||||
|
throw new InvalidOperationException("Colocated services need distinct HTTPS ports.");
|
||||||
|
var accounts = new List<Account> { new("prototype-patient", "Patient", Secret()),
|
||||||
|
new("prototype-professional", "HealthcareProfessional", Secret()), new("installation-check", "Patient", Secret()) };
|
||||||
|
var deployment = new Deployment(id, services, accounts);
|
||||||
|
foreach (var service in services.Values)
|
||||||
|
{
|
||||||
|
var env = service.Environment;
|
||||||
|
env["ASPNETCORE_ENVIRONMENT"] = "Production";
|
||||||
|
env["ASPNETCORE_URLS"] = "https://0.0.0.0:" + service.Port;
|
||||||
|
env["InternalAccess__GatewayKey"] = service.IncomingKey;
|
||||||
|
env["Kestrel__Certificates__Default__Path"] = $"/etc/healthapp/{service.Name}/service.pfx";
|
||||||
|
env["Kestrel__Certificates__Default__Password"] = service.CertificatePassword;
|
||||||
|
if (service.Name == "api-gateway")
|
||||||
|
{
|
||||||
|
env["Authentication__KeyDirectory"] = "/var/lib/healthapp-api-gateway/keys";
|
||||||
|
foreach (var (name, contract) in ContractNames)
|
||||||
|
{
|
||||||
|
env[$"Services__{contract}__BaseUrl"] = Url(services[name]);
|
||||||
|
env[$"Services__{contract}__Key"] = services[name].IncomingKey;
|
||||||
|
if (services[name].OutgoingKey is { } key) env[$"InternalAccess__{contract}__Key"] = key;
|
||||||
|
}
|
||||||
|
for (var index = 0; index < accounts.Count; index++)
|
||||||
|
{
|
||||||
|
var account = accounts[index];
|
||||||
|
env[$"Authentication__Accounts__{index}__AccountId"] = account.AccountId;
|
||||||
|
env[$"Authentication__Accounts__{index}__Role"] = account.Role;
|
||||||
|
env[$"Authentication__Accounts__{index}__PasswordHash"] = new PasswordHasher<Account>().HashPassword(account, account.Password);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (service.OutgoingKey is not null)
|
||||||
|
{
|
||||||
|
env["Services__ApiGateway__BaseUrl"] = Url(services["api-gateway"]);
|
||||||
|
env["Services__ApiGateway__Key"] = service.OutgoingKey;
|
||||||
|
}
|
||||||
|
if (service.Database is { } db)
|
||||||
|
env[service.Name == "patient-profile" ? "ConnectionStrings__PatientDatabase" : "ConnectionStrings__ObservationDatabase"] = ConnectionString(db);
|
||||||
|
}
|
||||||
|
Directory.CreateDirectory(output);
|
||||||
|
if ((OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())) File.SetUnixFileMode(output, UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute);
|
||||||
|
using var caKey = RSA.Create(3072);
|
||||||
|
var caRequest = new CertificateRequest("CN=HealthApp prototype " + id, caKey, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
|
||||||
|
caRequest.CertificateExtensions.Add(new X509BasicConstraintsExtension(true, false, 0, true));
|
||||||
|
caRequest.CertificateExtensions.Add(new X509KeyUsageExtension(X509KeyUsageFlags.KeyCertSign | X509KeyUsageFlags.CrlSign, true));
|
||||||
|
caRequest.CertificateExtensions.Add(new X509SubjectKeyIdentifierExtension(caRequest.PublicKey, false));
|
||||||
|
using var ca = caRequest.CreateSelfSigned(DateTimeOffset.UtcNow.AddMinutes(-5), DateTimeOffset.UtcNow.AddYears(2));
|
||||||
|
// Only the public CA is needed on installed nodes; no signing key is retained.
|
||||||
|
File.WriteAllText(Path.Combine(output, "healthapp-ca.crt"), certificates is null ? ca.ExportCertificatePem() :
|
||||||
|
File.ReadAllText(Path.Combine(certificates, "healthapp-ca.crt")));
|
||||||
|
foreach (var service in services.Values)
|
||||||
|
{
|
||||||
|
var directory = Path.Combine(output, service.Name);
|
||||||
|
Directory.CreateDirectory(directory);
|
||||||
|
File.WriteAllText(Path.Combine(directory, "service.json"), JsonSerializer.Serialize(service, Json));
|
||||||
|
File.WriteAllLines(Path.Combine(directory, "service.env"), service.Environment.Select(e => e.Key + "=" + Quote(e.Value)));
|
||||||
|
byte[] pfx;
|
||||||
|
if (certificates is not null)
|
||||||
|
{
|
||||||
|
var password = File.ReadAllText(Path.Combine(certificates, service.Name + ".password")).TrimEnd('\r', '\n');
|
||||||
|
var supplied = X509CertificateLoader.LoadPkcs12CollectionFromFile(Path.Combine(certificates, service.Name + ".pfx"), password);
|
||||||
|
if (!supplied.Cast<X509Certificate2>().Any(c => c.HasPrivateKey)) throw new InvalidOperationException("Supplied certificate has no private key.");
|
||||||
|
pfx = supplied.Export(X509ContentType.Pfx, service.CertificatePassword)!;
|
||||||
|
foreach (var certificate in supplied) certificate.Dispose();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
using var key = RSA.Create(2048);
|
||||||
|
var request = new CertificateRequest("CN=" + service.Host, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
|
||||||
|
request.CertificateExtensions.Add(new X509BasicConstraintsExtension(false, false, 0, true));
|
||||||
|
request.CertificateExtensions.Add(new X509KeyUsageExtension(X509KeyUsageFlags.DigitalSignature | X509KeyUsageFlags.KeyEncipherment, true));
|
||||||
|
request.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(new System.Security.Cryptography.OidCollection { new("1.3.6.1.5.5.7.3.1") }, true));
|
||||||
|
var san = new SubjectAlternativeNameBuilder();
|
||||||
|
if (IPAddress.TryParse(service.Host, out var ip)) san.AddIpAddress(ip); else san.AddDnsName(service.Host);
|
||||||
|
request.CertificateExtensions.Add(san.Build());
|
||||||
|
using var leaf = request.Create(ca, DateTimeOffset.UtcNow.AddMinutes(-2), DateTimeOffset.UtcNow.AddYears(1), RandomNumberGenerator.GetBytes(16));
|
||||||
|
using var withKey = leaf.CopyWithPrivateKey(key);
|
||||||
|
pfx = withKey.Export(X509ContentType.Pfx, service.CertificatePassword);
|
||||||
|
}
|
||||||
|
File.WriteAllBytes(Path.Combine(directory, "service.pfx"), pfx);
|
||||||
|
}
|
||||||
|
File.WriteAllText(Path.Combine(output, "deployment.json"), JsonSerializer.Serialize(deployment, Json));
|
||||||
|
File.WriteAllText(Path.Combine(output, "accounts.json"), JsonSerializer.Serialize(accounts, Json));
|
||||||
|
if ((OperatingSystem.IsLinux() || OperatingSystem.IsMacOS()))
|
||||||
|
foreach (var file in Directory.EnumerateFiles(output, "*", SearchOption.AllDirectories))
|
||||||
|
File.SetUnixFileMode(file, UnixFileMode.UserRead | UnixFileMode.UserWrite);
|
||||||
|
}
|
||||||
|
public static string ConnectionString(DatabaseSettings db) => new NpgsqlConnectionStringBuilder
|
||||||
|
{
|
||||||
|
Host = db.Host, Port = db.Port, Database = db.Name, Username = db.User, Password = db.Password,
|
||||||
|
SslMode = SslMode.Prefer, Timeout = 10, Pooling = false
|
||||||
|
}.ConnectionString;
|
||||||
|
private static string Quote(string value) => "\"" + value.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\"";
|
||||||
|
public static ServiceSettings ReadService(string directory) => JsonSerializer.Deserialize<ServiceSettings>(
|
||||||
|
File.ReadAllText(Path.Combine(directory, "service.json")), Json) ?? throw new InvalidOperationException("Service configuration is invalid.");
|
||||||
|
}
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
using System.Diagnostics;
|
||||||
|
using System.Text.Json;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
|
namespace HealthApp.Provisioning;
|
||||||
|
|
||||||
|
public static class Distribution
|
||||||
|
{
|
||||||
|
public static async Task Deploy(string bundle, string directory, string user, string[] selected)
|
||||||
|
{
|
||||||
|
if (!Regex.IsMatch(user, "^[a-zA-Z_][a-zA-Z0-9_-]*$")) throw new InvalidOperationException("SSH user is invalid.");
|
||||||
|
var deployment = Deployment.Load(directory);
|
||||||
|
async Task Run(string command, params string[] args)
|
||||||
|
{
|
||||||
|
var start = new ProcessStartInfo(command) { UseShellExecute = false, RedirectStandardOutput = true, RedirectStandardError = true };
|
||||||
|
foreach (var argument in args) start.ArgumentList.Add(argument);
|
||||||
|
using var process = Process.Start(start) ?? throw new InvalidOperationException("Could not run deployment transport.");
|
||||||
|
var stdout = process.StandardOutput.ReadToEndAsync();
|
||||||
|
var stderr = process.StandardError.ReadToEndAsync();
|
||||||
|
using var timeout = new CancellationTokenSource(TimeSpan.FromMinutes(20));
|
||||||
|
try { await process.WaitForExitAsync(timeout.Token); }
|
||||||
|
catch (OperationCanceledException) { process.Kill(true); throw; }
|
||||||
|
await stdout;
|
||||||
|
var errors = await stderr;
|
||||||
|
if (process.ExitCode != 0)
|
||||||
|
{
|
||||||
|
var reportedStep = errors.Split('\n').LastOrDefault(line => line.StartsWith("Installation failed at ", StringComparison.Ordinal));
|
||||||
|
throw new InvalidOperationException(reportedStep ?? "SSH deployment transport failed; check administrative SSH access and node installation logs.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var temporary = Path.Combine(Path.GetTempPath(), "healthapp-distribution-" + Guid.NewGuid().ToString("N"));
|
||||||
|
Directory.CreateDirectory(temporary);
|
||||||
|
if (OperatingSystem.IsLinux()) File.SetUnixFileMode(temporary, UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
foreach (var group in selected.GroupBy(n => deployment.Services[n].Host, StringComparer.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
var names = group.ToArray();
|
||||||
|
var node = Path.Combine(temporary, "node-" + Guid.NewGuid().ToString("N"));
|
||||||
|
Directory.CreateDirectory(node);
|
||||||
|
var material = Path.Combine(node, "deployment");
|
||||||
|
Directory.CreateDirectory(material);
|
||||||
|
foreach (var script in Directory.GetFiles(bundle).Where(p => p.EndsWith(".sh") || p.EndsWith(".ps1"))) File.Copy(script, Path.Combine(node, Path.GetFileName(script)));
|
||||||
|
CopyDirectory(Path.Combine(bundle, "provisioner"), Path.Combine(node, "provisioner"));
|
||||||
|
Directory.CreateDirectory(Path.Combine(node, "services"));
|
||||||
|
Directory.CreateDirectory(Path.Combine(node, "systemd"));
|
||||||
|
foreach (var name in names)
|
||||||
|
{
|
||||||
|
CopyDirectory(Path.Combine(bundle, "services", name), Path.Combine(node, "services", name));
|
||||||
|
CopyDirectory(Path.Combine(directory, name), Path.Combine(material, name));
|
||||||
|
File.Copy(Path.Combine(bundle, "systemd", "healthapp-" + name + ".service"), Path.Combine(node, "systemd", "healthapp-" + name + ".service"));
|
||||||
|
}
|
||||||
|
// Retain remote origins, but do not give a node unrelated service/database/private-key credentials.
|
||||||
|
var scoped = deployment with
|
||||||
|
{
|
||||||
|
Services = deployment.Services.ToDictionary(p => p.Key, p => names.Contains(p.Key) ? p.Value :
|
||||||
|
p.Value with { IncomingKey = "", OutgoingKey = null, CertificatePassword = "", Database = null, Environment = new() }),
|
||||||
|
Accounts = names.Contains("api-gateway") ? deployment.Accounts : []
|
||||||
|
};
|
||||||
|
File.WriteAllText(Path.Combine(material, "deployment.json"), JsonSerializer.Serialize(scoped, Deployment.Json));
|
||||||
|
if (names.Contains("api-gateway")) File.Copy(Path.Combine(directory, "accounts.json"), Path.Combine(material, "accounts.json"));
|
||||||
|
File.Copy(Path.Combine(directory, "healthapp-ca.crt"), Path.Combine(material, "healthapp-ca.crt"));
|
||||||
|
var target = user + "@" + group.Key;
|
||||||
|
var windows = names.All(n => deployment.Services[n].Platform == "windows");
|
||||||
|
if (names.Any(n => deployment.Services[n].Platform == "windows") && !windows)
|
||||||
|
throw new InvalidOperationException("One host cannot use two native service managers.");
|
||||||
|
var remote = windows ? "C:/ProgramData/healthapp-install-" + deployment.Id : "/var/tmp/healthapp-install-" + deployment.Id;
|
||||||
|
Console.WriteLine("Install selected node: " + group.Key);
|
||||||
|
if (windows)
|
||||||
|
await Run("ssh", target, "powershell", "-NoProfile", "-NonInteractive", "-Command",
|
||||||
|
"New-Item -ItemType Directory -Path '" + remote + "' | Out-Null");
|
||||||
|
else await Run("ssh", target, "mkdir", "-m", "0700", remote);
|
||||||
|
var scpHost = group.Key.Contains(':') ? user + "@[" + group.Key + "]" : target;
|
||||||
|
await Run("scp", "-r", node + "/.", scpHost + ":" + remote + "/");
|
||||||
|
if (windows)
|
||||||
|
await Run("ssh", target, "powershell", "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-File", remote + "/install.ps1", "-Services", string.Join(',', names),
|
||||||
|
"-Deployment", remote + "/deployment", "-DeferTopologyCheck");
|
||||||
|
else await Run("ssh", target, "sudo", "-n", "bash", remote + "/install.sh", "--services", string.Join(',', names),
|
||||||
|
"--deployment", remote + "/deployment", "--defer-topology-check");
|
||||||
|
}
|
||||||
|
// Services communicate through the actual HTTPS origins on their installed hosts.
|
||||||
|
await InstallationVerification.Verify(directory, selected, selected.Length == Deployment.Names.Length);
|
||||||
|
Console.WriteLine("Distributed topology verification passed.");
|
||||||
|
}
|
||||||
|
finally { Directory.Delete(temporary, true); }
|
||||||
|
}
|
||||||
|
private static void CopyDirectory(string source, string destination)
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(destination);
|
||||||
|
foreach (var file in Directory.GetFiles(source)) File.Copy(file, Path.Combine(destination, Path.GetFileName(file)));
|
||||||
|
foreach (var child in Directory.GetDirectories(source)) CopyDirectory(child, Path.Combine(destination, Path.GetFileName(child)));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType><TargetFramework>net10.0</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable><ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||||
|
<PackageReference Include="Npgsql" Version="10.0.3" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
using System.Net;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Net.Security;
|
||||||
|
using System.Security.Cryptography.X509Certificates;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
|
using System.Net.Http.Json;
|
||||||
|
using System.Text.Json;
|
||||||
|
|
||||||
|
namespace HealthApp.Provisioning;
|
||||||
|
|
||||||
|
public static class InstallationVerification
|
||||||
|
{
|
||||||
|
public static async Task Verify(string deploymentDirectory, string[] selected, bool complete, bool startupOnly = false)
|
||||||
|
{
|
||||||
|
var deployment = Deployment.Load(deploymentDirectory);
|
||||||
|
using var root = X509CertificateLoader.LoadCertificateFromFile(Path.Combine(deploymentDirectory, "healthapp-ca.crt"));
|
||||||
|
using var handler = new HttpClientHandler
|
||||||
|
{
|
||||||
|
ServerCertificateCustomValidationCallback = (_, certificate, _, errors) =>
|
||||||
|
{
|
||||||
|
if (certificate is null || (errors & (SslPolicyErrors.RemoteCertificateNameMismatch | SslPolicyErrors.RemoteCertificateNotAvailable)) != 0) return false;
|
||||||
|
using var chain = new X509Chain();
|
||||||
|
chain.ChainPolicy.TrustMode = X509ChainTrustMode.CustomRootTrust;
|
||||||
|
chain.ChainPolicy.CustomTrustStore.Add(root);
|
||||||
|
chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck;
|
||||||
|
chain.ChainPolicy.ApplicationPolicy.Add(new Oid("1.3.6.1.5.5.7.3.1"));
|
||||||
|
return chain.Build(certificate);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(15), BaseAddress = new Uri(Deployment.Url(deployment.Services["api-gateway"])) };
|
||||||
|
async Task<HttpResponseMessage> Probe(Func<HttpRequestMessage> create, string name)
|
||||||
|
{
|
||||||
|
using var deadline = new CancellationTokenSource(TimeSpan.FromSeconds(30));
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using var request = create();
|
||||||
|
var response = await client.SendAsync(request, deadline.Token);
|
||||||
|
if (response.StatusCode is not (HttpStatusCode.BadGateway or HttpStatusCode.ServiceUnavailable or HttpStatusCode.GatewayTimeout)) return response;
|
||||||
|
response.Dispose();
|
||||||
|
}
|
||||||
|
catch (HttpRequestException) { }
|
||||||
|
catch (OperationCanceledException) when (!deadline.IsCancellationRequested) { }
|
||||||
|
try { await Task.Delay(500, deadline.Token); }
|
||||||
|
catch (OperationCanceledException) { throw new InvalidOperationException("HTTPS startup/dependency probe timed out for " + name + "."); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (var name in selected)
|
||||||
|
{
|
||||||
|
var service = deployment.Services[name];
|
||||||
|
if (Deployment.ReadService(Path.Combine(deploymentDirectory, name)).Database is { } database)
|
||||||
|
{
|
||||||
|
try { await DatabaseProvisioning.Check(database); }
|
||||||
|
catch { throw new InvalidOperationException("Dedicated database reachability verification failed for " + name + "."); }
|
||||||
|
}
|
||||||
|
// Correct incoming credentials prove network/TLS and the configured service trust boundary.
|
||||||
|
var path = Deployment.Url(service) +
|
||||||
|
(name == "api-gateway" ? "api/measurement-guidance" : startupOnly ? "" : "api/patients/00000000-0000-0000-0000-000000000001" +
|
||||||
|
(name == "insights" ? "/insights?from=2026-01-01&to=2026-01-02" :
|
||||||
|
name == "health-overview" ? "/overview?from=2026-01-01&to=2026-01-02" :
|
||||||
|
name == "observation" ? "/observations?from=2026-01-01&to=2026-01-02" : ""));
|
||||||
|
using var response = await Probe(() =>
|
||||||
|
{
|
||||||
|
var request = new HttpRequestMessage(HttpMethod.Get, path);
|
||||||
|
if (name != "api-gateway") request.Headers.Add("X-Gateway-Key", service.IncomingKey);
|
||||||
|
return request;
|
||||||
|
}, name);
|
||||||
|
if (response.StatusCode is not (HttpStatusCode.OK or HttpStatusCode.NotFound))
|
||||||
|
throw new InvalidOperationException("HTTPS/dependency verification failed for " + name + " (HTTP " + (int)response.StatusCode + ").");
|
||||||
|
}
|
||||||
|
if (startupOnly) return;
|
||||||
|
// Exercise each installed service's configured outgoing gateway credentials using its actual network API.
|
||||||
|
foreach (var name in selected.Where(n => n is "observation" or "insights" or "health-overview"))
|
||||||
|
{
|
||||||
|
var service = deployment.Services[name];
|
||||||
|
using var request = new HttpRequestMessage(HttpMethod.Get, Deployment.Url(deployment.Services["api-gateway"]) +
|
||||||
|
"api/patients/00000000-0000-0000-0000-000000000001" + (name == "insights" ? "/observations?from=2026-01-01&to=2026-01-02" : ""));
|
||||||
|
request.Headers.Add("X-Service-Key", service.OutgoingKey);
|
||||||
|
using var response = await client.SendAsync(request);
|
||||||
|
if (response.StatusCode is not (HttpStatusCode.OK or HttpStatusCode.NotFound))
|
||||||
|
throw new InvalidOperationException("Gateway service-credential verification failed for " + name + ".");
|
||||||
|
}
|
||||||
|
if (!complete) return;
|
||||||
|
var account = deployment.Accounts.Single(a => a.AccountId == "installation-check");
|
||||||
|
using var login = await client.PostAsJsonAsync("api/authentication/login", new { accountId = account.AccountId, password = account.Password });
|
||||||
|
login.EnsureSuccessStatusCode();
|
||||||
|
using var token = JsonDocument.Parse(await login.Content.ReadAsStringAsync());
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.RootElement.GetProperty("accessToken").GetString());
|
||||||
|
using var current = await client.GetAsync("api/patients/me");
|
||||||
|
Guid patient;
|
||||||
|
if (current.StatusCode == HttpStatusCode.NotFound)
|
||||||
|
{
|
||||||
|
using var created = await client.PostAsJsonAsync("api/patients", new { name = "Installer verification (synthetic)", dateOfBirth = "1980-01-01" });
|
||||||
|
created.EnsureSuccessStatusCode();
|
||||||
|
using var profile = JsonDocument.Parse(await created.Content.ReadAsStringAsync());
|
||||||
|
patient = profile.RootElement.GetProperty("patientId").GetGuid();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
current.EnsureSuccessStatusCode();
|
||||||
|
using var profile = JsonDocument.Parse(await current.Content.ReadAsStringAsync());
|
||||||
|
patient = profile.RootElement.GetProperty("patientId").GetGuid();
|
||||||
|
}
|
||||||
|
using var latest = await client.GetAsync($"api/patients/{patient}/observations/latest");
|
||||||
|
if (latest.StatusCode == HttpStatusCode.NotFound)
|
||||||
|
{
|
||||||
|
using var record = await client.PostAsJsonAsync($"api/patients/{patient}/observations", new
|
||||||
|
{
|
||||||
|
measuredAt = DateTime.UtcNow, systolic = 120, diastolic = 80, pulse = 60,
|
||||||
|
note = "Installer verification; synthetic data", measurementContext = new { setting = "Home", activityCondition = "AtRest" }
|
||||||
|
});
|
||||||
|
record.EnsureSuccessStatusCode();
|
||||||
|
}
|
||||||
|
else latest.EnsureSuccessStatusCode();
|
||||||
|
var bounds = $"from=2000-01-01&to={Uri.EscapeDataString(DateTime.UtcNow.AddDays(1).ToString("O"))}&setting=Home&activityCondition=AtRest";
|
||||||
|
using var overview = await client.GetAsync($"api/patients/{patient}/overview?{bounds}");
|
||||||
|
overview.EnsureSuccessStatusCode();
|
||||||
|
using var result = JsonDocument.Parse(await overview.Content.ReadAsStringAsync());
|
||||||
|
if (result.RootElement.GetProperty("patient").GetProperty("patientId").GetGuid() != patient ||
|
||||||
|
result.RootElement.GetProperty("latestObservation").ValueKind != JsonValueKind.Object ||
|
||||||
|
result.RootElement.GetProperty("insight").ValueKind != JsonValueKind.Object ||
|
||||||
|
result.RootElement.GetProperty("insightContributingCount").GetInt32() < 1)
|
||||||
|
throw new InvalidOperationException("Representative complete-system workflow did not return profile, latest observation and insight.");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
using System.Text.Json;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
|
||||||
|
namespace HealthApp.Provisioning;
|
||||||
|
|
||||||
|
public static class LaunchdWriter
|
||||||
|
{
|
||||||
|
public static void Write(string service, string root, string dotnet, string output)
|
||||||
|
{
|
||||||
|
if (!Deployment.Names.Contains(service)) throw new InvalidOperationException("Unknown service.");
|
||||||
|
var directory = Path.Combine(root, "services", service);
|
||||||
|
var assembly = service switch { "api-gateway" => "ApiGateway", "patient-profile" => "PatientProfileService",
|
||||||
|
"observation" => "ObservationService", "insights" => "InsightsService", _ => "HealthOverviewService" };
|
||||||
|
var environment = new XElement("dict");
|
||||||
|
foreach (var line in File.ReadAllLines(Path.Combine(root, "config", service, "service.env")))
|
||||||
|
{
|
||||||
|
var position = line.IndexOf('=');
|
||||||
|
environment.Add(new XElement("key", line[..position]), new XElement("string", JsonSerializer.Deserialize<string>(line[(position + 1)..])));
|
||||||
|
}
|
||||||
|
var document = new XDocument(new XDeclaration("1.0", "utf-8", null),
|
||||||
|
new XDocumentType("plist", "-//Apple//DTD PLIST 1.0//EN", "http://www.apple.com/DTDs/PropertyList-1.0.dtd", null),
|
||||||
|
new XElement("plist", new XAttribute("version", "1.0"), new XElement("dict",
|
||||||
|
new XElement("key", "Label"), new XElement("string", "healthapp-" + service),
|
||||||
|
new XElement("key", "ProgramArguments"), new XElement("array", new XElement("string", dotnet), new XElement("string", Path.Combine(directory, assembly + ".dll"))),
|
||||||
|
new XElement("key", "WorkingDirectory"), new XElement("string", directory),
|
||||||
|
new XElement("key", "UserName"), new XElement("string", "_healthapp_" + service.Replace('-', '_')),
|
||||||
|
new XElement("key", "EnvironmentVariables"), environment,
|
||||||
|
new XElement("key", "RunAtLoad"), new XElement("true"), new XElement("key", "KeepAlive"), new XElement("true"))));
|
||||||
|
document.Save(output);
|
||||||
|
if (!OperatingSystem.IsWindows()) File.SetUnixFileMode(output, UnixFileMode.UserRead | UnixFileMode.UserWrite);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
using System.Text.Json;
|
||||||
|
|
||||||
|
namespace HealthApp.Provisioning;
|
||||||
|
|
||||||
|
public static class Program
|
||||||
|
{
|
||||||
|
public static async Task<int> Main(string[] args)
|
||||||
|
{
|
||||||
|
var command = args.FirstOrDefault() ?? "";
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var options = new Dictionary<string, string>();
|
||||||
|
for (var index = 1; index < args.Length; index += 2)
|
||||||
|
{
|
||||||
|
if (index + 1 >= args.Length || !args[index].StartsWith("--") || !options.TryAdd(args[index][2..], args[index + 1]))
|
||||||
|
throw new InvalidOperationException("Invalid provisioning arguments.");
|
||||||
|
}
|
||||||
|
string Required(string key) => options.GetValueOrDefault(key) ?? throw new InvalidOperationException("Missing argument: " + key);
|
||||||
|
switch (command)
|
||||||
|
{
|
||||||
|
case "launchd":
|
||||||
|
LaunchdWriter.Write(Required("service"), Required("root"), Required("dotnet"), Required("output"));
|
||||||
|
break;
|
||||||
|
case "secret":
|
||||||
|
File.WriteAllText(Required("output"), Deployment.Secret());
|
||||||
|
if (!OperatingSystem.IsWindows()) File.SetUnixFileMode(Required("output"), UnixFileMode.UserRead | UnixFileMode.UserWrite);
|
||||||
|
break;
|
||||||
|
case "admin-connection":
|
||||||
|
var admin = new Npgsql.NpgsqlConnectionStringBuilder { Host = "localhost", Port = int.Parse(Required("port")),
|
||||||
|
Username = "postgres", Database = "postgres", Password = File.ReadAllText(Required("password-file")).Trim(), Pooling = false };
|
||||||
|
File.WriteAllText(Required("output"), admin.ConnectionString);
|
||||||
|
if (!OperatingSystem.IsWindows()) File.SetUnixFileMode(Required("output"), UnixFileMode.UserRead | UnixFileMode.UserWrite);
|
||||||
|
break;
|
||||||
|
case "execute":
|
||||||
|
var native = options.GetValueOrDefault("platform", "macos");
|
||||||
|
var serviceName = Required("service");
|
||||||
|
if (!Deployment.Names.Contains(serviceName)) throw new InvalidOperationException("Unknown selected service.");
|
||||||
|
var rootPath = Required("root");
|
||||||
|
var config = Path.Combine(rootPath, "config", serviceName, "service.env");
|
||||||
|
var start = new System.Diagnostics.ProcessStartInfo(Required("dotnet")) { UseShellExecute = false,
|
||||||
|
WorkingDirectory = Path.Combine(rootPath, "services", serviceName) };
|
||||||
|
start.ArgumentList.Add(Required("assembly"));
|
||||||
|
start.ArgumentList.Add("--migrate");
|
||||||
|
foreach (var line in File.ReadAllLines(config))
|
||||||
|
start.Environment[line[..line.IndexOf('=')]] = JsonSerializer.Deserialize<string>(line[(line.IndexOf('=') + 1)..])!;
|
||||||
|
using (var process = System.Diagnostics.Process.Start(start)!)
|
||||||
|
{
|
||||||
|
await process.WaitForExitAsync();
|
||||||
|
if (process.ExitCode != 0) throw new InvalidOperationException("Selected service migration failed.");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "prepare":
|
||||||
|
Deployment.Prepare(Required("output"), options.GetValueOrDefault("host", "localhost"), options.GetValueOrDefault("topology"), options.GetValueOrDefault("certificates"));
|
||||||
|
break;
|
||||||
|
case "database":
|
||||||
|
await DatabaseProvisioning.Create(Required("service-dir"), options.GetValueOrDefault("admin-file"));
|
||||||
|
break;
|
||||||
|
case "configure":
|
||||||
|
ConfigurationWriter.Configure(Required("service-dir"), Required("root"), options.GetValueOrDefault("platform", "linux"));
|
||||||
|
break;
|
||||||
|
case "distribute":
|
||||||
|
var names = Required("services").Split(',');
|
||||||
|
if (names.Any(n => !Deployment.Names.Contains(n))) throw new InvalidOperationException("Unknown distribution service.");
|
||||||
|
await Distribution.Deploy(Required("bundle"), Required("deployment"), Required("ssh-user"), names);
|
||||||
|
break;
|
||||||
|
case "verify-startup":
|
||||||
|
case "verify":
|
||||||
|
var selected = Required("services").Split(',');
|
||||||
|
if (selected.Any(n => !Deployment.Names.Contains(n))) throw new InvalidOperationException("Unknown verification service.");
|
||||||
|
await InstallationVerification.Verify(Required("deployment"), selected, options.GetValueOrDefault("complete") == "true", command == "verify-startup");
|
||||||
|
break;
|
||||||
|
default: throw new InvalidOperationException("Unknown provisioning command.");
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (Exception error)
|
||||||
|
{
|
||||||
|
Console.Error.WriteLine($"Provisioning step '{command}' failed: " + (error is InvalidOperationException ? error.Message : error.GetType().Name) +
|
||||||
|
" No credentials are printed; inspect the relevant service logs.");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,258 @@
|
|||||||
|
# US-16 — Provision and install HealthApp
|
||||||
|
|
||||||
|
The installer provisions a working prototype topology. A normal installation no longer
|
||||||
|
requires prepared application configuration, database roles/passwords, service keys,
|
||||||
|
or HTTPS certificates. Select one service, a comma-separated subset, or `all`.
|
||||||
|
|
||||||
|
The application DLLs and shared C# provisioning utility are portable. OS adapters
|
||||||
|
perform package installation and native service registration: systemd on supported
|
||||||
|
Linux hosts, Windows Services on Windows, and launchd on macOS. Deployment location
|
||||||
|
and OS do not combine services, introduce shared persistence or change gateway-routed
|
||||||
|
communication. There is no container/orchestration requirement.
|
||||||
|
|
||||||
|
## Build the release
|
||||||
|
|
||||||
|
A build machine needs the .NET 10 SDK and package access. It is distinct from a target
|
||||||
|
machine, where the installer supplies missing runtime/dependencies.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bash deploy/build-release.sh --output /tmp/healthapp-release
|
||||||
|
# Optional: build just a selected application's payload plus the provisioning utility.
|
||||||
|
bash deploy/build-release.sh --output /tmp/healthapp-insights --services insights
|
||||||
|
```
|
||||||
|
|
||||||
|
On a Windows build machine, use `deploy/build-release.ps1 -Output NEW_DIRECTORY`
|
||||||
|
from PowerShell with the same optional `-Services` selection.
|
||||||
|
|
||||||
|
The bundle includes the application DLLs, provisioning utility, OS installers, units,
|
||||||
|
examples and this guide. Windows services invoke `dotnet Application.dll`, so they do
|
||||||
|
not depend on a Linux-generated apphost executable. The small Microsoft WindowsServices
|
||||||
|
hosting dependency lets the same ASP.NET Core applications respond to Windows service
|
||||||
|
control; it is inactive on Linux/macOS. No production service references another service.
|
||||||
|
|
||||||
|
Transfer the release by normal administrative deployment transport. Public release
|
||||||
|
files contain no generated secrets. Build output must be a new directory.
|
||||||
|
|
||||||
|
## Normal Ubuntu/Debian installation
|
||||||
|
|
||||||
|
Automatic Linux provisioning accepts Debian/Ubuntu ancestry (`ID` or `ID_LIKE`),
|
||||||
|
with apt, a running systemd manager and administrative access. It checks actual package
|
||||||
|
availability rather than a fixed distribution/version list. Internet access to configured
|
||||||
|
package feeds is needed when dependencies are absent. Existing .NET 10 ASP.NET Core
|
||||||
|
runtime and PostgreSQL installations are reused where available.
|
||||||
|
|
||||||
|
The installer prefers configured distribution feeds. On Debian itself, if the runtime
|
||||||
|
package is absent, it attempts Microsoft's repository for that Debian VERSION_ID.
|
||||||
|
Derivatives use their own configured feeds; their version numbers are never passed to
|
||||||
|
an upstream repository. If no compatible runtime source or PostgreSQL package is
|
||||||
|
available, installation stops with a specific dependency error. Debian ancestry alone
|
||||||
|
does not guarantee .NET/CPU compatibility; startup and topology verification still apply.
|
||||||
|
|
||||||
|
From the release directory:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo bash install.sh --services all --host 192.168.1.20
|
||||||
|
```
|
||||||
|
|
||||||
|
Use the target's reachable DNS name/IP for `--host`. The default `localhost` is useful
|
||||||
|
for a wholly local prototype; use a reachable address for another computer to access
|
||||||
|
it. No later application-file editing is required.
|
||||||
|
|
||||||
|
For an individual service, use its name and an existing matching generated deployment
|
||||||
|
from the overall topology, which already specifies its remote dependencies/keys:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo bash install.sh --services insights --deployment /secure/generated-deployment
|
||||||
|
```
|
||||||
|
|
||||||
|
Names: `api-gateway`, `patient-profile`, `observation`, `insights`, `health-overview`.
|
||||||
|
|
||||||
|
The installer:
|
||||||
|
|
||||||
|
1. Detects .NET 10 ASP.NET Core runtime and local PostgreSQL availability; installs
|
||||||
|
missing dependencies from supported package feeds. PostgreSQL is provisioned only
|
||||||
|
when Patient/Profile or Observation is selected.
|
||||||
|
2. Generates a private deployment plan, independent service keys and synthetic
|
||||||
|
prototype accounts. No hard-coded passwords or hand-written password hashes are used.
|
||||||
|
3. Creates a private prototype CA and separate service certificates, installs the
|
||||||
|
public CA into OS trust, and configures Production HTTPS endpoints.
|
||||||
|
4. Creates separate PostgreSQL databases and login roles for the selected persistent
|
||||||
|
services. Roles cannot administer the server/create roles/databases or connect to
|
||||||
|
the other service's database. Schema ownership supports that service's migrations.
|
||||||
|
5. Creates independent service identities, application/configuration directories and
|
||||||
|
service registrations. Runs the selected persistent services' migrations, enables
|
||||||
|
and starts every selected application, then verifies startup and topology.
|
||||||
|
|
||||||
|
Linux application/configuration paths are `/opt/healthapp/NAME` and
|
||||||
|
`/etc/healthapp/NAME/service.env`. Env files are root-only; systemd passes their values
|
||||||
|
to the owning process. Certificate private keys are readable only by root and the
|
||||||
|
respective service identity. Units use `healthapp-NAME` users/groups, not a shared
|
||||||
|
application identity. Gateway key state remains gateway-owned.
|
||||||
|
|
||||||
|
Generated material normally resides at `/var/lib/healthapp-installation/deployment`
|
||||||
|
with a private directory and private files. `accounts.json` contains generated
|
||||||
|
`prototype-patient`, `prototype-professional` and `installation-check` passwords.
|
||||||
|
The professional starts without assignments. Do not put generated material in Git.
|
||||||
|
Only the CA's public certificate is installed/exported publicly; its signing private
|
||||||
|
key is not retained. Certificates expire after one year; the prototype CA after two.
|
||||||
|
|
||||||
|
## Topology and distributed installation
|
||||||
|
|
||||||
|
A topology specifies addresses, ports and native platforms, not credentials. Defaults
|
||||||
|
are HTTPS ports 5443/5081/5082/5083/5084. Colocated applications need different ports.
|
||||||
|
For example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"hosts": {
|
||||||
|
"api-gateway": "192.168.1.20",
|
||||||
|
"patient-profile": "192.168.1.21",
|
||||||
|
"observation": "192.168.1.22",
|
||||||
|
"insights": "192.168.1.23",
|
||||||
|
"health-overview": "192.168.1.24"
|
||||||
|
},
|
||||||
|
"platforms": {
|
||||||
|
"api-gateway": "linux",
|
||||||
|
"patient-profile": "linux",
|
||||||
|
"observation": "linux",
|
||||||
|
"insights": "macos",
|
||||||
|
"health-overview": "windows"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Optional `ports` uses the same service keys and integer values. Hostnames/IPs must
|
||||||
|
resolve/reach the corresponding target. Supply existing administrative SSH access;
|
||||||
|
Unix hosts need passwordless sudo for the installer, Windows SSH sessions must be
|
||||||
|
elevated administrators. Host administration credentials are distinct from generated
|
||||||
|
HealthApp/database credentials and are not invented by the application installer.
|
||||||
|
|
||||||
|
Generate one consistent deployment and automatically distribute matching, scoped
|
||||||
|
material to each host:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo bash install.sh --services all --prepare-only --topology topology.json \
|
||||||
|
--deployment /secure/healthapp-deployment --dotnet /path/to/available/dotnet
|
||||||
|
bash distribute.sh --deployment /secure/healthapp-deployment --ssh-user administrator
|
||||||
|
```
|
||||||
|
|
||||||
|
Use an administrative session able to read the protected deployment material. The
|
||||||
|
preparation machine needs an available .NET 10 runtime/SDK for the C# utility.
|
||||||
|
Distribution uses SSH/SCP, installs only selected applications per host, and exports
|
||||||
|
only their private material plus necessary remote origins. It starts nodes first,
|
||||||
|
then verifies the complete topology over its real HTTPS endpoints. No credentials
|
||||||
|
are manually invented, copied into application files or distributed individually.
|
||||||
|
Services never depend on a shared runtime directory/file across machines.
|
||||||
|
|
||||||
|
A node started with the orchestrator's `--defer-topology-check` has verified local
|
||||||
|
process/HTTPS/database readiness but pending cross-node verification. It is not
|
||||||
|
reported as a verified complete topology until the orchestrator's final check passes.
|
||||||
|
For incremental installation, reuse the same deployment; independently generated
|
||||||
|
plans deliberately have different keys and cannot authenticate to each other.
|
||||||
|
|
||||||
|
## Windows and macOS adapters
|
||||||
|
|
||||||
|
On Windows, from an elevated PowerShell session in the release:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1 -Services all -HostName 192.168.1.20
|
||||||
|
```
|
||||||
|
|
||||||
|
The adapter installs the .NET runtime automatically, resolves and checksum-verifies
|
||||||
|
an EDB PostgreSQL installer from Microsoft's package manifest, creates an owned
|
||||||
|
PostgreSQL service when needed, and generates its administrator secret in protected
|
||||||
|
files. Existing application/data files are not overwritten. An existing externally
|
||||||
|
managed PostgreSQL server can instead be used with `-PostgresAdminFile`; the installer
|
||||||
|
still generates application database roles/passwords automatically.
|
||||||
|
|
||||||
|
Applications have separate native Windows Services and virtual service identities,
|
||||||
|
protected per-service JSON configuration, state and certificate ACLs. Their Production
|
||||||
|
configuration is installed automatically; certificates are trusted in LocalMachine
|
||||||
|
Root. HTTPS firewall rules cover only selected application ports. No IIS is required.
|
||||||
|
Windows uses `-Deployment`, `-Topology`, `-Certificates` for the same shared material.
|
||||||
|
Default application root is `%ProgramData%\HealthApp`.
|
||||||
|
|
||||||
|
On macOS, from a sudo administrator session:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo bash install.sh --services all --host 192.168.1.20
|
||||||
|
```
|
||||||
|
|
||||||
|
The Darwin adapter installs the ASP.NET Core runtime, provisions Homebrew/PostgreSQL
|
||||||
|
and required Apple build tools where available through softwareupdate, initializes
|
||||||
|
an installer-owned PostgreSQL cluster with SCRAM passwords, and creates separate
|
||||||
|
hidden service identities and launchd daemons. It configures system-keychain CA trust,
|
||||||
|
private environment/launchd files and selected migrations automatically. Default root
|
||||||
|
is `/Library/Application Support/HealthApp`. macOS package/tool installation requires
|
||||||
|
an administrator user session, network access, and acceptance of OS/vendor licensing.
|
||||||
|
|
||||||
|
The adapters target supported .NET desktop/server operating systems. Portability does
|
||||||
|
not claim support for every OS/kernel/version/CPU where .NET itself is unavailable.
|
||||||
|
The live Windows/macOS registration paths need native-host validation; see evidence
|
||||||
|
limits below. The Linux execution environment cannot run Windows SCM or macOS launchd.
|
||||||
|
|
||||||
|
## Verification and management
|
||||||
|
|
||||||
|
Installation verifies distinct native processes, configured HTTPS endpoints, selected
|
||||||
|
databases using their dedicated credentials, actual service keys and outgoing gateway
|
||||||
|
access. The complete-system check logs in with the generated `installation-check`
|
||||||
|
account and exercises profile/observation/Overview through all deployed services.
|
||||||
|
It creates at most one clearly labelled synthetic check profile/observation if absent.
|
||||||
|
This is prototype test data, not a clinical reading; repeated verification reuses it.
|
||||||
|
|
||||||
|
The verifier trusts the generated public CA, validates certificate chains/server names,
|
||||||
|
and never disables TLS validation. Existing HTTPS trust is retained. All step failures
|
||||||
|
identify the failed operation/service and retain existing data/material for inspection.
|
||||||
|
Sensitive SQL/credentials are not printed. Existing applications/configuration cause
|
||||||
|
refusal rather than silent replacement; this remains a first-install mechanism,
|
||||||
|
not an upgrade/uninstall/data-removal tool. Deployment is not a cross-service transaction.
|
||||||
|
|
||||||
|
Linux may rerun `sudo bash verify.sh --services all --deployment DIRECTORY` from the
|
||||||
|
bundle. Manage selected units with `systemctl start/stop/restart healthapp-NAME`.
|
||||||
|
Windows uses `Start-Service`, `Stop-Service`, `Restart-Service`; macOS uses
|
||||||
|
`launchctl bootstrap`, `bootout`, `kickstart` on `healthapp-NAME` labels. Stopping a
|
||||||
|
service does not directly stop peer processes; requests needing it may fail.
|
||||||
|
|
||||||
|
External trusted certificates can be supplied during preparation with `--certificates`
|
||||||
|
or `-Certificates`. The directory supplies `NAME.pfx`, `NAME.password` for all five
|
||||||
|
planned services and `healthapp-ca.crt`. Supplied PFX certificate chains are retained;
|
||||||
|
private keys/passwords are protected and configured automatically. Prototype browser
|
||||||
|
clients may import the exported public CA for trust; server-side service trust is
|
||||||
|
configured automatically by installation.
|
||||||
|
|
||||||
|
`--root DIRECTORY` on Linux is explicitly offline staging: it generates the same
|
||||||
|
settings/material but cannot install host packages or register/start systemd. It is
|
||||||
|
not reported as a live verified installation. `--postgres-admin-file` allows automated
|
||||||
|
DB provisioning against an externally managed/test server, not manual application
|
||||||
|
DB/user preparation. Normal Linux installation administers local PostgreSQL through
|
||||||
|
its OS postgres identity without inventing a PostgreSQL administrator password.
|
||||||
|
|
||||||
|
## Evidence and dependencies
|
||||||
|
|
||||||
|
The xUnit deployment suite builds the release, calls the actual provisioner/installer,
|
||||||
|
creates database roles/databases in an isolated PostgreSQL server and runs all five
|
||||||
|
installed services in separate Production-mode HTTPS processes. Tests cover generated
|
||||||
|
key matching/uniqueness, certificate private-key output, private configuration, database
|
||||||
|
isolation/permissions, migrations, native-format configuration, independent restart,
|
||||||
|
representative functionality and repeated non-destructive verification. Package command
|
||||||
|
contracts are tested with controlled command doubles; no host package installation
|
||||||
|
is performed by the tests. The ordinary application tests remain unchanged.
|
||||||
|
|
||||||
|
Linux HTTPS/interservice/database execution is verified here. Live systemd package/
|
||||||
|
registration behaviour needs a supported Linux host; Windows/macOS service registration
|
||||||
|
needs those native hosts. Native configuration formats are exercised by the shared
|
||||||
|
utility tests; shell/PowerShell syntax validation is separate from a native end-to-end
|
||||||
|
run. The manual `.github/workflows/prototype-native-install.yml` workflow provisions
|
||||||
|
and verifies fresh Ubuntu, Windows and macOS runners; it is supplied for native
|
||||||
|
validation and has not been executed remotely in this session. These limits must not be described as verified production deployment on every OS.
|
||||||
|
|
||||||
|
The provisioning tool uses standard .NET X.509/password hashing and Npgsql for creating
|
||||||
|
and checking databases. Its dependency is not a shared service runtime library.
|
||||||
|
Microsoft.Extensions.Hosting.WindowsServices is added to the five services solely for
|
||||||
|
native Windows service lifetime integration; Linux/macOS responsibilities are unchanged.
|
||||||
|
|
||||||
|
Package/lifetime references reviewed during implementation:
|
||||||
|
[Ubuntu runtime installation](https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu-install),
|
||||||
|
[Debian runtime installation](https://learn.microsoft.com/en-us/dotnet/core/install/linux-debian),
|
||||||
|
[Windows service hosting](https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/windows-service?view=aspnetcore-10.0),
|
||||||
|
[EDB unattended installer parameters](https://www.enterprisedb.com/docs/supported-open-source/postgresql/installing/command_line_parameters/).
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
ASPNETCORE_ENVIRONMENT=Production
|
||||||
|
Services__PatientProfile__BaseUrl=https://patient-profile.example.test:5081/
|
||||||
|
ASPNETCORE_URLS=https://0.0.0.0:5443
|
||||||
|
Kestrel__Certificates__Default__Path=/etc/healthapp/gateway.pfx
|
||||||
|
Kestrel__Certificates__Default__Password=REPLACE_ME
|
||||||
|
Services__Observation__BaseUrl=https://observation.example.test:5082/
|
||||||
|
|
||||||
|
Services__Insights__BaseUrl=https://insights.example.test:5083/
|
||||||
|
|
||||||
|
Authentication__KeyDirectory=/var/lib/healthapp-api-gateway/keys
|
||||||
|
Authentication__TokenLifetimeMinutes=30
|
||||||
|
# Account identifiers support ASCII letters, digits, hyphen and underscore.
|
||||||
|
Authentication__Accounts__0__AccountId=example-patient
|
||||||
|
Authentication__Accounts__0__Role=Patient
|
||||||
|
Authentication__Accounts__0__PasswordHash=REPLACE_WITH_ASPNET_CORE_PASSWORD_HASH
|
||||||
|
# Use distinct randomly generated credentials of at least 32 characters.
|
||||||
|
Services__PatientProfile__Key=REPLACE_ME
|
||||||
|
Services__Observation__Key=REPLACE_ME
|
||||||
|
Services__Insights__Key=REPLACE_ME
|
||||||
|
InternalAccess__Observation__Key=REPLACE_ME
|
||||||
|
InternalAccess__Insights__Key=REPLACE_ME
|
||||||
|
|
||||||
|
# Pre-created professional credentials and read-only patient assignments.
|
||||||
|
Authentication__Accounts__1__AccountId=example_professional
|
||||||
|
Authentication__Accounts__1__Role=HealthcareProfessional
|
||||||
|
Authentication__Accounts__1__PasswordHash=REPLACE_WITH_ASPNET_CORE_PASSWORD_HASH
|
||||||
|
# Replace the synthetic identifier below with a created patient's identifier.
|
||||||
|
# Restart the gateway after changing assignments. Omit assignments for an empty list.
|
||||||
|
Access__ProfessionalAssignments__example_professional__0=00000000-0000-0000-0000-000000000001
|
||||||
|
|
||||||
|
Services__HealthOverview__BaseUrl=https://health-overview.example.test:5084/
|
||||||
|
Services__HealthOverview__Key=REPLACE_ME
|
||||||
|
InternalAccess__HealthOverview__Key=REPLACE_ME
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
[CmdletBinding()]
|
||||||
|
param([Parameter(Mandatory=$true)][string]$Output, [string]$Services='all')
|
||||||
|
$ErrorActionPreference='Stop'
|
||||||
|
$assemblies=@{ 'api-gateway'='ApiGateway'; 'patient-profile'='PatientProfileService'; 'observation'='ObservationService'; 'insights'='InsightsService'; 'health-overview'='HealthOverviewService' }
|
||||||
|
$selected=if ($Services -eq 'all') { @('api-gateway','patient-profile','observation','insights','health-overview') } else { @($Services.Split(',')) }
|
||||||
|
if ((Test-Path $Output) -or @($selected | Select-Object -Unique).Count -ne $selected.Count) { throw 'Use a new output directory and unique service names.' }
|
||||||
|
foreach ($name in $selected) { if (-not $assemblies.ContainsKey($name)) { throw "Unknown service: $name" } }
|
||||||
|
New-Item -ItemType Directory -Path $Output | Out-Null
|
||||||
|
$destination=(Resolve-Path $Output).Path
|
||||||
|
$repository=Split-Path $PSScriptRoot -Parent
|
||||||
|
foreach ($directory in @('services','systemd','examples')) { New-Item -ItemType Directory -Path "$destination\$directory" | Out-Null }
|
||||||
|
Copy-Item "$PSScriptRoot\installer\*.sh","$PSScriptRoot\installer\*.ps1","$PSScriptRoot\INSTALLATION.md" $destination
|
||||||
|
foreach ($name in $selected) {
|
||||||
|
& dotnet publish "$repository\src\$($assemblies[$name])\$($assemblies[$name]).csproj" --configuration Release --self-contained false '-p:UseAppHost=false' --output "$destination\services\$name"
|
||||||
|
if ($LASTEXITCODE -ne 0) { throw "Publish failed: $name" }
|
||||||
|
Copy-Item "$PSScriptRoot\systemd\healthapp-$name.service" "$destination\systemd"
|
||||||
|
Copy-Item "$PSScriptRoot\$name.env.example" "$destination\examples"
|
||||||
|
}
|
||||||
|
& dotnet publish "$PSScriptRoot\HealthApp.Provisioning\HealthApp.Provisioning.csproj" --configuration Release --self-contained false '-p:UseAppHost=false' --output "$destination\provisioner"
|
||||||
|
if ($LASTEXITCODE -ne 0) { throw 'Publish failed: provisioning utility' }
|
||||||
|
$selected | Set-Content "$destination\services.list"
|
||||||
|
Write-Host "Portable release created: $destination"
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
fail() { printf 'Error: %s\n' "$*" >&2; exit 1; }
|
||||||
|
script_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
repo_dir=$(cd -- "$script_dir/.." && pwd)
|
||||||
|
source "$script_dir/installer/services.sh"
|
||||||
|
requested=all
|
||||||
|
output=
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case "$1" in
|
||||||
|
--output) [[ $# -gt 1 ]] || fail 'Missing output directory.'; output=$2; shift 2;;
|
||||||
|
--services) [[ $# -gt 1 ]] || fail 'Missing services.'; requested=$2; shift 2;;
|
||||||
|
--help) printf '%s\n' 'Usage: bash deploy/build-release.sh --output NEW_DIRECTORY [--services all|api-gateway,patient-profile,observation,insights,health-overview]' 'Requires .NET 10 SDK. HEALTHAPP_DOTNET may select its executable.'; exit 0;;
|
||||||
|
*) fail "Unknown argument: $1";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
select_services "$requested"
|
||||||
|
[[ -n "$output" && ! -e "$output" ]] || fail 'Provide a new, non-existing output directory.'
|
||||||
|
dotnet_command=${HEALTHAPP_DOTNET:-dotnet}
|
||||||
|
command -v "$dotnet_command" >/dev/null || fail '.NET 10 SDK is required to build a release.'
|
||||||
|
mkdir -p -- "$output/services" "$output/systemd" "$output/examples"
|
||||||
|
output=$(cd -- "$output" && pwd)
|
||||||
|
cp -- "$script_dir/installer/"*.sh "$output/"
|
||||||
|
cp -- "$script_dir/installer/"*.ps1 "$output/"
|
||||||
|
cp -- "$script_dir/INSTALLATION.md" "$output/"
|
||||||
|
for service in "${selected_services[@]}"; do
|
||||||
|
assembly=$(assembly_for "$service")
|
||||||
|
"$dotnet_command" publish "$repo_dir/src/$assembly/$assembly.csproj" --configuration Release --self-contained false -p:UseAppHost=false --output "$output/services/$service"
|
||||||
|
cp -- "$script_dir/systemd/healthapp-$service.service" "$output/systemd/"
|
||||||
|
cp -- "$script_dir/$service.env.example" "$output/examples/"
|
||||||
|
done
|
||||||
|
"$dotnet_command" publish "$script_dir/HealthApp.Provisioning/HealthApp.Provisioning.csproj" --configuration Release --self-contained false -p:UseAppHost=false --output "$output/provisioner"
|
||||||
|
printf '%s\n' "${selected_services[@]}" > "$output/services.list"
|
||||||
|
printf 'Release created: %s\n' "$output"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
ASPNETCORE_ENVIRONMENT=Production
|
||||||
|
ASPNETCORE_URLS=https://0.0.0.0:5084
|
||||||
|
Services__ApiGateway__BaseUrl=https://gateway.example.test:5443/
|
||||||
|
|
||||||
|
InternalAccess__GatewayKey=REPLACE_ME
|
||||||
|
Kestrel__Certificates__Default__Path=/etc/healthapp/service.pfx
|
||||||
|
Kestrel__Certificates__Default__Password=REPLACE_ME
|
||||||
|
Services__ApiGateway__Key=REPLACE_ME
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
ASPNETCORE_ENVIRONMENT=Production
|
||||||
|
ASPNETCORE_URLS=https://0.0.0.0:5083
|
||||||
|
Services__ApiGateway__BaseUrl=https://gateway.example.test:5443/
|
||||||
|
|
||||||
|
InternalAccess__GatewayKey=REPLACE_ME
|
||||||
|
Kestrel__Certificates__Default__Path=/etc/healthapp/service.pfx
|
||||||
|
Kestrel__Certificates__Default__Password=REPLACE_ME
|
||||||
|
Services__ApiGateway__Key=REPLACE_ME
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Source from install.sh. Package commands use the supported distribution's signed feeds.
|
||||||
|
package_available() {
|
||||||
|
local policy
|
||||||
|
policy=$(LC_ALL=C apt-cache policy "$1") || return 1
|
||||||
|
[[ "$policy" =~ Candidate:[[:space:]]+([^[:space:]]+) && "${BASH_REMATCH[1]}" != '(none)' ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
ensure_dependencies() {
|
||||||
|
local distribution=$1 version=$2 runtime=$3 persistence=$4 ancestry=${5:-}
|
||||||
|
case " $distribution $ancestry " in
|
||||||
|
*" debian "*|*" ubuntu "*) ;;
|
||||||
|
*) fail 'Automatic Linux provisioning requires a Debian/Ubuntu-based distribution (ID or ID_LIKE).';;
|
||||||
|
esac
|
||||||
|
command -v apt-get >/dev/null && command -v apt-cache >/dev/null || fail 'Debian/Ubuntu provisioning requires apt-get and apt-cache.'
|
||||||
|
step='refresh dependency package availability'
|
||||||
|
apt-get update || fail 'Could not refresh package feeds; check network access and configured repositories.'
|
||||||
|
step='install base dependencies'
|
||||||
|
if ! command -v curl >/dev/null || ! command -v update-ca-certificates >/dev/null; then
|
||||||
|
DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates curl
|
||||||
|
fi
|
||||||
|
if [[ ! -x "$runtime" ]] || ! "$runtime" --list-runtimes | grep -q 'Microsoft.AspNetCore.App 10\.'; then
|
||||||
|
step='install .NET 10 ASP.NET Core runtime'
|
||||||
|
if ! package_available aspnetcore-runtime-10.0 && [[ "$distribution" == debian ]]; then
|
||||||
|
[[ "$version" =~ ^[0-9]+$ ]] || fail 'Cannot identify a compatible Microsoft Debian package repository from VERSION_ID.'
|
||||||
|
local package_dir
|
||||||
|
package_dir=$(mktemp -d)
|
||||||
|
if ! curl --fail --silent --show-error --location "https://packages.microsoft.com/config/debian/$version/packages-microsoft-prod.deb" -o "$package_dir/microsoft.deb"; then
|
||||||
|
rm -f -- "$package_dir/microsoft.deb"
|
||||||
|
rmdir -- "$package_dir"
|
||||||
|
fail "No accessible Microsoft Debian $version repository; aspnetcore-runtime-10.0 is unavailable in configured feeds."
|
||||||
|
fi
|
||||||
|
dpkg -i "$package_dir/microsoft.deb"
|
||||||
|
rm -f -- "$package_dir/microsoft.deb"
|
||||||
|
rmdir -- "$package_dir"
|
||||||
|
apt-get update
|
||||||
|
fi
|
||||||
|
package_available aspnetcore-runtime-10.0 || fail "Required package aspnetcore-runtime-10.0 is unavailable for $distribution $version in configured feeds; no compatible runtime repository could be identified automatically."
|
||||||
|
DEBIAN_FRONTEND=noninteractive apt-get install -y aspnetcore-runtime-10.0 || fail 'Failed to install aspnetcore-runtime-10.0 from configured feeds.'
|
||||||
|
fi
|
||||||
|
[[ -x "$runtime" ]] && "$runtime" --list-runtimes | grep -q 'Microsoft.AspNetCore.App 10\.' || fail 'The .NET 10 ASP.NET Core runtime could not be provisioned.'
|
||||||
|
if [[ "$persistence" == true ]]; then
|
||||||
|
step='provision PostgreSQL server'
|
||||||
|
if ! command -v pg_isready >/dev/null || ! pg_isready -q -h localhost -p 5432; then
|
||||||
|
package_available postgresql || fail "Required package postgresql is unavailable for $distribution $version in configured feeds."
|
||||||
|
DEBIAN_FRONTEND=noninteractive apt-get install -y postgresql || fail 'Failed to install PostgreSQL from configured feeds.'
|
||||||
|
systemctl enable --now postgresql
|
||||||
|
fi
|
||||||
|
local ready=false attempt
|
||||||
|
for attempt in {1..30}; do
|
||||||
|
if pg_isready -q -h localhost -p 5432; then ready=true; break; fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
[[ "$ready" == true ]] || fail 'PostgreSQL did not become available on localhost:5432.'
|
||||||
|
fi
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
script_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
fail() { printf 'Distribution failed: %s\n' "$*" >&2; exit 1; }
|
||||||
|
source "$script_dir/services.sh"
|
||||||
|
deployment=
|
||||||
|
requested=all
|
||||||
|
ssh_user=
|
||||||
|
dotnet_path=/usr/bin/dotnet
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case "$1" in
|
||||||
|
--deployment|--services|--ssh-user|--dotnet)
|
||||||
|
[[ $# -gt 1 ]] || fail 'Missing argument.'
|
||||||
|
case "$1" in --deployment) deployment=$2;; --services) requested=$2;; --ssh-user) ssh_user=$2;; --dotnet) dotnet_path=$2;; esac
|
||||||
|
shift 2;;
|
||||||
|
--help) printf '%s\n' 'Usage: bash distribute.sh --deployment GENERATED_DIRECTORY --ssh-user ADMIN_USER [--services all|NAME[,NAME]] [--dotnet PATH]' 'Uses configured SSH access and passwordless sudo on the topology hosts. Generates no new credentials; installs matching scoped material and verifies the topology.'; exit 0;;
|
||||||
|
*) fail "Unknown argument: $1";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
select_services "$requested"
|
||||||
|
[[ -n "$deployment" && -n "$ssh_user" ]] || fail 'Deployment directory and SSH administrator are required.'
|
||||||
|
"$dotnet_path" "$script_dir/provisioner/HealthApp.Provisioning.dll" distribute --bundle "$script_dir" \
|
||||||
|
--deployment "$deployment" --services "$(IFS=,; echo "${selected_services[*]}")" --ssh-user "$ssh_user"
|
||||||
@@ -0,0 +1,156 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
umask 077
|
||||||
|
step=arguments
|
||||||
|
fail() { printf 'Installation failed at %s: %s\n' "$step" "$*" >&2; exit 1; }
|
||||||
|
trap 'printf "Installation failed at %s (line %s). Existing data was retained.\n" "$step" "$LINENO" >&2' ERR
|
||||||
|
script_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
source "$script_dir/services.sh"
|
||||||
|
requested=
|
||||||
|
root='/Library/Application Support/HealthApp'
|
||||||
|
host=localhost
|
||||||
|
topology=
|
||||||
|
deployment=
|
||||||
|
external_certificates=
|
||||||
|
admin_file=
|
||||||
|
prepare_only=false
|
||||||
|
defer=false
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case "$1" in
|
||||||
|
--services|--host|--topology|--deployment|--certificates|--root|--postgres-admin-file)
|
||||||
|
[[ $# -gt 1 ]] || fail 'Missing value.'
|
||||||
|
case "$1" in --services) requested=$2;; --host) host=$2;; --topology) topology=$2;; --deployment) deployment=$2;;
|
||||||
|
--certificates) external_certificates=$2;; --root) root=$2;; --postgres-admin-file) admin_file=$2;; esac
|
||||||
|
shift 2;;
|
||||||
|
--prepare-only) prepare_only=true; shift;;
|
||||||
|
--defer-topology-check) defer=true; shift;;
|
||||||
|
--help) printf '%s\n' 'Usage: sudo bash install.sh --services all|NAME[,NAME] [--host DNS_OR_IP] [--topology FILE] [--deployment GENERATED_DIRECTORY]' 'macOS installs the runtime/PostgreSQL and independent launchd daemons using the same application DLLs and provisioning utility.'; exit 0;;
|
||||||
|
*) fail "Unknown argument: $1";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
[[ $(uname -s) == Darwin && $EUID -eq 0 ]] || fail 'Run under sudo on macOS.'
|
||||||
|
select_services "$requested"
|
||||||
|
for service in "${selected_services[@]}"; do
|
||||||
|
[[ ! -e "$root/services/$service" && ! -e "/Library/LaunchDaemons/healthapp-$service.plist" ]] || fail "Already installed: $service."
|
||||||
|
done
|
||||||
|
mkdir -p "$root"
|
||||||
|
chmod 0711 "$root"
|
||||||
|
step='install .NET 10 ASP.NET Core runtime'
|
||||||
|
dotnet_path="$root/runtime/dotnet"
|
||||||
|
if command -v dotnet >/dev/null && dotnet --list-runtimes | grep -q 'Microsoft.AspNetCore.App 10\.'; then dotnet_path=$(command -v dotnet); fi
|
||||||
|
if [[ ! -x "$dotnet_path" ]]; then
|
||||||
|
curl --fail --silent --show-error https://dot.net/v1/dotnet-install.sh -o "$root/dotnet-install.sh"
|
||||||
|
bash "$root/dotnet-install.sh" --channel 10.0 --runtime aspnetcore --install-dir "$root/runtime" --no-path
|
||||||
|
chmod -R a+rX "$root/runtime"
|
||||||
|
fi
|
||||||
|
provision=("$dotnet_path" "$script_dir/provisioner/HealthApp.Provisioning.dll")
|
||||||
|
step='generate credentials and HTTPS certificates'
|
||||||
|
[[ -n "$deployment" ]] || deployment="$root/deployment"
|
||||||
|
if [[ ! -f "$deployment/deployment.json" ]]; then
|
||||||
|
args=(prepare --output "$deployment" --host "$host")
|
||||||
|
[[ -z "$topology" ]] || args+=(--topology "$topology")
|
||||||
|
[[ -z "$external_certificates" ]] || args+=(--certificates "$external_certificates")
|
||||||
|
"${provision[@]}" "${args[@]}"
|
||||||
|
fi
|
||||||
|
[[ "$prepare_only" == false ]] || { printf 'Generated deployment in %s\n' "$deployment"; exit 0; }
|
||||||
|
step='configure HTTPS trust'
|
||||||
|
security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain "$deployment/healthapp-ca.crt"
|
||||||
|
create_identity() {
|
||||||
|
local name=$1 uid=300
|
||||||
|
if id "$name" >/dev/null 2>&1; then return; fi
|
||||||
|
while dscl . -search /Users UniqueID "$uid" | grep -q . || dscl . -search /Groups PrimaryGroupID "$uid" | grep -q .; do uid=$((uid+1)); done
|
||||||
|
dscl . -create "/Groups/$name"
|
||||||
|
dscl . -create "/Groups/$name" PrimaryGroupID "$uid"
|
||||||
|
dscl . -create "/Users/$name"
|
||||||
|
dscl . -create "/Users/$name" UniqueID "$uid"
|
||||||
|
dscl . -create "/Users/$name" PrimaryGroupID "$uid"
|
||||||
|
dscl . -create "/Users/$name" UserShell /usr/bin/false
|
||||||
|
dscl . -create "/Users/$name" NFSHomeDirectory /var/empty
|
||||||
|
dscl . -create "/Users/$name" IsHidden 1
|
||||||
|
}
|
||||||
|
persistence=false
|
||||||
|
for service in "${selected_services[@]}"; do case "$service" in patient-profile|observation) persistence=true;; esac; done
|
||||||
|
if [[ "$persistence" == true && -z "$admin_file" ]]; then
|
||||||
|
step='install PostgreSQL binaries'
|
||||||
|
brew_user=${SUDO_USER:-}
|
||||||
|
[[ -n "$brew_user" && "$brew_user" != root ]] || fail 'Run sudo from an administrator account so Homebrew can run as that user.'
|
||||||
|
if ! xcode-select -p >/dev/null 2>&1; then
|
||||||
|
touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
|
||||||
|
label=$(softwareupdate --list 2>&1 | sed -n 's/^.*Label: \(Command Line Tools.*\)/\1/p' | tail -n 1)
|
||||||
|
[[ -n "$label" ]] || fail 'Apple did not offer Command Line Tools through softwareupdate.'
|
||||||
|
softwareupdate --install "$label" --agree-to-license
|
||||||
|
rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
|
||||||
|
fi
|
||||||
|
brew_path=/opt/homebrew/bin/brew
|
||||||
|
[[ -x "$brew_path" ]] || brew_path=/usr/local/bin/brew
|
||||||
|
if [[ ! -x "$brew_path" ]]; then
|
||||||
|
curl --fail --silent --show-error https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -o "$root/homebrew-install.sh"
|
||||||
|
chmod 0644 "$root/homebrew-install.sh"
|
||||||
|
sudo -u "$brew_user" env NONINTERACTIVE=1 bash "$root/homebrew-install.sh"
|
||||||
|
[[ -x /opt/homebrew/bin/brew ]] && brew_path=/opt/homebrew/bin/brew || brew_path=/usr/local/bin/brew
|
||||||
|
fi
|
||||||
|
sudo -u "$brew_user" "$brew_path" install postgresql@17
|
||||||
|
pg_prefix=$(sudo -u "$brew_user" "$brew_path" --prefix postgresql@17)
|
||||||
|
step='create installer-owned PostgreSQL cluster'
|
||||||
|
pg_identity=_healthapp_postgres
|
||||||
|
create_identity "$pg_identity"
|
||||||
|
admin_file="$root/postgres-admin.connection"
|
||||||
|
if [[ ! -f "$admin_file" ]]; then
|
||||||
|
port=5432
|
||||||
|
while nc -z localhost "$port" >/dev/null 2>&1; do port=$((port+1)); done
|
||||||
|
"${provision[@]}" secret --output "$root/postgres.password"
|
||||||
|
mkdir -p "$root/postgresql-data"
|
||||||
|
chown "$pg_identity:$pg_identity" "$root/postgresql-data" "$root/postgres.password"
|
||||||
|
sudo -u "$pg_identity" "$pg_prefix/bin/initdb" -D "$root/postgresql-data" -U postgres --auth-local=scram-sha-256 --auth-host=scram-sha-256 --pwfile "$root/postgres.password"
|
||||||
|
printf '\nport = %s\n' "$port" >> "$root/postgresql-data/postgresql.conf"
|
||||||
|
"${provision[@]}" admin-connection --password-file "$root/postgres.password" --port "$port" --output "$admin_file"
|
||||||
|
pg_plist=/Library/LaunchDaemons/healthapp-postgresql.plist
|
||||||
|
cat > "$pg_plist" <<PLIST
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0"><dict><key>Label</key><string>healthapp-postgresql</string><key>ProgramArguments</key><array><string>$pg_prefix/bin/postgres</string><string>-D</string><string>$root/postgresql-data</string></array><key>UserName</key><string>$pg_identity</string><key>RunAtLoad</key><true/><key>KeepAlive</key><true/></dict></plist>
|
||||||
|
PLIST
|
||||||
|
chmod 0644 "$pg_plist"
|
||||||
|
launchctl bootstrap system "$pg_plist"
|
||||||
|
fi
|
||||||
|
port=$(sed -n 's/.*Port=\([0-9]*\).*/\1/p' "$admin_file")
|
||||||
|
[[ -n "$port" ]] || port=5432
|
||||||
|
for attempt in {1..30}; do if "$pg_prefix/bin/pg_isready" -q -p "$port"; then break; fi; sleep 1; done
|
||||||
|
fi
|
||||||
|
for service in "${selected_services[@]}"; do
|
||||||
|
step="configure $service"
|
||||||
|
identity="_healthapp_${service//-/_}"
|
||||||
|
create_identity "$identity"
|
||||||
|
case "$service" in patient-profile|observation)
|
||||||
|
"${provision[@]}" database --service-dir "$deployment/$service" --admin-file "$admin_file";;
|
||||||
|
esac
|
||||||
|
"${provision[@]}" configure --service-dir "$deployment/$service" --root "$root" --platform macos
|
||||||
|
mkdir -p "$root/services" "$root/config" "$root/state"
|
||||||
|
chmod 0711 "$root/services" "$root/config" "$root/state"
|
||||||
|
cp -R "$script_dir/services/$service" "$root/services/$service"
|
||||||
|
chmod -R a+rX "$root/services/$service"
|
||||||
|
chgrp -R "$identity" "$root/config/$service"
|
||||||
|
chmod 0750 "$root/config/$service"
|
||||||
|
chmod 0640 "$root/config/$service/"*
|
||||||
|
if [[ "$service" == api-gateway ]]; then
|
||||||
|
mkdir -p "$root/state/api-gateway/keys"
|
||||||
|
chown -R "$identity:$identity" "$root/state/api-gateway"
|
||||||
|
chmod 0700 "$root/state/api-gateway"
|
||||||
|
fi
|
||||||
|
case "$service" in patient-profile|observation)
|
||||||
|
"${provision[@]}" execute --service "$service" --assembly "$root/services/$service/$(assembly_for "$service").dll" --dotnet "$dotnet_path" --root "$root";;
|
||||||
|
esac
|
||||||
|
# plutil converts the JSON object to an XML plist without treating configuration as shell code.
|
||||||
|
"$dotnet_path" "$script_dir/provisioner/HealthApp.Provisioning.dll" launchd --service "$service" --root "$root" --dotnet "$dotnet_path" --output "/Library/LaunchDaemons/healthapp-$service.plist"
|
||||||
|
chmod 0600 "/Library/LaunchDaemons/healthapp-$service.plist"
|
||||||
|
launchctl bootstrap system "/Library/LaunchDaemons/healthapp-$service.plist"
|
||||||
|
done
|
||||||
|
step='verify startup and HTTPS'
|
||||||
|
for service in "${selected_services[@]}"; do launchctl print "system/healthapp-$service" >/dev/null; done
|
||||||
|
"${provision[@]}" verify-startup --deployment "$deployment" --services "$(IFS=,; echo "${selected_services[*]}")"
|
||||||
|
if [[ "$defer" == false ]]; then
|
||||||
|
args=(verify --deployment "$deployment" --services "$(IFS=,; echo "${selected_services[*]}")")
|
||||||
|
[[ "$requested" != all ]] || args+=(--complete true)
|
||||||
|
"${provision[@]}" "${args[@]}"
|
||||||
|
fi
|
||||||
|
printf 'Installation completed. Account credentials: %s/accounts.json\n' "$deployment"
|
||||||
@@ -0,0 +1,159 @@
|
|||||||
|
[CmdletBinding()]
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory=$true)][string]$Services,
|
||||||
|
[string]$HostName = 'localhost',
|
||||||
|
[string]$Topology,
|
||||||
|
[string]$Deployment,
|
||||||
|
[string]$Certificates,
|
||||||
|
[string]$PostgresAdminFile,
|
||||||
|
[string]$Root = "$env:ProgramData\HealthApp",
|
||||||
|
[switch]$PrepareOnly,
|
||||||
|
[switch]$DeferTopologyCheck
|
||||||
|
)
|
||||||
|
$ErrorActionPreference = 'Stop'
|
||||||
|
$step = 'arguments'
|
||||||
|
function Check-Exit([string]$Operation) { if ($LASTEXITCODE -ne 0) { throw "$Operation failed (exit $LASTEXITCODE)." } }
|
||||||
|
function Protect-Private([string]$Path) {
|
||||||
|
& icacls.exe $Path /inheritance:r /grant:r '*S-1-5-18:(OI)(CI)F' '*S-1-5-32-544:(OI)(CI)F' | Out-Null
|
||||||
|
Check-Exit 'Protect private deployment files'
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
|
||||||
|
$principal = New-Object Security.Principal.WindowsPrincipal($identity)
|
||||||
|
if (-not $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { throw 'Run from an elevated PowerShell session.' }
|
||||||
|
$assemblies = @{ 'api-gateway'='ApiGateway'; 'patient-profile'='PatientProfileService'; 'observation'='ObservationService'; 'insights'='InsightsService'; 'health-overview'='HealthOverviewService' }
|
||||||
|
$selected = if ($Services -eq 'all') { @('api-gateway','patient-profile','observation','insights','health-overview') } else { @($Services.Split(',')) }
|
||||||
|
if (@($selected | Select-Object -Unique).Count -ne $selected.Count) { throw 'Repeated service selection.' }
|
||||||
|
foreach ($name in $selected) {
|
||||||
|
if (-not $assemblies.ContainsKey($name)) { throw "Unknown service: $name" }
|
||||||
|
if (-not (Test-Path "$PSScriptRoot\services\$name\$($assemblies[$name]).dll")) { throw "Missing release: $name" }
|
||||||
|
if ((Test-Path "$Root\services\$name") -or (Get-Service "healthapp-$name" -ErrorAction SilentlyContinue)) { throw "Already installed: $name. Existing files were not changed." }
|
||||||
|
}
|
||||||
|
New-Item -ItemType Directory -Force $Root | Out-Null
|
||||||
|
Protect-Private $Root
|
||||||
|
$step = 'install .NET 10 ASP.NET Core runtime'
|
||||||
|
$dotnet = "$Root\runtime\dotnet.exe"
|
||||||
|
if (Get-Command dotnet.exe -ErrorAction SilentlyContinue) {
|
||||||
|
$candidate = (Get-Command dotnet.exe).Source
|
||||||
|
if ((& $candidate --list-runtimes) -match 'Microsoft.AspNetCore.App 10\.') { $dotnet = $candidate }
|
||||||
|
}
|
||||||
|
if (-not (Test-Path $dotnet)) {
|
||||||
|
$script = "$Root\dotnet-install.ps1"
|
||||||
|
Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile $script -UseBasicParsing
|
||||||
|
& $script -Channel '10.0' -Runtime 'aspnetcore' -InstallDir "$Root\runtime" -NoPath
|
||||||
|
if (-not (Test-Path $dotnet)) { throw 'Runtime installation did not produce dotnet.exe.' }
|
||||||
|
}
|
||||||
|
$utility = "$PSScriptRoot\provisioner\HealthApp.Provisioning.dll"
|
||||||
|
$step = 'generate deployment material'
|
||||||
|
if (-not $Deployment) { $Deployment = "$Root\deployment" }
|
||||||
|
if (-not (Test-Path "$Deployment\deployment.json")) {
|
||||||
|
$prepare = @($utility,'prepare','--output',$Deployment,'--host',$HostName)
|
||||||
|
if ($Topology) { $prepare += @('--topology',$Topology) }
|
||||||
|
if ($Certificates) { $prepare += @('--certificates',$Certificates) }
|
||||||
|
& $dotnet @prepare
|
||||||
|
Check-Exit 'Generate credentials and HTTPS certificates'
|
||||||
|
}
|
||||||
|
Protect-Private $Deployment
|
||||||
|
if ($PrepareOnly) { Write-Host "Generated protected deployment material in $Deployment"; return }
|
||||||
|
$step = 'install prototype HTTPS trust'
|
||||||
|
Import-Certificate -FilePath "$Deployment\healthapp-ca.crt" -CertStoreLocation Cert:\LocalMachine\Root | Out-Null
|
||||||
|
$needsPostgres = ($selected -contains 'patient-profile') -or ($selected -contains 'observation')
|
||||||
|
if ($needsPostgres -and -not $PostgresAdminFile) {
|
||||||
|
$PostgresAdminFile = "$Root\postgres-admin.connection"
|
||||||
|
if (-not (Test-Path $PostgresAdminFile)) {
|
||||||
|
$step = 'install PostgreSQL'
|
||||||
|
# Resolve the maintained Microsoft package manifest, verify the vendor binary checksum,
|
||||||
|
# and pass the generated administrator secret through a protected options file.
|
||||||
|
$headers = @{ 'User-Agent'='HealthApp-Prototype-Installer' }
|
||||||
|
$manifestBase = 'https://api.github.com/repos/microsoft/winget-pkgs/contents/manifests/p/PostgreSQL/PostgreSQL/17'
|
||||||
|
$versions = Invoke-RestMethod $manifestBase -Headers $headers
|
||||||
|
$latest = $versions | Sort-Object @{Expression={[version]($_.name.Split('-')[0])}}, @{Expression={[int]($_.name.Split('-')[-1])}} -Descending | Select-Object -First 1
|
||||||
|
$files = Invoke-RestMethod $latest.url -Headers $headers
|
||||||
|
$manifest = $files | Where-Object { $_.name -like '*.installer.yaml' } | Select-Object -First 1
|
||||||
|
$yaml = (Invoke-WebRequest $manifest.download_url -UseBasicParsing).Content
|
||||||
|
$download = [regex]::Match($yaml,'(?m)^\s*InstallerUrl:\s*(\S+)').Groups[1].Value
|
||||||
|
$checksum = [regex]::Match($yaml,'(?m)^\s*InstallerSha256:\s*([A-Fa-f0-9]{64})').Groups[1].Value
|
||||||
|
if (-not $download.StartsWith('https://get.enterprisedb.com/') -or -not $checksum) { throw 'PostgreSQL package manifest is invalid.' }
|
||||||
|
$installer = "$Root\postgresql-installer.exe"
|
||||||
|
Invoke-WebRequest $download -OutFile $installer -UseBasicParsing
|
||||||
|
if ((Get-FileHash $installer -Algorithm SHA256).Hash -ne $checksum) { throw 'PostgreSQL installer checksum does not match.' }
|
||||||
|
$random = New-Object byte[] 32
|
||||||
|
$rng = [Security.Cryptography.RandomNumberGenerator]::Create()
|
||||||
|
$rng.GetBytes($random); $rng.Dispose()
|
||||||
|
$adminPassword = [BitConverter]::ToString($random).Replace('-','') + 'a!'
|
||||||
|
$port = 5432
|
||||||
|
$listener = New-Object Net.Sockets.TcpListener([Net.IPAddress]::Loopback,$port)
|
||||||
|
try { $listener.Start() } catch { $listener = New-Object Net.Sockets.TcpListener([Net.IPAddress]::Loopback,0); $listener.Start(); $port = $listener.LocalEndpoint.Port }
|
||||||
|
finally { $listener.Stop() }
|
||||||
|
$options = "$Root\postgresql.options"
|
||||||
|
@('mode=unattended','unattendedmodeui=none','debuglevel=0','enable-components=server,commandlinetools',
|
||||||
|
"prefix=$Root\postgresql","datadir=$Root\postgresql-data","serverport=$port",'servicename=healthapp-postgresql',
|
||||||
|
'serviceaccount=NT AUTHORITY\NetworkService',"superpassword=$adminPassword") | Set-Content $options -Encoding UTF8
|
||||||
|
Protect-Private $options
|
||||||
|
$installed = Start-Process $installer -ArgumentList @('--optionfile',('"'+$options+'"')) -Wait -PassThru
|
||||||
|
if ($installed.ExitCode -ne 0) { throw 'PostgreSQL unattended installation failed.' }
|
||||||
|
"Host=localhost;Port=$port;Database=postgres;Username=postgres;Password=$adminPassword" | Set-Content $PostgresAdminFile -Encoding UTF8
|
||||||
|
Protect-Private $PostgresAdminFile
|
||||||
|
Remove-Item $options
|
||||||
|
}
|
||||||
|
Start-Service 'healthapp-postgresql'
|
||||||
|
}
|
||||||
|
foreach ($name in $selected) {
|
||||||
|
$step = "configure $name"
|
||||||
|
if ($name -eq 'patient-profile' -or $name -eq 'observation') {
|
||||||
|
& $dotnet $utility database --service-dir "$Deployment\$name" --admin-file $PostgresAdminFile
|
||||||
|
Check-Exit "Create dedicated $name database and credentials"
|
||||||
|
}
|
||||||
|
& $dotnet $utility configure --service-dir "$Deployment\$name" --root $Root --platform windows
|
||||||
|
Check-Exit "Configure $name"
|
||||||
|
New-Item -ItemType Directory -Force "$Root\services" | Out-Null
|
||||||
|
$application = "$Root\services\$name"
|
||||||
|
Copy-Item "$PSScriptRoot\services\$name" $application -Recurse
|
||||||
|
Copy-Item "$Root\config\$name\appsettings.Production.json" "$application\appsettings.Production.json"
|
||||||
|
$dll = "$application\$($assemblies[$name]).dll"
|
||||||
|
if ($name -eq 'patient-profile' -or $name -eq 'observation') {
|
||||||
|
& $dotnet $dll --migrate --contentRoot $application --environment Production
|
||||||
|
Check-Exit "Migrate $name database"
|
||||||
|
}
|
||||||
|
$serviceName = "healthapp-$name"
|
||||||
|
$binary = '"'+$dotnet+'" "'+$dll+'" --contentRoot "'+$application+'" --environment Production'
|
||||||
|
New-Service -Name $serviceName -BinaryPathName $binary -StartupType Automatic -Description "HealthApp $name" | Out-Null
|
||||||
|
& sc.exe config $serviceName obj= "NT SERVICE\$serviceName" | Out-Null
|
||||||
|
Check-Exit "Configure independent $name virtual service account"
|
||||||
|
& icacls.exe $application /grant "NT SERVICE\${serviceName}:(OI)(CI)RX" /T | Out-Null
|
||||||
|
& icacls.exe "$Root\config\$name" /grant "NT SERVICE\${serviceName}:(OI)(CI)RX" /T | Out-Null
|
||||||
|
if ($name -eq 'api-gateway') {
|
||||||
|
New-Item -ItemType Directory -Force "$Root\state\api-gateway\keys" | Out-Null
|
||||||
|
& icacls.exe "$Root\state\api-gateway" /grant "NT SERVICE\${serviceName}:(OI)(CI)M" /T | Out-Null
|
||||||
|
}
|
||||||
|
# Service identities need traversal/runtime access, not other services' private configuration.
|
||||||
|
foreach ($parent in @("$Root\services","$Root\config","$Root\state")) {
|
||||||
|
if (Test-Path $parent) { & icacls.exe $parent /grant "NT SERVICE\${serviceName}:RX" | Out-Null }
|
||||||
|
}
|
||||||
|
& icacls.exe $Root /grant "NT SERVICE\${serviceName}:RX" | Out-Null
|
||||||
|
if ($dotnet.StartsWith($Root)) { & icacls.exe "$Root\runtime" /grant "NT SERVICE\${serviceName}:(OI)(CI)RX" /T | Out-Null }
|
||||||
|
& sc.exe failure $serviceName reset= 86400 actions= restart/5000 | Out-Null
|
||||||
|
$settings = Get-Content "$Deployment\$name\service.json" -Raw | ConvertFrom-Json
|
||||||
|
New-NetFirewallRule -DisplayName "HealthApp $name HTTPS" -Direction Inbound -Action Allow -Protocol TCP -LocalPort $settings.Port -Program $dotnet | Out-Null
|
||||||
|
Start-Service $serviceName
|
||||||
|
}
|
||||||
|
$step = 'verify running processes and HTTPS'
|
||||||
|
$processIds = @()
|
||||||
|
foreach ($name in $selected) {
|
||||||
|
$native = Get-CimInstance Win32_Service -Filter "Name='healthapp-$name'"
|
||||||
|
if ($native.State -ne 'Running' -or $native.ProcessId -eq 0 -or ($processIds -contains $native.ProcessId)) { throw "$name is not an independent running service." }
|
||||||
|
$processIds += $native.ProcessId
|
||||||
|
}
|
||||||
|
& $dotnet $utility verify-startup --deployment $Deployment --services ($selected -join ',')
|
||||||
|
Check-Exit 'HTTPS startup verification'
|
||||||
|
if (-not $DeferTopologyCheck) {
|
||||||
|
$verify = @($utility,'verify','--deployment',$Deployment,'--services',($selected -join ','))
|
||||||
|
if ($Services -eq 'all') { $verify += @('--complete','true') }
|
||||||
|
& $dotnet @verify
|
||||||
|
Check-Exit 'Dependency and representative workflow verification'
|
||||||
|
}
|
||||||
|
Write-Host "Installation completed. Generated account credentials are protected in $Deployment\accounts.json"
|
||||||
|
} catch {
|
||||||
|
Write-Error "Installation failed at ${step}: $($_.Exception.Message). Existing data and deployment material were retained."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
umask 077
|
||||||
|
step=arguments
|
||||||
|
fail() { printf 'Installation failed at %s: %s\n' "$step" "$*" >&2; exit 1; }
|
||||||
|
trap 'printf "Installation failed at %s (line %s). Existing data and generated material were retained.\n" "$step" "$LINENO" >&2' ERR
|
||||||
|
script_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
if [[ $(uname -s) == Darwin ]]; then exec bash "$script_dir/install-macos.sh" "$@"; fi
|
||||||
|
source "$script_dir/services.sh"
|
||||||
|
source "$script_dir/bootstrap.sh"
|
||||||
|
bundle=$script_dir
|
||||||
|
requested=
|
||||||
|
target_root=/
|
||||||
|
dotnet_path=/usr/bin/dotnet
|
||||||
|
host=localhost
|
||||||
|
topology=
|
||||||
|
deployment=
|
||||||
|
external_certificates=
|
||||||
|
admin_file=
|
||||||
|
prepare_only=false
|
||||||
|
defer_verification=false
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case "$1" in
|
||||||
|
--bundle|--services|--root|--dotnet|--host|--topology|--deployment|--certificates|--postgres-admin-file)
|
||||||
|
[[ $# -gt 1 ]] || fail "Missing value for $1."
|
||||||
|
case "$1" in --bundle) bundle=$2;; --services) requested=$2;; --root) target_root=$2;; --dotnet) dotnet_path=$2;;
|
||||||
|
--host) host=$2;; --topology) topology=$2;; --deployment) deployment=$2;; --certificates) external_certificates=$2;;
|
||||||
|
--postgres-admin-file) admin_file=$2;; esac
|
||||||
|
shift 2;;
|
||||||
|
--prepare-only) prepare_only=true; shift;;
|
||||||
|
--defer-topology-check) defer_verification=true; shift;;
|
||||||
|
--help) printf '%s\n' 'Usage: bash install.sh --services all|NAME[,NAME] [--host DNS_OR_IP] [--topology topology.json] [--deployment generated-directory]' 'Provisioning installs runtime/PostgreSQL as needed and generates credentials, HTTPS, configuration, migrations and running systemd services.' 'Optional --root DIRECTORY stages generated files offline; --dotnet PATH selects the available runtime.' '--prepare-only generates a deployment for automatic distribution with distribute.sh. --certificates DIR accepts external certificates.'; exit 0;;
|
||||||
|
*) fail "Unknown argument: $1";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
select_services "$requested"
|
||||||
|
[[ $(uname -s) == Linux ]] || fail 'Only Linux is supported.'
|
||||||
|
[[ "$target_root" == /* && "$target_root" != *$'\n'* ]] || fail 'Root must be an absolute path.'
|
||||||
|
[[ "$dotnet_path" =~ ^/[A-Za-z0-9_./+-]+$ ]] || fail 'Runtime path is invalid.'
|
||||||
|
target_root=$(realpath -m -- "$target_root")
|
||||||
|
step=preflight
|
||||||
|
for service in "${selected_services[@]}"; do
|
||||||
|
assembly=$(assembly_for "$service")
|
||||||
|
[[ -f "$bundle/services/$service/$assembly.dll" && -f "$bundle/systemd/healthapp-$service.service" ]] || fail "Missing release payload: $service"
|
||||||
|
[[ ! -e "$target_root/opt/healthapp/$service" && ! -e "$target_root/etc/healthapp/$service" && ! -e "$target_root/etc/systemd/system/healthapp-$service.service" ]] || fail "Already installed: $service; existing configuration was not changed."
|
||||||
|
done
|
||||||
|
[[ -f "$bundle/provisioner/HealthApp.Provisioning.dll" ]] || fail 'Missing release provisioning utility.'
|
||||||
|
persistence=false
|
||||||
|
for service in "${selected_services[@]}"; do case "$service" in patient-profile|observation) persistence=true;; esac; done
|
||||||
|
if [[ "$target_root" == / && "$prepare_only" == false ]]; then
|
||||||
|
[[ $EUID -eq 0 && -d /run/systemd/system ]] || fail 'Live installation requires root and a running systemd manager.'
|
||||||
|
source /etc/os-release
|
||||||
|
ensure_dependencies "$ID" "${VERSION_ID:-}" "$dotnet_path" "$persistence" "${ID_LIKE:-}"
|
||||||
|
else
|
||||||
|
[[ -x "$dotnet_path" ]] || fail 'Offline preparation needs an available .NET 10 runtime.'
|
||||||
|
fi
|
||||||
|
provision=("$dotnet_path" "$bundle/provisioner/HealthApp.Provisioning.dll")
|
||||||
|
step='generate deployment credentials and HTTPS certificates'
|
||||||
|
if [[ -z "$deployment" || ! -f "$deployment/deployment.json" ]]; then
|
||||||
|
[[ -n "$deployment" ]] || deployment="$target_root/var/lib/healthapp-installation/deployment"
|
||||||
|
arguments=(prepare --output "$deployment" --host "$host")
|
||||||
|
[[ -z "$topology" ]] || arguments+=(--topology "$topology")
|
||||||
|
[[ -z "$external_certificates" ]] || arguments+=(--certificates "$external_certificates")
|
||||||
|
"${provision[@]}" "${arguments[@]}"
|
||||||
|
fi
|
||||||
|
if [[ "$prepare_only" == true ]]; then
|
||||||
|
printf 'Deployment material generated in %s. It contains secrets; distribute.sh installs the scoped material on each host.\n' "$deployment"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
install -d -m 0755 "$target_root/opt/healthapp" "$target_root/etc/systemd/system"
|
||||||
|
install -d -m 0711 "$target_root/etc/healthapp"
|
||||||
|
install -d -m 0755 "$target_root/usr/local/share/ca-certificates"
|
||||||
|
ca_id=$(sha256sum "$deployment/healthapp-ca.crt" | cut -c1-16)
|
||||||
|
install -m 0644 "$deployment/healthapp-ca.crt" "$target_root/usr/local/share/ca-certificates/healthapp-prototype-$ca_id.crt"
|
||||||
|
if [[ "$target_root" == / ]]; then
|
||||||
|
step='install local HTTPS trust'
|
||||||
|
update-ca-certificates
|
||||||
|
fi
|
||||||
|
for service in "${selected_services[@]}"; do
|
||||||
|
step="configure $service"
|
||||||
|
if [[ "$target_root" == / ]]; then
|
||||||
|
user="healthapp-$service"
|
||||||
|
getent group "$user" >/dev/null || groupadd --system "$user"
|
||||||
|
id "$user" >/dev/null 2>&1 || useradd --system --gid "$user" --home-dir /nonexistent --shell /usr/sbin/nologin "$user"
|
||||||
|
fi
|
||||||
|
if [[ "$service" == patient-profile || "$service" == observation ]]; then
|
||||||
|
if [[ "$target_root" == / || -n "$admin_file" ]]; then
|
||||||
|
step="create dedicated database and role for $service"
|
||||||
|
args=(database --service-dir "$deployment/$service")
|
||||||
|
[[ -z "$admin_file" ]] || args+=(--admin-file "$admin_file")
|
||||||
|
"${provision[@]}" "${args[@]}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
"${provision[@]}" configure --service-dir "$deployment/$service" --root "$target_root"
|
||||||
|
install -d -m 0755 "$target_root/opt/healthapp/$service"
|
||||||
|
cp -R "$bundle/services/$service/." "$target_root/opt/healthapp/$service/"
|
||||||
|
chmod -R a+rX,go-w "$target_root/opt/healthapp/$service"
|
||||||
|
sed -e "s|ExecStart=/usr/bin/dotnet |ExecStart=$dotnet_path |" \
|
||||||
|
-e "s|EnvironmentFile=/etc/healthapp/$service.env|EnvironmentFile=/etc/healthapp/$service/service.env|" \
|
||||||
|
-e "s/^User=healthapp$/User=healthapp-$service/" -e "s/^Group=healthapp$/Group=healthapp-$service/" \
|
||||||
|
"$bundle/systemd/healthapp-$service.service" > "$target_root/etc/systemd/system/healthapp-$service.service"
|
||||||
|
chmod 0644 "$target_root/etc/systemd/system/healthapp-$service.service"
|
||||||
|
if [[ "$target_root" == / ]]; then
|
||||||
|
chmod 0750 "/etc/healthapp/$service"
|
||||||
|
chgrp "$user" "/etc/healthapp/$service" "/etc/healthapp/$service/service.pfx"
|
||||||
|
chmod 0640 "/etc/healthapp/$service/service.pfx"
|
||||||
|
fi
|
||||||
|
printf 'Installed selected application: %s\n' "$service"
|
||||||
|
done
|
||||||
|
if [[ "$target_root" != / ]]; then
|
||||||
|
printf 'Offline deployment staged in %s. Package installation, systemd startup and live verification were not performed.\n' "$target_root"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
step='register independent systemd services'
|
||||||
|
systemctl daemon-reload
|
||||||
|
for service in "${selected_services[@]}"; do
|
||||||
|
case "$service" in patient-profile|observation)
|
||||||
|
step="migrate $service database"
|
||||||
|
assembly=$(assembly_for "$service")
|
||||||
|
systemd-run --quiet --wait --pipe --collect --unit="healthapp-$service-migrate" \
|
||||||
|
--property="User=healthapp-$service" --property="Group=healthapp-$service" \
|
||||||
|
--property="EnvironmentFile=/etc/healthapp/$service/service.env" --property="WorkingDirectory=/opt/healthapp/$service" \
|
||||||
|
"$dotnet_path" "/opt/healthapp/$service/$assembly.dll" --migrate;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
done
|
||||||
|
systemctl daemon-reload
|
||||||
|
for service in "${selected_services[@]}"; do
|
||||||
|
step="enable/start $service"
|
||||||
|
systemctl enable --now "healthapp-$service.service"
|
||||||
|
done
|
||||||
|
step='verify startup and HTTPS listening'
|
||||||
|
pids=()
|
||||||
|
for service in "${selected_services[@]}"; do
|
||||||
|
systemctl is-active --quiet "healthapp-$service.service" || fail "$service is not running."
|
||||||
|
pid=$(systemctl show --property MainPID --value "healthapp-$service.service")
|
||||||
|
[[ "$pid" =~ ^[1-9][0-9]*$ && -d "/proc/$pid" ]] || fail "$service has no running process."
|
||||||
|
for peer in "${pids[@]}"; do [[ "$pid" != "$peer" ]] || fail 'Selected services share a process.'; done
|
||||||
|
pids+=("$pid")
|
||||||
|
done
|
||||||
|
"${provision[@]}" verify-startup --deployment "$deployment" --services "$(IFS=,; echo "${selected_services[*]}")"
|
||||||
|
if [[ "$defer_verification" == true ]]; then
|
||||||
|
printf '%s\n' 'Node started. Distributed topology verification is pending until all nodes have started.'
|
||||||
|
else
|
||||||
|
step='verify configured dependencies and representative functionality'
|
||||||
|
arguments=(verify --deployment "$deployment" --services "$(IFS=,; echo "${selected_services[*]}")")
|
||||||
|
[[ "$requested" != all ]] || arguments+=(--complete true)
|
||||||
|
"${provision[@]}" "${arguments[@]}"
|
||||||
|
printf 'Installation and topology verification completed. Account credentials: %s/accounts.json\n' "$deployment"
|
||||||
|
fi
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Deployment metadata only; each application remains independently published and configured.
|
||||||
|
all_services=(api-gateway patient-profile observation insights health-overview)
|
||||||
|
select_services() {
|
||||||
|
local requested="$1" item
|
||||||
|
selected_services=()
|
||||||
|
if [[ "$requested" == all ]]; then
|
||||||
|
selected_services=("${all_services[@]}")
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
IFS=',' read -r -a selected_services <<< "$requested"
|
||||||
|
[[ ${#selected_services[@]} -gt 0 && "$requested" != *, ]] || fail "Select services by comma-separated name or all."
|
||||||
|
local seen=,
|
||||||
|
for item in "${selected_services[@]}"; do
|
||||||
|
case "$item" in api-gateway|patient-profile|observation|insights|health-overview) ;; *) fail "Unknown service: $item" ;; esac
|
||||||
|
case "$seen" in *,$item,*) fail "Repeated service: $item";; esac
|
||||||
|
seen+="$item,"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
assembly_for() {
|
||||||
|
case "$1" in
|
||||||
|
api-gateway) printf '%s' ApiGateway;;
|
||||||
|
patient-profile) printf '%s' PatientProfileService;;
|
||||||
|
observation) printf '%s' ObservationService;;
|
||||||
|
insights) printf '%s' InsightsService;;
|
||||||
|
health-overview) printf '%s' HealthOverviewService;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
script_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
fail() { printf 'Verification failed: %s\n' "$*" >&2; exit 1; }
|
||||||
|
source "$script_dir/services.sh"
|
||||||
|
requested=
|
||||||
|
deployment=/var/lib/healthapp-installation/deployment
|
||||||
|
dotnet_path=/usr/bin/dotnet
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case "$1" in
|
||||||
|
--services|--deployment|--dotnet)
|
||||||
|
[[ $# -gt 1 ]] || fail 'Missing argument.'
|
||||||
|
case "$1" in --services) requested=$2;; --deployment) deployment=$2;; --dotnet) dotnet_path=$2;; esac
|
||||||
|
shift 2;;
|
||||||
|
--help) printf '%s\n' 'Usage: bash verify.sh --services all|NAME[,NAME] [--deployment GENERATED_DIRECTORY] [--dotnet PATH]' 'Checks systemd processes, HTTPS, dedicated databases, service credentials and the complete-system synthetic workflow.'; exit 0;;
|
||||||
|
*) fail "Unknown argument: $1";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
select_services "$requested"
|
||||||
|
pids=()
|
||||||
|
for service in "${selected_services[@]}"; do
|
||||||
|
systemctl is-active --quiet "healthapp-$service.service" || fail "$service is not running."
|
||||||
|
pid=$(systemctl show --property MainPID --value "healthapp-$service.service")
|
||||||
|
[[ "$pid" =~ ^[1-9][0-9]*$ && -d "/proc/$pid" ]] || fail "$service has no process."
|
||||||
|
for peer in "${pids[@]}"; do [[ "$pid" != "$peer" ]] || fail 'Services share a process.'; done
|
||||||
|
pids+=("$pid")
|
||||||
|
done
|
||||||
|
args=(verify --deployment "$deployment" --services "$(IFS=,; echo "${selected_services[*]}")")
|
||||||
|
[[ "$requested" != all ]] || args+=(--complete true)
|
||||||
|
"$dotnet_path" "$script_dir/provisioner/HealthApp.Provisioning.dll" "${args[@]}"
|
||||||
|
printf '%s\n' 'Installation verification passed.'
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
ASPNETCORE_ENVIRONMENT=Production
|
||||||
|
ASPNETCORE_URLS=https://0.0.0.0:5082
|
||||||
|
ConnectionStrings__ObservationDatabase="Host=database.example.test;Port=5432;Database=observations;Username=observations;Password=REPLACE_ME"
|
||||||
|
Services__ApiGateway__BaseUrl=https://gateway.example.test:5443/
|
||||||
|
|
||||||
|
InternalAccess__GatewayKey=REPLACE_ME
|
||||||
|
Kestrel__Certificates__Default__Path=/etc/healthapp/service.pfx
|
||||||
|
Kestrel__Certificates__Default__Password=REPLACE_ME
|
||||||
|
Services__ApiGateway__Key=REPLACE_ME
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
ASPNETCORE_ENVIRONMENT=Production
|
||||||
|
ASPNETCORE_URLS=https://0.0.0.0:5081
|
||||||
|
ConnectionStrings__PatientDatabase="Host=database.example.test;Port=5432;Database=patient_profile;Username=patient_profile;Password=REPLACE_ME"
|
||||||
|
|
||||||
|
InternalAccess__GatewayKey=REPLACE_ME
|
||||||
|
Kestrel__Certificates__Default__Path=/etc/healthapp/service.pfx
|
||||||
|
Kestrel__Certificates__Default__Password=REPLACE_ME
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=HealthApp API gateway
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
StateDirectory=healthapp-api-gateway
|
||||||
|
StateDirectoryMode=0700
|
||||||
|
Type=simple
|
||||||
|
User=healthapp
|
||||||
|
Group=healthapp
|
||||||
|
WorkingDirectory=/opt/healthapp/api-gateway
|
||||||
|
ExecStart=/usr/bin/dotnet /opt/healthapp/api-gateway/ApiGateway.dll
|
||||||
|
EnvironmentFile=/etc/healthapp/api-gateway.env
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=5
|
||||||
|
KillSignal=SIGINT
|
||||||
|
TimeoutStopSec=30
|
||||||
|
SyslogIdentifier=healthapp-api-gateway
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=HealthApp Health Overview service
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=healthapp
|
||||||
|
Group=healthapp
|
||||||
|
WorkingDirectory=/opt/healthapp/health-overview
|
||||||
|
ExecStart=/usr/bin/dotnet /opt/healthapp/health-overview/HealthOverviewService.dll
|
||||||
|
EnvironmentFile=/etc/healthapp/health-overview.env
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=5
|
||||||
|
KillSignal=SIGINT
|
||||||
|
TimeoutStopSec=30
|
||||||
|
SyslogIdentifier=healthapp-health-overview
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=HealthApp Insights service
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=healthapp
|
||||||
|
Group=healthapp
|
||||||
|
WorkingDirectory=/opt/healthapp/insights
|
||||||
|
ExecStart=/usr/bin/dotnet /opt/healthapp/insights/InsightsService.dll
|
||||||
|
EnvironmentFile=/etc/healthapp/insights.env
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=5
|
||||||
|
KillSignal=SIGINT
|
||||||
|
TimeoutStopSec=30
|
||||||
|
SyslogIdentifier=healthapp-insights
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=HealthApp Observation service
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=healthapp
|
||||||
|
Group=healthapp
|
||||||
|
WorkingDirectory=/opt/healthapp/observation
|
||||||
|
ExecStart=/usr/bin/dotnet /opt/healthapp/observation/ObservationService.dll
|
||||||
|
EnvironmentFile=/etc/healthapp/observation.env
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=5
|
||||||
|
KillSignal=SIGINT
|
||||||
|
TimeoutStopSec=30
|
||||||
|
SyslogIdentifier=healthapp-observation
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=HealthApp Patient/Profile service
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=healthapp
|
||||||
|
Group=healthapp
|
||||||
|
WorkingDirectory=/opt/healthapp/patient-profile
|
||||||
|
ExecStart=/usr/bin/dotnet /opt/healthapp/patient-profile/PatientProfileService.dll
|
||||||
|
EnvironmentFile=/etc/healthapp/patient-profile.env
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=5
|
||||||
|
KillSignal=SIGINT
|
||||||
|
TimeoutStopSec=30
|
||||||
|
SyslogIdentifier=healthapp-patient-profile
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"sdk": {
|
||||||
|
"version": "10.0.100",
|
||||||
|
"rollForward": "latestFeature"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,200 @@
|
|||||||
|
# US-13 prototype authentication
|
||||||
|
|
||||||
|
The API gateway authenticates pre-created externally configured accounts. Login is
|
||||||
|
`POST /api/authentication/login` with `accountId` and `password`. A successful JSON
|
||||||
|
response contains `accessToken`, `tokenType: Bearer`, `expiresIn`, `accountId` and
|
||||||
|
trusted `role`; it contains no patient data or refresh token. Send the access token
|
||||||
|
as `Authorization: Bearer <token>` on subsequent patient-data requests. Invalid
|
||||||
|
credentials return the same `401` response for unknown accounts and wrong passwords.
|
||||||
|
Login responses cannot be cached. General measurement guidance remains public.
|
||||||
|
|
||||||
|
## Mechanism and configuration
|
||||||
|
|
||||||
|
Use ASP.NET Core's built-in bearer authentication and ticket protection, with
|
||||||
|
Data Protection's application name `HealthApp.ApiGateway` and the bearer purpose.
|
||||||
|
Tokens are opaque protected authentication tickets, not JWTs. The configured key
|
||||||
|
ring and framework purpose enforce the gateway trust boundary; only account ID,
|
||||||
|
role and authentication properties are protected inside a token. Do not share the
|
||||||
|
key ring with other applications/services. No custom cryptography, identity
|
||||||
|
microservice, account database or refresh-token mechanism is introduced.
|
||||||
|
|
||||||
|
The gateway verifies passwords with ASP.NET Core `PasswordHasher` against
|
||||||
|
`Authentication:Accounts:<index>:{AccountId,Role,PasswordHash}`. Roles are `Patient`
|
||||||
|
or `HealthcareProfessional`, from trusted configuration. IDs support ASCII letters,
|
||||||
|
digits, hyphen and underscore, up to 128 characters. This keeps the internal account
|
||||||
|
lookup contract unambiguous. Provision credentials externally; no registration or
|
||||||
|
administration API is exposed. For provisioning, `tools/PasswordHash` reads a
|
||||||
|
password from standard input and emits its ASP.NET Core hash. Supply input securely
|
||||||
|
(e.g. redirect a permission-restricted temporary file), and protect the resulting
|
||||||
|
hash/configuration; neither belongs in Git. The tool needs no NuGet dependency.
|
||||||
|
|
||||||
|
`Authentication:TokenLifetimeMinutes` defaults to 30; supported range is 1–1440.
|
||||||
|
`Authentication:KeyDirectory` is required. Keep its contents persistent through
|
||||||
|
restart/deployment and readable only by the gateway service account. The systemd
|
||||||
|
unit provides a mode-0700 state directory; example configuration points into it.
|
||||||
|
Keys are protected by filesystem permissions in this Linux prototype. Removing
|
||||||
|
keys invalidates tokens; preserve them for restart continuity. Accounts and
|
||||||
|
configuration are loaded at startup; after disabling accounts or changing roles,
|
||||||
|
old tokens can remain valid until their expiry. Immediate revocation is outside
|
||||||
|
this story. Missing/invalid/expired tokens return `401`; authenticate again after
|
||||||
|
expiry. Credential validation is not repeated for each operation.
|
||||||
|
|
||||||
|
Before thesis measurement, record the lifetime, account/role mix, key persistence,
|
||||||
|
login frequency and expiry handling. Normally obtain tokens during workload setup
|
||||||
|
and reuse them; state explicitly whether login is measured. If tokens expire,
|
||||||
|
re-authentication is required. Keep these choices identical across variants. The
|
||||||
|
automated test helper logs in using real password verification and caches tokens;
|
||||||
|
its account-per-resource setup is not a prescribed measurement workload.
|
||||||
|
|
||||||
|
## Ownership and profile creation
|
||||||
|
|
||||||
|
The patient service owns the account association as `patient.account_id` with a
|
||||||
|
unique index. It remains application access data, outside tokens. The gateway
|
||||||
|
queries its protected `GET /api/patients/by-account/{accountId}` service API on each
|
||||||
|
request; that API is not forwarded as a public account-lookup route. An account
|
||||||
|
without a profile may log in and create one; its other own-data requests return
|
||||||
|
`404`. Patient operations are subject to the standard Patient authorization policy.
|
||||||
|
|
||||||
|
`GET /api/patients/me` retrieves the caller’s own associated profile without needing
|
||||||
|
to know its generated identifier, including after a creation response was lost.
|
||||||
|
It returns `404` before profile creation.
|
||||||
|
|
||||||
|
Profile creation derives `X-Account-Id` from the authenticated principal. The
|
||||||
|
gateway overwrites client input; the service accepts it only behind its gateway
|
||||||
|
credential. The profile and association are inserted in one atomic database save,
|
||||||
|
so failure rolls both back. The unique index arbitrates concurrent creation. A
|
||||||
|
completed creation, a retry after a lost response and a competing request cannot
|
||||||
|
create another profile; later attempts receive `409`. A retry after a failed
|
||||||
|
transaction may create the first profile. Profile identity remains persistent
|
||||||
|
through restarts. US-01's authenticated creation is included because US-13 depends
|
||||||
|
on a persistent, recoverable association.
|
||||||
|
|
||||||
|
Apply the new patient migration before startup. Existing profiles retain a null
|
||||||
|
account association rather than being assigned to an arbitrary account. They are
|
||||||
|
not accessible to patient accounts until a trusted deployment operator explicitly
|
||||||
|
associates them with pre-created accounts. For synthetic experiments, provision a
|
||||||
|
fresh database via the authenticated creation flow. Do not infer ownership from
|
||||||
|
caller-supplied IDs or automatically assign historical profiles.
|
||||||
|
|
||||||
|
For observation-ID requests, the gateway reads the observation through its service
|
||||||
|
API to obtain the actual patient, then compares that owner with the account's
|
||||||
|
profile. Requests for another patient's information receive an empty `404`, the
|
||||||
|
same as missing data, without forwarding writes or revealing existence. Failed
|
||||||
|
ownership lookups fail closed with `502`/`504`. Tokens do not cache ownership.
|
||||||
|
Healthcare-professional logins establish a trusted role. US-14 now permits reads
|
||||||
|
of assigned patients and the caller’s own assignment list; all professional writes
|
||||||
|
are rejected before forwarding. Trend/overview endpoints remain unimplemented; the
|
||||||
|
gateway's default authentication policy also protects future patient endpoints,
|
||||||
|
which must retain ownership checks when added.
|
||||||
|
|
||||||
|
## Service and transport protection
|
||||||
|
|
||||||
|
Use HTTPS for client and service traffic. Outside Development, gateway and service
|
||||||
|
requests over HTTP are rejected and outgoing service endpoints must be HTTPS.
|
||||||
|
Certificates use ordinary Kestrel configuration and normal platform validation;
|
||||||
|
no insecure certificate handler is provided. Configure DNS names/certificates for
|
||||||
|
separate machines. Development permits plain HTTP for local automated tests only.
|
||||||
|
Use network firewall rules to restrict service ports to trusted hosts as an
|
||||||
|
additional deployment control; the application credential checks still enforce
|
||||||
|
protection if a client reaches a service directly.
|
||||||
|
|
||||||
|
Each service requires `InternalAccess:GatewayKey`, a random credential of at least
|
||||||
|
32 characters, matched by the gateway's `Services:<service>:Key`. Services reject
|
||||||
|
missing/wrong keys and client bearer tokens. Use distinct per-service gateway keys
|
||||||
|
in deployment. The gateway forwards only its own configured key; arbitrary client
|
||||||
|
identity headers are not propagated. Do not log these headers or tokens.
|
||||||
|
|
||||||
|
Observation and Insights each have a separate `Services:ApiGateway:Key`, matched
|
||||||
|
by the gateway's `InternalAccess:Observation:Key` or `InternalAccess:Insights:Key`.
|
||||||
|
Their `X-Service-Key` authenticates an internal principal using an ASP.NET Core
|
||||||
|
handler. The Observation principal can only GET a patient profile by patient ID;
|
||||||
|
the Insights principal can only GET observation history by patient ID. Neither
|
||||||
|
can create/update/delete profiles or observations, query account associations or
|
||||||
|
call other protected routes. Both internal read paths still pass through the
|
||||||
|
gateway. Service credentials are separate from patient tokens and token keys.
|
||||||
|
Use independent random values, restrictive configuration-file permissions and
|
||||||
|
HTTPS; placeholder values in deployment examples deliberately fail validation.
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
|
||||||
|
The acceptance suite exercises real HTTP hosts and PostgreSQL migrations. It covers
|
||||||
|
US-13's login, own access, missing/invalid/expired tokens, no-profile behaviour,
|
||||||
|
cross-patient reads/writes and observation ownership. Additional checks cover
|
||||||
|
caller-supplied account spoofing, persistent tokens/associations after restart,
|
||||||
|
duplicate/concurrent creation, unavailable-service recovery, direct service bypass,
|
||||||
|
internal-credential route restrictions, professional creation rejection and public
|
||||||
|
US-15 guidance. Existing functional assertions run through real token login rather
|
||||||
|
than a production authentication bypass.
|
||||||
|
|
||||||
|
Framework reference:
|
||||||
|
https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.authentication.bearertoken.bearertokenoptions?view=aspnetcore-10.0
|
||||||
|
|
||||||
|
## US-14 professional assignments
|
||||||
|
|
||||||
|
Predefine assignments in the gateway's external `Access:ProfessionalAssignments`
|
||||||
|
configuration, keyed by the stable professional account identifier. For example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"Access": {
|
||||||
|
"ProfessionalAssignments": {
|
||||||
|
"example_professional": [
|
||||||
|
"00000000-0000-0000-0000-000000000001",
|
||||||
|
"00000000-0000-0000-0000-000000000002"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Use actual patient identifiers returned by authenticated profile creation. The
|
||||||
|
example UUIDs are placeholders. A professional can have several patients, and
|
||||||
|
several professionals can share a patient. Duplicate identifiers are treated as
|
||||||
|
one assignment. Empty identifiers are rejected at startup. An omitted account
|
||||||
|
entry means no assignments. Configure that account's role and password hash
|
||||||
|
separately under `Authentication:Accounts`; assignments never grant a role.
|
||||||
|
|
||||||
|
`GET /api/professionals/me/patients` requires the HealthcareProfessional policy and
|
||||||
|
returns an array of `{ "patientId": "..." }` entries, in deterministic identifier
|
||||||
|
order. It lists only the caller's configured assignments, without fetching patient
|
||||||
|
records. No assignments returns `[]`. Missing profiles remain assigned identifiers;
|
||||||
|
retrieving their data follows the existing missing-resource behaviour. Caller
|
||||||
|
query parameters or identity headers cannot select another professional's list.
|
||||||
|
Patient accounts cannot use this endpoint.
|
||||||
|
|
||||||
|
Professional GET requests to existing patient profiles, observations (including
|
||||||
|
recorded legacy context), history, latest observations and numerical insight
|
||||||
|
require membership in the caller's assignment set. Observation-ID requests resolve
|
||||||
|
the actual owning patient via the protected Observation API; a supplied patient ID
|
||||||
|
is not evidence of assignment. Unassigned reads return an empty `404`, preserving
|
||||||
|
the same non-disclosure convention as patient access. Assigned missing data follows
|
||||||
|
the existing retrieval contracts. All professional POST/PUT/PATCH/DELETE requests
|
||||||
|
are rejected with `403` before ownership lookups or forwarding. There is no
|
||||||
|
assignment-management API or additional database/service.
|
||||||
|
|
||||||
|
Assignments are loaded at gateway startup, outside tokens and credential
|
||||||
|
validation. Restart the gateway after changing its external configuration. Existing
|
||||||
|
valid tokens then use the new assignment data. Empty lists need no upstream service;
|
||||||
|
observation-owner lookup failures fail closed with `502`/`504`.
|
||||||
|
|
||||||
|
The US-14 tests exercise actual login, multiple and shared assignments, empty lists,
|
||||||
|
assigned/unassigned reads, preserved context, missing resources, every existing
|
||||||
|
write route, invalid and expired credentials, patient-role rejection, assignment
|
||||||
|
changes across restart and unavailable ownership lookup. Trend and overview
|
||||||
|
endpoints now have equivalent owner/assignment routing and integration tests under
|
||||||
|
US-11/US-12. Structured observation context is included in authorized reads.
|
||||||
|
|
||||||
|
## US-12 Overview service access
|
||||||
|
|
||||||
|
The gateway requires `Services:HealthOverview:BaseUrl` and `Services:HealthOverview:Key`.
|
||||||
|
The latter matches Overview's `InternalAccess:GatewayKey` and protects direct access.
|
||||||
|
Overview's outgoing `Services:ApiGateway:Key` matches `InternalAccess:HealthOverview:Key`
|
||||||
|
on the gateway. Use distinct randomly generated credentials of at least 32 characters
|
||||||
|
for each direction and service; load them externally. Production endpoints use HTTPS.
|
||||||
|
|
||||||
|
The HealthOverview service identity is restricted to GET patient profiles, GET latest
|
||||||
|
overall observations and GET numerical insights. It cannot retrieve history, trends or
|
||||||
|
another overview, or perform writes. It establishes no client identity. The gateway
|
||||||
|
checks client ownership/professional assignment before forwarding the outer request.
|
||||||
|
Internal credentials are trusted service credentials and must remain inaccessible to clients.
|
||||||
|
Overview adds no authentication framework, shared runtime library or persistence.
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="10.0.12" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Security.Claims;
|
||||||
|
using ApiGateway.Security;
|
||||||
|
using Microsoft.AspNetCore.Authentication;
|
||||||
|
using Microsoft.AspNetCore.Authentication.BearerToken;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
|
namespace ApiGateway.Controllers;
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
|
[Route("api/authentication")]
|
||||||
|
public sealed class AuthenticationController(PrototypeAccounts accounts,
|
||||||
|
IOptionsMonitor<BearerTokenOptions> options) : ControllerBase
|
||||||
|
{
|
||||||
|
[AllowAnonymous]
|
||||||
|
[HttpPost("login")]
|
||||||
|
public IActionResult Login(LoginRequest request)
|
||||||
|
{
|
||||||
|
var account = accounts.Verify(request.AccountId, request.Password);
|
||||||
|
if (account is null) return Unauthorized(new { title = "Invalid credentials." });
|
||||||
|
var principal = new ClaimsPrincipal(new ClaimsIdentity(new[]
|
||||||
|
{
|
||||||
|
new Claim(ClaimTypes.NameIdentifier, account.AccountId),
|
||||||
|
new Claim(ClaimTypes.Role, account.Role)
|
||||||
|
}, "Bearer"));
|
||||||
|
var settings = options.Get("Bearer");
|
||||||
|
var expiry = settings.TimeProvider!.GetUtcNow().Add(settings.BearerTokenExpiration);
|
||||||
|
// Use the framework's ticket protector and bearer validation. No refresh endpoint/token.
|
||||||
|
var ticket = new AuthenticationTicket(principal, new AuthenticationProperties { ExpiresUtc = expiry }, "Bearer");
|
||||||
|
Response.Headers.CacheControl = "no-store";
|
||||||
|
Response.Headers.Pragma = "no-cache";
|
||||||
|
return Ok(new { accessToken = settings.BearerTokenProtector.Protect(ticket), tokenType = "Bearer",
|
||||||
|
expiresIn = (long)settings.BearerTokenExpiration.TotalSeconds, accountId = account.AccountId, role = account.Role });
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed record LoginRequest([Required] string AccountId, [Required] string Password);
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace ApiGateway.Controllers;
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
|
[Route("api")]
|
||||||
|
public sealed class HealthOverviewController(IHttpClientFactory clients) : ControllerBase
|
||||||
|
{
|
||||||
|
[HttpGet("patients/{patientId:guid}/overview")]
|
||||||
|
public Task GetOverview(Guid patientId, CancellationToken cancellationToken) =>
|
||||||
|
ForwardAsync(HttpMethod.Get, $"api/patients/{patientId}/overview{Request.QueryString}", cancellationToken);
|
||||||
|
|
||||||
|
private async Task ForwardAsync(HttpMethod method, string path, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
using var request = new HttpRequestMessage(method, path);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using var upstream = await clients.CreateClient("HealthOverview")
|
||||||
|
.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken);
|
||||||
|
Response.StatusCode = (int)upstream.StatusCode;
|
||||||
|
Response.ContentType = upstream.Content.Headers.ContentType?.ToString();
|
||||||
|
if (upstream.Headers.Location is { } location)
|
||||||
|
Response.Headers.Location = location.IsAbsoluteUri ? location.PathAndQuery : location.ToString();
|
||||||
|
await upstream.Content.CopyToAsync(Response.Body, cancellationToken);
|
||||||
|
}
|
||||||
|
catch (HttpRequestException)
|
||||||
|
{
|
||||||
|
await WriteFailureAsync(StatusCodes.Status502BadGateway);
|
||||||
|
}
|
||||||
|
catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested)
|
||||||
|
{
|
||||||
|
await WriteFailureAsync(StatusCodes.Status504GatewayTimeout);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Task WriteFailureAsync(int status)
|
||||||
|
{
|
||||||
|
if (Response.HasStarted)
|
||||||
|
{
|
||||||
|
HttpContext.Abort();
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
Response.Clear();
|
||||||
|
return Results.Problem(statusCode: status, title: "Health overview service is unavailable.")
|
||||||
|
.ExecuteAsync(HttpContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace ApiGateway.Controllers;
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
|
[Route("api")]
|
||||||
|
public sealed class InsightsController(IHttpClientFactory clients) : ControllerBase
|
||||||
|
{
|
||||||
|
[HttpGet("patients/{patientId:guid}/insights")]
|
||||||
|
public Task GetSummary(Guid patientId, CancellationToken cancellationToken) =>
|
||||||
|
ForwardAsync(HttpMethod.Get, $"api/patients/{patientId}/insights{Request.QueryString}", cancellationToken);
|
||||||
|
|
||||||
|
[HttpGet("patients/{patientId:guid}/trends")]
|
||||||
|
public Task GetTrend(Guid patientId, CancellationToken cancellationToken) =>
|
||||||
|
ForwardAsync(HttpMethod.Get, $"api/patients/{patientId}/trends{Request.QueryString}", cancellationToken);
|
||||||
|
|
||||||
|
private async Task ForwardAsync(HttpMethod method, string path, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
using var request = new HttpRequestMessage(method, path);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using var upstream = await clients.CreateClient("Insights")
|
||||||
|
.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken);
|
||||||
|
Response.StatusCode = (int)upstream.StatusCode;
|
||||||
|
Response.ContentType = upstream.Content.Headers.ContentType?.ToString();
|
||||||
|
if (upstream.Headers.Location is { } location)
|
||||||
|
Response.Headers.Location = location.IsAbsoluteUri ? location.PathAndQuery : location.ToString();
|
||||||
|
await upstream.Content.CopyToAsync(Response.Body, cancellationToken);
|
||||||
|
}
|
||||||
|
catch (HttpRequestException)
|
||||||
|
{
|
||||||
|
await WriteFailureAsync(StatusCodes.Status502BadGateway);
|
||||||
|
}
|
||||||
|
catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested)
|
||||||
|
{
|
||||||
|
await WriteFailureAsync(StatusCodes.Status504GatewayTimeout);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Task WriteFailureAsync(int status)
|
||||||
|
{
|
||||||
|
if (Response.HasStarted)
|
||||||
|
{
|
||||||
|
HttpContext.Abort();
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
Response.Clear();
|
||||||
|
return Results.Problem(statusCode: status, title: "Insights service is unavailable.")
|
||||||
|
.ExecuteAsync(HttpContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace ApiGateway.Controllers;
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
|
[AllowAnonymous]
|
||||||
|
[Route("api/measurement-guidance")]
|
||||||
|
public sealed class MeasurementGuidanceController : ControllerBase
|
||||||
|
{
|
||||||
|
[HttpGet]
|
||||||
|
public IActionResult Get([FromQuery] string? setting, [FromQuery] string? activityCondition)
|
||||||
|
{
|
||||||
|
var requestedSetting = string.IsNullOrWhiteSpace(setting) ? "Unknown" : setting.Trim();
|
||||||
|
var requestedActivity = string.IsNullOrWhiteSpace(activityCondition) ? "Unknown" : activityCondition.Trim();
|
||||||
|
if (!new[] { "Home", "Clinic", "Other", "Unknown" }.Contains(requestedSetting, StringComparer.OrdinalIgnoreCase))
|
||||||
|
return Problem(statusCode: 400, title: "Unsupported measurement setting.");
|
||||||
|
if (!new[] { "AtRest", "DuringActivity", "AfterActivity", "Unknown" }.Contains(requestedActivity, StringComparer.OrdinalIgnoreCase))
|
||||||
|
return Problem(statusCode: 400, title: "Unsupported activity condition.");
|
||||||
|
|
||||||
|
var available = requestedSetting.Equals("Home", StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| requestedSetting.Equals("Unknown", StringComparison.OrdinalIgnoreCase);
|
||||||
|
return Ok(new
|
||||||
|
{
|
||||||
|
available,
|
||||||
|
requestedSetting,
|
||||||
|
requestedActivityCondition = requestedActivity,
|
||||||
|
applicableSetting = available ? "Home" : null,
|
||||||
|
applicableActivityCondition = available ? "AtRest" : null,
|
||||||
|
reviewedOn = available ? "2026-10-04" : null,
|
||||||
|
explanation = available
|
||||||
|
? "These instructions apply to resting home self-measurement, not a clinical measurement protocol. Unknown conditions remain unknown; requesting guidance does not record a setting or certify compliance."
|
||||||
|
: "Verified guidance is unavailable for the requested setting. Home instructions have not been substituted for clinical or other-setting instructions.",
|
||||||
|
steps = available ? new[]
|
||||||
|
{
|
||||||
|
new GuidanceStep(1, "Equipment", "Use a validated upper-arm device with a cuff suited to your arm. Follow its instructions for placement and maintenance; incorrect cuff size can distort readings."),
|
||||||
|
new GuidanceStep(2, "Preparation", "Choose a quiet place. Avoid smoking for 30 minutes beforehand and rest seated for five minutes."),
|
||||||
|
new GuidanceStep(3, "Position", "Sit with back and arm supported and legs uncrossed. Put the cuff on bare skin, clear of tight clothing, and keep the arm relaxed and still during measurement."),
|
||||||
|
new GuidanceStep(4, "Measure", "Use the device as instructed. Reproduce your setting, posture and preparation when possible to help later comparisons."),
|
||||||
|
new GuidanceStep(5, "Planned monitoring", "The cited Danish home protocol uses three readings in the morning before breakfast and three in the evening before dinner, over three consecutive days. This planned series differs from saving one observation; follow individually supplied clinical instructions."),
|
||||||
|
new GuidanceStep(6, "Record", "Save actual blood-pressure values in mmHg, device-reported pulse in beats/minute, and measurement time. Record setting, activity and preparation where known, including departures from routine. Do not discard, change or invent values to fit guidance.")
|
||||||
|
} : Array.Empty<GuidanceStep>(),
|
||||||
|
pulseExplanation = available
|
||||||
|
? "Rest and activity affect the context of pulse readings. One device-reported pulse value does not assess rhythm regularity."
|
||||||
|
: null,
|
||||||
|
activityExplanation = available
|
||||||
|
? "During-activity and after-activity measurements differ from resting measurements. Record the actual conditions; do not relabel them as resting. Such observations remain valid to record."
|
||||||
|
: null,
|
||||||
|
limitations = available
|
||||||
|
? "Guidance does not guarantee accuracy or replace device or individual clinical instructions. It does not recommend medication changes. Viewing or declining it does not save or alter observations, certify a procedure, or prevent a valid submission."
|
||||||
|
: null,
|
||||||
|
sources = available ? new[]
|
||||||
|
{
|
||||||
|
new GuidanceSource("Sundhed.dk — Højt blodtryk", "https://www.sundhed.dk/sundhedsfaglig/laegehaandbogen/hjerte-kar/symptomer-og-tegn/hoejt-blodtryk/", "2024-09-25"),
|
||||||
|
new GuidanceSource("Sundhed.dk — Blodtryksmåling", "https://www.sundhed.dk/sundhedsfaglig/laegehaandbogen/undersoegelser-og-proever/kliniske-procedurer/hjertekar/blodtryksmaaling/", "2025-03-13")
|
||||||
|
} : Array.Empty<GuidanceSource>()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private sealed record GuidanceStep(int Order, string Topic, string Instruction);
|
||||||
|
private sealed record GuidanceSource(string Title, string Url, string UpdatedOn);
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace ApiGateway.Controllers;
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
|
[Route("api")]
|
||||||
|
public sealed class ObservationController(IHttpClientFactory clients) : ControllerBase
|
||||||
|
{
|
||||||
|
[HttpPost("patients/{patientId:guid}/observations")]
|
||||||
|
public Task RecordObservation(Guid patientId, CancellationToken cancellationToken) =>
|
||||||
|
ForwardAsync(HttpMethod.Post, $"api/patients/{patientId}/observations", cancellationToken);
|
||||||
|
|
||||||
|
[HttpDelete("observations/{observationId:guid}")]
|
||||||
|
public Task DeleteObservation(Guid observationId, CancellationToken cancellationToken) =>
|
||||||
|
ForwardAsync(HttpMethod.Delete, $"api/observations/{observationId}", cancellationToken);
|
||||||
|
|
||||||
|
[HttpPut("observations/{observationId:guid}")]
|
||||||
|
public Task UpdateObservation(Guid observationId, CancellationToken cancellationToken) =>
|
||||||
|
ForwardAsync(HttpMethod.Put, $"api/observations/{observationId}", cancellationToken);
|
||||||
|
|
||||||
|
[HttpPatch("observations/{observationId:guid}")]
|
||||||
|
public Task PatchObservation(Guid observationId, CancellationToken cancellationToken) =>
|
||||||
|
ForwardAsync(HttpMethod.Patch, $"api/observations/{observationId}", cancellationToken);
|
||||||
|
|
||||||
|
[HttpGet("observations/{observationId:guid}")]
|
||||||
|
public Task GetObservation(Guid observationId, CancellationToken cancellationToken) =>
|
||||||
|
ForwardAsync(HttpMethod.Get, $"api/observations/{observationId}", cancellationToken);
|
||||||
|
|
||||||
|
[HttpGet("patients/{patientId:guid}/observations/latest")]
|
||||||
|
public Task GetLatest(Guid patientId, CancellationToken cancellationToken) =>
|
||||||
|
ForwardAsync(HttpMethod.Get, $"api/patients/{patientId}/observations/latest", cancellationToken);
|
||||||
|
|
||||||
|
[HttpGet("patients/{patientId:guid}/observations")]
|
||||||
|
public Task GetByPeriod(Guid patientId, CancellationToken cancellationToken) =>
|
||||||
|
ForwardAsync(HttpMethod.Get, $"api/patients/{patientId}/observations{Request.QueryString}", cancellationToken);
|
||||||
|
|
||||||
|
private async Task ForwardAsync(HttpMethod method, string path, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
using var request = new HttpRequestMessage(method, path);
|
||||||
|
if (method == HttpMethod.Post || method == HttpMethod.Put || method == HttpMethod.Patch)
|
||||||
|
{
|
||||||
|
request.Content = new StreamContent(Request.Body);
|
||||||
|
if (Request.ContentType is not null)
|
||||||
|
request.Content.Headers.TryAddWithoutValidation("Content-Type", Request.ContentType);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using var upstream = await clients.CreateClient("Observation")
|
||||||
|
.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken);
|
||||||
|
Response.StatusCode = (int)upstream.StatusCode;
|
||||||
|
Response.ContentType = upstream.Content.Headers.ContentType?.ToString();
|
||||||
|
foreach (var header in new[] { "X-Measurement-Setting", "X-Activity-Condition" })
|
||||||
|
if (upstream.Headers.TryGetValues(header, out var values))
|
||||||
|
Response.Headers[header] = values.ToArray();
|
||||||
|
if (upstream.Headers.Location is { } location)
|
||||||
|
Response.Headers.Location = location.IsAbsoluteUri ? location.PathAndQuery : location.ToString();
|
||||||
|
await upstream.Content.CopyToAsync(Response.Body, cancellationToken);
|
||||||
|
}
|
||||||
|
catch (HttpRequestException)
|
||||||
|
{
|
||||||
|
await WriteFailureAsync(StatusCodes.Status502BadGateway);
|
||||||
|
}
|
||||||
|
catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested)
|
||||||
|
{
|
||||||
|
await WriteFailureAsync(StatusCodes.Status504GatewayTimeout);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Task WriteFailureAsync(int status)
|
||||||
|
{
|
||||||
|
if (Response.HasStarted)
|
||||||
|
{
|
||||||
|
HttpContext.Abort();
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
Response.Clear();
|
||||||
|
return Results.Problem(statusCode: status, title: "Observation service is unavailable.")
|
||||||
|
.ExecuteAsync(HttpContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using System.Security.Claims;
|
||||||
|
|
||||||
|
namespace ApiGateway.Controllers;
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
|
[Route("api/patients")]
|
||||||
|
public sealed class PatientController(IHttpClientFactory clients) : ControllerBase
|
||||||
|
{
|
||||||
|
[HttpPost]
|
||||||
|
public Task CreatePatient(CancellationToken cancellationToken) =>
|
||||||
|
ForwardAsync(HttpMethod.Post, "api/patients", cancellationToken);
|
||||||
|
|
||||||
|
[HttpGet("me")]
|
||||||
|
public Task GetOwnPatient(CancellationToken cancellationToken) =>
|
||||||
|
ForwardAsync(HttpMethod.Get, "api/patients/by-account/" + Uri.EscapeDataString(User.FindFirstValue(ClaimTypes.NameIdentifier)!), cancellationToken);
|
||||||
|
|
||||||
|
[HttpGet("{patientId:guid}")]
|
||||||
|
public Task GetPatient(Guid patientId, CancellationToken cancellationToken) =>
|
||||||
|
ForwardAsync(HttpMethod.Get, $"api/patients/{patientId}", cancellationToken);
|
||||||
|
|
||||||
|
[HttpPut("{patientId:guid}")]
|
||||||
|
public Task UpdatePatient(Guid patientId, CancellationToken cancellationToken) =>
|
||||||
|
ForwardAsync(HttpMethod.Put, $"api/patients/{patientId}", cancellationToken);
|
||||||
|
|
||||||
|
private async Task ForwardAsync(HttpMethod method, string path, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
using var request = new HttpRequestMessage(method, path);
|
||||||
|
if (method == HttpMethod.Post)
|
||||||
|
request.Headers.Add("X-Account-Id", User.FindFirstValue(ClaimTypes.NameIdentifier));
|
||||||
|
if (method == HttpMethod.Post || method == HttpMethod.Put)
|
||||||
|
{
|
||||||
|
request.Content = new StreamContent(Request.Body);
|
||||||
|
if (Request.ContentType is not null)
|
||||||
|
request.Content.Headers.TryAddWithoutValidation("Content-Type", Request.ContentType);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using var upstream = await clients.CreateClient("PatientProfile")
|
||||||
|
.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken);
|
||||||
|
Response.StatusCode = (int)upstream.StatusCode;
|
||||||
|
Response.ContentType = upstream.Content.Headers.ContentType?.ToString();
|
||||||
|
if (upstream.Headers.Location is { } location)
|
||||||
|
Response.Headers.Location = location.IsAbsoluteUri ? location.PathAndQuery : location.ToString();
|
||||||
|
await upstream.Content.CopyToAsync(Response.Body, cancellationToken);
|
||||||
|
}
|
||||||
|
catch (HttpRequestException)
|
||||||
|
{
|
||||||
|
await WriteFailureAsync(StatusCodes.Status502BadGateway);
|
||||||
|
}
|
||||||
|
catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested)
|
||||||
|
{
|
||||||
|
await WriteFailureAsync(StatusCodes.Status504GatewayTimeout);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Task WriteFailureAsync(int status)
|
||||||
|
{
|
||||||
|
if (Response.HasStarted)
|
||||||
|
{
|
||||||
|
HttpContext.Abort();
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
Response.Clear();
|
||||||
|
return Results.Problem(statusCode: status, title: "Patient/Profile service is unavailable.")
|
||||||
|
.ExecuteAsync(HttpContext);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using System.Security.Claims;
|
||||||
|
using ApiGateway.Security;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
|
namespace ApiGateway.Controllers;
|
||||||
|
|
||||||
|
[ApiController]
|
||||||
|
[Authorize(Policy = "HealthcareProfessional")]
|
||||||
|
[Route("api/professionals/me/patients")]
|
||||||
|
public sealed class ProfessionalController(ProfessionalAssignments assignments) : ControllerBase
|
||||||
|
{
|
||||||
|
[HttpGet]
|
||||||
|
public IActionResult GetAssignedPatients() =>
|
||||||
|
Ok(assignments.GetPatients(User.FindFirstValue(ClaimTypes.NameIdentifier)!)
|
||||||
|
.Select(patientId => new { patientId }));
|
||||||
|
}
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
using ApiGateway.Security;
|
||||||
|
using Microsoft.AspNetCore.Authentication;
|
||||||
|
using Microsoft.AspNetCore.Authentication.BearerToken;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.DataProtection;
|
||||||
|
using Microsoft.AspNetCore.DataProtection.KeyManagement;
|
||||||
|
using Microsoft.AspNetCore.DataProtection.Repositories;
|
||||||
|
namespace ApiGateway;
|
||||||
|
|
||||||
|
public class Program
|
||||||
|
{
|
||||||
|
public static void Main(string[] args)
|
||||||
|
{
|
||||||
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
builder.Host.UseWindowsService(options => options.ServiceName = "healthapp-api-gateway");
|
||||||
|
builder.Services.AddControllers();
|
||||||
|
builder.Services.AddProblemDetails();
|
||||||
|
builder.Services.AddSingleton<PrototypeAccounts>();
|
||||||
|
builder.Services.AddSingleton<ProfessionalAssignments>();
|
||||||
|
builder.Services.AddAuthentication("ClientOrService")
|
||||||
|
.AddPolicyScheme("ClientOrService", null, options => options.ForwardDefaultSelector = context =>
|
||||||
|
context.Request.Headers.ContainsKey("X-Service-Key") ? "InternalService" : "Bearer")
|
||||||
|
.AddBearerToken("Bearer", options =>
|
||||||
|
{
|
||||||
|
options.BearerTokenExpiration = TimeSpan.FromMinutes(builder.Configuration.GetValue("Authentication:TokenLifetimeMinutes", 30));
|
||||||
|
})
|
||||||
|
.AddScheme<AuthenticationSchemeOptions, InternalServiceAuthenticationHandler>("InternalService", null);
|
||||||
|
builder.Services.AddAuthorization(options =>
|
||||||
|
{
|
||||||
|
options.FallbackPolicy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build();
|
||||||
|
options.AddPolicy("Patient", policy => policy.RequireRole("Patient").RequireClaim(System.Security.Claims.ClaimTypes.NameIdentifier));
|
||||||
|
options.AddPolicy("HealthcareProfessional", policy => policy.RequireRole("HealthcareProfessional")
|
||||||
|
.RequireClaim(System.Security.Claims.ClaimTypes.NameIdentifier));
|
||||||
|
});
|
||||||
|
builder.Services.AddDataProtection().SetApplicationName("HealthApp.ApiGateway");
|
||||||
|
builder.Services.AddOptions<KeyManagementOptions>().Configure<IConfiguration, ILoggerFactory>((options, configuration, logger) =>
|
||||||
|
{
|
||||||
|
var keyDirectory = configuration["Authentication:KeyDirectory"];
|
||||||
|
if (string.IsNullOrWhiteSpace(keyDirectory)) throw new InvalidOperationException("Authentication:KeyDirectory is required.");
|
||||||
|
options.XmlRepository = new FileSystemXmlRepository(new DirectoryInfo(keyDirectory), logger);
|
||||||
|
});
|
||||||
|
builder.Services.AddHttpClient("PatientProfile", (services, client) =>
|
||||||
|
{
|
||||||
|
var configuration = services.GetRequiredService<IConfiguration>();
|
||||||
|
client.BaseAddress = GetBaseUri(configuration, "PatientProfile");
|
||||||
|
client.DefaultRequestHeaders.Add("X-Gateway-Key", configuration["Services:PatientProfile:Key"]);
|
||||||
|
})
|
||||||
|
.ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler { AllowAutoRedirect = false });
|
||||||
|
|
||||||
|
builder.Services.AddHttpClient("Observation", (services, client) =>
|
||||||
|
{
|
||||||
|
var configuration = services.GetRequiredService<IConfiguration>();
|
||||||
|
client.BaseAddress = GetBaseUri(configuration, "Observation");
|
||||||
|
client.DefaultRequestHeaders.Add("X-Gateway-Key", configuration["Services:Observation:Key"]);
|
||||||
|
})
|
||||||
|
.ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler { AllowAutoRedirect = false });
|
||||||
|
|
||||||
|
builder.Services.AddHttpClient("Insights", (services, client) =>
|
||||||
|
{
|
||||||
|
var configuration = services.GetRequiredService<IConfiguration>();
|
||||||
|
client.BaseAddress = GetBaseUri(configuration, "Insights");
|
||||||
|
client.DefaultRequestHeaders.Add("X-Gateway-Key", configuration["Services:Insights:Key"]);
|
||||||
|
})
|
||||||
|
.ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler { AllowAutoRedirect = false });
|
||||||
|
|
||||||
|
builder.Services.AddHttpClient("HealthOverview", (services, client) =>
|
||||||
|
{
|
||||||
|
var configuration = services.GetRequiredService<IConfiguration>();
|
||||||
|
client.BaseAddress = GetBaseUri(configuration, "HealthOverview");
|
||||||
|
client.DefaultRequestHeaders.Add("X-Gateway-Key", configuration["Services:HealthOverview:Key"]);
|
||||||
|
})
|
||||||
|
.ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler { AllowAutoRedirect = false });
|
||||||
|
|
||||||
|
var app = builder.Build();
|
||||||
|
_ = GetBaseUri(app.Configuration, "PatientProfile");
|
||||||
|
_ = GetBaseUri(app.Configuration, "Observation");
|
||||||
|
_ = GetBaseUri(app.Configuration, "Insights");
|
||||||
|
_ = GetBaseUri(app.Configuration, "HealthOverview");
|
||||||
|
foreach (var key in new[] { "Services:PatientProfile:Key", "Services:Observation:Key", "Services:Insights:Key", "Services:HealthOverview:Key", "InternalAccess:HealthOverview:Key", "InternalAccess:Observation:Key", "InternalAccess:Insights:Key" })
|
||||||
|
if (string.IsNullOrWhiteSpace(app.Configuration[key]) || app.Configuration[key]!.Length < 32)
|
||||||
|
throw new InvalidOperationException($"{key} must contain at least 32 characters.");
|
||||||
|
if (string.IsNullOrWhiteSpace(app.Configuration["Authentication:KeyDirectory"]))
|
||||||
|
throw new InvalidOperationException("Authentication:KeyDirectory is required.");
|
||||||
|
var lifetime = app.Configuration.GetValue("Authentication:TokenLifetimeMinutes", 30);
|
||||||
|
if (lifetime <= 0 || lifetime > 1440) throw new InvalidOperationException("Token lifetime must be between 1 and 1440 minutes.");
|
||||||
|
if (!app.Environment.IsDevelopment())
|
||||||
|
foreach (var service in new[] { "PatientProfile", "Observation", "Insights", "HealthOverview" })
|
||||||
|
if (GetBaseUri(app.Configuration, service).Scheme != "https")
|
||||||
|
throw new InvalidOperationException("Production service endpoints must use HTTPS.");
|
||||||
|
_ = app.Services.GetRequiredService<PrototypeAccounts>();
|
||||||
|
_ = app.Services.GetRequiredService<ProfessionalAssignments>();
|
||||||
|
app.UseExceptionHandler();
|
||||||
|
app.Use(async (context, next) =>
|
||||||
|
{
|
||||||
|
if (!app.Environment.IsDevelopment() && !context.Request.IsHttps) { context.Response.StatusCode = 400; return; }
|
||||||
|
await next(context);
|
||||||
|
});
|
||||||
|
app.UseRouting();
|
||||||
|
app.UseAuthentication();
|
||||||
|
app.UseAuthorization();
|
||||||
|
app.UseMiddleware<PatientAccessMiddleware>();
|
||||||
|
app.MapControllers();
|
||||||
|
app.Run();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Uri GetBaseUri(IConfiguration configuration, string service)
|
||||||
|
{
|
||||||
|
var endpoint = configuration[$"Services:{service}:BaseUrl"];
|
||||||
|
if (!Uri.TryCreate(endpoint, UriKind.Absolute, out var baseUri) ||
|
||||||
|
(baseUri.Scheme != "http" && baseUri.Scheme != "https") ||
|
||||||
|
baseUri.AbsolutePath != "/" || !string.IsNullOrEmpty(baseUri.Query) ||
|
||||||
|
!string.IsNullOrEmpty(baseUri.Fragment) || !string.IsNullOrEmpty(baseUri.UserInfo))
|
||||||
|
throw new InvalidOperationException($"Services:{service}:BaseUrl must be an HTTP(S) origin URL.");
|
||||||
|
return baseUri;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
using System.Security.Claims;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Text;
|
||||||
|
using System.Text.Encodings.Web;
|
||||||
|
using Microsoft.AspNetCore.Authentication;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
|
namespace ApiGateway.Security;
|
||||||
|
|
||||||
|
public sealed class InternalServiceAuthenticationHandler(IOptionsMonitor<AuthenticationSchemeOptions> options,
|
||||||
|
ILoggerFactory logger, UrlEncoder encoder, IConfiguration configuration)
|
||||||
|
: AuthenticationHandler<AuthenticationSchemeOptions>(options, logger, encoder)
|
||||||
|
{
|
||||||
|
protected override Task<AuthenticateResult> HandleAuthenticateAsync()
|
||||||
|
{
|
||||||
|
var supplied = Request.Headers["X-Service-Key"].ToString();
|
||||||
|
foreach (var service in new[] { "Observation", "Insights", "HealthOverview" })
|
||||||
|
{
|
||||||
|
var expected = configuration[$"InternalAccess:{service}:Key"]!;
|
||||||
|
if (CryptographicOperations.FixedTimeEquals(Encoding.UTF8.GetBytes(supplied), Encoding.UTF8.GetBytes(expected)))
|
||||||
|
{
|
||||||
|
var identity = new ClaimsIdentity(new[] { new Claim(ClaimTypes.Role, "Service"),
|
||||||
|
new Claim(ClaimTypes.NameIdentifier, service) }, Scheme.Name);
|
||||||
|
return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(new ClaimsPrincipal(identity), Scheme.Name)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Task.FromResult(AuthenticateResult.Fail("Invalid service credential."));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
using System.Net;
|
||||||
|
using System.Security.Claims;
|
||||||
|
using System.Text.Json;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
|
||||||
|
namespace ApiGateway.Security;
|
||||||
|
|
||||||
|
public sealed class PatientAccessMiddleware(RequestDelegate next)
|
||||||
|
{
|
||||||
|
public async Task InvokeAsync(HttpContext context, IHttpClientFactory clients, IAuthorizationService authorization,
|
||||||
|
ProfessionalAssignments assignments)
|
||||||
|
{
|
||||||
|
if (context.GetEndpoint()?.Metadata.GetMetadata<IAllowAnonymous>() is not null)
|
||||||
|
{
|
||||||
|
await next(context);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (context.User.Identity?.IsAuthenticated != true) { context.Response.StatusCode = 401; return; }
|
||||||
|
var route = context.Request.Path.Value ?? "";
|
||||||
|
var segments = route.Trim('/').Split('/');
|
||||||
|
if (context.User.IsInRole("Service"))
|
||||||
|
{
|
||||||
|
var service = context.User.FindFirstValue(ClaimTypes.NameIdentifier);
|
||||||
|
var patientRoute = segments.Length >= 3 && segments[0] == "api" && segments[1] == "patients"
|
||||||
|
&& Guid.TryParse(segments[2], out _);
|
||||||
|
var allowed = context.Request.Method == "GET" && patientRoute && (service switch
|
||||||
|
{
|
||||||
|
"Observation" => segments.Length == 3,
|
||||||
|
"Insights" => segments.Length == 4 && segments[3] == "observations",
|
||||||
|
"HealthOverview" => segments.Length == 3 ||
|
||||||
|
(segments.Length == 4 && segments[3] == "insights") ||
|
||||||
|
(segments.Length == 5 && segments[3] == "observations" && segments[4] == "latest"),
|
||||||
|
_ => false
|
||||||
|
});
|
||||||
|
if (!allowed) { context.Response.StatusCode = 403; return; }
|
||||||
|
await next(context);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var professional = (await authorization.AuthorizeAsync(context.User, "HealthcareProfessional")).Succeeded;
|
||||||
|
if (professional)
|
||||||
|
{
|
||||||
|
if (context.Request.Method != "GET") { context.Response.StatusCode = 403; return; }
|
||||||
|
if (route.Equals("/api/professionals/me/patients", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
await next(context);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (!(await authorization.AuthorizeAsync(context.User, "Patient")).Succeeded)
|
||||||
|
{ context.Response.StatusCode = 403; return; }
|
||||||
|
if (!professional &&
|
||||||
|
((route.Equals("/api/patients", StringComparison.OrdinalIgnoreCase) && context.Request.Method == "POST")
|
||||||
|
|| (route.Equals("/api/patients/me", StringComparison.OrdinalIgnoreCase) && context.Request.Method == "GET")))
|
||||||
|
{
|
||||||
|
await next(context);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var accountId = context.User.FindFirstValue(ClaimTypes.NameIdentifier)!;
|
||||||
|
Guid? patientId = null;
|
||||||
|
if (!professional)
|
||||||
|
{
|
||||||
|
using var ownResponse = await clients.CreateClient("PatientProfile").GetAsync(
|
||||||
|
"api/patients/by-account/" + Uri.EscapeDataString(accountId), context.RequestAborted);
|
||||||
|
if (ownResponse.StatusCode == HttpStatusCode.NotFound) { context.Response.StatusCode = 404; return; }
|
||||||
|
ownResponse.EnsureSuccessStatusCode();
|
||||||
|
using var own = JsonDocument.Parse(await ownResponse.Content.ReadAsStringAsync(context.RequestAborted));
|
||||||
|
patientId = own.RootElement.GetProperty("patientId").GetGuid();
|
||||||
|
}
|
||||||
|
Guid requestedPatient;
|
||||||
|
if (segments.Length >= 3 && segments[0] == "api" && segments[1] == "patients"
|
||||||
|
&& Guid.TryParse(segments[2], out requestedPatient)) { }
|
||||||
|
else if (segments.Length == 3 && segments[0] == "api" && segments[1] == "observations"
|
||||||
|
&& Guid.TryParse(segments[2], out var observationId))
|
||||||
|
{
|
||||||
|
using var response = await clients.CreateClient("Observation").GetAsync($"api/observations/{observationId}", context.RequestAborted);
|
||||||
|
if (response.StatusCode == HttpStatusCode.NotFound) { context.Response.StatusCode = 404; return; }
|
||||||
|
response.EnsureSuccessStatusCode();
|
||||||
|
using var observation = JsonDocument.Parse(await response.Content.ReadAsStringAsync(context.RequestAborted));
|
||||||
|
requestedPatient = observation.RootElement.GetProperty("patientId").GetGuid();
|
||||||
|
}
|
||||||
|
else { context.Response.StatusCode = 404; return; }
|
||||||
|
var permitted = professional ? assignments.IsAssigned(accountId, requestedPatient) : requestedPatient == patientId;
|
||||||
|
if (!permitted) { context.Response.StatusCode = 404; return; }
|
||||||
|
await next(context);
|
||||||
|
}
|
||||||
|
catch (HttpRequestException) { await Results.Problem(statusCode: 502, title: "Ownership lookup is unavailable.").ExecuteAsync(context); }
|
||||||
|
catch (OperationCanceledException) when (!context.RequestAborted.IsCancellationRequested)
|
||||||
|
{ await Results.Problem(statusCode: 504, title: "Ownership lookup timed out.").ExecuteAsync(context); }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
namespace ApiGateway.Security;
|
||||||
|
|
||||||
|
// Application access data, separate from credentials and token contents.
|
||||||
|
public sealed class ProfessionalAssignments
|
||||||
|
{
|
||||||
|
private readonly Dictionary<string, Guid[]> assignments;
|
||||||
|
|
||||||
|
public ProfessionalAssignments(IConfiguration configuration)
|
||||||
|
{
|
||||||
|
assignments = configuration.GetSection("Access:ProfessionalAssignments")
|
||||||
|
.Get<Dictionary<string, Guid[]>>() ?? new(StringComparer.Ordinal);
|
||||||
|
foreach (var accountId in assignments.Keys.ToArray())
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(accountId) || assignments[accountId].Any(id => id == Guid.Empty))
|
||||||
|
throw new InvalidOperationException("Professional assignments require an account identifier and nonempty patient identifiers.");
|
||||||
|
assignments[accountId] = assignments[accountId].Distinct().Order().ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public IReadOnlyList<Guid> GetPatients(string accountId) =>
|
||||||
|
assignments.TryGetValue(accountId, out var patients) ? Array.AsReadOnly(patients) : Array.Empty<Guid>();
|
||||||
|
|
||||||
|
public bool IsAssigned(string accountId, Guid patientId) => GetPatients(accountId).Contains(patientId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
using Microsoft.AspNetCore.Identity;
|
||||||
|
|
||||||
|
namespace ApiGateway.Security;
|
||||||
|
|
||||||
|
public sealed class PrototypeAccount
|
||||||
|
{
|
||||||
|
public string AccountId { get; set; } = "";
|
||||||
|
public string Role { get; set; } = "Patient";
|
||||||
|
public string PasswordHash { get; set; } = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed class PrototypeAccounts
|
||||||
|
{
|
||||||
|
private readonly Dictionary<string, PrototypeAccount> accounts;
|
||||||
|
private readonly PasswordHasher<PrototypeAccount> hasher = new();
|
||||||
|
private readonly PrototypeAccount dummy = new() { AccountId = "invalid" };
|
||||||
|
|
||||||
|
public PrototypeAccounts(IConfiguration configuration)
|
||||||
|
{
|
||||||
|
var configured = configuration.GetSection("Authentication:Accounts").Get<PrototypeAccount[]>() ?? [];
|
||||||
|
if (configured.Length == 0 || configured.Any(a => string.IsNullOrWhiteSpace(a.AccountId) || a.AccountId.Length > 128 || a.AccountId.Any(c => !char.IsAsciiLetterOrDigit(c) && c is not ('-' or '_')) || string.IsNullOrWhiteSpace(a.PasswordHash)
|
||||||
|
|| a.Role is not ("Patient" or "HealthcareProfessional")))
|
||||||
|
throw new InvalidOperationException("Authentication accounts require an identifier, password hash and supported role.");
|
||||||
|
accounts = configured.ToDictionary(a => a.AccountId, StringComparer.Ordinal);
|
||||||
|
dummy.PasswordHash = hasher.HashPassword(dummy, Guid.NewGuid().ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public PrototypeAccount? Verify(string accountId, string password)
|
||||||
|
{
|
||||||
|
var known = accounts.TryGetValue(accountId, out var account);
|
||||||
|
account ??= dummy;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var result = hasher.VerifyHashedPassword(account, account.PasswordHash, password);
|
||||||
|
return known && result != PasswordVerificationResult.Failed ? account : null;
|
||||||
|
}
|
||||||
|
catch (FormatException) { return null; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using HealthOverviewService.Clients;
|
||||||
|
using HealthOverviewService.Contracts;
|
||||||
|
|
||||||
|
namespace HealthOverviewService.Application;
|
||||||
|
|
||||||
|
public sealed class HealthOverviewApplicationService(PatientProfileServiceClient patients,
|
||||||
|
ObservationServiceClient observations, InsightsServiceClient insights)
|
||||||
|
{
|
||||||
|
public async Task<HealthOverviewDto?> GetOverviewAsync(Guid patientId, DateTime from, DateTime to,
|
||||||
|
ContextSelection selection, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
from = NormalizeTimestamp(from);
|
||||||
|
to = NormalizeTimestamp(to);
|
||||||
|
if (to < from) throw new ArgumentException("The end time must not be earlier than the start time.", nameof(to));
|
||||||
|
Validator.ValidateObject(selection, new ValidationContext(selection), validateAllProperties: true);
|
||||||
|
var patient = await patients.GetPatientAsync(patientId, cancellationToken);
|
||||||
|
if (patient is null) return null;
|
||||||
|
var latest = await observations.GetLatestAsync(patientId, cancellationToken);
|
||||||
|
var insight = await insights.GetSummaryAsync(patientId, from, to, selection, cancellationToken);
|
||||||
|
return new(patient, latest, insight, from, to, selection, insight?.ContributingCount ?? 0,
|
||||||
|
"Latest overall observation for the patient, independent of the insight period and context selections. " +
|
||||||
|
"Its recorded context applies only to that observation, not to the insight's contributing observations.",
|
||||||
|
insight is null ? "No calculated insight is available: no observations match the requested period and insight selection." :
|
||||||
|
"The insight uses the requested period and context selection only. " + insight.ContextExplanation);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static DateTime NormalizeTimestamp(DateTime value) => DateTime.SpecifyKind(
|
||||||
|
value.Kind == DateTimeKind.Unspecified ? value : value.ToUniversalTime(), DateTimeKind.Unspecified);
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using System.Globalization;
|
||||||
|
using System.Net;
|
||||||
|
using System.Text.Json;
|
||||||
|
using HealthOverviewService.Contracts;
|
||||||
|
|
||||||
|
namespace HealthOverviewService.Clients;
|
||||||
|
|
||||||
|
public abstract class InsightsServiceClient
|
||||||
|
{
|
||||||
|
public abstract Task<HealthInsightDto?> GetSummaryAsync(Guid patientId, DateTime from, DateTime to, ContextSelection selection, CancellationToken cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
public sealed class HttpInsightsServiceClient(HttpClient client) : InsightsServiceClient
|
||||||
|
{
|
||||||
|
public override async Task<HealthInsightDto?> GetSummaryAsync(Guid patientId, DateTime from, DateTime to, ContextSelection selection, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
var path = $"api/patients/{patientId}/insights";
|
||||||
|
path += $"?from={Uri.EscapeDataString(from.ToString("O", CultureInfo.InvariantCulture))}&to={Uri.EscapeDataString(to.ToString("O", CultureInfo.InvariantCulture))}";
|
||||||
|
if (selection.Setting is not null) path += "&setting=" + Uri.EscapeDataString(selection.Setting);
|
||||||
|
if (selection.ActivityCondition is not null) path += "&activityCondition=" + Uri.EscapeDataString(selection.ActivityCondition);
|
||||||
|
|
||||||
|
using var response = await client.GetAsync(path, cancellationToken);
|
||||||
|
if (response.StatusCode == HttpStatusCode.NotFound) return null;
|
||||||
|
response.EnsureSuccessStatusCode();
|
||||||
|
return await response.Content.ReadFromJsonAsync<HealthInsightDto>(cancellationToken)
|
||||||
|
?? throw new JsonException("Empty upstream response.");
|
||||||
|
}
|
||||||
|
}
|
||||||
Loaded 100 of 240 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user