Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b76897d8f8 | ||
|
|
2117236366 | ||
|
|
5d9371388c | ||
|
|
e5f00796af | ||
|
|
d69fcf8c76 | ||
|
|
453e37b3c3 | ||
|
|
743674a022 | ||
|
|
17f3b0dbd3 | ||
|
|
79bb6a11cd | ||
|
|
e50cf0a011 | ||
|
|
a69b9b2118 | ||
|
|
45a040f3a2 | ||
|
|
23a824dd81 | ||
|
|
7dc4ee60f0 | ||
|
|
dd68d16eba | ||
|
|
4562497541 | ||
|
|
eedf2a941b | ||
|
|
950f67d8b7 |
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
|
||||||
@@ -6,3 +6,10 @@ TestResults/
|
|||||||
|
|
||||||
# Draw.io backup files
|
# Draw.io backup files
|
||||||
Docs/Architecture/.*.bkp
|
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>
|
||||||
@@ -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>
|
||||||
@@ -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,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.
|
||||||
@@ -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.
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
<Solution>
|
<Solution>
|
||||||
|
<Folder Name="/deploy/">
|
||||||
|
<Project Path="deploy/HealthApp.Provisioning/HealthApp.Provisioning.csproj" />
|
||||||
|
</Folder>
|
||||||
<Folder Name="/src/">
|
<Folder Name="/src/">
|
||||||
<Project Path="src/HealthOverviewService/HealthOverviewService.csproj" />
|
<Project Path="src/HealthOverviewService/HealthOverviewService.csproj" />
|
||||||
<Project Path="src/InsightsService/InsightsService.csproj" />
|
<Project Path="src/InsightsService/InsightsService.csproj" />
|
||||||
@@ -7,6 +10,7 @@
|
|||||||
<Project Path="src/ObservationService/ObservationService.csproj" />
|
<Project Path="src/ObservationService/ObservationService.csproj" />
|
||||||
</Folder>
|
</Folder>
|
||||||
<Folder Name="/tests/">
|
<Folder Name="/tests/">
|
||||||
|
<Project Path="tests/Deployment.AcceptanceTests/Deployment.AcceptanceTests.csproj" />
|
||||||
<Project Path="tests/Observation.AcceptanceTests/Observation.AcceptanceTests.csproj" />
|
<Project Path="tests/Observation.AcceptanceTests/Observation.AcceptanceTests.csproj" />
|
||||||
<Project Path="tests/PatientProfile.AcceptanceTests/PatientProfile.AcceptanceTests.csproj" />
|
<Project Path="tests/PatientProfile.AcceptanceTests/PatientProfile.AcceptanceTests.csproj" />
|
||||||
</Folder>
|
</Folder>
|
||||||
|
|||||||
@@ -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,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,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.'
|
||||||
@@ -4,4 +4,7 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="10.0.12" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -12,6 +12,7 @@ public class Program
|
|||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
builder.Host.UseWindowsService(options => options.ServiceName = "healthapp-api-gateway");
|
||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
builder.Services.AddProblemDetails();
|
builder.Services.AddProblemDetails();
|
||||||
builder.Services.AddSingleton<PrototypeAccounts>();
|
builder.Services.AddSingleton<PrototypeAccounts>();
|
||||||
|
|||||||
@@ -4,4 +4,7 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="10.0.12" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -10,6 +10,7 @@ public class Program
|
|||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
builder.Host.UseWindowsService(options => options.ServiceName = "healthapp-health-overview");
|
||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
builder.Services.AddProblemDetails();
|
builder.Services.AddProblemDetails();
|
||||||
builder.Services.AddScoped<HealthOverviewApplicationService>();
|
builder.Services.AddScoped<HealthOverviewApplicationService>();
|
||||||
|
|||||||
@@ -4,4 +4,7 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="10.0.12" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -11,6 +11,7 @@ public class Program
|
|||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
builder.Host.UseWindowsService(options => options.ServiceName = "healthapp-insights");
|
||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
builder.Services.AddProblemDetails();
|
builder.Services.AddProblemDetails();
|
||||||
builder.Services.AddScoped<InsightsApplicationService>();
|
builder.Services.AddScoped<InsightsApplicationService>();
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="10.0.12" />
|
||||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.3" />
|
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.3" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.12" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.12" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.12" PrivateAssets="all" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.12" PrivateAssets="all" />
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ public class Program
|
|||||||
public static async Task Main(string[] args)
|
public static async Task Main(string[] args)
|
||||||
{
|
{
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
builder.Host.UseWindowsService(options => options.ServiceName = "healthapp-observation");
|
||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
builder.Services.AddProblemDetails();
|
builder.Services.AddProblemDetails();
|
||||||
builder.Services.AddDbContext<ObservationDbContext>((services, options) =>
|
builder.Services.AddDbContext<ObservationDbContext>((services, options) =>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="10.0.12" />
|
||||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.3" />
|
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.3" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.12" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.12" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.12" PrivateAssets="all" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.12" PrivateAssets="all" />
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ public class Program
|
|||||||
public static async Task Main(string[] args)
|
public static async Task Main(string[] args)
|
||||||
{
|
{
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
builder.Host.UseWindowsService(options => options.ServiceName = "healthapp-patient-profile");
|
||||||
builder.Services.AddControllers();
|
builder.Services.AddControllers();
|
||||||
builder.Services.AddProblemDetails();
|
builder.Services.AddProblemDetails();
|
||||||
builder.Services.AddDbContext<PatientDbContext>((services, options) =>
|
builder.Services.AddDbContext<PatientDbContext>((services, options) =>
|
||||||
|
|||||||
@@ -295,6 +295,22 @@ US-04 tests use real HTTP between the hosts and separate temporary patient and o
|
|||||||
|
|
||||||
Dependencies: Npgsql's EF Core PostgreSQL provider supplies persistence; EF Core Relational is pinned to the same patch as EF Core Design to keep runtime/tooling versions aligned; EF Core Design supports migration maintenance. xUnit, its Visual Studio runner, Microsoft.NET.Test.Sdk, and ASP.NET Core MVC Testing are used only for automated tests. The gateway uses the platform's HttpClient and has no extra package dependency.
|
Dependencies: Npgsql's EF Core PostgreSQL provider supplies persistence; EF Core Relational is pinned to the same patch as EF Core Design to keep runtime/tooling versions aligned; EF Core Design supports migration maintenance. xUnit, its Visual Studio runner, Microsoft.NET.Test.Sdk, and ASP.NET Core MVC Testing are used only for automated tests. The gateway uses the platform's HttpClient and has no extra package dependency.
|
||||||
|
|
||||||
|
## Provisioning installer (US-16)
|
||||||
|
|
||||||
|
Build a portable release using `bash deploy/build-release.sh --output NEW_DIRECTORY`.
|
||||||
|
A normal supported Linux installation is `sudo bash install.sh --services all --host
|
||||||
|
DNS_OR_IP`; it provisions missing runtime/PostgreSQL dependencies, separate databases
|
||||||
|
and roles, generated service/account credentials, HTTPS/trust, independent configuration,
|
||||||
|
migrations, service registration/startup and installation verification. No prepared env
|
||||||
|
files, service passwords or prototype certificates are required.
|
||||||
|
|
||||||
|
Shared C# provisioning also generates Windows/macOS configuration. Native adapters use
|
||||||
|
Windows Services or launchd without changing application binaries/service boundaries.
|
||||||
|
See [INSTALLATION.md](../deploy/INSTALLATION.md) for supported hosts, native commands,
|
||||||
|
automatic SSH topology distribution, generated credentials and test evidence/limitations.
|
||||||
|
The existing `deploy/*.env.example` files remain useful for advanced/manual development;
|
||||||
|
they are no longer prerequisites for the normal installer.
|
||||||
|
|
||||||
## Linux deployment
|
## Linux deployment
|
||||||
|
|
||||||
Publish each service separately:
|
Publish each service separately:
|
||||||
|
|||||||
@@ -0,0 +1,256 @@
|
|||||||
|
# Test alignment review — 2026-10-05
|
||||||
|
|
||||||
|
Reviewed baseline: `b6342af`, including the renamed non-persistence ER illustrations.
|
||||||
|
Scope: all test classes/support/fixtures in both test projects; US-01–US-15 and
|
||||||
|
common requirements; current architecture diagrams/correction; authentication design;
|
||||||
|
relevant gateway/client/DTO behaviour needed to interpret what a test actually exercises.
|
||||||
|
|
||||||
|
Fresh verification: `dotnet test HealthApp.slnx -c Release --no-restore` against isolated
|
||||||
|
real PostgreSQL: **265 passed, zero failed, zero skipped** (29 PatientProfile, 236
|
||||||
|
Observation project). The projects also built as part of that run. The temporary database
|
||||||
|
container was removed afterwards. No implementation, requirements or test expectations
|
||||||
|
were changed by this review.
|
||||||
|
|
||||||
|
## Conclusion
|
||||||
|
|
||||||
|
The suite broadly agrees with the specified product and its logical service/data
|
||||||
|
boundaries. There is useful automated evidence for every story. However, passing
|
||||||
|
265 tests does **not** demonstrate complete acceptance or deployment coverage.
|
||||||
|
There are misleading/mismatched test fixtures and coverage gaps below. These are
|
||||||
|
primarily test-evidence findings, not proof that the corresponding production
|
||||||
|
operation is broken. Earlier claims that every acceptance criterion was covered
|
||||||
|
were too broad, especially for all-route authentication and process isolation.
|
||||||
|
|
||||||
|
Keep the existing behavioural expectations; strengthen coverage rather than
|
||||||
|
weakening tests or changing the requirements. This report replaces the earlier
|
||||||
|
coverage review's remaining-work conclusions for test alignment only; that older
|
||||||
|
review remains a historical pre-implementation snapshot.
|
||||||
|
|
||||||
|
## Findings and recommended corrections
|
||||||
|
|
||||||
|
### F1 — High: authentication coverage is incomplete for the current route set
|
||||||
|
|
||||||
|
References:
|
||||||
|
- `tests/Observation.AcceptanceTests/PatientAuthenticationTests.cs:63`
|
||||||
|
- `tests/Observation.AcceptanceTests/PatientAuthenticationTests.cs:200`
|
||||||
|
- `tests/Observation.AcceptanceTests/ProfessionalAccessTests.cs:197`
|
||||||
|
- `tests/Observation.AcceptanceTests/PatchObservationTests.cs:182`
|
||||||
|
- `tests/Observation.AcceptanceTests/HealthTrendTests.cs:383`
|
||||||
|
- `tests/Observation.AcceptanceTests/HealthOverviewTests.cs:196`
|
||||||
|
|
||||||
|
US-13 explicitly applies missing, invalid and expired authentication behaviour to
|
||||||
|
every applicable operation. The test named
|
||||||
|
`Missing_and_invalid_tokens_reject_every_existing_patient_operation` omits PATCH,
|
||||||
|
trends and overview. PATCH separately checks missing/invalid tokens, and trend/
|
||||||
|
overview tests separately check missing tokens and owner/assignment rejection.
|
||||||
|
Expired-token testing is concentrated on profile retrieval and assignment-list access;
|
||||||
|
invalid/expired-token rejection is not explicitly exercised for trends and overview.
|
||||||
|
The additional shared middleware makes rejection plausible, but is not equivalent to
|
||||||
|
an assertion on each endpoint (an accidental endpoint exception could escape).
|
||||||
|
|
||||||
|
Recommendation: a route/method table using real login, existing protected resources,
|
||||||
|
valid request bodies/periods, and explicit actors. Cover missing/invalid/expired tokens,
|
||||||
|
patient-owner/other-patient and assigned/unassigned professional reads. Verify no
|
||||||
|
protected body and unchanged state on rejected writes. Include PATCH and both newer
|
||||||
|
GET routes. This extends documented scenarios, not product functionality.
|
||||||
|
|
||||||
|
### F2 — Medium: several missing-resource tests pass before reaching the intended service
|
||||||
|
|
||||||
|
References:
|
||||||
|
- `tests/Support/AuthenticatedTestClient.cs:76`
|
||||||
|
- `tests/PatientProfile.AcceptanceTests/CreatePatientTests.cs:94`
|
||||||
|
- `tests/PatientProfile.AcceptanceTests/UpdatePatientTests.cs:36`
|
||||||
|
- `tests/Observation.AcceptanceTests/RecordObservationTests.cs:113`
|
||||||
|
- `tests/Observation.AcceptanceTests/UpdateObservationTests.cs:112`
|
||||||
|
- `tests/Observation.AcceptanceTests/PatchObservationTests.cs:169`
|
||||||
|
- `tests/Observation.AcceptanceTests/DeleteObservationTests.cs:79`
|
||||||
|
- `src/ApiGateway/Security/PatientAccessMiddleware.cs`
|
||||||
|
|
||||||
|
For an unknown identifier the automatic authenticated client falls back to its last
|
||||||
|
account. An account without a profile, or an account whose own profile differs from
|
||||||
|
the random patient ID, gets an empty gateway 404 before the requested profile/record
|
||||||
|
operation is called. Observation-ID operations resolve the observation during access
|
||||||
|
checking and return 404 there before forwarding update/patch/delete to the operation.
|
||||||
|
|
||||||
|
Those tests validly establish public rejection/non-disclosure/no mutation. They do
|
||||||
|
not separately prove the downstream controller/application/repository missing-resource
|
||||||
|
handling suggested by their names. Common requirements assume authorised callers for
|
||||||
|
ordinary missing-resource scenarios; the distinction should be explicit.
|
||||||
|
|
||||||
|
There is already a genuinely assigned missing-profile GET test under US-14 and an
|
||||||
|
assigned missing-profile Overview test, so missing profile reads are not entirely
|
||||||
|
uncovered. Unknown observation ownership cannot simply be assigned to a caller.
|
||||||
|
|
||||||
|
Recommendation: retain the public security tests and label them accurately. Add
|
||||||
|
service-component tests or authenticated internal-service HTTP tests for the remaining
|
||||||
|
missing-resource branches, using the actual service protection mechanism. Do not relax
|
||||||
|
public ownership checks or invent a public route that bypasses authorization.
|
||||||
|
|
||||||
|
### F3 — Medium: trend calculator fixtures declare selections inconsistent with their data
|
||||||
|
|
||||||
|
References:
|
||||||
|
- `tests/Observation.AcceptanceTests/HealthTrendTests.cs:20`
|
||||||
|
- `tests/Observation.AcceptanceTests/HealthTrendTests.cs:113`
|
||||||
|
- `tests/Observation.AcceptanceTests/HealthTrendTests.cs:137`
|
||||||
|
- `tests/Observation.AcceptanceTests/HealthTrendTests.cs:187`
|
||||||
|
|
||||||
|
The calculator helper always supplies `Home` and `AtRest`. Some callers supply Clinic,
|
||||||
|
Unknown or AfterActivity observations. In the architecture the calculator consumes
|
||||||
|
already-selected observations; the HTTP history client performs selection. These
|
||||||
|
fixtures therefore describe an impossible selected-input/result-metadata combination
|
||||||
|
for those cases. Their numerical/context assertions are still useful unit assertions,
|
||||||
|
but they cannot demonstrate a valid selected-series assessment.
|
||||||
|
|
||||||
|
Recommendation: let the helper accept an explicit selection. Use unrestricted
|
||||||
|
selection for mixed/unknown series and the matching Clinic selection for Clinic-only
|
||||||
|
series. Assert selection metadata as well as the relevant numerical/context behaviour.
|
||||||
|
Keep actual selection/exclusion assertions in the existing HTTP tests.
|
||||||
|
|
||||||
|
### F4 — Medium: the suite does not verify independent OS-process deployment
|
||||||
|
|
||||||
|
References:
|
||||||
|
- `tests/Observation.AcceptanceTests/ObservationApiFixture.cs:66`
|
||||||
|
- `tests/PatientProfile.AcceptanceTests/PatientApiFixture.cs:49`
|
||||||
|
- the microservice process boundary in `AGENTS.md`
|
||||||
|
- `Docs/Architecture/02_microservice_architecture.jpg`
|
||||||
|
|
||||||
|
The main fixture creates real Kestrel endpoints and real HTTP calls, but all five
|
||||||
|
WebApplicationFactory hosts live inside the test process. The profile fixture uses
|
||||||
|
Kestrel for the profile and a gateway test server. Restart methods recreate hosts;
|
||||||
|
they do not restart separate operating-system processes. Development uses loopback
|
||||||
|
HTTP and a common fixture gateway-key value for multiple services.
|
||||||
|
|
||||||
|
This is an acceptable integration-test arrangement, not itself a production architecture
|
||||||
|
violation. It cannot certify separate deployment, separate-machine networking,
|
||||||
|
production HTTPS/certificate configuration, independently surviving process failure,
|
||||||
|
systemd behaviour, or per-service credentials in an actual deployment. Test-only
|
||||||
|
project references and fixture DB inspection/seeding are not production cross-service
|
||||||
|
coupling; common requirements explicitly allow independent scenario setup.
|
||||||
|
|
||||||
|
Recommendation: add a small separate-process acceptance/smoke test that starts the
|
||||||
|
published five executables with external configuration, distinct service credentials,
|
||||||
|
and independent patient/observation databases. Exercise representative reads/writes
|
||||||
|
and stop/restart an individual process. A deployment check should additionally verify
|
||||||
|
production HTTPS and systemd on the intended Linux hosts. Separate-machine operation
|
||||||
|
requires deployment evidence or equivalent network separation, not a claim based on
|
||||||
|
localhost tests alone. These checks need not replace fast existing integration tests.
|
||||||
|
|
||||||
|
### F5 — Medium: US-11 clinical/context edge cases are mostly calculator-level evidence
|
||||||
|
|
||||||
|
References:
|
||||||
|
- `tests/Observation.AcceptanceTests/HealthTrendTests.cs:12`
|
||||||
|
- `tests/Observation.AcceptanceTests/HealthTrendTests.cs:149`
|
||||||
|
- `tests/Observation.AcceptanceTests/HealthTrendTests.cs:173`
|
||||||
|
- `tests/Observation.AcceptanceTests/HealthTrendTests.cs:237`
|
||||||
|
- `tests/Observation.AcceptanceTests/HealthTrendTests.cs:341`
|
||||||
|
- US-11 context scenarios and AC-11-A through AC-11-N
|
||||||
|
|
||||||
|
Separate metric interpretations, reversals, equal-timestamp handling and exercise-
|
||||||
|
narrative conflict are checked directly against InsightCalculator. HTTP tests cover
|
||||||
|
scope, filters, counts, invalid requests, context correction, deletion and access.
|
||||||
|
The layers together provide substantial evidence, but there is no full HTTP conflict
|
||||||
|
scenario proving original text travels from PostgreSQL through both gateway calls
|
||||||
|
into the trend calculation, nor an HTTP all-tied-timestamps scenario or a HTTP
|
||||||
|
storage/insertion-order equivalence check. Context clearing affecting clinical
|
||||||
|
interpretation is not directly checked by the trend API tests.
|
||||||
|
|
||||||
|
Recommendation: add representative end-to-end cases for conflicting recorded text,
|
||||||
|
all-tied timestamps, context clearing and order independence. For clearing, preserve
|
||||||
|
numerical description but check withdrawn references/changed comparability and correct
|
||||||
|
Unknown-only selection. Verify all three metrics' relevant fields, not just systolic.
|
||||||
|
|
||||||
|
The current missing-optional-details tests use either fully populated preparation
|
||||||
|
fields except additional circumstances, or all preparation fields missing. Add
|
||||||
|
individual omitted-detail cases to test US-11's narrower rule that a missing optional
|
||||||
|
detail only limits claims that depend on it. Distinguish reference comparison from
|
||||||
|
stronger trajectory/comparability claims; do not add invented clinical thresholds.
|
||||||
|
|
||||||
|
### F6 — Lower priority: Overview's unknown-context case is not a fully absent-context fixture
|
||||||
|
|
||||||
|
Reference: `tests/Observation.AcceptanceTests/HealthOverviewTests.cs:110`.
|
||||||
|
|
||||||
|
That case submits null setting/activity but still supplies rest, posture, arm, device
|
||||||
|
and cuff through the record helper. It correctly verifies unknown categories. It does
|
||||||
|
not prove all preparation details remain absent when the latest reading truly has no
|
||||||
|
context while an older reading has complete context.
|
||||||
|
|
||||||
|
Recommendation: add an older complete reading and a newest submission omitting the
|
||||||
|
entire context object, then assert Unknown categories and null optional fields in
|
||||||
|
latest. Assert that the insight's own context explanation is retained independently.
|
||||||
|
|
||||||
|
## Additional evidence limits
|
||||||
|
|
||||||
|
- Tests asserting clinical boundaries, a source-domain substring or words such as
|
||||||
|
"favourable" are regression evidence for the chosen implementation. They do not
|
||||||
|
independently validate the medical applicability of each inference. The US-11
|
||||||
|
source-to-claim mapping in `src/TRENDS.md` remains part of the evidence and needs
|
||||||
|
explicit review when rules or sources change. This audit is not a clinical validation.
|
||||||
|
- The documented OLS slope has sign checks, but no exact irregular-spacing slope
|
||||||
|
fixture. A deterministic example with a hand-calculated slope would strengthen
|
||||||
|
evidence for the documented mathematical method without prescribing a new method.
|
||||||
|
- The suite verifies offset equivalence but does not rerun equivalent requests under
|
||||||
|
different service time zones. That would strengthen the machine-independent
|
||||||
|
offset-free UTC contract.
|
||||||
|
- HTTP failure tests usually stop a dependency to provoke a connection failure.
|
||||||
|
Invalid upstream JSON, upstream timeouts and client-disconnect cancellation are
|
||||||
|
not comprehensively tested. These are robustness/implementation-contract coverage
|
||||||
|
suggestions, not new user-story acceptance criteria.
|
||||||
|
- Many tests assert exact HTTP status, DTO equality, headers and explanation wording.
|
||||||
|
These are compatible implementation contracts, but common requirements do not make
|
||||||
|
every exact string/status a product requirement. Keep essential behaviour checks
|
||||||
|
distinct from presentation-contract regression tests.
|
||||||
|
|
||||||
|
## Story-to-test traceability
|
||||||
|
|
||||||
|
This table identifies existing evidence and qualifications, not an assertion that
|
||||||
|
all possible cases or every deployment property have been proven.
|
||||||
|
|
||||||
|
| Story | Existing automated evidence | Qualification |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| US-01 | CreatePatientTests; PatientAuthenticationTests login/create/retry/concurrency/restart/database-trigger rollback | Atomic association and recovery tested; F1 applies to cross-cutting authentication. |
|
||||||
|
| US-02 | CreatePatientTests retrieval after restart; ProfessionalAccessTests assigned/missing profile reads | Legacy random-ID test is gateway rejection (F2); assigned missing read is genuine evidence. |
|
||||||
|
| US-03 | UpdatePatientTests update/restart/no-mutation validation; ProfessionalAccessTests forbidden writes | Missing update is gateway rejection, not independent service behaviour (F2). |
|
||||||
|
| US-04 | RecordObservationTests; RecordMeasurementContextTests; MeasurementContextMigrationTests | Values, partial/absent/conflicting context, validation, migration and access covered; missing-patient recording needs F2 qualification. |
|
||||||
|
| US-05 | ViewObservationContextTests; RecordObservationTests; professional/ownership tests | Complete/partial/historical text and protected context have strong evidence; missing ID often stops at ownership lookup. |
|
||||||
|
| US-06 | LatestObservationTests | Actual deterministic seeded measurement/recording/ID ties and edits/restart covered. DB seeding is explicitly allowed. |
|
||||||
|
| US-07 | ObservationHistoryTests; ContextFilteredHistoryTests | Independent/combined/unknown filters, metadata, chronology, inclusive/equal/offset bounds and access covered. |
|
||||||
|
| US-08 | UpdateObservationTests; PatchObservationTests; selected-insight/trend/overview freshness tests | Partial correction/clearing/atomic rejection covered; F2 for missing operation and F5 for cleared trend interpretation. |
|
||||||
|
| US-09 | DeleteObservationTests; DeleteContextualisedObservationTests; trend/overview deletion tests | Persisted removal and exclusion are covered; missing delete component path is F2. |
|
||||||
|
| US-10 | HealthInsightTests; ContextSelectedInsightTests | Arithmetic means/extrema, exact rounding fixtures, selection metadata, pooled context and freshness covered. |
|
||||||
|
| US-11 | HealthTrendCalculationTests and HealthTrendTests (both in HealthTrendTests.cs) | Explicit AC-A–N numerical/interpretation evidence is divided between unit and HTTP tests; F3/F5 and source-validation limits apply. |
|
||||||
|
| US-12 | HealthOverviewTests | Profile/latest/selected insight/empty insight/limits/freshness/access/failure covered; F1/F4/F6 remain. |
|
||||||
|
| US-13 | PatientAuthenticationTests; AuthenticationIntegrationTests; story-level access tests | Real credentials/bearer validation/expiration/tampering/association tested; complete operation matrix missing (F1). |
|
||||||
|
| US-14 | ProfessionalAccessTests; story-level assigned/unassigned/write-rejection tests | Multiple/shared/empty assignments, spoofing, ownership and non-disclosure covered; newer-route invalid/expired authentication still F1. |
|
||||||
|
| US-15 | MeasurementGuidanceTests; RecordObservationTests valid submissions without guidance | Public, labelled, sourced, ordered/static guidance and no upstream access covered; source accuracy is not established by string assertions alone. |
|
||||||
|
|
||||||
|
## Architecture alignment
|
||||||
|
|
||||||
|
- Main interservice flows are actual HTTP through the API Gateway, consistent with
|
||||||
|
Observation, Insights and Overview class models. Production projects do not contain
|
||||||
|
references to other service implementations.
|
||||||
|
- Patient and observation fixture databases are separate. Migration/persistence tests
|
||||||
|
inspect only controlled test databases. This does not authorize production services
|
||||||
|
to access another service's database.
|
||||||
|
- Insights and Overview have no DB/repository registration; freshness is tested with
|
||||||
|
current corrections and deletions. The explicitly renamed ER illustrations do not
|
||||||
|
require persisted calculated results.
|
||||||
|
- The real authentication implementation is used for main functional/security tests.
|
||||||
|
A replacement handler is used only in specifically labelled replaceability tests;
|
||||||
|
it is not evidence for bearer cryptography and is not a measured workload.
|
||||||
|
- Fixtures replace the clock for deterministic expiry and load synthetic accounts;
|
||||||
|
deployment/measurement must use recorded production settings and real service
|
||||||
|
processes. The current test harness is not an energy-measurement workload.
|
||||||
|
- Production HTTPS is tested narrowly for the gateway login/guidance entry point.
|
||||||
|
Main service integration uses Development HTTP. Production transport protection
|
||||||
|
for every service and systemd deployment remains a separate verification task.
|
||||||
|
|
||||||
|
## Recommended next work
|
||||||
|
|
||||||
|
1. Complete the current route/method authentication matrix (F1).
|
||||||
|
2. Correct the inconsistent trend unit-fixture selections (F3) and clarify/add
|
||||||
|
missing-resource component evidence (F2).
|
||||||
|
3. Add the small number of end-to-end trend and absent-context overview cases (F5/F6).
|
||||||
|
4. Verify the separate-process deployed baseline (F4), before architectural/energy comparison.
|
||||||
|
|
||||||
|
No architecture redesign or requirement rewrite is needed to improve these tests.
|
||||||
|
The review does not approve changed clinical rules or new product behaviour.
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
using System.Runtime.Versioning;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace Deployment.AcceptanceTests;
|
||||||
|
|
||||||
|
[SupportedOSPlatform("linux")]
|
||||||
|
public sealed class BootstrapTests
|
||||||
|
{
|
||||||
|
[Theory]
|
||||||
|
[InlineData("ubuntu", "24.04", false, false, false)]
|
||||||
|
[InlineData("ubuntu", "24.04", true, true, false)]
|
||||||
|
[InlineData("ubuntu", "24.04", true, true, true)]
|
||||||
|
[InlineData("ubuntu", "26.04", false, true, false)]
|
||||||
|
[InlineData("ubuntu", "26.04", true, true, true)]
|
||||||
|
[InlineData("debian", "12", true, false, false)]
|
||||||
|
[InlineData("debian", "13", false, true, false)]
|
||||||
|
[InlineData("linuxmint", "22", false, true, false, "ubuntu debian")]
|
||||||
|
[InlineData("pop", "future", false, false, false, "ubuntu")]
|
||||||
|
[InlineData("ubuntu", "future", false, false, false)]
|
||||||
|
[InlineData("debian", "13", false, false, false, "", false)]
|
||||||
|
[InlineData("linuxmint", "22", false, false, false, "ubuntu debian", false, true, true, "aspnetcore-runtime-10.0 is unavailable")]
|
||||||
|
[InlineData("debian", "99", false, false, false, "", false, true, false, "No accessible Microsoft Debian 99 repository")]
|
||||||
|
[InlineData("ubuntu", "26.04", true, true, false, "", true, false, true, "Required package postgresql is unavailable")]
|
||||||
|
[InlineData("fedora", "44", true, false, false, "", true, true, true, "requires a Debian/Ubuntu-based distribution")]
|
||||||
|
public async Task Package_provisioning_detects_runtime_and_postgresql_and_installs_only_needed_dependencies(
|
||||||
|
string distribution, string version, bool runtimeAvailable, bool databaseRequired, bool databaseAvailable,
|
||||||
|
string ancestry = "", bool runtimePackage = true, bool postgresPackage = true,
|
||||||
|
bool repositoryAvailable = true, string expectedError = "")
|
||||||
|
{
|
||||||
|
var directory = Path.Combine(Path.GetTempPath(), "healthapp-bootstrap-" + Guid.NewGuid().ToString("N"));
|
||||||
|
Directory.CreateDirectory(directory);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var log = Path.Combine(directory, "commands");
|
||||||
|
await File.WriteAllTextAsync(log, "");
|
||||||
|
var installed = Path.Combine(directory, "runtime-installed");
|
||||||
|
var script = Path.Combine(directory, "test.sh");
|
||||||
|
await File.WriteAllTextAsync(script, """
|
||||||
|
set -euo pipefail
|
||||||
|
fail() { printf '%s\n' "$*" >&2; exit 1; }
|
||||||
|
runtime() { if [[ "$RUNTIME_PRESENT" == true || -f "$RUNTIME_INSTALLED" ]]; then printf '%s\n' 'Microsoft.AspNetCore.App 10.0.12 [runtime]'; else return 1; fi; }
|
||||||
|
apt-get() { printf '%s\n' "apt-get $*" >> "$COMMAND_LOG"; if [[ "$*" == *aspnetcore-runtime-10.0* ]]; then touch "$RUNTIME_INSTALLED"; fi; }
|
||||||
|
apt-cache() {
|
||||||
|
if [[ "$2" == aspnetcore-runtime-10.0 && ( "$RUNTIME_PACKAGE" == true || -f "$REPOSITORY_ADDED" ) || "$2" == postgresql && "$POSTGRES_PACKAGE" == true ]]; then
|
||||||
|
printf '%s\n' ' Candidate: 10.0.1';
|
||||||
|
else printf '%s\n' ' Candidate: (none)'; fi
|
||||||
|
}
|
||||||
|
curl() { [[ "$REPOSITORY_AVAILABLE" == true ]] || return 22; printf '%s\n' "curl $*" >> "$COMMAND_LOG"; }
|
||||||
|
update-ca-certificates() { :; }
|
||||||
|
dpkg() { printf '%s\n' "dpkg $*" >> "$COMMAND_LOG"; touch "$REPOSITORY_ADDED"; }
|
||||||
|
pg_isready() { [[ -f "$DATABASE_READY" ]]; }
|
||||||
|
systemctl() { printf '%s\n' "systemctl $*" >> "$COMMAND_LOG"; touch "$DATABASE_READY"; }
|
||||||
|
source "$BOOTSTRAP"
|
||||||
|
ensure_dependencies "$DISTRO" "$VERSION" /bin/true "$DATABASE_REQUIRED" "$ANCESTRY"
|
||||||
|
""");
|
||||||
|
// Runtime is an executable stub; installed packages switch its simulated inventory.
|
||||||
|
var runtime = Path.Combine(directory, "dotnet");
|
||||||
|
await File.WriteAllTextAsync(runtime, "#!/bin/bash\nif [[ \"$RUNTIME_PRESENT\" == true || -f \"$RUNTIME_INSTALLED\" ]]; then printf '%s\\n' 'Microsoft.AspNetCore.App 10.0.12 [runtime]'; else exit 1; fi\n");
|
||||||
|
File.SetUnixFileMode(runtime, UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute);
|
||||||
|
var body = (await File.ReadAllTextAsync(script)).Replace("/bin/true", "\"$RUNTIME_EXECUTABLE\"");
|
||||||
|
await File.WriteAllTextAsync(script, body);
|
||||||
|
var environment = new Dictionary<string, string>
|
||||||
|
{
|
||||||
|
["COMMAND_LOG"] = log, ["RUNTIME_INSTALLED"] = installed,
|
||||||
|
["RUNTIME_PRESENT"] = runtimeAvailable ? "true" : "false", ["RUNTIME_EXECUTABLE"] = runtime,
|
||||||
|
["DATABASE_READY"] = Path.Combine(directory, "pg-ready"), ["DATABASE_REQUIRED"] = databaseRequired ? "true" : "false",
|
||||||
|
["ANCESTRY"] = ancestry, ["RUNTIME_PACKAGE"] = runtimePackage ? "true" : "false",
|
||||||
|
["POSTGRES_PACKAGE"] = postgresPackage ? "true" : "false", ["REPOSITORY_AVAILABLE"] = repositoryAvailable ? "true" : "false",
|
||||||
|
["REPOSITORY_ADDED"] = Path.Combine(directory, "repository-added"),
|
||||||
|
["BOOTSTRAP"] = Path.Combine(DeploymentFixture.Repository, "deploy/installer/bootstrap.sh"), ["DISTRO"] = distribution, ["VERSION"] = version
|
||||||
|
};
|
||||||
|
if (databaseAvailable) await File.WriteAllTextAsync(environment["DATABASE_READY"], "ready");
|
||||||
|
var result = await DeploymentFixture.Run("bash", [script], environment);
|
||||||
|
if (expectedError.Length > 0)
|
||||||
|
{
|
||||||
|
Assert.NotEqual(0, result.Code);
|
||||||
|
Assert.Contains(expectedError, result.Output);
|
||||||
|
var failedCommands = await File.ReadAllTextAsync(log);
|
||||||
|
Assert.DoesNotContain("install -y aspnetcore-runtime-10.0", failedCommands);
|
||||||
|
Assert.DoesNotContain("install -y postgresql", failedCommands);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Assert.True(result.Code == 0, result.Output);
|
||||||
|
var commands = await File.ReadAllTextAsync(log);
|
||||||
|
Assert.Equal(!runtimeAvailable, commands.Contains("install -y aspnetcore-runtime-10.0"));
|
||||||
|
Assert.Equal(databaseRequired && !databaseAvailable, commands.Contains("install -y postgresql"));
|
||||||
|
Assert.Equal(databaseRequired && !databaseAvailable, commands.Contains("systemctl enable --now postgresql"));
|
||||||
|
Assert.Equal(!runtimeAvailable && !runtimePackage && distribution == "debian", commands.Contains("packages.microsoft.com/config/debian/" + version));
|
||||||
|
}
|
||||||
|
finally { Directory.Delete(directory, true); }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<IsPackable>false</IsPackable>
|
||||||
|
<IsTestProject>true</IsTestProject>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||||
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
|
||||||
|
<PackageReference Include="xunit" Version="2.9.3" />
|
||||||
|
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" PrivateAssets="all" />
|
||||||
|
<PackageReference Include="Npgsql" Version="10.0.3" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
@@ -0,0 +1,197 @@
|
|||||||
|
using System.Diagnostics;
|
||||||
|
using System.Net;
|
||||||
|
using System.Net.Sockets;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
using System.Security.Cryptography.X509Certificates;
|
||||||
|
using System.Net.Security;
|
||||||
|
using System.Text.Json;
|
||||||
|
using System.Runtime.Versioning;
|
||||||
|
using Npgsql;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace Deployment.AcceptanceTests;
|
||||||
|
|
||||||
|
[SupportedOSPlatform("linux")]
|
||||||
|
public sealed class DeploymentFixture : IAsyncLifetime
|
||||||
|
{
|
||||||
|
public static readonly string[] Services = ["api-gateway", "patient-profile", "observation", "insights", "health-overview"];
|
||||||
|
public static string Assembly(string service) => service switch
|
||||||
|
{
|
||||||
|
"api-gateway" => "ApiGateway", "patient-profile" => "PatientProfileService",
|
||||||
|
"observation" => "ObservationService", "insights" => "InsightsService", _ => "HealthOverviewService"
|
||||||
|
};
|
||||||
|
public static string Repository
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var directory = new DirectoryInfo(AppContext.BaseDirectory);
|
||||||
|
while (directory is not null && !File.Exists(Path.Combine(directory.FullName, "HealthApp.slnx"))) directory = directory.Parent;
|
||||||
|
return directory?.FullName ?? throw new InvalidOperationException("Repository root not found.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string Dotnet { get; } = Environment.GetEnvironmentVariable("HEALTHAPP_DOTNET") ??
|
||||||
|
Environment.GetEnvironmentVariable("DOTNET_HOST_PATH") ?? "dotnet";
|
||||||
|
public string Temporary { get; } = Path.Combine(Path.GetTempPath(), "healthapp-us16-" + Guid.NewGuid().ToString("N"));
|
||||||
|
public string Bundle => Path.Combine(Temporary, "release");
|
||||||
|
public string Deployment => Path.Combine(Temporary, "deployment");
|
||||||
|
public string AdminFile => Path.Combine(Temporary, "admin.connection");
|
||||||
|
public string Root => Path.Combine(Temporary, "installed");
|
||||||
|
public Dictionary<string, string> Urls { get; } = new();
|
||||||
|
public Dictionary<string, Dictionary<string, string>> Settings { get; } = new();
|
||||||
|
public Dictionary<string, Process> Processes { get; } = new();
|
||||||
|
private readonly List<string> databases = [];
|
||||||
|
public string Admin { get; private set; } = "";
|
||||||
|
public string Password { get; private set; } = "";
|
||||||
|
private readonly List<string> roles = [];
|
||||||
|
|
||||||
|
public async Task InitializeAsync()
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(Temporary);
|
||||||
|
Admin = Environment.GetEnvironmentVariable("TEST_POSTGRES_CONNECTION") ?? throw new InvalidOperationException("TEST_POSTGRES_CONNECTION is required.");
|
||||||
|
var release = await Run("bash", [Path.Combine(Repository, "deploy/build-release.sh"), "--output", Bundle],
|
||||||
|
new() { ["HEALTHAPP_DOTNET"] = Dotnet });
|
||||||
|
Assert.True(release.Code == 0, release.Output);
|
||||||
|
var ports = new Dictionary<string, int>();
|
||||||
|
foreach (var service in Services)
|
||||||
|
{
|
||||||
|
using var listener = new TcpListener(IPAddress.Loopback, 0);
|
||||||
|
listener.Start();
|
||||||
|
ports[service] = ((IPEndPoint)listener.LocalEndpoint).Port;
|
||||||
|
}
|
||||||
|
var hosts = Services.Select((name, index) => (name, index)).ToDictionary(p => p.name, p => "127.0.0." + (p.index + 1));
|
||||||
|
var topology = Path.Combine(Temporary, "topology.json");
|
||||||
|
await File.WriteAllTextAsync(topology, JsonSerializer.Serialize(new { hosts, ports }));
|
||||||
|
var prepared = await Provision("prepare", "--output", Deployment, "--topology", topology);
|
||||||
|
Assert.True(prepared.Code == 0, prepared.Output);
|
||||||
|
await File.WriteAllTextAsync(AdminFile, Admin);
|
||||||
|
File.SetUnixFileMode(AdminFile, UnixFileMode.UserRead | UnixFileMode.UserWrite);
|
||||||
|
var installation = await Run("bash", [Path.Combine(Bundle, "install.sh"), "--services", "all", "--deployment", Deployment,
|
||||||
|
"--postgres-admin-file", AdminFile, "--root", Root, "--dotnet", Dotnet]);
|
||||||
|
Assert.Equal(0, installation.Code);
|
||||||
|
using var accounts = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(Deployment, "accounts.json")));
|
||||||
|
Password = accounts.RootElement.EnumerateArray().Single(a => a.GetProperty("AccountId").GetString() == "prototype-patient").GetProperty("Password").GetString()!;
|
||||||
|
foreach (var service in Services)
|
||||||
|
{
|
||||||
|
Settings[service] = ReadEnvironment(Root, service);
|
||||||
|
Settings[service]["SSL_CERT_FILE"] = Path.Combine(Deployment, "healthapp-ca.crt");
|
||||||
|
Settings[service]["Logging__LogLevel__Default"] = "Warning";
|
||||||
|
Settings[service]["Logging__LogLevel__Microsoft.AspNetCore"] = "Warning";
|
||||||
|
Urls[service] = $"https://{hosts[service]}:{ports[service]}/";
|
||||||
|
}
|
||||||
|
foreach (var service in new[] { "patient-profile", "observation" })
|
||||||
|
{
|
||||||
|
var key = service == "patient-profile" ? "ConnectionStrings__PatientDatabase" : "ConnectionStrings__ObservationDatabase";
|
||||||
|
var db = new NpgsqlConnectionStringBuilder(Settings[service][key]);
|
||||||
|
databases.Add(db.Database!); roles.Add(db.Username!);
|
||||||
|
var migrated = await Run(Dotnet, [InstalledAssembly(service), "--migrate"], Settings[service]);
|
||||||
|
Assert.True(migrated.Code == 0, "Deployment database migration failed.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<(int Code, string Output)> Provision(params string[] arguments) => Run(Dotnet,
|
||||||
|
[Path.Combine(Bundle, "provisioner/HealthApp.Provisioning.dll"), .. arguments]);
|
||||||
|
public static Dictionary<string, string> ReadEnvironment(string root, string service) =>
|
||||||
|
File.ReadAllLines(Path.Combine(root, "etc/healthapp", service, "service.env")).ToDictionary(
|
||||||
|
line => line[..line.IndexOf('=')], line => JsonSerializer.Deserialize<string>(line[(line.IndexOf('=') + 1)..])!);
|
||||||
|
public HttpClient HttpClient()
|
||||||
|
{
|
||||||
|
var handler = new HttpClientHandler { ServerCertificateCustomValidationCallback = (_, certificate, _, errors) =>
|
||||||
|
{
|
||||||
|
if (certificate is null || (errors & (SslPolicyErrors.RemoteCertificateNameMismatch | SslPolicyErrors.RemoteCertificateNotAvailable)) != 0) return false;
|
||||||
|
using var root = X509CertificateLoader.LoadCertificateFromFile(Path.Combine(Deployment, "healthapp-ca.crt"));
|
||||||
|
using var chain = new X509Chain();
|
||||||
|
chain.ChainPolicy.TrustMode = X509ChainTrustMode.CustomRootTrust;
|
||||||
|
chain.ChainPolicy.CustomTrustStore.Add(root);
|
||||||
|
chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck;
|
||||||
|
return chain.Build(certificate);
|
||||||
|
}};
|
||||||
|
return new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(10) };
|
||||||
|
}
|
||||||
|
|
||||||
|
public string InstalledAssembly(string service) => Path.Combine(Root, "opt/healthapp", service, Assembly(service) + ".dll");
|
||||||
|
public Task<(int Code, string Output)> Install(string root, string services) => Run("bash",
|
||||||
|
[Path.Combine(Bundle, "install.sh"), "--services", services, "--deployment", Deployment, "--root", root, "--dotnet", Dotnet]);
|
||||||
|
|
||||||
|
public async Task Start(string service, string? root = null)
|
||||||
|
{
|
||||||
|
var start = new ProcessStartInfo(Dotnet) { WorkingDirectory = Path.Combine(root ?? Root, "opt/healthapp", service),
|
||||||
|
RedirectStandardOutput = true, RedirectStandardError = true, UseShellExecute = false };
|
||||||
|
start.ArgumentList.Add(Path.Combine(root ?? Root, "opt/healthapp", service, Assembly(service) + ".dll"));
|
||||||
|
foreach (var (key, value) in ReadEnvironment(root ?? Root, service)) start.Environment[key] = value;
|
||||||
|
start.Environment["SSL_CERT_FILE"] = Path.Combine(Deployment, "healthapp-ca.crt");
|
||||||
|
start.Environment["Logging__LogLevel__Default"] = "Warning";
|
||||||
|
var process = Process.Start(start)!;
|
||||||
|
// Do not emit application logs containing potentially sensitive deployment information.
|
||||||
|
process.OutputDataReceived += (_, _) => { };
|
||||||
|
process.ErrorDataReceived += (_, _) => { };
|
||||||
|
process.BeginOutputReadLine(); process.BeginErrorReadLine();
|
||||||
|
Processes[service] = process;
|
||||||
|
using var client = HttpClient();
|
||||||
|
for (var attempt = 0; attempt < 100; attempt++)
|
||||||
|
{
|
||||||
|
Assert.False(process.HasExited, $"{service} exited during startup.");
|
||||||
|
try { using var response = await client.GetAsync(Urls[service]); return; }
|
||||||
|
catch (HttpRequestException) { }
|
||||||
|
catch (TaskCanceledException) { }
|
||||||
|
await Task.Delay(100);
|
||||||
|
}
|
||||||
|
throw new TimeoutException($"{service} did not accept configured network traffic.");
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task Stop(string service)
|
||||||
|
{
|
||||||
|
if (!Processes.Remove(service, out var process)) return;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!process.HasExited)
|
||||||
|
{
|
||||||
|
// SIGINT is also the committed systemd unit's graceful stop signal.
|
||||||
|
var sent = await Run("kill", ["-INT", process.Id.ToString()]);
|
||||||
|
Assert.Equal(0, sent.Code);
|
||||||
|
using var deadline = new CancellationTokenSource(TimeSpan.FromSeconds(15));
|
||||||
|
try { await process.WaitForExitAsync(deadline.Token); }
|
||||||
|
catch (OperationCanceledException) { process.Kill(true); await process.WaitForExitAsync(); throw; }
|
||||||
|
Assert.Equal(0, process.ExitCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally { process.Dispose(); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<(int Code, string Output)> Run(string executable, string[] arguments,
|
||||||
|
Dictionary<string, string>? environment = null, string? workingDirectory = null)
|
||||||
|
{
|
||||||
|
var start = new ProcessStartInfo(executable) { UseShellExecute = false, RedirectStandardOutput = true, RedirectStandardError = true };
|
||||||
|
if (workingDirectory is not null) start.WorkingDirectory = workingDirectory;
|
||||||
|
foreach (var argument in arguments) start.ArgumentList.Add(argument);
|
||||||
|
if (environment is not null) foreach (var (key, value) in environment) start.Environment[key] = value;
|
||||||
|
using var process = Process.Start(start)!;
|
||||||
|
var stdout = process.StandardOutput.ReadToEndAsync();
|
||||||
|
var stderr = process.StandardError.ReadToEndAsync();
|
||||||
|
using var deadline = new CancellationTokenSource(TimeSpan.FromMinutes(3));
|
||||||
|
try { await process.WaitForExitAsync(deadline.Token); }
|
||||||
|
catch (OperationCanceledException) { process.Kill(true); await process.WaitForExitAsync(); throw; }
|
||||||
|
return (process.ExitCode, await stdout + await stderr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task DisposeAsync()
|
||||||
|
{
|
||||||
|
foreach (var service in Processes.Keys.ToArray()) await Stop(service);
|
||||||
|
NpgsqlConnection.ClearAllPools();
|
||||||
|
if (!string.IsNullOrEmpty(Admin))
|
||||||
|
{
|
||||||
|
await using var connection = new NpgsqlConnection(Admin);
|
||||||
|
await connection.OpenAsync();
|
||||||
|
foreach (var database in databases)
|
||||||
|
{
|
||||||
|
await using var drop = new NpgsqlCommand("DROP DATABASE IF EXISTS " + database + " WITH (FORCE)", connection);
|
||||||
|
await drop.ExecuteNonQueryAsync();
|
||||||
|
}
|
||||||
|
foreach (var role in roles)
|
||||||
|
{
|
||||||
|
await using var dropRole = new NpgsqlCommand("DROP ROLE IF EXISTS " + role, connection);
|
||||||
|
await dropRole.ExecuteNonQueryAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (Directory.Exists(Temporary)) Directory.Delete(Temporary, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,309 @@
|
|||||||
|
using System.Net;
|
||||||
|
using System.Runtime.Versioning;
|
||||||
|
using System.Net.Http.Headers;
|
||||||
|
using System.Net.Http.Json;
|
||||||
|
using System.Text.Json;
|
||||||
|
using Npgsql;
|
||||||
|
using System.Security.Cryptography.X509Certificates;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace Deployment.AcceptanceTests;
|
||||||
|
|
||||||
|
[SupportedOSPlatform("linux")]
|
||||||
|
public sealed class InstallationTests(DeploymentFixture fixture) : IClassFixture<DeploymentFixture>
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public async Task A_selected_service_release_can_be_built_into_a_relative_output_directory()
|
||||||
|
{
|
||||||
|
var result = await DeploymentFixture.Run("bash", [Path.Combine(DeploymentFixture.Repository, "deploy/build-release.sh"),
|
||||||
|
"--output", "single-release", "--services", "insights"], new() { ["HEALTHAPP_DOTNET"] = fixture.Dotnet }, fixture.Temporary);
|
||||||
|
Assert.Equal(0, result.Code);
|
||||||
|
var release = Path.Combine(fixture.Temporary, "single-release");
|
||||||
|
Assert.True(File.Exists(Path.Combine(release, "services/insights/InsightsService.dll")));
|
||||||
|
Assert.Single(Directory.GetDirectories(Path.Combine(release, "services")));
|
||||||
|
Assert.True(File.Exists(Path.Combine(release, "install.sh")));
|
||||||
|
Assert.True(File.Exists(Path.Combine(release, "INSTALLATION.md")));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[InlineData("insights", 1)]
|
||||||
|
[InlineData("patient-profile,observation", 2)]
|
||||||
|
[InlineData("all", 5)]
|
||||||
|
public async Task Only_selected_payloads_configuration_and_independent_units_are_installed(string selection, int count)
|
||||||
|
{
|
||||||
|
var root = Path.Combine(fixture.Temporary, "selection-" + Guid.NewGuid().ToString("N"));
|
||||||
|
var installed = await fixture.Install(root, selection);
|
||||||
|
Assert.Equal(0, installed.Code);
|
||||||
|
var payloads = Directory.GetDirectories(Path.Combine(root, "opt/healthapp")).Select(Path.GetFileName).Order().ToArray();
|
||||||
|
var expected = selection == "all" ? DeploymentFixture.Services : selection.Split(',');
|
||||||
|
Assert.Equal(count, payloads.Length);
|
||||||
|
Assert.Equal(expected.Order(), payloads);
|
||||||
|
foreach (var service in expected)
|
||||||
|
{
|
||||||
|
var env = Path.Combine(root, "etc/healthapp", service, "service.env");
|
||||||
|
var generated = DeploymentFixture.ReadEnvironment(root, service);
|
||||||
|
Assert.Equal("Production", generated["ASPNETCORE_ENVIRONMENT"]);
|
||||||
|
Assert.StartsWith("https://", generated["ASPNETCORE_URLS"]);
|
||||||
|
Assert.NotEmpty(generated["InternalAccess__GatewayKey"]);
|
||||||
|
Assert.True(File.Exists(generated["Kestrel__Certificates__Default__Path"]));
|
||||||
|
Assert.Equal(UnixFileMode.UserRead | UnixFileMode.UserWrite, File.GetUnixFileMode(env));
|
||||||
|
var unit = await File.ReadAllTextAsync(Path.Combine(root, "etc/systemd/system", "healthapp-" + service + ".service"));
|
||||||
|
Assert.Contains("ExecStart=" + fixture.Dotnet + " /opt/healthapp/" + service + "/" + DeploymentFixture.Assembly(service) + ".dll", unit);
|
||||||
|
Assert.Contains("EnvironmentFile=/etc/healthapp/" + service + "/service.env", unit);
|
||||||
|
Assert.Contains("User=healthapp-" + service, unit);
|
||||||
|
Assert.Contains("Group=healthapp-" + service, unit);
|
||||||
|
Assert.DoesNotContain("Requires=healthapp-", unit);
|
||||||
|
Assert.DoesNotContain("PartOf=", unit);
|
||||||
|
Assert.DoesNotContain("BindsTo=", unit);
|
||||||
|
}
|
||||||
|
// A repeated install must not overwrite live configuration or application files.
|
||||||
|
var repeated = await fixture.Install(root, selection);
|
||||||
|
Assert.NotEqual(0, repeated.Code);
|
||||||
|
Assert.Contains("Already installed", repeated.Output);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task Configuration_and_certificates_are_generated_with_matching_credentials_and_private_permissions()
|
||||||
|
{
|
||||||
|
Assert.Equal(5, fixture.Settings.Values.Select(s => s["InternalAccess__GatewayKey"]).Distinct().Count());
|
||||||
|
foreach (var service in DeploymentFixture.Services)
|
||||||
|
{
|
||||||
|
var settings = fixture.Settings[service];
|
||||||
|
Assert.Equal("Production", settings["ASPNETCORE_ENVIRONMENT"]);
|
||||||
|
Assert.StartsWith("https://", settings["ASPNETCORE_URLS"]);
|
||||||
|
using var certificate = X509CertificateLoader.LoadPkcs12FromFile(settings["Kestrel__Certificates__Default__Path"], settings["Kestrel__Certificates__Default__Password"]);
|
||||||
|
Assert.True(certificate.HasPrivateKey);
|
||||||
|
Assert.True(certificate.NotAfter > DateTime.UtcNow);
|
||||||
|
var env = Path.Combine(fixture.Root, "etc/healthapp", service, "service.env");
|
||||||
|
Assert.Equal(UnixFileMode.UserRead | UnixFileMode.UserWrite, File.GetUnixFileMode(env));
|
||||||
|
}
|
||||||
|
Assert.Equal(fixture.Settings["observation"]["Services__ApiGateway__Key"], fixture.Settings["api-gateway"]["InternalAccess__Observation__Key"]);
|
||||||
|
Assert.Equal(fixture.Settings["insights"]["InternalAccess__GatewayKey"], fixture.Settings["api-gateway"]["Services__Insights__Key"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task Dedicated_database_roles_cannot_access_each_others_data_or_administer_the_server()
|
||||||
|
{
|
||||||
|
var profile = new NpgsqlConnectionStringBuilder(fixture.Settings["patient-profile"]["ConnectionStrings__PatientDatabase"]);
|
||||||
|
var observation = new NpgsqlConnectionStringBuilder(fixture.Settings["observation"]["ConnectionStrings__ObservationDatabase"]);
|
||||||
|
Assert.NotEqual(profile.Database, observation.Database);
|
||||||
|
Assert.NotEqual(profile.Username, observation.Username);
|
||||||
|
Assert.NotEqual(profile.Password, observation.Password);
|
||||||
|
await using var own = new NpgsqlConnection(profile.ConnectionString);
|
||||||
|
await own.OpenAsync();
|
||||||
|
await using var privileges = new NpgsqlCommand("SELECT rolsuper OR rolcreatedb OR rolcreaterole OR rolreplication FROM pg_roles WHERE rolname = current_user", own);
|
||||||
|
Assert.Equal(false, await privileges.ExecuteScalarAsync());
|
||||||
|
await using var other = new NpgsqlConnection(new NpgsqlConnectionStringBuilder(profile.ConnectionString) { Database = observation.Database }.ConnectionString);
|
||||||
|
var failure = await Assert.ThrowsAsync<PostgresException>(() => other.OpenAsync());
|
||||||
|
Assert.Equal("42501", failure.SqlState);
|
||||||
|
var retried = await fixture.Provision("database", "--service-dir", Path.Combine(fixture.Deployment, "patient-profile"), "--admin-file", fixture.AdminFile);
|
||||||
|
Assert.True(retried.Code == 0, retried.Output);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task New_deployments_get_new_secrets_and_do_not_overwrite_existing_material()
|
||||||
|
{
|
||||||
|
var output = Path.Combine(fixture.Temporary, "another-deployment");
|
||||||
|
Assert.Equal(0, (await fixture.Provision("prepare", "--output", output, "--host", "localhost")).Code);
|
||||||
|
using var first = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(fixture.Deployment, "deployment.json")));
|
||||||
|
using var second = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(output, "deployment.json")));
|
||||||
|
Assert.NotEqual(first.RootElement.GetProperty("Services").GetProperty("insights").GetProperty("IncomingKey").GetString(),
|
||||||
|
second.RootElement.GetProperty("Services").GetProperty("insights").GetProperty("IncomingKey").GetString());
|
||||||
|
Assert.NotEqual(0, (await fixture.Provision("prepare", "--output", output)).Code);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task Native_configuration_adapters_use_the_same_service_values_and_independent_paths()
|
||||||
|
{
|
||||||
|
var nativeRoot = Path.Combine(fixture.Temporary, "native-settings");
|
||||||
|
var windows = await fixture.Provision("configure", "--service-dir", Path.Combine(fixture.Deployment, "api-gateway"),
|
||||||
|
"--root", nativeRoot, "--platform", "windows");
|
||||||
|
Assert.True(windows.Code == 0, windows.Output);
|
||||||
|
using var json = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(nativeRoot, "config/api-gateway/appsettings.Production.json")));
|
||||||
|
Assert.StartsWith("https://", json.RootElement.GetProperty("urls").GetString());
|
||||||
|
Assert.Equal(fixture.Settings["api-gateway"]["Services__Observation__Key"], json.RootElement.GetProperty("Services").GetProperty("Observation").GetProperty("Key").GetString());
|
||||||
|
var mac = await fixture.Provision("configure", "--service-dir", Path.Combine(fixture.Deployment, "insights"),
|
||||||
|
"--root", nativeRoot, "--platform", "macos");
|
||||||
|
Assert.True(mac.Code == 0, mac.Output);
|
||||||
|
var plist = Path.Combine(nativeRoot, "insights.plist");
|
||||||
|
var launch = await fixture.Provision("launchd", "--service", "insights", "--root", nativeRoot, "--dotnet", fixture.Dotnet, "--output", plist);
|
||||||
|
Assert.True(launch.Code == 0, launch.Output);
|
||||||
|
var document = System.Xml.Linq.XDocument.Load(plist);
|
||||||
|
Assert.Contains(document.Descendants("string"), element => element.Value == "_healthapp_insights");
|
||||||
|
Assert.Contains(document.Descendants("string"), element => element.Value.EndsWith("InsightsService.dll"));
|
||||||
|
Assert.Equal(UnixFileMode.UserRead | UnixFileMode.UserWrite, File.GetUnixFileMode(plist));
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task VerifyScopedTopologyDistribution()
|
||||||
|
{
|
||||||
|
var directory = Path.Combine(fixture.Temporary, "distribution-contract");
|
||||||
|
Directory.CreateDirectory(directory);
|
||||||
|
var commands = Path.Combine(directory, "commands");
|
||||||
|
var captured = Path.Combine(directory, "captured");
|
||||||
|
Directory.CreateDirectory(captured);
|
||||||
|
var transport = Path.Combine(directory, "bin");
|
||||||
|
Directory.CreateDirectory(transport);
|
||||||
|
await File.WriteAllTextAsync(Path.Combine(transport, "ssh"), "#!/bin/bash\nprintf '%s\\n' \"$*\" >> \"$TRANSPORT_LOG\"\n");
|
||||||
|
await File.WriteAllTextAsync(Path.Combine(transport, "scp"), "#!/bin/bash\ntarget=\"${3%%:*}\"\nname=\"${target#*@}\"\nmkdir -p \"$CAPTURE/$name\"\ncp -R \"$2\" \"$CAPTURE/$name/\"\n");
|
||||||
|
foreach (var script in Directory.GetFiles(transport)) File.SetUnixFileMode(script, UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute);
|
||||||
|
var environment = new Dictionary<string, string> { ["PATH"] = transport + ":" + Environment.GetEnvironmentVariable("PATH"), ["TRANSPORT_LOG"] = commands, ["CAPTURE"] = captured };
|
||||||
|
var result = await DeploymentFixture.Run(fixture.Dotnet, [Path.Combine(fixture.Bundle, "provisioner/HealthApp.Provisioning.dll"),
|
||||||
|
"distribute", "--bundle", fixture.Bundle, "--deployment", fixture.Deployment, "--ssh-user", "administrator", "--services", string.Join(',', DeploymentFixture.Services)], environment);
|
||||||
|
Assert.True(result.Code == 0, result.Output);
|
||||||
|
Assert.Equal(5, Directory.GetDirectories(captured).Length);
|
||||||
|
foreach (var node in Directory.GetDirectories(captured))
|
||||||
|
{
|
||||||
|
var installed = Assert.Single(Directory.GetDirectories(Path.Combine(node, "services")));
|
||||||
|
var selected = Path.GetFileName(installed);
|
||||||
|
Assert.Single(Directory.GetDirectories(Path.Combine(node, "deployment")));
|
||||||
|
using var scope = JsonDocument.Parse(await File.ReadAllTextAsync(Path.Combine(node, "deployment/deployment.json")));
|
||||||
|
foreach (var name in DeploymentFixture.Services.Where(n => n != selected))
|
||||||
|
{
|
||||||
|
Assert.Equal("", scope.RootElement.GetProperty("Services").GetProperty(name).GetProperty("IncomingKey").GetString());
|
||||||
|
Assert.Equal(JsonValueKind.Null, scope.RootElement.GetProperty("Services").GetProperty(name).GetProperty("Database").ValueKind);
|
||||||
|
}
|
||||||
|
if (selected != "api-gateway") Assert.Empty(scope.RootElement.GetProperty("Accounts").EnumerateArray());
|
||||||
|
}
|
||||||
|
Assert.Contains("--defer-topology-check", await File.ReadAllTextAsync(commands));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[InlineData("unknown")]
|
||||||
|
[InlineData("insights,insights")]
|
||||||
|
[InlineData("insights,")]
|
||||||
|
public async Task Invalid_service_selection_is_rejected_without_creating_an_installation(string selection)
|
||||||
|
{
|
||||||
|
var root = Path.Combine(fixture.Temporary, "invalid-" + Guid.NewGuid().ToString("N"));
|
||||||
|
var result = await fixture.Install(root, selection);
|
||||||
|
Assert.NotEqual(0, result.Code);
|
||||||
|
Assert.False(Directory.Exists(root));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task Invalid_topology_fails_before_generating_configuration_or_credentials()
|
||||||
|
{
|
||||||
|
var topology = Path.Combine(fixture.Temporary, "invalid-topology.json");
|
||||||
|
await File.WriteAllTextAsync(topology, "{\"hosts\":{\"insights\":\"https://not-a-host/path\"}}");
|
||||||
|
var output = Path.Combine(fixture.Temporary, "invalid-topology-result");
|
||||||
|
var result = await fixture.Provision("prepare", "--output", output, "--topology", topology);
|
||||||
|
Assert.NotEqual(0, result.Code);
|
||||||
|
Assert.False(Directory.Exists(output));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Theory]
|
||||||
|
[InlineData("patient-profile")]
|
||||||
|
[InlineData("observation")]
|
||||||
|
[InlineData("insights")]
|
||||||
|
[InlineData("health-overview")]
|
||||||
|
[InlineData("api-gateway")]
|
||||||
|
public async Task A_single_installed_service_starts_and_stops_without_other_local_service_processes(string service)
|
||||||
|
{
|
||||||
|
var root = Path.Combine(fixture.Temporary, "single-" + service);
|
||||||
|
Assert.Equal(0, (await fixture.Install(root, service)).Code);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await fixture.Start(service, root);
|
||||||
|
Assert.Single(fixture.Processes);
|
||||||
|
Assert.False(fixture.Processes[service].HasExited);
|
||||||
|
}
|
||||||
|
finally { await fixture.Stop(service); }
|
||||||
|
Assert.Empty(fixture.Processes);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task Two_colocated_installed_services_run_with_independent_configuration_and_processes()
|
||||||
|
{
|
||||||
|
var root = Path.Combine(fixture.Temporary, "two-services");
|
||||||
|
Assert.Equal(0, (await fixture.Install(root, "patient-profile,observation")).Code);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await fixture.Start("patient-profile", root);
|
||||||
|
await fixture.Start("observation", root);
|
||||||
|
Assert.Equal(2, fixture.Processes.Values.Select(p => p.Id).Distinct().Count());
|
||||||
|
using var client = fixture.HttpClient();
|
||||||
|
using var request = new HttpRequestMessage(HttpMethod.Get, fixture.Urls["observation"] +
|
||||||
|
"api/patients/00000000-0000-0000-0000-000000000001/observations?from=2026-09-01&to=2026-09-10");
|
||||||
|
request.Headers.Add("X-Gateway-Key", fixture.Settings["observation"]["InternalAccess__GatewayKey"]);
|
||||||
|
using var response = await client.SendAsync(request);
|
||||||
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
|
Assert.Equal("[]", await response.Content.ReadAsStringAsync());
|
||||||
|
var observationPid = fixture.Processes["observation"].Id;
|
||||||
|
await fixture.Stop("patient-profile");
|
||||||
|
Assert.False(fixture.Processes["observation"].HasExited);
|
||||||
|
Assert.Equal(observationPid, fixture.Processes["observation"].Id);
|
||||||
|
await fixture.Start("patient-profile", root);
|
||||||
|
Assert.Equal(observationPid, fixture.Processes["observation"].Id);
|
||||||
|
}
|
||||||
|
finally { foreach (var service in fixture.Processes.Keys.ToArray()) await fixture.Stop(service); }
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public async Task Installed_complete_system_runs_in_five_processes_and_preserves_network_and_persistence_boundaries()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
foreach (var service in DeploymentFixture.Services) await fixture.Start(service);
|
||||||
|
Assert.Equal(5, fixture.Processes.Values.Select(p => p.Id).Distinct().Count());
|
||||||
|
using var client = fixture.HttpClient();
|
||||||
|
client.BaseAddress = new Uri(fixture.Urls["api-gateway"]);
|
||||||
|
using var login = await client.PostAsJsonAsync("api/authentication/login", new
|
||||||
|
{ accountId = "prototype-patient", password = fixture.Password });
|
||||||
|
Assert.Equal(HttpStatusCode.OK, login.StatusCode);
|
||||||
|
using var tokenJson = JsonDocument.Parse(await login.Content.ReadAsStringAsync());
|
||||||
|
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokenJson.RootElement.GetProperty("accessToken").GetString());
|
||||||
|
using var profile = await client.PostAsJsonAsync("api/patients", new { name = "Deployed patient", dateOfBirth = "1980-01-01" });
|
||||||
|
Assert.Equal(HttpStatusCode.Created, profile.StatusCode);
|
||||||
|
using var profileJson = JsonDocument.Parse(await profile.Content.ReadAsStringAsync());
|
||||||
|
var patient = profileJson.RootElement.GetProperty("patientId").GetGuid();
|
||||||
|
using var recorded = await client.PostAsJsonAsync($"api/patients/{patient}/observations", new
|
||||||
|
{ measuredAt = "2026-09-05T08:00:00", systolic = 128, diastolic = 82, pulse = 68,
|
||||||
|
measurementContext = new { setting = "Home", activityCondition = "AtRest" } });
|
||||||
|
Assert.Equal(HttpStatusCode.Created, recorded.StatusCode);
|
||||||
|
var overviewPath = $"api/patients/{patient}/overview?from=2026-09-01&to=2026-09-10&setting=Home&activityCondition=AtRest";
|
||||||
|
using var overview = await client.GetAsync(overviewPath);
|
||||||
|
Assert.Equal(HttpStatusCode.OK, overview.StatusCode);
|
||||||
|
using var overviewJson = JsonDocument.Parse(await overview.Content.ReadAsStringAsync());
|
||||||
|
Assert.Equal(patient, overviewJson.RootElement.GetProperty("patient").GetProperty("patientId").GetGuid());
|
||||||
|
Assert.Equal(128, overviewJson.RootElement.GetProperty("latestObservation").GetProperty("systolic").GetInt32());
|
||||||
|
Assert.Equal(128m, overviewJson.RootElement.GetProperty("insight").GetProperty("averageSystolic").GetDecimal());
|
||||||
|
Assert.Equal(1, overviewJson.RootElement.GetProperty("insightContributingCount").GetInt32());
|
||||||
|
foreach (var service in DeploymentFixture.Services)
|
||||||
|
{
|
||||||
|
var peers = fixture.Processes.Where(p => p.Key != service).ToDictionary(p => p.Key, p => p.Value.Id);
|
||||||
|
var oldId = fixture.Processes[service].Id;
|
||||||
|
await fixture.Stop(service);
|
||||||
|
foreach (var (peer, id) in peers)
|
||||||
|
{
|
||||||
|
Assert.Equal(id, fixture.Processes[peer].Id);
|
||||||
|
Assert.False(fixture.Processes[peer].HasExited);
|
||||||
|
}
|
||||||
|
await fixture.Start(service);
|
||||||
|
Assert.NotEqual(oldId, fixture.Processes[service].Id);
|
||||||
|
using var fresh = await client.GetAsync(overviewPath);
|
||||||
|
Assert.Equal(HttpStatusCode.OK, fresh.StatusCode);
|
||||||
|
}
|
||||||
|
var verified = await fixture.Provision("verify", "--deployment", fixture.Deployment, "--services", string.Join(',', DeploymentFixture.Services), "--complete", "true");
|
||||||
|
Assert.True(verified.Code == 0, verified.Output);
|
||||||
|
await VerifyScopedTopologyDistribution();
|
||||||
|
// Each DB owns only its documented service's tables; aggregation services have no DB configuration.
|
||||||
|
foreach (var (service, key, owned, absent) in new[]
|
||||||
|
{
|
||||||
|
("patient-profile", "ConnectionStrings__PatientDatabase", "patient", "blood_pressure_observation"),
|
||||||
|
("observation", "ConnectionStrings__ObservationDatabase", "blood_pressure_observation", "patient")
|
||||||
|
})
|
||||||
|
{
|
||||||
|
await using var connection = new NpgsqlConnection(fixture.Settings[service][key]);
|
||||||
|
await connection.OpenAsync();
|
||||||
|
await using var command = new NpgsqlCommand("SELECT tablename FROM pg_tables WHERE schemaname = 'public'", connection);
|
||||||
|
await using var reader = await command.ExecuteReaderAsync();
|
||||||
|
List<string> tables = [];
|
||||||
|
while (await reader.ReadAsync()) tables.Add(reader.GetString(0));
|
||||||
|
Assert.Contains(owned, tables);
|
||||||
|
Assert.DoesNotContain(absent, tables);
|
||||||
|
}
|
||||||
|
Assert.DoesNotContain(fixture.Settings["insights"].Keys, k => k.StartsWith("ConnectionStrings__"));
|
||||||
|
Assert.DoesNotContain(fixture.Settings["health-overview"].Keys, k => k.StartsWith("ConnectionStrings__"));
|
||||||
|
}
|
||||||
|
finally { foreach (var service in fixture.Processes.Keys.ToArray()) await fixture.Stop(service); }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,331 @@
|
|||||||
|
# HealthApp energy workloads
|
||||||
|
|
||||||
|
JMeter 5.6.3 is installed on this development computer at `~/.local/bin/jmeter`.
|
||||||
|
Its launcher uses the installed Java 17; the default Java 26 cannot compile
|
||||||
|
JMeter's bundled Groovy scripts. The `jpgc-perfmon` 2.1 plugin is installed for live server monitoring.
|
||||||
|
|
||||||
|
Runs default to **30 minutes of warmup + 4 hours of measurement**. A few additional
|
||||||
|
seconds allow startup/draining. Only requests entirely inside the four-hour window
|
||||||
|
appear in `measured.csv`. Full raw samples remain in `samples.csv`. `run.json` and
|
||||||
|
`timeline.json` identify exact UTC measurement boundaries for your external meter.
|
||||||
|
|
||||||
|
## Scenarios
|
||||||
|
|
||||||
|
| Plan | User workflow |
|
||||||
|
|---|---|
|
||||||
|
| `recording` | View guidance/profile, save a home resting reading, retrieve it, view overview. |
|
||||||
|
| `review` | Profile, latest reading, filtered history, numerical insights, trends, overview. |
|
||||||
|
| `correction` | Record an erroneous/duplicate entry, correct it, check overview, delete that entry, confirm removal. |
|
||||||
|
| `mixed` | Expected session mix: 65% review, 30% recording, 5% correction. |
|
||||||
|
| `professional` | Assigned-patient list, profile/latest/history/insights/trends/overview; no writes. |
|
||||||
|
| `idle` | No measured API traffic; services remain running for the same observation period. |
|
||||||
|
|
||||||
|
Each thread retains its own account, patient and opaque token. Login occurs initially
|
||||||
|
and before token expiry, including during four-hour runs. Requests use the gateway;
|
||||||
|
IDs come from actual responses. Nonexpected HTTP statuses and semantic failures stop
|
||||||
|
the affected user and invalidate the run. Only newly created correction-scenario
|
||||||
|
observations are deleted. Baseline and ordinary recording observations remain.
|
||||||
|
|
||||||
|
Per-user seeded random generators produce independent **Gaussian delays**:
|
||||||
|
interaction mean 1 second, standard deviation 250 ms, minimum 500 ms; between-session mean
|
||||||
|
120 seconds, standard deviation 30 seconds. Interaction delays use a Gaussian truncated symmetrically between 500 and 1500 ms,
|
||||||
|
retaining a 1-second expected mean. Between-session negative draws are clamped to zero. Threads also ramp up over
|
||||||
|
120 seconds. The seed is recorded; OS scheduling still affects exact timings.
|
||||||
|
These are configurable experimental assumptions, not measured population behaviour.
|
||||||
|
The default session frequency represents sustained, accelerated prototype activity;
|
||||||
|
for less frequent patient visits increase `--session-pause-ms` and its deviation.
|
||||||
|
A closed-loop user waits for each response; throughput decreases when the server slows.
|
||||||
|
Concurrency means resident simulated users, including their idle/thinking time.
|
||||||
|
|
||||||
|
## Live NUC monitoring in JMeter
|
||||||
|
|
||||||
|
All six plans contain **jp@gc – PerfMon Metrics Collector**, including idle.
|
||||||
|
The listener connects over TCP to the agent on the target (default port 4444),
|
||||||
|
samples every second, and writes `perfmon.csv` directly on this computer
|
||||||
|
through JMeter during the run. No server log transfer is needed. In GUI mode the
|
||||||
|
listener shows live graphs; use CLI mode for actual energy experiments.
|
||||||
|
|
||||||
|
Collected host metrics: CPU combined utilisation and I/O wait (%), memory usage
|
||||||
|
(% and actual-used bytes), swap-used bytes, disk read/write bytes per second,
|
||||||
|
and network received/sent bytes per second. These are system totals, not per-service
|
||||||
|
attribution. Network/disk counters depend on SIGAR's device support; zero values on
|
||||||
|
an idle host do not establish their accuracy. Compare the readings against Linux
|
||||||
|
utilities before treating the agent as a validated measurement instrument.
|
||||||
|
|
||||||
|
The runner checks agent access/metric availability before starting. It records
|
||||||
|
`--perfmon-host`, `--perfmon-port` and `--perfmon-interval-ms` (default 1000) in
|
||||||
|
`run.json`; by default the agent host matches `--host`. Failed, missing or widely
|
||||||
|
spaced measurements invalidate monitoring. `perfmon-measured.csv` excludes warmup,
|
||||||
|
decodes the plugin's synthetic `elapsed` field into metric values/units, and retains
|
||||||
|
timestamps from this computer's collector, not server-origin timestamps.
|
||||||
|
**PerfMon's elapsed field is not HTTP latency.** Host metrics stay separate
|
||||||
|
from application request counts. Raw `perfmon.csv` contains warmup and measured data.
|
||||||
|
`run.json` also includes each metric's sample count, mean and maximum.
|
||||||
|
|
||||||
|
Keep the agent running on the NUC for the full warmup and measured run. Its TCP
|
||||||
|
connection is plain-text and provides no authentication; restrict port 4444 to the
|
||||||
|
load-generator computer. Restart it with `--no-exec --udp-port 0 --tcp-port 4444`
|
||||||
|
to disable the agent's executable custom metrics; these plans use only built-in metrics.
|
||||||
|
`--no-perfmon` is for isolated workflow testing and explicitly records that no server
|
||||||
|
monitoring was collected. The plugin must still be installed to load its JMX element.
|
||||||
|
The validation fixture uses this switch and does not connect to the NUC.
|
||||||
|
|
||||||
|
[PerfMon listener documentation](https://jmeter-plugins.org/wiki/PerfMon/),
|
||||||
|
[agent metrics/protocol](https://github.com/undera/perfmon-agent).
|
||||||
|
|
||||||
|
## Live Shelly power in JMeter
|
||||||
|
|
||||||
|
Every scenario, including idle, contains one **Shelly live power** thread. It polls
|
||||||
|
`http://192.168.1.44/rpc/Switch.GetStatus?id=0` every second directly from
|
||||||
|
JMeter, independently of simulated users. There is no cloud dependency and no
|
||||||
|
post-run network transfer. No switch/set/reset commands are sent.
|
||||||
|
|
||||||
|
`shelly.csv` is written while JMeter runs, with timestamps, request status,
|
||||||
|
`shelly_power_watts`, `shelly_voltage_volts`, `shelly_current_amps` and cumulative
|
||||||
|
`shelly_energy_wh`. Raw readings include warmup. `shelly-measured.csv` brackets only
|
||||||
|
the measured interval, interpolating its boundaries; `run.json` includes mean watts,
|
||||||
|
integrated joules/kWh and the counter's Wh delta converted to joules/kWh.
|
||||||
|
The timestamp is approximated by each polling request's midpoint on this computer.
|
||||||
|
Meter requests are excluded from the application's request-rate and latency summary.
|
||||||
|
JMeter's overall console summary includes meter polls; use `run.json` and
|
||||||
|
`measured.csv` for the application-only figures.
|
||||||
|
|
||||||
|
Energy from sampled power is the sum of the recorded in-window power values, each multiplied by the nominal polling interval. This assumes each reading represents that interval; actual polling timestamps may differ and sample coverage is reported. Counter deltas provide a separate cross-check;
|
||||||
|
the device's counter update granularity can make short runs report little or no
|
||||||
|
counter change despite nonzero power. Both boundary interpolation and meter accuracy
|
||||||
|
limit precision; this does not claim calibration. The plug measures what is connected
|
||||||
|
to its outlet, including the NUC's power-adapter losses. Connect only the intended
|
||||||
|
measured equipment. Its internal temperature is **not the NUC CPU temperature**.
|
||||||
|
|
||||||
|
The runner defaults to this plug and checks its status before starting. Override with
|
||||||
|
`--shelly-host`, `--shelly-port`, `--shelly-switch-id` or `--shelly-interval-ms`.
|
||||||
|
There is a short unmeasured drain after the four-hour window to obtain its closing
|
||||||
|
boundary. Missing samples, long gaps, failed polls and counter resets invalidate the
|
||||||
|
power measurement; they are not treated as zero watts. `--no-shelly` is for isolated
|
||||||
|
workflow testing, and records that power monitoring was disabled. The current plug
|
||||||
|
has authentication disabled; authenticated device access is not yet implemented.
|
||||||
|
|
||||||
|
The runner configures JMeter's `sample_variables` so the numeric columns are saved.
|
||||||
|
For a manual GUI/CLI launch, pass:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
-Jsample_variables=shelly_power_watts,shelly_voltage_volts,shelly_current_amps,shelly_energy_wh
|
||||||
|
```
|
||||||
|
|
||||||
|
Use the runner for experiment timing, summaries and completeness checks. A new
|
||||||
|
power-monitoring-only check can be run without application requests:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 tools/energy-jmeter/verify-shelly.py --host 192.168.1.44 --output tools/energy-jmeter/results/shelly-check-new
|
||||||
|
```
|
||||||
|
|
||||||
|
[Shelly switch status and energy units](https://shelly-api-docs.shelly.cloud/gen2/ComponentsAndServices/Switch/).
|
||||||
|
|
||||||
|
## 1. Prepare distinct test accounts (outside measurement)
|
||||||
|
|
||||||
|
The installer initially supplies only one ordinary patient account. Use distinct
|
||||||
|
accounts for realistic many-patient runs. There is no registration API. This setup
|
||||||
|
uses the existing external gateway-account configuration and password hash tool.
|
||||||
|
It changes no application code or service boundaries.
|
||||||
|
|
||||||
|
The hash tool has already been built on this computer. To rebuild it:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dotnet publish tools/PasswordHash -c Release --self-contained false -p:UseAppHost=false -o tools/energy-jmeter/hash-tool
|
||||||
|
```
|
||||||
|
|
||||||
|
From the repository root, copy the supporting tools to the server:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scp -r tools/energy-jmeter steffen@192.168.1.125:~/healthapp-energy
|
||||||
|
```
|
||||||
|
|
||||||
|
On **testserver**, generate 100 additional synthetic accounts, preserve the old
|
||||||
|
configuration, and explicitly install the generated copy:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo python3 ~/healthapp-energy/create-accounts.py --gateway-env /etc/healthapp/api-gateway/service.env --output /var/lib/healthapp-energy-fixture --count 100 --dotnet /usr/bin/dotnet
|
||||||
|
sudo cp -a /etc/healthapp/api-gateway/service.env /etc/healthapp/api-gateway/service.env.before-energy
|
||||||
|
sudo install -m 600 /var/lib/healthapp-energy-fixture/gateway.env /etc/healthapp/api-gateway/service.env
|
||||||
|
sudo systemctl restart healthapp-api-gateway
|
||||||
|
sudo install -m 600 -o "$USER" -g "$(id -gn)" /var/lib/healthapp-energy-fixture/accounts.json "$HOME/energy-accounts.json"
|
||||||
|
sudo install -m 644 /var/lib/healthapp-installation/deployment/healthapp-ca.crt "$HOME/healthapp-ca.crt"
|
||||||
|
```
|
||||||
|
|
||||||
|
Keep these generated accounts/configuration private. Existing installer accounts
|
||||||
|
are retained. The generator refuses to overwrite an existing output or regenerate
|
||||||
|
an already-configured energy-account set. Review generated configuration before
|
||||||
|
installing it. Do not run this on clinical data.
|
||||||
|
|
||||||
|
Back on **this development computer**, from the repository root:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir -p tools/energy-jmeter/.private
|
||||||
|
chmod 700 tools/energy-jmeter/.private
|
||||||
|
scp steffen@192.168.1.125:~/energy-accounts.json tools/energy-jmeter/.private/accounts.json
|
||||||
|
scp steffen@192.168.1.125:~/healthapp-ca.crt tools/energy-jmeter/.private/healthapp-ca.crt
|
||||||
|
chmod 600 tools/energy-jmeter/.private/accounts.json
|
||||||
|
python3 tools/energy-jmeter/prepare.py --base-url https://192.168.1.125:5443 --ca tools/energy-jmeter/.private/healthapp-ca.crt --accounts tools/energy-jmeter/.private/accounts.json --output tools/energy-jmeter/.private/dataset --days 30
|
||||||
|
```
|
||||||
|
|
||||||
|
This creates/reuses each account's profile and seeds 60 historical synthetic readings
|
||||||
|
per patient, including home/resting, clinic, after-activity and unknown contexts.
|
||||||
|
Preparation verifies TLS certificates/hostnames and happens outside the
|
||||||
|
measurement window. For repeat comparisons, restore the same synthetic database
|
||||||
|
snapshot and reuse the same account configuration; recording grows history over time.
|
||||||
|
Seeding alone does not reset workload-created records. Use a new preparation output
|
||||||
|
folder if reseeding against a restored database.
|
||||||
|
|
||||||
|
For an immediate read-only trial with the existing prototype account, export the
|
||||||
|
installer's `accounts.json` privately instead of creating accounts. Prepare it with
|
||||||
|
`prepare.py`, then explicitly use `--allow-shared-read-account` with `review`.
|
||||||
|
That measures concurrent sessions sharing one patient, not a many-patient population.
|
||||||
|
The reserved `installation-check` account is excluded from preparation.
|
||||||
|
|
||||||
|
Professional tests require preconfigured professional accounts and assignments
|
||||||
|
(see [authentication documentation](../../src/AUTHENTICATION.md)). Create a separate
|
||||||
|
private CSV with `account_id,password,patient_id`, one assigned target per professional.
|
||||||
|
The runner verifies role/assignments. The default unassigned professional will fail
|
||||||
|
preflight instead of silently benchmarking rejected requests.
|
||||||
|
|
||||||
|
## 2. Find a suitable concurrency before the four-hour run
|
||||||
|
|
||||||
|
For the 8 GB, 8th/9th-generation Intel NUC, try 10, 25, 50 and 100 users in short
|
||||||
|
capacity runs. Generate more accounts before trying 200. Age/RAM do not establish
|
||||||
|
capacity. Review CPU, RAM, thermal throttling, error rate and latency on the NUC.
|
||||||
|
Choose your acceptable latency before deciding which level to measure for four hours.
|
||||||
|
For example, this trial lasts 2 minutes of warmup plus 5 measured minutes:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 tools/energy-jmeter/run.py mixed --host 192.168.1.125 --ca tools/energy-jmeter/.private/healthapp-ca.crt --users-file tools/energy-jmeter/.private/dataset/users.csv --users 50 --warmup 120 --duration 300 --output tools/energy-jmeter/results/capacity-50
|
||||||
|
```
|
||||||
|
|
||||||
|
A short check identifies obvious overload; it does not establish thermal stability
|
||||||
|
or long-run capacity. Output directories must be new. Failed users are not silently
|
||||||
|
replaced. Do not use a partial/failed run as a successful four-hour measurement.
|
||||||
|
|
||||||
|
## 3. Run a full experiment
|
||||||
|
|
||||||
|
Ensure the NUC is powered through the Shelly plug at **192.168.1.44**, then run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 tools/energy-jmeter/run.py mixed --host 192.168.1.125 --ca tools/energy-jmeter/.private/healthapp-ca.crt --users-file tools/energy-jmeter/.private/dataset/users.csv --users 100 --warmup 1800 --duration 14400 --output tools/energy-jmeter/results/mixed-100-run1
|
||||||
|
```
|
||||||
|
|
||||||
|
Substitute another scenario or concurrency as needed. `--warmup 600` or `1200`
|
||||||
|
selects 10/20 minutes; the four measured hours remain unchanged. Choose a warmup
|
||||||
|
that reaches stable server temperature/power rather than assuming a universal value.
|
||||||
|
`--seed 42`, `--think-min-ms`, `--think-mean-ms`, `--think-stddev-ms`, `--session-pause-ms` and
|
||||||
|
`--session-stddev-ms` control timing. Include these identically across comparisons.
|
||||||
|
|
||||||
|
Use the same-duration `idle` run to establish baseline power:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bash tools/energy-jmeter/run-idle.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
The idle runner sends zero application requests, including during startup. No CA, credentials or dataset is needed. JMeter collects only PerfMon host metrics and Shelly power readings.
|
||||||
|
The application services/PostgreSQL stay running as they are. The runner does not start, stop or restart them. Keep the PerfMon agent running. The one-command launcher creates a timestamped result folder under `results/idle-*`. The load generator and HTML-report
|
||||||
|
creation stay on this computer, outside the NUC's energy measurement. Keep server
|
||||||
|
power settings, dataset, service versions, logging and other workloads consistent.
|
||||||
|
Record those settings, thermal state, meter sampling interval and clock synchronisation.
|
||||||
|
Repeat runs and vary their order to check drift. Only a brief monitoring-only JMeter check has been run against the NUC; no application load has been sent by Codex.
|
||||||
|
|
||||||
|
## 4. Read results and energy
|
||||||
|
|
||||||
|
`run.json` contains measurement boundaries, request/error counts, request rate,
|
||||||
|
p95 latency, random seed, timings and plan hash. JMeter CSV excludes response bodies,
|
||||||
|
request headers and passwords. The private runtime credential CSV is deleted at exit;
|
||||||
|
keep the whole result directory private and inspect logs before sharing.
|
||||||
|
|
||||||
|
JMeter now collects the Shelly readings live and the runner calculates measured-window energy automatically. For another external meter, export its readings as
|
||||||
|
CSV with `timestamp,power_watts` (timezone-qualified ISO timestamps, increasing,
|
||||||
|
covering the full interval), then integrate only the measured four hours:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 tools/energy-jmeter/energy.py tools/energy-jmeter/results/mixed-100-run1/run.json power.csv
|
||||||
|
```
|
||||||
|
|
||||||
|
The tool interpolates interval edges and integrates watts using trapezoids. It reports
|
||||||
|
joules, kWh, mean watts and joules per HTTP request. `--idle-watts VALUE` additionally
|
||||||
|
reports energy above the measured idle mean. A request is not a user session;
|
||||||
|
compare scenario/mix and achieved throughput when interpreting efficiency.
|
||||||
|
Raw meter data must be preserved; missing intervals cannot be repaired by JMeter. The same rule applies to Shelly polls.
|
||||||
|
|
||||||
|
JMeter's stock HTTPS client trusts test certificates. The Python runner verifies the
|
||||||
|
provided CA and hostname during preflight; JMeter traffic itself remains encrypted
|
||||||
|
but does not provide certificate validation. Do not describe this as a TLS security test.
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 tools/energy-jmeter/generate-plans.py
|
||||||
|
python3 tools/energy-jmeter/verify-plans.py
|
||||||
|
python3 tools/energy-jmeter/verify-perfmon.py
|
||||||
|
python3 tools/energy-jmeter/verify-shelly.py
|
||||||
|
python3 tools/energy-jmeter/verify-idle.py
|
||||||
|
```
|
||||||
|
|
||||||
|
The validation script exercises every plan against an isolated local HTTPS contract
|
||||||
|
stub, including dynamic IDs, token renewal, status/semantic assertions, deletion and
|
||||||
|
warmup exclusion. It does not prove capacity or replace the application's acceptance
|
||||||
|
suite. The real-server short capacity trial is required before a four-hour measurement.
|
||||||
|
|
||||||
|
References: [Apache release](https://jmeter.apache.org/download_jmeter.cgi),
|
||||||
|
[CLI load testing](https://jmeter.apache.org/usermanual/get-started.html),
|
||||||
|
[JMeter components](https://jmeter.apache.org/usermanual/component_reference.html).
|
||||||
|
|
||||||
|
For a short live monitoring-only check (no patient requests):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 tools/energy-jmeter/verify-perfmon.py --host 192.168.1.125 --output tools/energy-jmeter/results/perfmon-check-new
|
||||||
|
```
|
||||||
|
|
||||||
|
This verifies that JMeter saves readings while it is still running, then checks
|
||||||
|
metric coverage and decoding. A monitoring-only check succeeded against the NUC;
|
||||||
|
comparison with independent Linux readings is still needed to validate accuracy.
|
||||||
|
|
||||||
|
## Time-aligned graphs and one-second request reporting
|
||||||
|
|
||||||
|
Every finished run generates `report.html` (interactive), `report.png`, `report.svg`
|
||||||
|
and `per-second.csv`. The plotting dependency is Matplotlib, already installed on
|
||||||
|
this computer. If setting up another load generator, install Matplotlib there.
|
||||||
|
All panels share UTC timestamps and experiment-relative one-second intervals,
|
||||||
|
starting at the recorded warmup start. Warmup is shaded; measurement begins after
|
||||||
|
the exact configured warmup duration.
|
||||||
|
|
||||||
|
CPU, RAM, power, disk and network values are averaged only when multiple samples
|
||||||
|
fall into a second; missing readings stay blank and create graph gaps. Application
|
||||||
|
requests and failed requests are counted individually per second. Mean/p95/max
|
||||||
|
latency is grouped by request start time, with p95 using the nearest-rank definition.
|
||||||
|
Requests spanning the measurement end are excluded from measured application figures,
|
||||||
|
matching `run.json`. Meter requests and internal timing samples never count as
|
||||||
|
application traffic. Seconds without requests have zero request/error counts and
|
||||||
|
no response-time value. The graph keeps every one-second bin; a wide full-run view
|
||||||
|
can visually compress points. Use the interactive range controls to inspect seconds.
|
||||||
|
|
||||||
|
For a running experiment, generate a snapshot or keep refreshing its artifacts:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 tools/energy-jmeter/report.py tools/energy-jmeter/results/RUN_FOLDER
|
||||||
|
python3 tools/energy-jmeter/report.py tools/energy-jmeter/results/RUN_FOLDER --follow
|
||||||
|
```
|
||||||
|
|
||||||
|
`--follow` refreshes artifacts every minute, using one-second data, and generates the
|
||||||
|
final report when the run finishes. Open `report.html` locally and use **Refresh
|
||||||
|
snapshot** to load new data. It provides a shared cursor across panels and a measured-
|
||||||
|
window selection. The latest seconds of a running snapshot are provisional because
|
||||||
|
JMeter writes request samples after their responses arrive. Missing future seconds
|
||||||
|
are not plotted as zeros. Report creation runs on the load generator.
|
||||||
|
|
||||||
|
Verify aggregation with `python3 tools/energy-jmeter/verify-report.py`.
|
||||||
|
|
||||||
|
For intentionally heavy shared-data capacity trials, use `review`,
|
||||||
|
`--allow-shared-read-account`, `--capacity-trial` and the desired thread count.
|
||||||
|
`--capacity-trial` restarts a read-only session after failures to maintain the trial
|
||||||
|
duration. Errors are still recorded and the run is marked unsuccessful if any occur;
|
||||||
|
the graphs remain useful for finding capacity. This mode permits no write scenarios.
|
||||||
|
First-use certificate pinning, when used instead of the installation CA, trusts the
|
||||||
|
certificate presented on that first connection; it is not an independently verified CA.
|
||||||
|
|
||||||
|
The rationale and figures for the selected 26-thread loaded experiment are in [WORKLOAD-SELECTION.md](WORKLOAD-SELECTION.md).
|
||||||
@@ -0,0 +1,180 @@
|
|||||||
|
# Why the loaded measurement uses 26 threads
|
||||||
|
|
||||||
|
**Decision, 9 October 2026:** use **26 JMeter threads** for the main loaded energy
|
||||||
|
experiment, with **30 minutes of warmup followed by four measured hours**. Collect
|
||||||
|
CPU, memory, power and request results at one-second resolution. This is the chosen
|
||||||
|
protocol; the four-hour loaded run has not yet been performed.
|
||||||
|
|
||||||
|
The aim is to produce substantial application load while preserving headroom for
|
||||||
|
background activity. The response-time knee informs the choice, but the main
|
||||||
|
experiment deliberately operates below its steep-rise region.
|
||||||
|
|
||||||
|
## Measurements used for the decision
|
||||||
|
|
||||||
|
Calibration used the same read-only review workflow and one shared patient dataset.
|
||||||
|
Each thread repeatedly retrieved profile, latest observation, filtered history,
|
||||||
|
insights, trends and overview, with an initial login and renewal if required.
|
||||||
|
Account provisioning and synthetic data preparation were separate from measurement.
|
||||||
|
This is concurrent use of one shared dataset, not 26 independently provisioned patients.
|
||||||
|
|
||||||
|
All comparable trials used:
|
||||||
|
|
||||||
|
- One-minute ramp/warmup followed by ten measured minutes.
|
||||||
|
- Gaussian request pauses with a **500 ms minimum**, **1,000 ms expected mean** and
|
||||||
|
**1,500 ms maximum**. The parent Gaussian standard deviation is 250 ms; symmetric
|
||||||
|
truncation preserves the expected mean and changes the resulting standard deviation.
|
||||||
|
- No additional pause between review sessions; this represents sustained active use.
|
||||||
|
- The same dataset, application deployment, workflow, seed and one-second monitoring.
|
||||||
|
- Sequential runs to prevent workload overlap. Mean response times exclude think time.
|
||||||
|
|
||||||
|
The initial trials with 100 ms mean pauses are excluded from the comparable curve.
|
||||||
|
The incomplete 80-thread trial is also excluded. The latest identical-pacing
|
||||||
|
30-thread repeat is used; it closely reproduced the earlier 30-thread result.
|
||||||
|
All 19 selected calibration points completed with zero failed requests and valid
|
||||||
|
monitoring. This does not establish the same behaviour for different patients,
|
||||||
|
data volumes, workflow mixes or deployment arrangements.
|
||||||
|
|
||||||
|
| Threads | Mean response | Requests/s | Mean CPU | Mean power |
|
||||||
|
|---:|---:|---:|---:|---:|
|
||||||
|
| 25 | 128 ms | 22.15 | 78.16% | 8.76 W |
|
||||||
|
| **26 — selected** | **139 ms** | **22.81** | **80.60%** | **8.90 W** |
|
||||||
|
| 27 | 148 ms | 23.52 | 82.96% | 9.04 W |
|
||||||
|
| 30 | 183 ms | 25.34 | 89.00% | 9.34 W |
|
||||||
|
| 35 | 280 ms | 27.32 | 95.65% | 9.65 W |
|
||||||
|
| 40 | 425 ms | 28.05 | 98.25% | 9.75 W |
|
||||||
|
| 50 | 785 ms | 27.95 | 98.72% | 9.81 W |
|
||||||
|
|
||||||
|
Full measured points: [calibration.csv](evidence/26-thread-choice/calibration.csv).
|
||||||
|
|
||||||
|
## Response-time knee
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
The curve steepens as utilisation approaches saturation. From 35 to 40 threads,
|
||||||
|
mean response time rises from 280 to 425 ms, while throughput grows only about 2.7%.
|
||||||
|
At 50 threads, response time rises further without increased throughput.
|
||||||
|
|
||||||
|
We adopted **35 threads as a practical knee marker**, based on the response-time
|
||||||
|
curve and a mean response time of approximately 280 ms being barely acceptable
|
||||||
|
for this experiment. The finer 26–39-thread trials support a gradual bend followed
|
||||||
|
by a steep-rise region, rather than a uniquely established abrupt threshold.
|
||||||
|
The figures use **mean response time only**. P95 remains in the original results
|
||||||
|
but is not mixed into this particular queueing comparison.
|
||||||
|
|
||||||
|
The simplified queueing model used to interpret the shape is:
|
||||||
|
|
||||||
|
\[
|
||||||
|
R = W + S,\qquad W = \frac{SU}{1-U},\qquad R = \frac{S}{1-U}.
|
||||||
|
\]
|
||||||
|
|
||||||
|
Here, `R` is mean response time, `W` waiting time, `S` service time and `U`
|
||||||
|
utilisation expressed as a fraction. Near saturation, a small increase in `U`
|
||||||
|
produces a disproportionately large increase in `R`.
|
||||||
|
|
||||||
|
This model motivates preserving headroom. The plots show **measured points**,
|
||||||
|
not a fitted theoretical curve: service time was not measured separately, and
|
||||||
|
whole-machine CPU utilisation is being used as a practical utilisation proxy.
|
||||||
|
The model does not prove a precise knee or distinguish the application's individual
|
||||||
|
queues and resources.
|
||||||
|
|
||||||
|
## Background activity and the headroom rule
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
The four-hour idle baseline made **zero application requests**, with services and
|
||||||
|
monitoring running. It recorded 14,395 CPU samples at nominal one-second intervals:
|
||||||
|
mean utilisation **0.505%**, maximum **11.055%**, seven samples at least 5% and one
|
||||||
|
sample at least 10%. These include monitoring overhead and other background work;
|
||||||
|
we did not collect process-level attribution.
|
||||||
|
|
||||||
|
Loaded trials had application requests in every measured second. Consequently,
|
||||||
|
those traces cannot isolate request-free background spikes or establish which
|
||||||
|
process caused a particular loaded-run peak.
|
||||||
|
|
||||||
|
The agreed conservative planning rule reserves the observed idle maximum as
|
||||||
|
**11.055 percentage points** against a chosen **95% CPU reference**:
|
||||||
|
|
||||||
|
\[
|
||||||
|
U_{\text{planning ceiling}} = 95\% - 11.055\text{ percentage points}
|
||||||
|
= 83.945\%.
|
||||||
|
\]
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
At 26 threads, average CPU is **80.603%**, leaving approximately **14.397 percentage
|
||||||
|
points** below the 95% reference: about **3.342 points beyond the reserved budget**.
|
||||||
|
At 27 threads, the average still meets the planning ceiling, but leaves only about
|
||||||
|
0.983 points beyond that budget. At 28 threads, average CPU is already above it.
|
||||||
|
|
||||||
|
We therefore chose **26 rather than 27 threads** for additional margin, and 26
|
||||||
|
rather than 25 to retain slightly more application load. It is also close to the
|
||||||
|
original approximately 80% utilisation objective. The measured mean response time
|
||||||
|
was 139 ms with zero failed requests.
|
||||||
|
|
||||||
|
The idle maximum is **not** a proven incremental disturbance that can simply be
|
||||||
|
added to loaded CPU, and it is not a guaranteed future maximum. Reserving its full
|
||||||
|
observed value is a planning assumption. The 95% reference is likewise our operating
|
||||||
|
criterion, not a demonstrated universal performance boundary.
|
||||||
|
|
||||||
|
## What the choice does not guarantee
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
An average below the planning ceiling does not keep every second below it. The
|
||||||
|
26-thread trial reached **98.994% CPU**, with **25 of 600 samples at least 95%**
|
||||||
|
(4.17%) and seven at least 98% (1.17%). Those transient peaks caused no recorded
|
||||||
|
request errors in this ten-minute trial, but they show that saturation remains
|
||||||
|
possible. The choice reduces exposure; it does not guarantee its elimination.
|
||||||
|
|
||||||
|
Calibration contains one trial at most thread counts and only one matching repeat
|
||||||
|
at 30. Run order was generally ascending and was not randomised; thermal/background
|
||||||
|
drift and measurement variation have not been fully separated. Four-hour stability
|
||||||
|
must be assessed in the actual long run, and repeat measurements are needed to
|
||||||
|
quantify variability. CPU measurements are PerfMon/SIGAR readings and have not been
|
||||||
|
independently validated against Linux counters.
|
||||||
|
|
||||||
|
## Main loaded measurement protocol
|
||||||
|
|
||||||
|
Use the **same shared-data read-only review scenario**, with:
|
||||||
|
|
||||||
|
| Setting | Value |
|
||||||
|
|---|---|
|
||||||
|
| Concurrent threads | **26** |
|
||||||
|
| Ramp | 60 seconds, inside warmup |
|
||||||
|
| Warmup excluded from analysis | **1,800 seconds** |
|
||||||
|
| Measured duration | **14,400 seconds** |
|
||||||
|
| Request pauses | Gaussian, 500–1,500 ms, expected mean 1,000 ms |
|
||||||
|
| Between-session pause | None |
|
||||||
|
| CPU and Shelly polling | **1,000 ms** |
|
||||||
|
| Error handling | Record failures; begin the next read-only session |
|
||||||
|
|
||||||
|
Keep application configuration, dataset, monitoring, power settings and other
|
||||||
|
activity consistent across comparisons. Preserve raw measurements. Inspect
|
||||||
|
per-second CPU/latency/error traces rather than relying only on run averages.
|
||||||
|
The Shelly measures the connected equipment, including adapter losses; power-meter
|
||||||
|
accuracy has not been independently calibrated. Treat its cumulative counter delta
|
||||||
|
as a separate cross-check to integration of sampled watts.
|
||||||
|
|
||||||
|
See the [execution guide](README.md) for run commands and reporting. The experiment
|
||||||
|
runs from the development computer, using application and monitoring APIs, without
|
||||||
|
SSH or administrative changes to the NUC.
|
||||||
|
|
||||||
|
## Evidence and reproducibility
|
||||||
|
|
||||||
|
The evidence accompanying this document contains no passwords or tokens:
|
||||||
|
|
||||||
|
- [Calibration points](evidence/26-thread-choice/calibration.csv).
|
||||||
|
- [Idle CPU trace](evidence/26-thread-choice/idle-cpu.csv).
|
||||||
|
- [Selected workload CPU trace](evidence/26-thread-choice/selected-cpu.csv).
|
||||||
|
- [Calculated evidence summary and source run names](evidence/26-thread-choice/evidence-summary.json).
|
||||||
|
- PNG figures above and same-stem SVG files for export.
|
||||||
|
|
||||||
|
The original complete results remain under `tools/energy-jmeter/results/`, which
|
||||||
|
is Git-ignored. Regenerate this evidence from those files with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python3 tools/energy-jmeter/document-choice.py
|
||||||
|
```
|
||||||
|
|
||||||
|
No architecture, service behaviour or authoritative requirements were changed by
|
||||||
|
this experiment decision.
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Generate additional synthetic accounts in a COPY of gateway configuration."""
|
||||||
|
import argparse, json, os, re, secrets, subprocess
|
||||||
|
from pathlib import Path
|
||||||
|
p=argparse.ArgumentParser()
|
||||||
|
p.add_argument('--gateway-env',required=True);p.add_argument('--output',required=True)
|
||||||
|
p.add_argument('--count',type=int,default=100);p.add_argument('--dotnet',default='dotnet')
|
||||||
|
p.add_argument('--hash-tool',default=str(Path(__file__).parent/'hash-tool/PasswordHash.dll'))
|
||||||
|
a=p.parse_args()
|
||||||
|
if not 1<=a.count<=10000: p.error('count must be 1..10000')
|
||||||
|
text=Path(a.gateway_env).read_text()
|
||||||
|
if 'energy-patient-' in text: p.error('Energy accounts already exist; reuse their credentials rather than overwrite')
|
||||||
|
indexes=[int(x) for x in re.findall(r'^Authentication__Accounts__(\d+)__AccountId=',text,re.M)]
|
||||||
|
if not indexes: p.error('No installer-created authentication accounts found')
|
||||||
|
out=Path(a.output);out.mkdir(mode=0o700,parents=True,exist_ok=False)
|
||||||
|
accounts=[]; lines=[]
|
||||||
|
for i in range(a.count):
|
||||||
|
account={'AccountId':f'energy-patient-{i+1:04d}','Role':'Patient','Password':secrets.token_hex(24)}
|
||||||
|
result=subprocess.run([a.dotnet,a.hash_tool],input=account['Password']+'\n',text=True,capture_output=True,check=True)
|
||||||
|
hashed=result.stdout.strip()
|
||||||
|
if not hashed or '\n' in hashed: raise RuntimeError('Password hash tool returned unexpected output')
|
||||||
|
index=max(indexes)+1+i
|
||||||
|
for key,value in [('AccountId',account['AccountId']),('Role','Patient'),('PasswordHash',hashed)]:
|
||||||
|
lines.append(f'Authentication__Accounts__{index}__{key}='+json.dumps(value))
|
||||||
|
accounts.append(account)
|
||||||
|
for name,value in [('gateway.env',text.rstrip()+'\n'+'\n'.join(lines)+'\n'),('accounts.json',json.dumps(accounts,indent=2))]:
|
||||||
|
path=out/name;path.write_text(value);os.chmod(path,0o600)
|
||||||
|
print(f'Generated {a.count} synthetic accounts. Original gateway configuration was not changed.')
|
||||||
|
print('Review and install',out/'gateway.env','then restart the gateway. Keep accounts.json private.')
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Export nonsecret measured evidence and figures supporting the 26-thread choice."""
|
||||||
|
from pathlib import Path
|
||||||
|
import argparse,csv,json,statistics,os,datetime as dt
|
||||||
|
HERE=Path(__file__).resolve().parent
|
||||||
|
p=argparse.ArgumentParser();p.add_argument('--results',type=Path,default=HERE/'results');p.add_argument('--output',type=Path,default=HERE/'evidence/26-thread-choice');a=p.parse_args()
|
||||||
|
a.output.mkdir(parents=True,exist_ok=True);os.environ.setdefault('MPLCONFIGDIR',str(a.results/'.figure-cache'))
|
||||||
|
import matplotlib
|
||||||
|
matplotlib.use('Agg')
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
import matplotlib.dates as dates
|
||||||
|
rows=[]
|
||||||
|
for n in [15,20,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,50]:
|
||||||
|
run=2 if n==30 else 1;folder=a.results/f'capacity-shared-{n}-human-delay-run{run}'
|
||||||
|
m=json.loads((folder/'run.json').read_text())
|
||||||
|
assert m['exit_code']==0 and m['think_min_ms']==500 and m['think_mean_ms']==1000
|
||||||
|
with (folder/'measured.csv').open() as f:samples=list(csv.DictReader(f))
|
||||||
|
rows.append({'threads':n,'run':folder.name,'cpu_percent':m['server_metrics']['192.168.1.125 CPU combined']['mean'],'mean_response_ms':statistics.mean(int(r['elapsed']) for r in samples),'requests_per_second':m['measured_http_requests_per_second'],'power_watts':m['power_energy']['average_watts'],'failed_requests':m['measured_failed_http_samples']})
|
||||||
|
with (a.output/'calibration.csv').open('w') as f:w=csv.DictWriter(f,fieldnames=list(rows[0]),lineterminator='\n');w.writeheader();w.writerows(rows)
|
||||||
|
def cpu_trace(name,filename):
|
||||||
|
folder=a.results/name;m=json.loads((folder/'run.json').read_text())
|
||||||
|
with (folder/'perfmon.csv').open() as f:trace=[{'timestamp_ms':int(r['timeStamp']),'cpu_percent':float(r['elapsed'])/1000} for r in csv.DictReader(f) if r['label'].endswith(' CPU combined') and r['success']=='true' and m['measurement_start_ms']<=int(r['timeStamp'])<m['measurement_end_ms']]
|
||||||
|
with (a.output/filename).open('w') as f:w=csv.DictWriter(f,fieldnames=['timestamp_ms','cpu_percent'],lineterminator='\n');w.writeheader();w.writerows(trace)
|
||||||
|
return m,trace
|
||||||
|
idle,idle_trace=cpu_trace('idle-20261008T104130Z','idle-cpu.csv')
|
||||||
|
selected,selected_trace=cpu_trace('capacity-shared-26-human-delay-run1','selected-cpu.csv')
|
||||||
|
reserve=max(p['cpu_percent'] for p in idle_trace);ceiling=95-reserve
|
||||||
|
summary={'idle_run':'idle-20261008T104130Z','selected_run':'capacity-shared-26-human-delay-run1','observed_idle_peak_percent':reserve,'assumed_reserve_percentage_points':reserve,'planning_ceiling_percent':ceiling,'selected_cpu_mean_percent':selected['server_metrics']['192.168.1.125 CPU combined']['mean'],'selected_cpu_peak_percent':max(p['cpu_percent'] for p in selected_trace),'selected_samples':len(selected_trace),'selected_samples_ge95':sum(p['cpu_percent']>=95 for p in selected_trace),'selected_samples_ge98':sum(p['cpu_percent']>=98 for p in selected_trace),'idle_samples':len(idle_trace),'idle_samples_ge5':sum(p['cpu_percent']>=5 for p in idle_trace),'idle_samples_ge10':sum(p['cpu_percent']>=10 for p in idle_trace),'idle_power_watts':idle['power_energy']['average_watts'],'selected_power_watts':selected['power_energy']['average_watts'],'long_run_protocol':{'threads':26,'warmup_seconds':1800,'measurement_seconds':14400,'sampling_interval_ms':1000,'think_min_ms':500,'think_mean_ms':1000,'think_parent_gaussian_sd_ms':250,'think_max_ms':1500,'session_pause_ms':0},'qualification':'Observed idle peak is a planning reserve, not an independently measured incremental disturbance or guaranteed bound.'}
|
||||||
|
(a.output/'evidence-summary.json').write_text(json.dumps(summary,indent=2))
|
||||||
|
def save(fig,name):
|
||||||
|
fig.savefig(a.output/(name+'.png'),dpi=170);fig.savefig(a.output/(name+'.svg'));plt.close(fig)
|
||||||
|
svg=a.output/(name+'.svg');svg.write_text('\n'.join(line.rstrip() for line in svg.read_text().splitlines())+'\n')
|
||||||
|
fig,axes=plt.subplots(1,2,figsize=(13,5),layout='constrained')
|
||||||
|
for ax,xfield,xlabel in [(axes[0],'threads','Concurrent threads'),(axes[1],'cpu_percent','Mean whole-machine CPU utilisation (%)')]:
|
||||||
|
ax.plot([r[xfield] for r in rows],[r['mean_response_ms'] for r in rows],'o-',markersize=4,label='Measured mean response time')
|
||||||
|
choice=next(r for r in rows if r['threads']==26);ax.scatter([choice[xfield]],[choice['mean_response_ms']],s=110,color='#b34416',zorder=4,label='Selected: 26 threads')
|
||||||
|
for n in [26,35,40,50]:
|
||||||
|
r=next(r for r in rows if r['threads']==n);ax.annotate(str(n)+' threads',(r[xfield],r['mean_response_ms']),xytext=(-5,10),textcoords='offset points',ha='right',fontsize=8)
|
||||||
|
ax.set_xlabel(xlabel);ax.set_ylabel('Mean response time (ms)');ax.set_ylim(bottom=0);ax.grid(alpha=.25);ax.legend(loc='upper left',fontsize=8)
|
||||||
|
axes[1].set_xlim(45,100)
|
||||||
|
fig.suptitle('Selected workload is below the observed steep-rise region\nMatched request pacing and shared data; ten-minute calibration trials')
|
||||||
|
save(fig,'mean-response-knee')
|
||||||
|
fig,ax=plt.subplots(figsize=(10,5),layout='constrained')
|
||||||
|
ax.plot([r['threads'] for r in rows],[r['cpu_percent'] for r in rows],'o-',markersize=4,label='Measured mean CPU')
|
||||||
|
ax.axhline(95,color='#ad3828',linestyle='--',label='95% planning limit')
|
||||||
|
ax.axhline(ceiling,color='#86671d',linestyle='--',label=f'Planning ceiling: 95 − {reserve:.3f} = {ceiling:.3f}%')
|
||||||
|
choice=next(r for r in rows if r['threads']==26);ax.scatter([26],[choice['cpu_percent']],s=120,color='#217a52',zorder=4);ax.annotate(f'26 threads: {choice["cpu_percent"]:.1f}%',(26,choice['cpu_percent']),xytext=(-45,-32),textcoords='offset points',arrowprops={'arrowstyle':'->'})
|
||||||
|
ax.set_xlabel('Concurrent threads');ax.set_ylabel('Mean CPU utilisation (%)');ax.set_ylim(40,102);ax.grid(alpha=.25);ax.legend(loc='lower right',fontsize=8);ax.set_title('Headroom rule applied to average CPU — not a per-second guarantee')
|
||||||
|
save(fig,'cpu-headroom')
|
||||||
|
fig,ax=plt.subplots(figsize=(12,4),layout='constrained')
|
||||||
|
x=[dt.datetime.fromtimestamp(r['timestamp_ms']/1000,dt.timezone.utc) for r in idle_trace]
|
||||||
|
ax.plot(x,[r['cpu_percent'] for r in idle_trace],linewidth=.7)
|
||||||
|
peak=max(idle_trace,key=lambda r:r['cpu_percent']);instant=dt.datetime.fromtimestamp(peak['timestamp_ms']/1000,dt.timezone.utc)
|
||||||
|
ax.annotate(f'Observed maximum: {reserve:.3f}%',(instant,reserve),xytext=(20,-25),textcoords='offset points',arrowprops={'arrowstyle':'->'})
|
||||||
|
ax.xaxis.set_major_formatter(dates.DateFormatter('%H:%M',tz=dt.timezone.utc));ax.set_xlabel('UTC time on 2026-10-08');ax.set_ylabel('CPU utilisation (%)');ax.set_ylim(0,13);ax.grid(alpha=.25);ax.set_title('Four-hour idle baseline: zero application requests; monitoring active')
|
||||||
|
save(fig,'idle-cpu-spikes')
|
||||||
|
fig,ax=plt.subplots(figsize=(12,4),layout='constrained')
|
||||||
|
x=[(r['timestamp_ms']-selected['measurement_start_ms'])/1000 for r in selected_trace]
|
||||||
|
ax.plot(x,[r['cpu_percent'] for r in selected_trace],linewidth=.8,label='One-second CPU readings')
|
||||||
|
ax.axhline(choice['cpu_percent'],color='#217a52',label=f'Mean: {choice["cpu_percent"]:.1f}%')
|
||||||
|
ax.axhline(95,color='#ad3828',linestyle='--',label='95% reference')
|
||||||
|
ax.set_xlabel('Seconds into the ten-minute measured window');ax.set_ylabel('CPU utilisation (%)');ax.set_ylim(40,102);ax.grid(alpha=.25);ax.legend(loc='lower right',fontsize=8);ax.set_title('26 threads: transient saturation remains possible (25 / 600 samples ≥95%)')
|
||||||
|
save(fig,'selected-cpu-trace')
|
||||||
|
print('Exported four figures, calibration table, CPU traces and evidence summary:',a.output)
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Sum timestamped external power readings at the nominal polling interval."""
|
||||||
|
import argparse, csv, datetime as dt, json
|
||||||
|
from pathlib import Path
|
||||||
|
p=argparse.ArgumentParser();p.add_argument('run');p.add_argument('power_csv');p.add_argument('--idle-watts',type=float);p.add_argument('--interval-seconds',type=float,default=1);a=p.parse_args()
|
||||||
|
run=json.loads(Path(a.run).read_text());start=run['measurement_start_ms']/1000;end=run['measurement_end_ms']/1000
|
||||||
|
points=[]
|
||||||
|
with open(a.power_csv) as f:
|
||||||
|
for r in csv.DictReader(f):
|
||||||
|
instant=dt.datetime.fromisoformat(r['timestamp'].replace('Z','+00:00'))
|
||||||
|
if instant.tzinfo is None: p.error('Power timestamps require a timezone')
|
||||||
|
watts=float(r['power_watts'])
|
||||||
|
if not 0<=watts<float('inf'):p.error('Power must be finite and nonnegative')
|
||||||
|
points.append((instant.timestamp(),watts))
|
||||||
|
if len(points)<2 or any(b[0]<=a[0] for a,b in zip(points,points[1:])):p.error('Power timestamps must be strictly increasing')
|
||||||
|
if points[0][0]>start or points[-1][0]<end:p.error('Power samples must cover the entire measurement interval')
|
||||||
|
if a.interval_seconds<=0:p.error('Interval must be positive')
|
||||||
|
measured=[power for timestamp,power in points if start<=timestamp<end]
|
||||||
|
if not measured:p.error('No power readings in measurement window')
|
||||||
|
coverage=len(measured)*a.interval_seconds
|
||||||
|
joules=sum(measured)*a.interval_seconds
|
||||||
|
result={'duration_seconds':end-start,'power_sample_count':len(measured),'nominal_sample_coverage_seconds':coverage,'method':'sum of recorded power readings multiplied by nominal interval','joules':joules,'kWh':joules/3600000,'average_watts':sum(measured)/len(measured)}
|
||||||
|
if a.idle_watts is not None:result['joules_above_idle']=joules-a.idle_watts*coverage
|
||||||
|
count=run.get('measured_http_samples',0)
|
||||||
|
if count:result['joules_per_http_request']=joules/count
|
||||||
|
print(json.dumps(result,indent=2))
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
threads,run,cpu_percent,mean_response_ms,requests_per_second,power_watts,failed_requests
|
||||||
|
15,capacity-shared-15-human-delay-run1,50.895801666666664,79.34052499101043,13.905,7.311085382211325,0
|
||||||
|
20,capacity-shared-20-human-delay-run1,65.083935,98.86954928545255,18.19333333333333,8.0890766215625,0
|
||||||
|
25,capacity-shared-25-human-delay-run1,78.16213333333333,128.36280189601987,22.151666666666667,8.764036898464678,0
|
||||||
|
26,capacity-shared-26-human-delay-run1,80.60345333333333,139.38706613080015,22.808333333333334,8.899511694113961,0
|
||||||
|
27,capacity-shared-27-human-delay-run1,82.96233333333333,148.47303139839818,23.515,9.036443046141601,0
|
||||||
|
28,capacity-shared-28-human-delay-run1,85.14292333333333,161.7337208497682,24.085,9.17391177691059,0
|
||||||
|
29,capacity-shared-29-human-delay-run1,87.06948666666668,173.3995543250726,24.68166666666667,9.21969683437396,0
|
||||||
|
30,capacity-shared-30-human-delay-run2,88.99881333333333,182.9120626151013,25.34,9.337538094281125,0
|
||||||
|
31,capacity-shared-31-human-delay-run1,90.41707833333334,205.14021541655853,25.686666666666667,9.406692395193705,0
|
||||||
|
32,capacity-shared-32-human-delay-run1,92.08799333333333,218.39473851432928,26.22833333333333,9.47666378438836,0
|
||||||
|
33,capacity-shared-33-human-delay-run1,93.45843666666666,237.0786376158277,26.62,9.510238336982816,0
|
||||||
|
34,capacity-shared-34-human-delay-run1,94.94577166666667,253.21672816728167,27.1,9.625515573054285,0
|
||||||
|
35,capacity-shared-35-human-delay-run1,95.64982,279.99633900787114,27.315,9.653541583333334,0
|
||||||
|
36,capacity-shared-36-human-delay-run1,96.68018166666666,308.8980768064066,27.471666666666668,9.700332333333334,0
|
||||||
|
37,capacity-shared-37-human-delay-run1,97.42113666666667,338.35063367531683,27.616666666666667,9.73826068038247,0
|
||||||
|
38,capacity-shared-38-human-delay-run1,97.793315,381.2771442436006,27.476666666666667,9.750565151409038,0
|
||||||
|
39,capacity-shared-39-human-delay-run1,98.11210833333334,415.07466844304486,27.52166666666667,9.74681905188326,0
|
||||||
|
40,capacity-shared-40-human-delay-run1,98.25498333333333,424.66961792144514,28.048333333333332,9.748927936868148,0
|
||||||
|
50,capacity-shared-50-human-delay-run1,98.71679666666667,784.9196039840162,27.945,9.807314705581957,0
|
||||||
|
|
After Width: | Height: | Size: 91 KiB |
|
After Width: | Height: | Size: 49 KiB |
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"idle_run": "idle-20261008T104130Z",
|
||||||
|
"selected_run": "capacity-shared-26-human-delay-run1",
|
||||||
|
"observed_idle_peak_percent": 11.055,
|
||||||
|
"assumed_reserve_percentage_points": 11.055,
|
||||||
|
"planning_ceiling_percent": 83.945,
|
||||||
|
"selected_cpu_mean_percent": 80.60345333333333,
|
||||||
|
"selected_cpu_peak_percent": 98.994,
|
||||||
|
"selected_samples": 600,
|
||||||
|
"selected_samples_ge95": 25,
|
||||||
|
"selected_samples_ge98": 7,
|
||||||
|
"idle_samples": 14395,
|
||||||
|
"idle_samples_ge5": 7,
|
||||||
|
"idle_samples_ge10": 1,
|
||||||
|
"idle_power_watts": 4.450219402777778,
|
||||||
|
"selected_power_watts": 8.899511694113961,
|
||||||
|
"long_run_protocol": {
|
||||||
|
"threads": 26,
|
||||||
|
"warmup_seconds": 1800,
|
||||||
|
"measurement_seconds": 14400,
|
||||||
|
"sampling_interval_ms": 1000,
|
||||||
|
"think_min_ms": 500,
|
||||||
|
"think_mean_ms": 1000,
|
||||||
|
"think_parent_gaussian_sd_ms": 250,
|
||||||
|
"think_max_ms": 1500,
|
||||||
|
"session_pause_ms": 0
|
||||||
|
},
|
||||||
|
"qualification": "Observed idle peak is a planning reserve, not an independently measured incremental disturbance or guaranteed bound."
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 278 KiB |
|
After Width: | Height: | Size: 154 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 259 KiB |
|
After Width: | Height: | Size: 58 KiB |
@@ -0,0 +1,601 @@
|
|||||||
|
timestamp_ms,cpu_percent
|
||||||
|
1791502598833,72.222
|
||||||
|
1791502599833,90.909
|
||||||
|
1791502600833,86.934
|
||||||
|
1791502601834,76.02
|
||||||
|
1791502602834,61.224
|
||||||
|
1791502603834,76.5
|
||||||
|
1791502604834,92.893
|
||||||
|
1791502605834,83.838
|
||||||
|
1791502606835,76.53
|
||||||
|
1791502607835,90.954
|
||||||
|
1791502608835,73.604
|
||||||
|
1791502609835,72.081
|
||||||
|
1791502610836,79.797
|
||||||
|
1791502611836,90.862
|
||||||
|
1791502612836,74.747
|
||||||
|
1791502613836,77.435
|
||||||
|
1791502614837,96.482
|
||||||
|
1791502615837,77.777
|
||||||
|
1791502616837,81.313
|
||||||
|
1791502617838,86.5
|
||||||
|
1791502618838,83.838
|
||||||
|
1791502619838,74.242
|
||||||
|
1791502620838,72.959
|
||||||
|
1791502621838,84.924
|
||||||
|
1791502622839,76.884
|
||||||
|
1791502623839,89.847
|
||||||
|
1791502624839,73.096
|
||||||
|
1791502625839,83.919
|
||||||
|
1791502626840,73.846
|
||||||
|
1791502627840,84.848
|
||||||
|
1791502628840,81.313
|
||||||
|
1791502629840,85.929
|
||||||
|
1791502630841,79.081
|
||||||
|
1791502631841,76.142
|
||||||
|
1791502632841,84.422
|
||||||
|
1791502633841,64.974
|
||||||
|
1791502634842,92.385
|
||||||
|
1791502635842,83.333
|
||||||
|
1791502636842,82.323
|
||||||
|
1791502637842,73.096
|
||||||
|
1791502638843,85.858
|
||||||
|
1791502639843,76.923
|
||||||
|
1791502640843,82.323
|
||||||
|
1791502641843,85.279
|
||||||
|
1791502642843,84.343
|
||||||
|
1791502643844,90.862
|
||||||
|
1791502644844,71.938
|
||||||
|
1791502645844,80.904
|
||||||
|
1791502646844,72.588
|
||||||
|
1791502647845,77.272
|
||||||
|
1791502648845,88.888
|
||||||
|
1791502649845,80.303
|
||||||
|
1791502650845,84.343
|
||||||
|
1791502651846,73.604
|
||||||
|
1791502652846,83.756
|
||||||
|
1791502653846,68.205
|
||||||
|
1791502654846,79.695
|
||||||
|
1791502655846,89.949
|
||||||
|
1791502656847,78.68
|
||||||
|
1791502657847,86.363
|
||||||
|
1791502658847,78.68
|
||||||
|
1791502659847,72.588
|
||||||
|
1791502660847,82.142
|
||||||
|
1791502661848,81.818
|
||||||
|
1791502662848,81.218
|
||||||
|
1791502663848,82.323
|
||||||
|
1791502664848,86.934
|
||||||
|
1791502665849,68.367
|
||||||
|
1791502666849,72.864
|
||||||
|
1791502667849,87.878
|
||||||
|
1791502668849,85.929
|
||||||
|
1791502669849,95.959
|
||||||
|
1791502670850,89.795
|
||||||
|
1791502671850,84.343
|
||||||
|
1791502672850,75.757
|
||||||
|
1791502673850,69.035
|
||||||
|
1791502674850,76.142
|
||||||
|
1791502675851,87.437
|
||||||
|
1791502676851,84.848
|
||||||
|
1791502677851,74.489
|
||||||
|
1791502678851,98.5
|
||||||
|
1791502679851,55.329
|
||||||
|
1791502680851,86.294
|
||||||
|
1791502681852,66.326
|
||||||
|
1791502682852,83.919
|
||||||
|
1791502683852,82.142
|
||||||
|
1791502684852,74.242
|
||||||
|
1791502685852,86.363
|
||||||
|
1791502686853,73.0
|
||||||
|
1791502687853,80.412
|
||||||
|
1791502688853,73.0
|
||||||
|
1791502689853,87.309
|
||||||
|
1791502690853,85.427
|
||||||
|
1791502691854,76.767
|
||||||
|
1791502692854,86.432
|
||||||
|
1791502693854,79.081
|
||||||
|
1791502694854,77.272
|
||||||
|
1791502695855,78.499
|
||||||
|
1791502696855,72.959
|
||||||
|
1791502697855,84.924
|
||||||
|
1791502698855,88.442
|
||||||
|
1791502699855,81.122
|
||||||
|
1791502700856,78.68
|
||||||
|
1791502701856,77.04
|
||||||
|
1791502702856,77.664
|
||||||
|
1791502703856,75.634
|
||||||
|
1791502704856,88.383
|
||||||
|
1791502705857,72.081
|
||||||
|
1791502706857,98.507
|
||||||
|
1791502707857,67.346
|
||||||
|
1791502708857,76.649
|
||||||
|
1791502709857,67.525
|
||||||
|
1791502710858,86.432
|
||||||
|
1791502711858,91.414
|
||||||
|
1791502712858,83.838
|
||||||
|
1791502713858,84.263
|
||||||
|
1791502714858,80.102
|
||||||
|
1791502715859,74.0
|
||||||
|
1791502716859,78.68
|
||||||
|
1791502717859,82.741
|
||||||
|
1791502718859,80.71
|
||||||
|
1791502719859,84.924
|
||||||
|
1791502720860,84.422
|
||||||
|
1791502721860,73.604
|
||||||
|
1791502722860,71.212
|
||||||
|
1791502723860,87.817
|
||||||
|
1791502724860,79.899
|
||||||
|
1791502725861,88.888
|
||||||
|
1791502726861,76.884
|
||||||
|
1791502727861,83.756
|
||||||
|
1791502728861,76.142
|
||||||
|
1791502729861,85.353
|
||||||
|
1791502730862,87.755
|
||||||
|
1791502731862,80.303
|
||||||
|
1791502732862,77.386
|
||||||
|
1791502733862,87.878
|
||||||
|
1791502734863,69.897
|
||||||
|
1791502735863,88.888
|
||||||
|
1791502736863,81.218
|
||||||
|
1791502737863,69.191
|
||||||
|
1791502738863,85.858
|
||||||
|
1791502739864,97.0
|
||||||
|
1791502740864,70.618
|
||||||
|
1791502741864,67.676
|
||||||
|
1791502742864,86.432
|
||||||
|
1791502743864,74.489
|
||||||
|
1791502744865,74.242
|
||||||
|
1791502745865,91.919
|
||||||
|
1791502746865,98.507
|
||||||
|
1791502747865,58.974
|
||||||
|
1791502748865,85.572
|
||||||
|
1791502749866,84.263
|
||||||
|
1791502750866,71.212
|
||||||
|
1791502751866,74.747
|
||||||
|
1791502752866,98.994
|
||||||
|
1791502753866,75.376
|
||||||
|
1791502754867,79.797
|
||||||
|
1791502755867,90.909
|
||||||
|
1791502756867,75.252
|
||||||
|
1791502757867,69.035
|
||||||
|
1791502758867,89.393
|
||||||
|
1791502759868,80.71
|
||||||
|
1791502760868,83.582
|
||||||
|
1791502761868,89.847
|
||||||
|
1791502762868,82.412
|
||||||
|
1791502763868,62.244
|
||||||
|
1791502764869,80.612
|
||||||
|
1791502765869,79.187
|
||||||
|
1791502766869,80.0
|
||||||
|
1791502767869,78.974
|
||||||
|
1791502768869,87.437
|
||||||
|
1791502769870,68.527
|
||||||
|
1791502770870,75.252
|
||||||
|
1791502771870,87.5
|
||||||
|
1791502772870,79.695
|
||||||
|
1791502773870,88.0
|
||||||
|
1791502774871,78.787
|
||||||
|
1791502775871,85.858
|
||||||
|
1791502776871,80.808
|
||||||
|
1791502777871,72.588
|
||||||
|
1791502778871,90.954
|
||||||
|
1791502779872,80.303
|
||||||
|
1791502780872,84.343
|
||||||
|
1791502781872,80.102
|
||||||
|
1791502782872,97.5
|
||||||
|
1791502783872,65.989
|
||||||
|
1791502784873,74.747
|
||||||
|
1791502785873,81.725
|
||||||
|
1791502786873,89.393
|
||||||
|
1791502787873,77.272
|
||||||
|
1791502788873,79.695
|
||||||
|
1791502789874,90.909
|
||||||
|
1791502790874,66.497
|
||||||
|
1791502791874,83.756
|
||||||
|
1791502792874,84.422
|
||||||
|
1791502793874,78.974
|
||||||
|
1791502794875,87.373
|
||||||
|
1791502795875,77.551
|
||||||
|
1791502796875,84.0
|
||||||
|
1791502797875,76.02
|
||||||
|
1791502798875,74.747
|
||||||
|
1791502799876,82.323
|
||||||
|
1791502800876,87.939
|
||||||
|
1791502801876,78.172
|
||||||
|
1791502802876,83.582
|
||||||
|
1791502803876,79.292
|
||||||
|
1791502804877,79.187
|
||||||
|
1791502805877,73.737
|
||||||
|
1791502806877,81.725
|
||||||
|
1791502807877,85.353
|
||||||
|
1791502808877,80.102
|
||||||
|
1791502809877,81.313
|
||||||
|
1791502810878,87.373
|
||||||
|
1791502811878,80.5
|
||||||
|
1791502812878,77.777
|
||||||
|
1791502813878,74.874
|
||||||
|
1791502814878,85.786
|
||||||
|
1791502815879,82.914
|
||||||
|
1791502816879,88.5
|
||||||
|
1791502817879,74.619
|
||||||
|
1791502818879,85.279
|
||||||
|
1791502819879,73.979
|
||||||
|
1791502820879,76.649
|
||||||
|
1791502821880,75.757
|
||||||
|
1791502822880,87.373
|
||||||
|
1791502823880,96.0
|
||||||
|
1791502824880,70.351
|
||||||
|
1791502825880,73.333
|
||||||
|
1791502826881,83.417
|
||||||
|
1791502827881,84.343
|
||||||
|
1791502828881,74.747
|
||||||
|
1791502829881,89.34
|
||||||
|
1791502830881,92.385
|
||||||
|
1791502831882,83.417
|
||||||
|
1791502832882,69.035
|
||||||
|
1791502833882,75.252
|
||||||
|
1791502834882,86.868
|
||||||
|
1791502835882,81.909
|
||||||
|
1791502836882,79.187
|
||||||
|
1791502837883,75.879
|
||||||
|
1791502838883,97.487
|
||||||
|
1791502839883,68.844
|
||||||
|
1791502840883,70.351
|
||||||
|
1791502841883,77.948
|
||||||
|
1791502842884,88.383
|
||||||
|
1791502843884,96.984
|
||||||
|
1791502844884,83.756
|
||||||
|
1791502845884,81.909
|
||||||
|
1791502846884,78.68
|
||||||
|
1791502847885,73.096
|
||||||
|
1791502848885,83.417
|
||||||
|
1791502849885,86.294
|
||||||
|
1791502850885,78.894
|
||||||
|
1791502851885,79.081
|
||||||
|
1791502852885,89.898
|
||||||
|
1791502853886,75.634
|
||||||
|
1791502854886,64.141
|
||||||
|
1791502855886,95.477
|
||||||
|
1791502856886,77.272
|
||||||
|
1791502857886,85.786
|
||||||
|
1791502858887,82.828
|
||||||
|
1791502859887,91.457
|
||||||
|
1791502860887,66.836
|
||||||
|
1791502861887,85.204
|
||||||
|
1791502862887,75.124
|
||||||
|
1791502863887,82.828
|
||||||
|
1791502864888,80.303
|
||||||
|
1791502865888,80.904
|
||||||
|
1791502866888,79.695
|
||||||
|
1791502867888,77.272
|
||||||
|
1791502868888,80.5
|
||||||
|
1791502869889,81.909
|
||||||
|
1791502870889,81.313
|
||||||
|
1791502871889,97.474
|
||||||
|
1791502872889,78.391
|
||||||
|
1791502873889,64.974
|
||||||
|
1791502874890,67.857
|
||||||
|
1791502875890,88.442
|
||||||
|
1791502876890,78.68
|
||||||
|
1791502877890,76.142
|
||||||
|
1791502878890,94.444
|
||||||
|
1791502879890,79.5
|
||||||
|
1791502880891,57.142
|
||||||
|
1791502881891,76.262
|
||||||
|
1791502882891,83.333
|
||||||
|
1791502883891,78.0
|
||||||
|
1791502884891,87.437
|
||||||
|
1791502885892,82.323
|
||||||
|
1791502886892,87.373
|
||||||
|
1791502887892,69.387
|
||||||
|
1791502888892,76.884
|
||||||
|
1791502889892,78.172
|
||||||
|
1791502890892,76.767
|
||||||
|
1791502891893,90.954
|
||||||
|
1791502892893,81.313
|
||||||
|
1791502893893,80.303
|
||||||
|
1791502894893,75.252
|
||||||
|
1791502895893,72.588
|
||||||
|
1791502896894,87.878
|
||||||
|
1791502897894,89.898
|
||||||
|
1791502898894,96.446
|
||||||
|
1791502899894,77.499
|
||||||
|
1791502900894,81.725
|
||||||
|
1791502901895,85.858
|
||||||
|
1791502902895,69.23
|
||||||
|
1791502903895,84.422
|
||||||
|
1791502904895,90.954
|
||||||
|
1791502905895,82.828
|
||||||
|
1791502906895,82.233
|
||||||
|
1791502907896,81.218
|
||||||
|
1791502908896,74.874
|
||||||
|
1791502909896,71.717
|
||||||
|
1791502910896,73.604
|
||||||
|
1791502911896,97.487
|
||||||
|
1791502912896,82.914
|
||||||
|
1791502913897,84.343
|
||||||
|
1791502914897,89.393
|
||||||
|
1791502915897,67.676
|
||||||
|
1791502916897,70.918
|
||||||
|
1791502917897,85.353
|
||||||
|
1791502918898,81.407
|
||||||
|
1791502919898,71.794
|
||||||
|
1791502920898,89.949
|
||||||
|
1791502921898,84.0
|
||||||
|
1791502922898,75.126
|
||||||
|
1791502923899,77.889
|
||||||
|
1791502924899,81.122
|
||||||
|
1791502925899,83.919
|
||||||
|
1791502926899,79.797
|
||||||
|
1791502927899,89.447
|
||||||
|
1791502928900,79.695
|
||||||
|
1791502929900,78.68
|
||||||
|
1791502930900,73.869
|
||||||
|
1791502931900,94.472
|
||||||
|
1791502932900,73.979
|
||||||
|
1791502933901,85.427
|
||||||
|
1791502934901,79.396
|
||||||
|
1791502935901,97.0
|
||||||
|
1791502936901,60.406
|
||||||
|
1791502937901,70.707
|
||||||
|
1791502938901,89.393
|
||||||
|
1791502939902,77.777
|
||||||
|
1791502940902,72.727
|
||||||
|
1791502941902,84.771
|
||||||
|
1791502942902,84.848
|
||||||
|
1791502943902,77.889
|
||||||
|
1791502944902,88.383
|
||||||
|
1791502945903,79.695
|
||||||
|
1791502946903,76.767
|
||||||
|
1791502947903,76.262
|
||||||
|
1791502948903,91.37
|
||||||
|
1791502949903,90.954
|
||||||
|
1791502950904,73.604
|
||||||
|
1791502951904,74.747
|
||||||
|
1791502952904,83.248
|
||||||
|
1791502953904,87.939
|
||||||
|
1791502954904,76.02
|
||||||
|
1791502955904,89.898
|
||||||
|
1791502956905,68.527
|
||||||
|
1791502957905,87.309
|
||||||
|
1791502958905,80.303
|
||||||
|
1791502959905,73.869
|
||||||
|
1791502960905,92.893
|
||||||
|
1791502961905,83.673
|
||||||
|
1791502962906,79.396
|
||||||
|
1791502963906,81.909
|
||||||
|
1791502964907,83.5
|
||||||
|
1791502965907,65.816
|
||||||
|
1791502966907,79.695
|
||||||
|
1791502967907,77.272
|
||||||
|
1791502968907,89.898
|
||||||
|
1791502969908,72.588
|
||||||
|
1791502970908,80.808
|
||||||
|
1791502971908,77.777
|
||||||
|
1791502972908,79.292
|
||||||
|
1791502973908,79.292
|
||||||
|
1791502974908,76.41
|
||||||
|
1791502975909,74.747
|
||||||
|
1791502976909,82.412
|
||||||
|
1791502977909,83.756
|
||||||
|
1791502978909,76.884
|
||||||
|
1791502979909,81.122
|
||||||
|
1791502980910,82.914
|
||||||
|
1791502981910,72.959
|
||||||
|
1791502982910,70.707
|
||||||
|
1791502983910,88.832
|
||||||
|
1791502984910,70.558
|
||||||
|
1791502985911,90.355
|
||||||
|
1791502986911,85.858
|
||||||
|
1791502987911,70.707
|
||||||
|
1791502988911,80.808
|
||||||
|
1791502989911,80.904
|
||||||
|
1791502990911,84.771
|
||||||
|
1791502991912,84.422
|
||||||
|
1791502992912,76.262
|
||||||
|
1791502993912,81.725
|
||||||
|
1791502994912,91.919
|
||||||
|
1791502995912,78.391
|
||||||
|
1791502996913,72.081
|
||||||
|
1791502997913,84.343
|
||||||
|
1791502998913,89.949
|
||||||
|
1791502999913,68.181
|
||||||
|
1791503000913,83.248
|
||||||
|
1791503001913,77.777
|
||||||
|
1791503002914,79.292
|
||||||
|
1791503003914,80.102
|
||||||
|
1791503004914,83.417
|
||||||
|
1791503005914,76.649
|
||||||
|
1791503006914,75.252
|
||||||
|
1791503007915,84.422
|
||||||
|
1791503008915,76.142
|
||||||
|
1791503009915,78.894
|
||||||
|
1791503010915,82.914
|
||||||
|
1791503011915,73.979
|
||||||
|
1791503012915,96.984
|
||||||
|
1791503013916,61.111
|
||||||
|
1791503014916,77.664
|
||||||
|
1791503015916,98.484
|
||||||
|
1791503016916,74.371
|
||||||
|
1791503017916,73.604
|
||||||
|
1791503018917,96.969
|
||||||
|
1791503019917,86.363
|
||||||
|
1791503020917,69.696
|
||||||
|
1791503021917,84.263
|
||||||
|
1791503022917,90.954
|
||||||
|
1791503023917,71.794
|
||||||
|
1791503024918,81.0
|
||||||
|
1791503025918,78.787
|
||||||
|
1791503026918,79.899
|
||||||
|
1791503027918,80.102
|
||||||
|
1791503028918,77.664
|
||||||
|
1791503029919,79.292
|
||||||
|
1791503030919,95.0
|
||||||
|
1791503031919,72.588
|
||||||
|
1791503032919,78.68
|
||||||
|
1791503033919,76.649
|
||||||
|
1791503034919,81.909
|
||||||
|
1791503035920,84.422
|
||||||
|
1791503036920,78.172
|
||||||
|
1791503037920,86.868
|
||||||
|
1791503038920,83.838
|
||||||
|
1791503039920,83.163
|
||||||
|
1791503040920,77.551
|
||||||
|
1791503041921,73.232
|
||||||
|
1791503042921,76.41
|
||||||
|
1791503043921,87.373
|
||||||
|
1791503044921,88.832
|
||||||
|
1791503045921,76.884
|
||||||
|
1791503046922,86.294
|
||||||
|
1791503047922,62.626
|
||||||
|
1791503048922,92.424
|
||||||
|
1791503049922,79.899
|
||||||
|
1791503050922,73.604
|
||||||
|
1791503051923,87.939
|
||||||
|
1791503052923,78.172
|
||||||
|
1791503053923,72.081
|
||||||
|
1791503054923,77.664
|
||||||
|
1791503055923,77.499
|
||||||
|
1791503056924,85.279
|
||||||
|
1791503057924,78.282
|
||||||
|
1791503058924,95.0
|
||||||
|
1791503059924,63.959
|
||||||
|
1791503060924,84.924
|
||||||
|
1791503061924,78.172
|
||||||
|
1791503062925,74.619
|
||||||
|
1791503063925,92.893
|
||||||
|
1791503064925,87.5
|
||||||
|
1791503065925,83.756
|
||||||
|
1791503066925,85.858
|
||||||
|
1791503067926,73.737
|
||||||
|
1791503068926,77.664
|
||||||
|
1791503069926,77.272
|
||||||
|
1791503070926,93.939
|
||||||
|
1791503071926,83.919
|
||||||
|
1791503072926,71.573
|
||||||
|
1791503073927,75.126
|
||||||
|
1791503074927,84.924
|
||||||
|
1791503075927,86.802
|
||||||
|
1791503076927,82.089
|
||||||
|
1791503077927,85.279
|
||||||
|
1791503078927,88.888
|
||||||
|
1791503079928,75.252
|
||||||
|
1791503080928,91.878
|
||||||
|
1791503081928,69.696
|
||||||
|
1791503082928,84.924
|
||||||
|
1791503083928,80.203
|
||||||
|
1791503084929,82.741
|
||||||
|
1791503085929,81.218
|
||||||
|
1791503086929,81.538
|
||||||
|
1791503087929,83.838
|
||||||
|
1791503088929,73.737
|
||||||
|
1791503089929,90.909
|
||||||
|
1791503090930,73.096
|
||||||
|
1791503091930,86.934
|
||||||
|
1791503092930,83.417
|
||||||
|
1791503093930,78.061
|
||||||
|
1791503094930,91.414
|
||||||
|
1791503095930,67.857
|
||||||
|
1791503096931,84.577
|
||||||
|
1791503097931,78.68
|
||||||
|
1791503098931,73.737
|
||||||
|
1791503099931,95.959
|
||||||
|
1791503100931,87.562
|
||||||
|
1791503101932,79.292
|
||||||
|
1791503102932,70.558
|
||||||
|
1791503103932,80.904
|
||||||
|
1791503104932,84.848
|
||||||
|
1791503105932,78.391
|
||||||
|
1791503106932,83.417
|
||||||
|
1791503107933,79.187
|
||||||
|
1791503108933,88.888
|
||||||
|
1791503109933,66.834
|
||||||
|
1791503110933,78.061
|
||||||
|
1791503111933,83.919
|
||||||
|
1791503112933,74.242
|
||||||
|
1791503113934,93.0
|
||||||
|
1791503114934,65.816
|
||||||
|
1791503115934,78.894
|
||||||
|
1791503116934,76.884
|
||||||
|
1791503117934,85.714
|
||||||
|
1791503118935,82.5
|
||||||
|
1791503119935,58.375
|
||||||
|
1791503120935,98.009
|
||||||
|
1791503121935,62.755
|
||||||
|
1791503122935,76.53
|
||||||
|
1791503123935,93.467
|
||||||
|
1791503124936,75.126
|
||||||
|
1791503125936,72.081
|
||||||
|
1791503126936,77.948
|
||||||
|
1791503127936,90.404
|
||||||
|
1791503128936,78.68
|
||||||
|
1791503129936,78.282
|
||||||
|
1791503130937,78.172
|
||||||
|
1791503131937,71.938
|
||||||
|
1791503132937,82.914
|
||||||
|
1791503133937,74.619
|
||||||
|
1791503134937,94.472
|
||||||
|
1791503135938,80.203
|
||||||
|
1791503136938,68.02
|
||||||
|
1791503137938,81.218
|
||||||
|
1791503138938,78.68
|
||||||
|
1791503139938,82.323
|
||||||
|
1791503140939,74.242
|
||||||
|
1791503141939,98.492
|
||||||
|
1791503142939,72.727
|
||||||
|
1791503143939,82.323
|
||||||
|
1791503144939,75.51
|
||||||
|
1791503145939,87.437
|
||||||
|
1791503146940,75.897
|
||||||
|
1791503147940,82.412
|
||||||
|
1791503148940,83.838
|
||||||
|
1791503149940,77.157
|
||||||
|
1791503150940,82.653
|
||||||
|
1791503151940,80.303
|
||||||
|
1791503152941,88.888
|
||||||
|
1791503153941,81.909
|
||||||
|
1791503154941,88.324
|
||||||
|
1791503155941,70.707
|
||||||
|
1791503156941,85.858
|
||||||
|
1791503157942,80.71
|
||||||
|
1791503158942,85.427
|
||||||
|
1791503159942,69.897
|
||||||
|
1791503160942,66.834
|
||||||
|
1791503161942,94.472
|
||||||
|
1791503162942,90.0
|
||||||
|
1791503163943,67.171
|
||||||
|
1791503164943,77.777
|
||||||
|
1791503165943,88.383
|
||||||
|
1791503166943,59.595
|
||||||
|
1791503167943,69.543
|
||||||
|
1791503168943,96.5
|
||||||
|
1791503169944,67.512
|
||||||
|
1791503170944,69.897
|
||||||
|
1791503171944,93.034
|
||||||
|
1791503172944,79.797
|
||||||
|
1791503173944,65.816
|
||||||
|
1791503174945,83.756
|
||||||
|
1791503175945,90.0
|
||||||
|
1791503176945,68.367
|
||||||
|
1791503177945,78.894
|
||||||
|
1791503178945,89.393
|
||||||
|
1791503179945,80.203
|
||||||
|
1791503180946,64.615
|
||||||
|
1791503181946,81.632
|
||||||
|
1791503182946,80.904
|
||||||
|
1791503183946,88.324
|
||||||
|
1791503184946,84.183
|
||||||
|
1791503185947,78.787
|
||||||
|
1791503186947,83.248
|
||||||
|
1791503187947,87.939
|
||||||
|
1791503188947,82.323
|
||||||
|
1791503189947,81.725
|
||||||
|
1791503190947,88.888
|
||||||
|
1791503191948,76.649
|
||||||
|
1791503192948,73.979
|
||||||
|
1791503193948,94.472
|
||||||
|
1791503194948,63.451
|
||||||
|
1791503195948,91.919
|
||||||
|
1791503196949,66.836
|
||||||
|
1791503197949,84.263
|
||||||
|
@@ -0,0 +1,186 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Generate JMeter plans with the PerfMon listener; no application changes required."""
|
||||||
|
from pathlib import Path
|
||||||
|
import xml.etree.ElementTree as E
|
||||||
|
from perfmon import METRICS
|
||||||
|
|
||||||
|
OUT = Path(__file__).parent / 'plans'
|
||||||
|
|
||||||
|
def prop(parent, name, value, kind='stringProp'):
|
||||||
|
E.SubElement(parent, kind, name=name).text = str(value).lower() if isinstance(value, bool) else str(value)
|
||||||
|
|
||||||
|
def element(tree, tag, gui, name, **attrs):
|
||||||
|
e = E.SubElement(tree, tag, guiclass=gui, testclass=tag, testname=name, enabled='true', **attrs)
|
||||||
|
return e, E.SubElement(tree, 'hashTree')
|
||||||
|
|
||||||
|
def script(tree, tag, name, code):
|
||||||
|
e, t = element(tree, tag, tag+'Gui', name)
|
||||||
|
for k,v in [('scriptLanguage','groovy'),('cacheKey','true'),('filename',''),('parameters',''),('script',code)]: prop(e,k,v)
|
||||||
|
return t
|
||||||
|
|
||||||
|
def request(tree, name, method, path, body='', status=200, check=''):
|
||||||
|
e, t = element(tree,'HTTPSamplerProxy','HttpTestSampleGui','HTTP '+name)
|
||||||
|
args = E.SubElement(e,'elementProp',name='HTTPsampler.Arguments',elementType='Arguments',guiclass='HTTPArgumentsPanel',testclass='Arguments',enabled='true')
|
||||||
|
collection = E.SubElement(args,'collectionProp',name='Arguments.arguments')
|
||||||
|
if body:
|
||||||
|
arg = E.SubElement(collection,'elementProp',name='',elementType='HTTPArgument')
|
||||||
|
prop(arg,'HTTPArgument.always_encode',False,'boolProp'); prop(arg,'Argument.value',body); prop(arg,'Argument.metadata','=')
|
||||||
|
for k,v in [('HTTPSampler.domain','${__P(host,127.0.0.1)}'),('HTTPSampler.port','${__P(port,5443)}'),('HTTPSampler.protocol','https'),('HTTPSampler.path',path),('HTTPSampler.method',method),('HTTPSampler.implementation','HttpClient4'),('HTTPSampler.connect_timeout','10000'),('HTTPSampler.response_timeout','30000')]: prop(e,k,v)
|
||||||
|
for k,v in [('HTTPSampler.postBodyRaw',bool(body)),('HTTPSampler.follow_redirects',False),('HTTPSampler.auto_redirects',False),('HTTPSampler.use_keepalive',True),('HTTPSampler.DO_MULTIPART_POST',False)]: prop(e,k,v,'boolProp')
|
||||||
|
# HTTP status and semantic checks fail the thread rather than generating cascades.
|
||||||
|
script(t,'JSR223Assertion','Expected response',f'''if (prev.getResponseCode() != '{status}') {{
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
{('def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())' if check else '')}
|
||||||
|
{check}
|
||||||
|
''')
|
||||||
|
script(t,'JSR223Timer','Gaussian interaction pause', """def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
""")
|
||||||
|
|
||||||
|
PERIOD = 'from=${period_from}&to=${period_to}'
|
||||||
|
PATIENT = '/api/patients/${patient_id}'
|
||||||
|
|
||||||
|
def review(t, professional=False):
|
||||||
|
if professional:
|
||||||
|
request(t,'Assigned patients','GET','/api/professionals/me/patients',check="assert json.any { it.patientId == vars.get('patient_id') } : 'Target patient is not assigned'")
|
||||||
|
request(t,'Read profile','GET',PATIENT if professional else '/api/patients/me',check="assert json.patientId == vars.get('patient_id')")
|
||||||
|
request(t,'Latest reading','GET',PATIENT+'/observations/latest',check="assert json.patientId == vars.get('patient_id')")
|
||||||
|
request(t,'Home resting history','GET',PATIENT+'/observations?'+PERIOD+'&setting=Home&activityCondition=AtRest',check="assert json instanceof List && !json.empty : 'Seed observations first'")
|
||||||
|
request(t,'Numerical insights','GET',PATIENT+'/insights?'+PERIOD+'&setting=Home&activityCondition=AtRest',check="assert json.contributingCount > 0")
|
||||||
|
request(t,'Trends','GET',PATIENT+'/trends?'+PERIOD)
|
||||||
|
overview(t)
|
||||||
|
|
||||||
|
def overview(t):
|
||||||
|
request(t,'Health overview','GET',PATIENT+'/overview?'+PERIOD,check="assert json.patient.patientId == vars.get('patient_id'); assert json.latestObservation != null; assert json.insight != null")
|
||||||
|
|
||||||
|
def record(t, correction=False):
|
||||||
|
request(t,'Measurement guidance','GET','/api/measurement-guidance?setting=Home&activityCondition=AtRest')
|
||||||
|
request(t,'Read own profile','GET','/api/patients/me',check="assert json.patientId == vars.get('patient_id')")
|
||||||
|
request(t,'Record synthetic measurement','POST',PATIENT+'/observations','${observation_body}',201,"assert json.patientId == vars.get('patient_id'); assert json.observationId; vars.put('observation_id',json.observationId)")
|
||||||
|
if correction:
|
||||||
|
request(t,'Correct entry and context','PATCH','/api/observations/${observation_id}','{"systolic":128,"measurementContext":{"additionalCircumstances":"Corrected synthetic entry"}}',check="assert json.systolic == 128")
|
||||||
|
request(t,'Confirm saved reading','GET','/api/observations/${observation_id}',check="assert json.observationId == vars.get('observation_id')")
|
||||||
|
overview(t)
|
||||||
|
if correction:
|
||||||
|
request(t,'Remove duplicate test entry','DELETE','/api/observations/${observation_id}',status=204)
|
||||||
|
request(t,'Confirm removal','GET','/api/observations/${observation_id}',status=404)
|
||||||
|
|
||||||
|
def shelly_group(tree):
|
||||||
|
group,gt=element(tree,'ThreadGroup','ThreadGroupGui','Shelly live power')
|
||||||
|
prop(group,'ThreadGroup.on_sample_error','continue')
|
||||||
|
loop=E.SubElement(group,'elementProp',name='ThreadGroup.main_controller',elementType='LoopController',guiclass='LoopControlPanel',testclass='LoopController',enabled='true')
|
||||||
|
prop(loop,'LoopController.continue_forever',False,'boolProp');prop(loop,'LoopController.loops',-1)
|
||||||
|
for k,v in [('ThreadGroup.num_threads','1'),('ThreadGroup.ramp_time','0'),('ThreadGroup.duration','${__P(total_duration_seconds,16210)}'),('ThreadGroup.delay','0')]:prop(group,k,v)
|
||||||
|
prop(group,'ThreadGroup.scheduler',True,'boolProp')
|
||||||
|
e,t=element(gt,'HTTPSamplerProxy','HttpTestSampleGui','POWER Shelly status')
|
||||||
|
E.SubElement(E.SubElement(e,'elementProp',name='HTTPsampler.Arguments',elementType='Arguments'),'collectionProp',name='Arguments.arguments')
|
||||||
|
for k,v in [('HTTPSampler.domain','${__P(shelly_host,192.168.1.44)}'),('HTTPSampler.port','${__P(shelly_port,80)}'),('HTTPSampler.protocol','http'),('HTTPSampler.path','/rpc/Switch.GetStatus?id=${__P(shelly_switch_id,0)}'),('HTTPSampler.method','GET'),('HTTPSampler.implementation','HttpClient4'),('HTTPSampler.connect_timeout','3000'),('HTTPSampler.response_timeout','3000')]:prop(e,k,v)
|
||||||
|
for k,v in [('HTTPSampler.follow_redirects',False),('HTTPSampler.use_keepalive',True)]:prop(e,k,v,'boolProp')
|
||||||
|
script(t,'JSR223Timer','Fixed meter cadence', "if (!vars.get('shelly_last_poll_ms')) return 0L; return Math.max(0L, Long.parseLong(vars.get('shelly_last_poll_ms')) + Long.parseLong(props.getProperty('shelly_interval_ms','1000')) - System.currentTimeMillis())")
|
||||||
|
script(t,'JSR223PreProcessor','Clear stale power values', "['shelly_power_watts','shelly_voltage_volts','shelly_current_amps','shelly_energy_wh'].each { vars.put(it,'') }")
|
||||||
|
script(t,'JSR223Assertion','Validate and extract plug readings', """vars.put('shelly_last_poll_ms',prev.getStartTime().toString())
|
||||||
|
try {
|
||||||
|
assert prev.getResponseCode() == '200'
|
||||||
|
def json=new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.output == true : 'Outlet is off'
|
||||||
|
def readings=[shelly_power_watts:json.apower,shelly_voltage_volts:json.voltage,shelly_current_amps:json.current,shelly_energy_wh:json.aenergy?.total]
|
||||||
|
readings.each { key,value -> assert value instanceof Number && Double.isFinite(value.doubleValue()) && value >= 0; vars.put(key,value.toString()) }
|
||||||
|
} catch (Throwable error) {
|
||||||
|
AssertionResult.setFailure(true);AssertionResult.setFailureMessage('Shelly status/measurement unavailable');prev.setSuccessful(false)
|
||||||
|
}
|
||||||
|
""")
|
||||||
|
collector,_=element(gt,'ResultCollector','SimpleDataWriter','Shelly measurements saved live')
|
||||||
|
prop(collector,'filename','${__P(shelly_file,shelly.csv)}');prop(collector,'ResultCollector.error_logging',False,'boolProp')
|
||||||
|
|
||||||
|
for scenario in ['recording','review','correction','professional','mixed','idle']:
|
||||||
|
root=E.Element('jmeterTestPlan',version='1.2',properties='5.0',jmeter='5.6.3'); tree=E.SubElement(root,'hashTree')
|
||||||
|
plan, pt=element(tree,'TestPlan','TestPlanGui','HealthApp energy: '+scenario)
|
||||||
|
prop(plan,'TestPlan.comments','Synthetic closed-loop sessions; default duration four hours. Setup is external; Shelly power is collected live without changing the outlet.')
|
||||||
|
prop(plan,'TestPlan.functional_mode',False,'boolProp'); prop(plan,'TestPlan.serialize_threadgroups',False,'boolProp')
|
||||||
|
E.SubElement(E.SubElement(plan,'elementProp',name='TestPlan.user_defined_variables',elementType='Arguments',guiclass='ArgumentsPanel',testclass='Arguments',enabled='true'),'collectionProp',name='Arguments.arguments')
|
||||||
|
shelly_group(pt)
|
||||||
|
collector, _ = element(pt,'kg.apc.jmeter.perfmon.PerfMonCollector','kg.apc.jmeter.vizualizers.PerfMonGui','NUC live CPU RAM disk and network')
|
||||||
|
collector.set('enabled','true')
|
||||||
|
prop(collector,'filename','${__P(perfmon_file,perfmon.csv)}')
|
||||||
|
prop(collector,'ResultCollector.error_logging',False,'boolProp')
|
||||||
|
connections=E.SubElement(collector,'collectionProp',name='metricConnections')
|
||||||
|
for i,(kind,param,unit) in enumerate(METRICS):
|
||||||
|
row=E.SubElement(connections,'collectionProp',name=str(i))
|
||||||
|
for j,value in enumerate(['${__P(perfmon_host,192.168.1.125)}','${__P(perfmon_port,4444)}',kind,param]):prop(row,str(j),value)
|
||||||
|
group, gt=element(pt,'ThreadGroup','ThreadGroupGui','Users')
|
||||||
|
prop(group,'ThreadGroup.on_sample_error','stopthread')
|
||||||
|
loop=E.SubElement(group,'elementProp',name='ThreadGroup.main_controller',elementType='LoopController',guiclass='LoopControlPanel',testclass='LoopController',enabled='true')
|
||||||
|
prop(loop,'LoopController.continue_forever',False,'boolProp'); prop(loop,'LoopController.loops',-1)
|
||||||
|
for k,v in [('ThreadGroup.num_threads','${__P(users,1)}'),('ThreadGroup.ramp_time','${__P(ramp_seconds,60)}'),('ThreadGroup.duration','${__P(total_duration_seconds,16210)}'),('ThreadGroup.delay','0')]: prop(group,k,v)
|
||||||
|
prop(group,'ThreadGroup.scheduler',True,'boolProp'); prop(group,'ThreadGroup.same_user_on_next_iteration',True,'boolProp')
|
||||||
|
if scenario=='idle':
|
||||||
|
prop(group,'ThreadGroup.num_threads','1');prop(group,'ThreadGroup.ramp_time','0')
|
||||||
|
once, ot=element(gt,'OnceOnlyController','OnceOnlyControllerGui','Record idle measurement window')
|
||||||
|
script(ot,'JSR223Sampler','Idle timing', '''long start=System.currentTimeMillis()
|
||||||
|
long measurement=start+Long.parseLong(props.getProperty('warmup_seconds','1800'))*1000
|
||||||
|
long end=measurement+Long.parseLong(props.getProperty('duration_seconds','14400'))*1000
|
||||||
|
if (props.get('timeline_file')) new File(props.get('timeline_file')).text=groovy.json.JsonOutput.toJson([warmup_start_ms:start,measurement_start_ms:measurement,measurement_end_ms:end])
|
||||||
|
''')
|
||||||
|
pause,_=element(gt,'TestAction','TestActionGui','Idle wait; no application requests')
|
||||||
|
prop(pause,'ActionProcessor.action',1,'intProp');prop(pause,'ActionProcessor.target',0,'intProp');prop(pause,'ActionProcessor.duration','1000')
|
||||||
|
E.indent(root);E.ElementTree(root).write(OUT/(scenario+'.jmx'),encoding='utf-8',xml_declaration=True)
|
||||||
|
continue
|
||||||
|
headers, _=element(gt,'HeaderManager','HeaderPanel','JSON and bearer token')
|
||||||
|
coll=E.SubElement(headers,'collectionProp',name='HeaderManager.headers')
|
||||||
|
for name,value in [('Content-Type','application/json'),('Authorization','Bearer ${token}')]:
|
||||||
|
h=E.SubElement(coll,'elementProp',name='',elementType='Header');prop(h,'Header.name',name);prop(h,'Header.value',value)
|
||||||
|
once, ot=element(gt,'OnceOnlyController','OnceOnlyControllerGui','Assign one account per user')
|
||||||
|
script(ot,'JSR223Sampler','Initialize user', '''def rows = new File(props.get('users_file')).readLines('UTF-8').drop(1).findAll { it.trim() }
|
||||||
|
def row = rows[ctx.getThreadNum()].split(',', -1)
|
||||||
|
vars.put('account_id', row[0]); vars.put('password', row[1]); vars.put('patient_id', row[2])
|
||||||
|
vars.put('token', ''); vars.put('expires_at', '0'); vars.put('session_number','0')
|
||||||
|
vars.putObject('user_random', new Random(Long.parseLong(props.getProperty('random_seed','42')) + ctx.getThreadNum()))
|
||||||
|
synchronized(props) {
|
||||||
|
if (props.get('timeline_file') && !props.get('workload_start_ms')) {
|
||||||
|
long start = System.currentTimeMillis()
|
||||||
|
long measurement = start + Long.parseLong(props.getProperty('warmup_seconds','1800')) * 1000
|
||||||
|
long end = measurement + Long.parseLong(props.getProperty('duration_seconds','14400')) * 1000
|
||||||
|
props.put('workload_start_ms',start.toString())
|
||||||
|
new File(props.get('timeline_file')).text = groovy.json.JsonOutput.toJson([warmup_start_ms:start,measurement_start_ms:measurement,measurement_end_ms:end])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
''')
|
||||||
|
script(gt,'JSR223Sampler','Prepare session', '''def now = java.time.Instant.now()
|
||||||
|
vars.put('refresh_login', (now.epochSecond >= Long.parseLong(vars.get('expires_at')) - 60).toString())
|
||||||
|
vars.put('login_body',groovy.json.JsonOutput.toJson([accountId:vars.get('account_id'),password:vars.get('password')]))
|
||||||
|
vars.put('period_from',props.get('period_from')); vars.put('period_to',props.get('period_to'))
|
||||||
|
int n = Integer.parseInt(vars.get('session_number')); vars.put('session_number',(n+1).toString())
|
||||||
|
// Random session mix: expected 65% review, 30% recording, 5% correction.
|
||||||
|
int slot = vars.getObject('user_random').nextInt(20)
|
||||||
|
vars.put('session_kind',slot < 13 ? 'review' : slot < 19 ? 'recording' : 'correction')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('session_pause_ms','120000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('session_stddev_ms','30000'))
|
||||||
|
vars.put('session_delay_ms',Math.max(0L,Math.round(mean + vars.getObject('user_random').nextGaussian()*deviation)).toString())
|
||||||
|
vars.put('observation_body',groovy.json.JsonOutput.toJson([measuredAt:now.toString(),systolic:128+(n%7),diastolic:82+(n%4),pulse:68+(n%6),measurementContext:[setting:'Home',activityCondition:'AtRest',restDurationMinutes:5,bodyPosition:'Seated'],note:'Synthetic JMeter energy workload']))
|
||||||
|
''')
|
||||||
|
login, lt=element(gt,'IfController','IfControllerPanel','Login or renew expired token')
|
||||||
|
prop(login,'IfController.condition','${refresh_login}');prop(login,'IfController.evaluateAll',False,'boolProp');prop(login,'IfController.useExpression',True,'boolProp')
|
||||||
|
request(lt,'Login','POST','/api/authentication/login','${login_body}',check="assert json.accessToken; vars.put('token',json.accessToken); vars.put('expires_at',(java.time.Instant.now().epochSecond + (json.expiresIn as long)).toString())")
|
||||||
|
if scenario=='mixed':
|
||||||
|
for kind in ['review','recording','correction']:
|
||||||
|
branch,bt=element(gt,'IfController','IfControllerPanel',kind+' session')
|
||||||
|
prop(branch,'IfController.condition',"${__groovy(vars.get('session_kind') == '"+kind+"')}");prop(branch,'IfController.useExpression',True,'boolProp');prop(branch,'IfController.evaluateAll',False,'boolProp')
|
||||||
|
review(bt) if kind=='review' else record(bt,kind=='correction')
|
||||||
|
elif scenario in ['review','professional']: review(gt,scenario=='professional')
|
||||||
|
else: record(gt,scenario=='correction')
|
||||||
|
pause, _ = element(gt,'TestAction','TestActionGui','Between-session pause')
|
||||||
|
prop(pause,'ActionProcessor.action',1,'intProp'); prop(pause,'ActionProcessor.target',0,'intProp'); prop(pause,'ActionProcessor.duration','${session_delay_ms}')
|
||||||
|
E.indent(root); E.ElementTree(root).write(OUT/(scenario+'.jmx'),encoding='utf-8',xml_declaration=True)
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
"""PerfMon agent preflight and JMeter's metric-file decoding."""
|
||||||
|
import csv, math, socket
|
||||||
|
METRICS=[('CPU','combined','percent'),('CPU','iowait','percent'),('Memory','usedperc','percent'),('Memory','actualused','bytes'),('Swap','used','bytes'),('Disks I/O','readbytes','bytes/second'),('Disks I/O','writebytes','bytes/second'),('Network I/O','bytesrecv','bytes/second'),('Network I/O','bytessent','bytes/second')]
|
||||||
|
TYPES={'CPU':'cpu','Memory':'memory','Swap':'swap','Disks I/O':'disks','Network I/O':'network'}
|
||||||
|
def check_agent(host,port):
|
||||||
|
specs=[TYPES[k]+':'+param for k,param,_ in METRICS]
|
||||||
|
with socket.create_connection((host,port),timeout=5) as s:
|
||||||
|
s.settimeout(5);s.sendall(('metrics-single:'+'\t'.join(specs)+'\n').encode())
|
||||||
|
values=s.makefile('r').readline(8192).strip().split('\t')
|
||||||
|
if len(values)!=len(specs):raise ValueError('PerfMon returned an incomplete metric response')
|
||||||
|
if any(not math.isfinite(float(v)) or float(v)<0 for v in values):raise ValueError('PerfMon reported unavailable/invalid metrics')
|
||||||
|
return dict(zip(specs,map(float,values)))
|
||||||
|
def summarize(raw,output,start,end,interval_ms):
|
||||||
|
with raw.open() as f: rows=list(csv.DictReader(f))
|
||||||
|
result=[];by_metric={}
|
||||||
|
for row in rows:
|
||||||
|
# PerfMon encodes the metric as synthetic elapsed milliseconds, not HTTP latency.
|
||||||
|
if row.get('success','true').lower()!='true':raise ValueError('PerfMon collector reported a failed sample')
|
||||||
|
value=float(row['elapsed'])/1000
|
||||||
|
if not math.isfinite(value) or value<0:raise ValueError('PerfMon collector reported a metric error')
|
||||||
|
timestamp=int(row['timeStamp'])
|
||||||
|
if not start<=timestamp<=end:continue
|
||||||
|
label=row['label']; unit=next((unit for kind,param,unit in METRICS if label.endswith(kind+' '+param)),'unknown')
|
||||||
|
if unit=='unknown':raise ValueError('Unknown PerfMon label: '+label)
|
||||||
|
result.append({'timestamp_ms':timestamp,'metric':label,'value':value,'unit':unit})
|
||||||
|
by_metric.setdefault(label,[]).append((timestamp,value))
|
||||||
|
if len(by_metric)!=len(METRICS):raise ValueError('Measured interval is missing required PerfMon metrics')
|
||||||
|
stats={}
|
||||||
|
for label,points in by_metric.items():
|
||||||
|
points.sort();gaps=[b[0]-a[0] for a,b in zip(points,points[1:])]
|
||||||
|
if max([points[0][0]-start,end-points[-1][0],*gaps])>interval_ms*3:raise ValueError('Gap in live monitoring: '+label)
|
||||||
|
stats[label]={'samples':len(points),'mean':sum(v for _,v in points)/len(points),'max':max(v for _,v in points)}
|
||||||
|
with output.open('w') as f:
|
||||||
|
w=csv.DictWriter(f,fieldnames=['timestamp_ms','metric','value','unit']);w.writeheader();w.writerows(result)
|
||||||
|
return stats
|
||||||
@@ -0,0 +1,745 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.6.3">
|
||||||
|
<hashTree>
|
||||||
|
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="HealthApp energy: correction" enabled="true">
|
||||||
|
<stringProp name="TestPlan.comments">Synthetic closed-loop sessions; default duration four hours. Setup is external; Shelly power is collected live without changing the outlet.</stringProp>
|
||||||
|
<boolProp name="TestPlan.functional_mode">false</boolProp>
|
||||||
|
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
|
||||||
|
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
</TestPlan>
|
||||||
|
<hashTree>
|
||||||
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Shelly live power" enabled="true">
|
||||||
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
||||||
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" enabled="true">
|
||||||
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
||||||
|
<stringProp name="LoopController.loops">-1</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.ramp_time">0</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.duration">${__P(total_duration_seconds,16210)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.delay">0</stringProp>
|
||||||
|
<boolProp name="ThreadGroup.scheduler">true</boolProp>
|
||||||
|
</ThreadGroup>
|
||||||
|
<hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="POWER Shelly status" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(shelly_host,192.168.1.44)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(shelly_port,80)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">http</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/rpc/Switch.GetStatus?id=${__P(shelly_switch_id,0)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">3000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">3000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Fixed meter cadence" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (!vars.get('shelly_last_poll_ms')) return 0L; return Math.max(0L, Long.parseLong(vars.get('shelly_last_poll_ms')) + Long.parseLong(props.getProperty('shelly_interval_ms','1000')) - System.currentTimeMillis())</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223PreProcessor guiclass="JSR223PreProcessorGui" testclass="JSR223PreProcessor" testname="Clear stale power values" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">['shelly_power_watts','shelly_voltage_volts','shelly_current_amps','shelly_energy_wh'].each { vars.put(it,'') }</stringProp>
|
||||||
|
</JSR223PreProcessor>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Validate and extract plug readings" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">vars.put('shelly_last_poll_ms',prev.getStartTime().toString())
|
||||||
|
try {
|
||||||
|
assert prev.getResponseCode() == '200'
|
||||||
|
def json=new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.output == true : 'Outlet is off'
|
||||||
|
def readings=[shelly_power_watts:json.apower,shelly_voltage_volts:json.voltage,shelly_current_amps:json.current,shelly_energy_wh:json.aenergy?.total]
|
||||||
|
readings.each { key,value -> assert value instanceof Number && Double.isFinite(value.doubleValue()) && value >= 0; vars.put(key,value.toString()) }
|
||||||
|
} catch (Throwable error) {
|
||||||
|
AssertionResult.setFailure(true);AssertionResult.setFailureMessage('Shelly status/measurement unavailable');prev.setSuccessful(false)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<ResultCollector guiclass="SimpleDataWriter" testclass="ResultCollector" testname="Shelly measurements saved live" enabled="true">
|
||||||
|
<stringProp name="filename">${__P(shelly_file,shelly.csv)}</stringProp>
|
||||||
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
||||||
|
</ResultCollector>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<kg.apc.jmeter.perfmon.PerfMonCollector guiclass="kg.apc.jmeter.vizualizers.PerfMonGui" testclass="kg.apc.jmeter.perfmon.PerfMonCollector" testname="NUC live CPU RAM disk and network" enabled="true">
|
||||||
|
<stringProp name="filename">${__P(perfmon_file,perfmon.csv)}</stringProp>
|
||||||
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
||||||
|
<collectionProp name="metricConnections">
|
||||||
|
<collectionProp name="0">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">CPU</stringProp>
|
||||||
|
<stringProp name="3">combined</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="1">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">CPU</stringProp>
|
||||||
|
<stringProp name="3">iowait</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="2">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Memory</stringProp>
|
||||||
|
<stringProp name="3">usedperc</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="3">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Memory</stringProp>
|
||||||
|
<stringProp name="3">actualused</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="4">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Swap</stringProp>
|
||||||
|
<stringProp name="3">used</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="5">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Disks I/O</stringProp>
|
||||||
|
<stringProp name="3">readbytes</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="6">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Disks I/O</stringProp>
|
||||||
|
<stringProp name="3">writebytes</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="7">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Network I/O</stringProp>
|
||||||
|
<stringProp name="3">bytesrecv</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="8">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Network I/O</stringProp>
|
||||||
|
<stringProp name="3">bytessent</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
</collectionProp>
|
||||||
|
</kg.apc.jmeter.perfmon.PerfMonCollector>
|
||||||
|
<hashTree />
|
||||||
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Users" enabled="true">
|
||||||
|
<stringProp name="ThreadGroup.on_sample_error">stopthread</stringProp>
|
||||||
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" enabled="true">
|
||||||
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
||||||
|
<stringProp name="LoopController.loops">-1</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="ThreadGroup.num_threads">${__P(users,1)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.ramp_time">${__P(ramp_seconds,60)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.duration">${__P(total_duration_seconds,16210)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.delay">0</stringProp>
|
||||||
|
<boolProp name="ThreadGroup.scheduler">true</boolProp>
|
||||||
|
<boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
|
||||||
|
</ThreadGroup>
|
||||||
|
<hashTree>
|
||||||
|
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="JSON and bearer token" enabled="true">
|
||||||
|
<collectionProp name="HeaderManager.headers">
|
||||||
|
<elementProp name="" elementType="Header">
|
||||||
|
<stringProp name="Header.name">Content-Type</stringProp>
|
||||||
|
<stringProp name="Header.value">application/json</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
<elementProp name="" elementType="Header">
|
||||||
|
<stringProp name="Header.name">Authorization</stringProp>
|
||||||
|
<stringProp name="Header.value">Bearer ${token}</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
</collectionProp>
|
||||||
|
</HeaderManager>
|
||||||
|
<hashTree />
|
||||||
|
<OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Assign one account per user" enabled="true" />
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Sampler guiclass="JSR223SamplerGui" testclass="JSR223Sampler" testname="Initialize user" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rows = new File(props.get('users_file')).readLines('UTF-8').drop(1).findAll { it.trim() }
|
||||||
|
def row = rows[ctx.getThreadNum()].split(',', -1)
|
||||||
|
vars.put('account_id', row[0]); vars.put('password', row[1]); vars.put('patient_id', row[2])
|
||||||
|
vars.put('token', ''); vars.put('expires_at', '0'); vars.put('session_number','0')
|
||||||
|
vars.putObject('user_random', new Random(Long.parseLong(props.getProperty('random_seed','42')) + ctx.getThreadNum()))
|
||||||
|
synchronized(props) {
|
||||||
|
if (props.get('timeline_file') && !props.get('workload_start_ms')) {
|
||||||
|
long start = System.currentTimeMillis()
|
||||||
|
long measurement = start + Long.parseLong(props.getProperty('warmup_seconds','1800')) * 1000
|
||||||
|
long end = measurement + Long.parseLong(props.getProperty('duration_seconds','14400')) * 1000
|
||||||
|
props.put('workload_start_ms',start.toString())
|
||||||
|
new File(props.get('timeline_file')).text = groovy.json.JsonOutput.toJson([warmup_start_ms:start,measurement_start_ms:measurement,measurement_end_ms:end])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Sampler>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<JSR223Sampler guiclass="JSR223SamplerGui" testclass="JSR223Sampler" testname="Prepare session" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def now = java.time.Instant.now()
|
||||||
|
vars.put('refresh_login', (now.epochSecond >= Long.parseLong(vars.get('expires_at')) - 60).toString())
|
||||||
|
vars.put('login_body',groovy.json.JsonOutput.toJson([accountId:vars.get('account_id'),password:vars.get('password')]))
|
||||||
|
vars.put('period_from',props.get('period_from')); vars.put('period_to',props.get('period_to'))
|
||||||
|
int n = Integer.parseInt(vars.get('session_number')); vars.put('session_number',(n+1).toString())
|
||||||
|
// Random session mix: expected 65% review, 30% recording, 5% correction.
|
||||||
|
int slot = vars.getObject('user_random').nextInt(20)
|
||||||
|
vars.put('session_kind',slot < 13 ? 'review' : slot < 19 ? 'recording' : 'correction')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('session_pause_ms','120000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('session_stddev_ms','30000'))
|
||||||
|
vars.put('session_delay_ms',Math.max(0L,Math.round(mean + vars.getObject('user_random').nextGaussian()*deviation)).toString())
|
||||||
|
vars.put('observation_body',groovy.json.JsonOutput.toJson([measuredAt:now.toString(),systolic:128+(n%7),diastolic:82+(n%4),pulse:68+(n%6),measurementContext:[setting:'Home',activityCondition:'AtRest',restDurationMinutes:5,bodyPosition:'Seated'],note:'Synthetic JMeter energy workload']))
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Sampler>
|
||||||
|
<hashTree />
|
||||||
|
<IfController guiclass="IfControllerPanel" testclass="IfController" testname="Login or renew expired token" enabled="true">
|
||||||
|
<stringProp name="IfController.condition">${refresh_login}</stringProp>
|
||||||
|
<boolProp name="IfController.evaluateAll">false</boolProp>
|
||||||
|
<boolProp name="IfController.useExpression">true</boolProp>
|
||||||
|
</IfController>
|
||||||
|
<hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Login" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments">
|
||||||
|
<elementProp name="" elementType="HTTPArgument">
|
||||||
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
||||||
|
<stringProp name="Argument.value">${login_body}</stringProp>
|
||||||
|
<stringProp name="Argument.metadata">=</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
</collectionProp>
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/authentication/login</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">POST</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.accessToken; vars.put('token',json.accessToken); vars.put('expires_at',(java.time.Instant.now().epochSecond + (json.expiresIn as long)).toString())
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Measurement guidance" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/measurement-guidance?setting=Home&activityCondition=AtRest</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
|
||||||
|
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Read own profile" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/patients/me</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.patientId == vars.get('patient_id')
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Record synthetic measurement" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments">
|
||||||
|
<elementProp name="" elementType="HTTPArgument">
|
||||||
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
||||||
|
<stringProp name="Argument.value">${observation_body}</stringProp>
|
||||||
|
<stringProp name="Argument.metadata">=</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
</collectionProp>
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/patients/${patient_id}/observations</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">POST</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '201') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.patientId == vars.get('patient_id'); assert json.observationId; vars.put('observation_id',json.observationId)
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Correct entry and context" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments">
|
||||||
|
<elementProp name="" elementType="HTTPArgument">
|
||||||
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
||||||
|
<stringProp name="Argument.value">{"systolic":128,"measurementContext":{"additionalCircumstances":"Corrected synthetic entry"}}</stringProp>
|
||||||
|
<stringProp name="Argument.metadata">=</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
</collectionProp>
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/observations/${observation_id}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">PATCH</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.systolic == 128
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Confirm saved reading" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/observations/${observation_id}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.observationId == vars.get('observation_id')
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Health overview" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/patients/${patient_id}/overview?from=${period_from}&to=${period_to}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.patient.patientId == vars.get('patient_id'); assert json.latestObservation != null; assert json.insight != null
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Remove duplicate test entry" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/observations/${observation_id}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">DELETE</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '204') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
|
||||||
|
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Confirm removal" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/observations/${observation_id}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '404') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
|
||||||
|
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<TestAction guiclass="TestActionGui" testclass="TestAction" testname="Between-session pause" enabled="true">
|
||||||
|
<intProp name="ActionProcessor.action">1</intProp>
|
||||||
|
<intProp name="ActionProcessor.target">0</intProp>
|
||||||
|
<stringProp name="ActionProcessor.duration">${session_delay_ms}</stringProp>
|
||||||
|
</TestAction>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
</hashTree>
|
||||||
|
</hashTree>
|
||||||
|
</jmeterTestPlan>
|
||||||
@@ -0,0 +1,184 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.6.3">
|
||||||
|
<hashTree>
|
||||||
|
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="HealthApp energy: idle" enabled="true">
|
||||||
|
<stringProp name="TestPlan.comments">Synthetic closed-loop sessions; default duration four hours. Setup is external; Shelly power is collected live without changing the outlet.</stringProp>
|
||||||
|
<boolProp name="TestPlan.functional_mode">false</boolProp>
|
||||||
|
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
|
||||||
|
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
</TestPlan>
|
||||||
|
<hashTree>
|
||||||
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Shelly live power" enabled="true">
|
||||||
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
||||||
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" enabled="true">
|
||||||
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
||||||
|
<stringProp name="LoopController.loops">-1</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.ramp_time">0</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.duration">${__P(total_duration_seconds,16210)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.delay">0</stringProp>
|
||||||
|
<boolProp name="ThreadGroup.scheduler">true</boolProp>
|
||||||
|
</ThreadGroup>
|
||||||
|
<hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="POWER Shelly status" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(shelly_host,192.168.1.44)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(shelly_port,80)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">http</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/rpc/Switch.GetStatus?id=${__P(shelly_switch_id,0)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">3000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">3000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Fixed meter cadence" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (!vars.get('shelly_last_poll_ms')) return 0L; return Math.max(0L, Long.parseLong(vars.get('shelly_last_poll_ms')) + Long.parseLong(props.getProperty('shelly_interval_ms','1000')) - System.currentTimeMillis())</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223PreProcessor guiclass="JSR223PreProcessorGui" testclass="JSR223PreProcessor" testname="Clear stale power values" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">['shelly_power_watts','shelly_voltage_volts','shelly_current_amps','shelly_energy_wh'].each { vars.put(it,'') }</stringProp>
|
||||||
|
</JSR223PreProcessor>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Validate and extract plug readings" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">vars.put('shelly_last_poll_ms',prev.getStartTime().toString())
|
||||||
|
try {
|
||||||
|
assert prev.getResponseCode() == '200'
|
||||||
|
def json=new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.output == true : 'Outlet is off'
|
||||||
|
def readings=[shelly_power_watts:json.apower,shelly_voltage_volts:json.voltage,shelly_current_amps:json.current,shelly_energy_wh:json.aenergy?.total]
|
||||||
|
readings.each { key,value -> assert value instanceof Number && Double.isFinite(value.doubleValue()) && value >= 0; vars.put(key,value.toString()) }
|
||||||
|
} catch (Throwable error) {
|
||||||
|
AssertionResult.setFailure(true);AssertionResult.setFailureMessage('Shelly status/measurement unavailable');prev.setSuccessful(false)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<ResultCollector guiclass="SimpleDataWriter" testclass="ResultCollector" testname="Shelly measurements saved live" enabled="true">
|
||||||
|
<stringProp name="filename">${__P(shelly_file,shelly.csv)}</stringProp>
|
||||||
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
||||||
|
</ResultCollector>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<kg.apc.jmeter.perfmon.PerfMonCollector guiclass="kg.apc.jmeter.vizualizers.PerfMonGui" testclass="kg.apc.jmeter.perfmon.PerfMonCollector" testname="NUC live CPU RAM disk and network" enabled="true">
|
||||||
|
<stringProp name="filename">${__P(perfmon_file,perfmon.csv)}</stringProp>
|
||||||
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
||||||
|
<collectionProp name="metricConnections">
|
||||||
|
<collectionProp name="0">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">CPU</stringProp>
|
||||||
|
<stringProp name="3">combined</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="1">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">CPU</stringProp>
|
||||||
|
<stringProp name="3">iowait</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="2">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Memory</stringProp>
|
||||||
|
<stringProp name="3">usedperc</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="3">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Memory</stringProp>
|
||||||
|
<stringProp name="3">actualused</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="4">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Swap</stringProp>
|
||||||
|
<stringProp name="3">used</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="5">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Disks I/O</stringProp>
|
||||||
|
<stringProp name="3">readbytes</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="6">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Disks I/O</stringProp>
|
||||||
|
<stringProp name="3">writebytes</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="7">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Network I/O</stringProp>
|
||||||
|
<stringProp name="3">bytesrecv</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="8">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Network I/O</stringProp>
|
||||||
|
<stringProp name="3">bytessent</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
</collectionProp>
|
||||||
|
</kg.apc.jmeter.perfmon.PerfMonCollector>
|
||||||
|
<hashTree />
|
||||||
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Users" enabled="true">
|
||||||
|
<stringProp name="ThreadGroup.on_sample_error">stopthread</stringProp>
|
||||||
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" enabled="true">
|
||||||
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
||||||
|
<stringProp name="LoopController.loops">-1</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="ThreadGroup.num_threads">${__P(users,1)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.ramp_time">${__P(ramp_seconds,60)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.duration">${__P(total_duration_seconds,16210)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.delay">0</stringProp>
|
||||||
|
<boolProp name="ThreadGroup.scheduler">true</boolProp>
|
||||||
|
<boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
|
||||||
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.ramp_time">0</stringProp>
|
||||||
|
</ThreadGroup>
|
||||||
|
<hashTree>
|
||||||
|
<OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Record idle measurement window" enabled="true" />
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Sampler guiclass="JSR223SamplerGui" testclass="JSR223Sampler" testname="Idle timing" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">long start=System.currentTimeMillis()
|
||||||
|
long measurement=start+Long.parseLong(props.getProperty('warmup_seconds','1800'))*1000
|
||||||
|
long end=measurement+Long.parseLong(props.getProperty('duration_seconds','14400'))*1000
|
||||||
|
if (props.get('timeline_file')) new File(props.get('timeline_file')).text=groovy.json.JsonOutput.toJson([warmup_start_ms:start,measurement_start_ms:measurement,measurement_end_ms:end])
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Sampler>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<TestAction guiclass="TestActionGui" testclass="TestAction" testname="Idle wait; no application requests" enabled="true">
|
||||||
|
<intProp name="ActionProcessor.action">1</intProp>
|
||||||
|
<intProp name="ActionProcessor.target">0</intProp>
|
||||||
|
<stringProp name="ActionProcessor.duration">1000</stringProp>
|
||||||
|
</TestAction>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
</hashTree>
|
||||||
|
</hashTree>
|
||||||
|
</jmeterTestPlan>
|
||||||
@@ -0,0 +1,678 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.6.3">
|
||||||
|
<hashTree>
|
||||||
|
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="HealthApp energy: professional" enabled="true">
|
||||||
|
<stringProp name="TestPlan.comments">Synthetic closed-loop sessions; default duration four hours. Setup is external; Shelly power is collected live without changing the outlet.</stringProp>
|
||||||
|
<boolProp name="TestPlan.functional_mode">false</boolProp>
|
||||||
|
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
|
||||||
|
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
</TestPlan>
|
||||||
|
<hashTree>
|
||||||
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Shelly live power" enabled="true">
|
||||||
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
||||||
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" enabled="true">
|
||||||
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
||||||
|
<stringProp name="LoopController.loops">-1</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.ramp_time">0</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.duration">${__P(total_duration_seconds,16210)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.delay">0</stringProp>
|
||||||
|
<boolProp name="ThreadGroup.scheduler">true</boolProp>
|
||||||
|
</ThreadGroup>
|
||||||
|
<hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="POWER Shelly status" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(shelly_host,192.168.1.44)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(shelly_port,80)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">http</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/rpc/Switch.GetStatus?id=${__P(shelly_switch_id,0)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">3000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">3000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Fixed meter cadence" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (!vars.get('shelly_last_poll_ms')) return 0L; return Math.max(0L, Long.parseLong(vars.get('shelly_last_poll_ms')) + Long.parseLong(props.getProperty('shelly_interval_ms','1000')) - System.currentTimeMillis())</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223PreProcessor guiclass="JSR223PreProcessorGui" testclass="JSR223PreProcessor" testname="Clear stale power values" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">['shelly_power_watts','shelly_voltage_volts','shelly_current_amps','shelly_energy_wh'].each { vars.put(it,'') }</stringProp>
|
||||||
|
</JSR223PreProcessor>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Validate and extract plug readings" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">vars.put('shelly_last_poll_ms',prev.getStartTime().toString())
|
||||||
|
try {
|
||||||
|
assert prev.getResponseCode() == '200'
|
||||||
|
def json=new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.output == true : 'Outlet is off'
|
||||||
|
def readings=[shelly_power_watts:json.apower,shelly_voltage_volts:json.voltage,shelly_current_amps:json.current,shelly_energy_wh:json.aenergy?.total]
|
||||||
|
readings.each { key,value -> assert value instanceof Number && Double.isFinite(value.doubleValue()) && value >= 0; vars.put(key,value.toString()) }
|
||||||
|
} catch (Throwable error) {
|
||||||
|
AssertionResult.setFailure(true);AssertionResult.setFailureMessage('Shelly status/measurement unavailable');prev.setSuccessful(false)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<ResultCollector guiclass="SimpleDataWriter" testclass="ResultCollector" testname="Shelly measurements saved live" enabled="true">
|
||||||
|
<stringProp name="filename">${__P(shelly_file,shelly.csv)}</stringProp>
|
||||||
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
||||||
|
</ResultCollector>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<kg.apc.jmeter.perfmon.PerfMonCollector guiclass="kg.apc.jmeter.vizualizers.PerfMonGui" testclass="kg.apc.jmeter.perfmon.PerfMonCollector" testname="NUC live CPU RAM disk and network" enabled="true">
|
||||||
|
<stringProp name="filename">${__P(perfmon_file,perfmon.csv)}</stringProp>
|
||||||
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
||||||
|
<collectionProp name="metricConnections">
|
||||||
|
<collectionProp name="0">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">CPU</stringProp>
|
||||||
|
<stringProp name="3">combined</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="1">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">CPU</stringProp>
|
||||||
|
<stringProp name="3">iowait</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="2">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Memory</stringProp>
|
||||||
|
<stringProp name="3">usedperc</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="3">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Memory</stringProp>
|
||||||
|
<stringProp name="3">actualused</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="4">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Swap</stringProp>
|
||||||
|
<stringProp name="3">used</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="5">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Disks I/O</stringProp>
|
||||||
|
<stringProp name="3">readbytes</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="6">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Disks I/O</stringProp>
|
||||||
|
<stringProp name="3">writebytes</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="7">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Network I/O</stringProp>
|
||||||
|
<stringProp name="3">bytesrecv</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="8">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Network I/O</stringProp>
|
||||||
|
<stringProp name="3">bytessent</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
</collectionProp>
|
||||||
|
</kg.apc.jmeter.perfmon.PerfMonCollector>
|
||||||
|
<hashTree />
|
||||||
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Users" enabled="true">
|
||||||
|
<stringProp name="ThreadGroup.on_sample_error">stopthread</stringProp>
|
||||||
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" enabled="true">
|
||||||
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
||||||
|
<stringProp name="LoopController.loops">-1</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="ThreadGroup.num_threads">${__P(users,1)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.ramp_time">${__P(ramp_seconds,60)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.duration">${__P(total_duration_seconds,16210)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.delay">0</stringProp>
|
||||||
|
<boolProp name="ThreadGroup.scheduler">true</boolProp>
|
||||||
|
<boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
|
||||||
|
</ThreadGroup>
|
||||||
|
<hashTree>
|
||||||
|
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="JSON and bearer token" enabled="true">
|
||||||
|
<collectionProp name="HeaderManager.headers">
|
||||||
|
<elementProp name="" elementType="Header">
|
||||||
|
<stringProp name="Header.name">Content-Type</stringProp>
|
||||||
|
<stringProp name="Header.value">application/json</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
<elementProp name="" elementType="Header">
|
||||||
|
<stringProp name="Header.name">Authorization</stringProp>
|
||||||
|
<stringProp name="Header.value">Bearer ${token}</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
</collectionProp>
|
||||||
|
</HeaderManager>
|
||||||
|
<hashTree />
|
||||||
|
<OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Assign one account per user" enabled="true" />
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Sampler guiclass="JSR223SamplerGui" testclass="JSR223Sampler" testname="Initialize user" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rows = new File(props.get('users_file')).readLines('UTF-8').drop(1).findAll { it.trim() }
|
||||||
|
def row = rows[ctx.getThreadNum()].split(',', -1)
|
||||||
|
vars.put('account_id', row[0]); vars.put('password', row[1]); vars.put('patient_id', row[2])
|
||||||
|
vars.put('token', ''); vars.put('expires_at', '0'); vars.put('session_number','0')
|
||||||
|
vars.putObject('user_random', new Random(Long.parseLong(props.getProperty('random_seed','42')) + ctx.getThreadNum()))
|
||||||
|
synchronized(props) {
|
||||||
|
if (props.get('timeline_file') && !props.get('workload_start_ms')) {
|
||||||
|
long start = System.currentTimeMillis()
|
||||||
|
long measurement = start + Long.parseLong(props.getProperty('warmup_seconds','1800')) * 1000
|
||||||
|
long end = measurement + Long.parseLong(props.getProperty('duration_seconds','14400')) * 1000
|
||||||
|
props.put('workload_start_ms',start.toString())
|
||||||
|
new File(props.get('timeline_file')).text = groovy.json.JsonOutput.toJson([warmup_start_ms:start,measurement_start_ms:measurement,measurement_end_ms:end])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Sampler>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<JSR223Sampler guiclass="JSR223SamplerGui" testclass="JSR223Sampler" testname="Prepare session" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def now = java.time.Instant.now()
|
||||||
|
vars.put('refresh_login', (now.epochSecond >= Long.parseLong(vars.get('expires_at')) - 60).toString())
|
||||||
|
vars.put('login_body',groovy.json.JsonOutput.toJson([accountId:vars.get('account_id'),password:vars.get('password')]))
|
||||||
|
vars.put('period_from',props.get('period_from')); vars.put('period_to',props.get('period_to'))
|
||||||
|
int n = Integer.parseInt(vars.get('session_number')); vars.put('session_number',(n+1).toString())
|
||||||
|
// Random session mix: expected 65% review, 30% recording, 5% correction.
|
||||||
|
int slot = vars.getObject('user_random').nextInt(20)
|
||||||
|
vars.put('session_kind',slot < 13 ? 'review' : slot < 19 ? 'recording' : 'correction')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('session_pause_ms','120000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('session_stddev_ms','30000'))
|
||||||
|
vars.put('session_delay_ms',Math.max(0L,Math.round(mean + vars.getObject('user_random').nextGaussian()*deviation)).toString())
|
||||||
|
vars.put('observation_body',groovy.json.JsonOutput.toJson([measuredAt:now.toString(),systolic:128+(n%7),diastolic:82+(n%4),pulse:68+(n%6),measurementContext:[setting:'Home',activityCondition:'AtRest',restDurationMinutes:5,bodyPosition:'Seated'],note:'Synthetic JMeter energy workload']))
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Sampler>
|
||||||
|
<hashTree />
|
||||||
|
<IfController guiclass="IfControllerPanel" testclass="IfController" testname="Login or renew expired token" enabled="true">
|
||||||
|
<stringProp name="IfController.condition">${refresh_login}</stringProp>
|
||||||
|
<boolProp name="IfController.evaluateAll">false</boolProp>
|
||||||
|
<boolProp name="IfController.useExpression">true</boolProp>
|
||||||
|
</IfController>
|
||||||
|
<hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Login" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments">
|
||||||
|
<elementProp name="" elementType="HTTPArgument">
|
||||||
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
||||||
|
<stringProp name="Argument.value">${login_body}</stringProp>
|
||||||
|
<stringProp name="Argument.metadata">=</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
</collectionProp>
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/authentication/login</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">POST</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.accessToken; vars.put('token',json.accessToken); vars.put('expires_at',(java.time.Instant.now().epochSecond + (json.expiresIn as long)).toString())
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Assigned patients" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/professionals/me/patients</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.any { it.patientId == vars.get('patient_id') } : 'Target patient is not assigned'
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Read profile" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/patients/${patient_id}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.patientId == vars.get('patient_id')
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Latest reading" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/patients/${patient_id}/observations/latest</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.patientId == vars.get('patient_id')
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Home resting history" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/patients/${patient_id}/observations?from=${period_from}&to=${period_to}&setting=Home&activityCondition=AtRest</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json instanceof List && !json.empty : 'Seed observations first'
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Numerical insights" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/patients/${patient_id}/insights?from=${period_from}&to=${period_to}&setting=Home&activityCondition=AtRest</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.contributingCount > 0
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Trends" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/patients/${patient_id}/trends?from=${period_from}&to=${period_to}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
|
||||||
|
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Health overview" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/patients/${patient_id}/overview?from=${period_from}&to=${period_to}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.patient.patientId == vars.get('patient_id'); assert json.latestObservation != null; assert json.insight != null
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<TestAction guiclass="TestActionGui" testclass="TestAction" testname="Between-session pause" enabled="true">
|
||||||
|
<intProp name="ActionProcessor.action">1</intProp>
|
||||||
|
<intProp name="ActionProcessor.target">0</intProp>
|
||||||
|
<stringProp name="ActionProcessor.duration">${session_delay_ms}</stringProp>
|
||||||
|
</TestAction>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
</hashTree>
|
||||||
|
</hashTree>
|
||||||
|
</jmeterTestPlan>
|
||||||
@@ -0,0 +1,574 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.6.3">
|
||||||
|
<hashTree>
|
||||||
|
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="HealthApp energy: recording" enabled="true">
|
||||||
|
<stringProp name="TestPlan.comments">Synthetic closed-loop sessions; default duration four hours. Setup is external; Shelly power is collected live without changing the outlet.</stringProp>
|
||||||
|
<boolProp name="TestPlan.functional_mode">false</boolProp>
|
||||||
|
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
|
||||||
|
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
</TestPlan>
|
||||||
|
<hashTree>
|
||||||
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Shelly live power" enabled="true">
|
||||||
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
||||||
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" enabled="true">
|
||||||
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
||||||
|
<stringProp name="LoopController.loops">-1</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.ramp_time">0</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.duration">${__P(total_duration_seconds,16210)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.delay">0</stringProp>
|
||||||
|
<boolProp name="ThreadGroup.scheduler">true</boolProp>
|
||||||
|
</ThreadGroup>
|
||||||
|
<hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="POWER Shelly status" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(shelly_host,192.168.1.44)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(shelly_port,80)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">http</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/rpc/Switch.GetStatus?id=${__P(shelly_switch_id,0)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">3000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">3000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Fixed meter cadence" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (!vars.get('shelly_last_poll_ms')) return 0L; return Math.max(0L, Long.parseLong(vars.get('shelly_last_poll_ms')) + Long.parseLong(props.getProperty('shelly_interval_ms','1000')) - System.currentTimeMillis())</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223PreProcessor guiclass="JSR223PreProcessorGui" testclass="JSR223PreProcessor" testname="Clear stale power values" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">['shelly_power_watts','shelly_voltage_volts','shelly_current_amps','shelly_energy_wh'].each { vars.put(it,'') }</stringProp>
|
||||||
|
</JSR223PreProcessor>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Validate and extract plug readings" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">vars.put('shelly_last_poll_ms',prev.getStartTime().toString())
|
||||||
|
try {
|
||||||
|
assert prev.getResponseCode() == '200'
|
||||||
|
def json=new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.output == true : 'Outlet is off'
|
||||||
|
def readings=[shelly_power_watts:json.apower,shelly_voltage_volts:json.voltage,shelly_current_amps:json.current,shelly_energy_wh:json.aenergy?.total]
|
||||||
|
readings.each { key,value -> assert value instanceof Number && Double.isFinite(value.doubleValue()) && value >= 0; vars.put(key,value.toString()) }
|
||||||
|
} catch (Throwable error) {
|
||||||
|
AssertionResult.setFailure(true);AssertionResult.setFailureMessage('Shelly status/measurement unavailable');prev.setSuccessful(false)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<ResultCollector guiclass="SimpleDataWriter" testclass="ResultCollector" testname="Shelly measurements saved live" enabled="true">
|
||||||
|
<stringProp name="filename">${__P(shelly_file,shelly.csv)}</stringProp>
|
||||||
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
||||||
|
</ResultCollector>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<kg.apc.jmeter.perfmon.PerfMonCollector guiclass="kg.apc.jmeter.vizualizers.PerfMonGui" testclass="kg.apc.jmeter.perfmon.PerfMonCollector" testname="NUC live CPU RAM disk and network" enabled="true">
|
||||||
|
<stringProp name="filename">${__P(perfmon_file,perfmon.csv)}</stringProp>
|
||||||
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
||||||
|
<collectionProp name="metricConnections">
|
||||||
|
<collectionProp name="0">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">CPU</stringProp>
|
||||||
|
<stringProp name="3">combined</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="1">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">CPU</stringProp>
|
||||||
|
<stringProp name="3">iowait</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="2">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Memory</stringProp>
|
||||||
|
<stringProp name="3">usedperc</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="3">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Memory</stringProp>
|
||||||
|
<stringProp name="3">actualused</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="4">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Swap</stringProp>
|
||||||
|
<stringProp name="3">used</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="5">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Disks I/O</stringProp>
|
||||||
|
<stringProp name="3">readbytes</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="6">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Disks I/O</stringProp>
|
||||||
|
<stringProp name="3">writebytes</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="7">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Network I/O</stringProp>
|
||||||
|
<stringProp name="3">bytesrecv</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="8">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Network I/O</stringProp>
|
||||||
|
<stringProp name="3">bytessent</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
</collectionProp>
|
||||||
|
</kg.apc.jmeter.perfmon.PerfMonCollector>
|
||||||
|
<hashTree />
|
||||||
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Users" enabled="true">
|
||||||
|
<stringProp name="ThreadGroup.on_sample_error">stopthread</stringProp>
|
||||||
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" enabled="true">
|
||||||
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
||||||
|
<stringProp name="LoopController.loops">-1</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="ThreadGroup.num_threads">${__P(users,1)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.ramp_time">${__P(ramp_seconds,60)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.duration">${__P(total_duration_seconds,16210)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.delay">0</stringProp>
|
||||||
|
<boolProp name="ThreadGroup.scheduler">true</boolProp>
|
||||||
|
<boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
|
||||||
|
</ThreadGroup>
|
||||||
|
<hashTree>
|
||||||
|
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="JSON and bearer token" enabled="true">
|
||||||
|
<collectionProp name="HeaderManager.headers">
|
||||||
|
<elementProp name="" elementType="Header">
|
||||||
|
<stringProp name="Header.name">Content-Type</stringProp>
|
||||||
|
<stringProp name="Header.value">application/json</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
<elementProp name="" elementType="Header">
|
||||||
|
<stringProp name="Header.name">Authorization</stringProp>
|
||||||
|
<stringProp name="Header.value">Bearer ${token}</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
</collectionProp>
|
||||||
|
</HeaderManager>
|
||||||
|
<hashTree />
|
||||||
|
<OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Assign one account per user" enabled="true" />
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Sampler guiclass="JSR223SamplerGui" testclass="JSR223Sampler" testname="Initialize user" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rows = new File(props.get('users_file')).readLines('UTF-8').drop(1).findAll { it.trim() }
|
||||||
|
def row = rows[ctx.getThreadNum()].split(',', -1)
|
||||||
|
vars.put('account_id', row[0]); vars.put('password', row[1]); vars.put('patient_id', row[2])
|
||||||
|
vars.put('token', ''); vars.put('expires_at', '0'); vars.put('session_number','0')
|
||||||
|
vars.putObject('user_random', new Random(Long.parseLong(props.getProperty('random_seed','42')) + ctx.getThreadNum()))
|
||||||
|
synchronized(props) {
|
||||||
|
if (props.get('timeline_file') && !props.get('workload_start_ms')) {
|
||||||
|
long start = System.currentTimeMillis()
|
||||||
|
long measurement = start + Long.parseLong(props.getProperty('warmup_seconds','1800')) * 1000
|
||||||
|
long end = measurement + Long.parseLong(props.getProperty('duration_seconds','14400')) * 1000
|
||||||
|
props.put('workload_start_ms',start.toString())
|
||||||
|
new File(props.get('timeline_file')).text = groovy.json.JsonOutput.toJson([warmup_start_ms:start,measurement_start_ms:measurement,measurement_end_ms:end])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Sampler>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<JSR223Sampler guiclass="JSR223SamplerGui" testclass="JSR223Sampler" testname="Prepare session" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def now = java.time.Instant.now()
|
||||||
|
vars.put('refresh_login', (now.epochSecond >= Long.parseLong(vars.get('expires_at')) - 60).toString())
|
||||||
|
vars.put('login_body',groovy.json.JsonOutput.toJson([accountId:vars.get('account_id'),password:vars.get('password')]))
|
||||||
|
vars.put('period_from',props.get('period_from')); vars.put('period_to',props.get('period_to'))
|
||||||
|
int n = Integer.parseInt(vars.get('session_number')); vars.put('session_number',(n+1).toString())
|
||||||
|
// Random session mix: expected 65% review, 30% recording, 5% correction.
|
||||||
|
int slot = vars.getObject('user_random').nextInt(20)
|
||||||
|
vars.put('session_kind',slot < 13 ? 'review' : slot < 19 ? 'recording' : 'correction')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('session_pause_ms','120000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('session_stddev_ms','30000'))
|
||||||
|
vars.put('session_delay_ms',Math.max(0L,Math.round(mean + vars.getObject('user_random').nextGaussian()*deviation)).toString())
|
||||||
|
vars.put('observation_body',groovy.json.JsonOutput.toJson([measuredAt:now.toString(),systolic:128+(n%7),diastolic:82+(n%4),pulse:68+(n%6),measurementContext:[setting:'Home',activityCondition:'AtRest',restDurationMinutes:5,bodyPosition:'Seated'],note:'Synthetic JMeter energy workload']))
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Sampler>
|
||||||
|
<hashTree />
|
||||||
|
<IfController guiclass="IfControllerPanel" testclass="IfController" testname="Login or renew expired token" enabled="true">
|
||||||
|
<stringProp name="IfController.condition">${refresh_login}</stringProp>
|
||||||
|
<boolProp name="IfController.evaluateAll">false</boolProp>
|
||||||
|
<boolProp name="IfController.useExpression">true</boolProp>
|
||||||
|
</IfController>
|
||||||
|
<hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Login" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments">
|
||||||
|
<elementProp name="" elementType="HTTPArgument">
|
||||||
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
||||||
|
<stringProp name="Argument.value">${login_body}</stringProp>
|
||||||
|
<stringProp name="Argument.metadata">=</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
</collectionProp>
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/authentication/login</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">POST</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.accessToken; vars.put('token',json.accessToken); vars.put('expires_at',(java.time.Instant.now().epochSecond + (json.expiresIn as long)).toString())
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Measurement guidance" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/measurement-guidance?setting=Home&activityCondition=AtRest</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
|
||||||
|
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Read own profile" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/patients/me</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.patientId == vars.get('patient_id')
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Record synthetic measurement" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments">
|
||||||
|
<elementProp name="" elementType="HTTPArgument">
|
||||||
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
||||||
|
<stringProp name="Argument.value">${observation_body}</stringProp>
|
||||||
|
<stringProp name="Argument.metadata">=</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
</collectionProp>
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/patients/${patient_id}/observations</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">POST</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '201') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.patientId == vars.get('patient_id'); assert json.observationId; vars.put('observation_id',json.observationId)
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Confirm saved reading" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/observations/${observation_id}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.observationId == vars.get('observation_id')
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Health overview" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/patients/${patient_id}/overview?from=${period_from}&to=${period_to}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.patient.patientId == vars.get('patient_id'); assert json.latestObservation != null; assert json.insight != null
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<TestAction guiclass="TestActionGui" testclass="TestAction" testname="Between-session pause" enabled="true">
|
||||||
|
<intProp name="ActionProcessor.action">1</intProp>
|
||||||
|
<intProp name="ActionProcessor.target">0</intProp>
|
||||||
|
<stringProp name="ActionProcessor.duration">${session_delay_ms}</stringProp>
|
||||||
|
</TestAction>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
</hashTree>
|
||||||
|
</hashTree>
|
||||||
|
</jmeterTestPlan>
|
||||||
@@ -0,0 +1,623 @@
|
|||||||
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
|
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.6.3">
|
||||||
|
<hashTree>
|
||||||
|
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="HealthApp energy: review" enabled="true">
|
||||||
|
<stringProp name="TestPlan.comments">Synthetic closed-loop sessions; default duration four hours. Setup is external; Shelly power is collected live without changing the outlet.</stringProp>
|
||||||
|
<boolProp name="TestPlan.functional_mode">false</boolProp>
|
||||||
|
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
|
||||||
|
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
</TestPlan>
|
||||||
|
<hashTree>
|
||||||
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Shelly live power" enabled="true">
|
||||||
|
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
|
||||||
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" enabled="true">
|
||||||
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
||||||
|
<stringProp name="LoopController.loops">-1</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="ThreadGroup.num_threads">1</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.ramp_time">0</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.duration">${__P(total_duration_seconds,16210)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.delay">0</stringProp>
|
||||||
|
<boolProp name="ThreadGroup.scheduler">true</boolProp>
|
||||||
|
</ThreadGroup>
|
||||||
|
<hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="POWER Shelly status" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(shelly_host,192.168.1.44)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(shelly_port,80)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">http</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/rpc/Switch.GetStatus?id=${__P(shelly_switch_id,0)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">3000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">3000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Fixed meter cadence" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (!vars.get('shelly_last_poll_ms')) return 0L; return Math.max(0L, Long.parseLong(vars.get('shelly_last_poll_ms')) + Long.parseLong(props.getProperty('shelly_interval_ms','1000')) - System.currentTimeMillis())</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223PreProcessor guiclass="JSR223PreProcessorGui" testclass="JSR223PreProcessor" testname="Clear stale power values" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">['shelly_power_watts','shelly_voltage_volts','shelly_current_amps','shelly_energy_wh'].each { vars.put(it,'') }</stringProp>
|
||||||
|
</JSR223PreProcessor>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Validate and extract plug readings" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">vars.put('shelly_last_poll_ms',prev.getStartTime().toString())
|
||||||
|
try {
|
||||||
|
assert prev.getResponseCode() == '200'
|
||||||
|
def json=new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.output == true : 'Outlet is off'
|
||||||
|
def readings=[shelly_power_watts:json.apower,shelly_voltage_volts:json.voltage,shelly_current_amps:json.current,shelly_energy_wh:json.aenergy?.total]
|
||||||
|
readings.each { key,value -> assert value instanceof Number && Double.isFinite(value.doubleValue()) && value >= 0; vars.put(key,value.toString()) }
|
||||||
|
} catch (Throwable error) {
|
||||||
|
AssertionResult.setFailure(true);AssertionResult.setFailureMessage('Shelly status/measurement unavailable');prev.setSuccessful(false)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<ResultCollector guiclass="SimpleDataWriter" testclass="ResultCollector" testname="Shelly measurements saved live" enabled="true">
|
||||||
|
<stringProp name="filename">${__P(shelly_file,shelly.csv)}</stringProp>
|
||||||
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
||||||
|
</ResultCollector>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<kg.apc.jmeter.perfmon.PerfMonCollector guiclass="kg.apc.jmeter.vizualizers.PerfMonGui" testclass="kg.apc.jmeter.perfmon.PerfMonCollector" testname="NUC live CPU RAM disk and network" enabled="true">
|
||||||
|
<stringProp name="filename">${__P(perfmon_file,perfmon.csv)}</stringProp>
|
||||||
|
<boolProp name="ResultCollector.error_logging">false</boolProp>
|
||||||
|
<collectionProp name="metricConnections">
|
||||||
|
<collectionProp name="0">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">CPU</stringProp>
|
||||||
|
<stringProp name="3">combined</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="1">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">CPU</stringProp>
|
||||||
|
<stringProp name="3">iowait</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="2">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Memory</stringProp>
|
||||||
|
<stringProp name="3">usedperc</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="3">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Memory</stringProp>
|
||||||
|
<stringProp name="3">actualused</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="4">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Swap</stringProp>
|
||||||
|
<stringProp name="3">used</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="5">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Disks I/O</stringProp>
|
||||||
|
<stringProp name="3">readbytes</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="6">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Disks I/O</stringProp>
|
||||||
|
<stringProp name="3">writebytes</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="7">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Network I/O</stringProp>
|
||||||
|
<stringProp name="3">bytesrecv</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
<collectionProp name="8">
|
||||||
|
<stringProp name="0">${__P(perfmon_host,192.168.1.125)}</stringProp>
|
||||||
|
<stringProp name="1">${__P(perfmon_port,4444)}</stringProp>
|
||||||
|
<stringProp name="2">Network I/O</stringProp>
|
||||||
|
<stringProp name="3">bytessent</stringProp>
|
||||||
|
</collectionProp>
|
||||||
|
</collectionProp>
|
||||||
|
</kg.apc.jmeter.perfmon.PerfMonCollector>
|
||||||
|
<hashTree />
|
||||||
|
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Users" enabled="true">
|
||||||
|
<stringProp name="ThreadGroup.on_sample_error">stopthread</stringProp>
|
||||||
|
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" enabled="true">
|
||||||
|
<boolProp name="LoopController.continue_forever">false</boolProp>
|
||||||
|
<stringProp name="LoopController.loops">-1</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="ThreadGroup.num_threads">${__P(users,1)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.ramp_time">${__P(ramp_seconds,60)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.duration">${__P(total_duration_seconds,16210)}</stringProp>
|
||||||
|
<stringProp name="ThreadGroup.delay">0</stringProp>
|
||||||
|
<boolProp name="ThreadGroup.scheduler">true</boolProp>
|
||||||
|
<boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
|
||||||
|
</ThreadGroup>
|
||||||
|
<hashTree>
|
||||||
|
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="JSON and bearer token" enabled="true">
|
||||||
|
<collectionProp name="HeaderManager.headers">
|
||||||
|
<elementProp name="" elementType="Header">
|
||||||
|
<stringProp name="Header.name">Content-Type</stringProp>
|
||||||
|
<stringProp name="Header.value">application/json</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
<elementProp name="" elementType="Header">
|
||||||
|
<stringProp name="Header.name">Authorization</stringProp>
|
||||||
|
<stringProp name="Header.value">Bearer ${token}</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
</collectionProp>
|
||||||
|
</HeaderManager>
|
||||||
|
<hashTree />
|
||||||
|
<OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Assign one account per user" enabled="true" />
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Sampler guiclass="JSR223SamplerGui" testclass="JSR223Sampler" testname="Initialize user" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rows = new File(props.get('users_file')).readLines('UTF-8').drop(1).findAll { it.trim() }
|
||||||
|
def row = rows[ctx.getThreadNum()].split(',', -1)
|
||||||
|
vars.put('account_id', row[0]); vars.put('password', row[1]); vars.put('patient_id', row[2])
|
||||||
|
vars.put('token', ''); vars.put('expires_at', '0'); vars.put('session_number','0')
|
||||||
|
vars.putObject('user_random', new Random(Long.parseLong(props.getProperty('random_seed','42')) + ctx.getThreadNum()))
|
||||||
|
synchronized(props) {
|
||||||
|
if (props.get('timeline_file') && !props.get('workload_start_ms')) {
|
||||||
|
long start = System.currentTimeMillis()
|
||||||
|
long measurement = start + Long.parseLong(props.getProperty('warmup_seconds','1800')) * 1000
|
||||||
|
long end = measurement + Long.parseLong(props.getProperty('duration_seconds','14400')) * 1000
|
||||||
|
props.put('workload_start_ms',start.toString())
|
||||||
|
new File(props.get('timeline_file')).text = groovy.json.JsonOutput.toJson([warmup_start_ms:start,measurement_start_ms:measurement,measurement_end_ms:end])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Sampler>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<JSR223Sampler guiclass="JSR223SamplerGui" testclass="JSR223Sampler" testname="Prepare session" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def now = java.time.Instant.now()
|
||||||
|
vars.put('refresh_login', (now.epochSecond >= Long.parseLong(vars.get('expires_at')) - 60).toString())
|
||||||
|
vars.put('login_body',groovy.json.JsonOutput.toJson([accountId:vars.get('account_id'),password:vars.get('password')]))
|
||||||
|
vars.put('period_from',props.get('period_from')); vars.put('period_to',props.get('period_to'))
|
||||||
|
int n = Integer.parseInt(vars.get('session_number')); vars.put('session_number',(n+1).toString())
|
||||||
|
// Random session mix: expected 65% review, 30% recording, 5% correction.
|
||||||
|
int slot = vars.getObject('user_random').nextInt(20)
|
||||||
|
vars.put('session_kind',slot < 13 ? 'review' : slot < 19 ? 'recording' : 'correction')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('session_pause_ms','120000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('session_stddev_ms','30000'))
|
||||||
|
vars.put('session_delay_ms',Math.max(0L,Math.round(mean + vars.getObject('user_random').nextGaussian()*deviation)).toString())
|
||||||
|
vars.put('observation_body',groovy.json.JsonOutput.toJson([measuredAt:now.toString(),systolic:128+(n%7),diastolic:82+(n%4),pulse:68+(n%6),measurementContext:[setting:'Home',activityCondition:'AtRest',restDurationMinutes:5,bodyPosition:'Seated'],note:'Synthetic JMeter energy workload']))
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Sampler>
|
||||||
|
<hashTree />
|
||||||
|
<IfController guiclass="IfControllerPanel" testclass="IfController" testname="Login or renew expired token" enabled="true">
|
||||||
|
<stringProp name="IfController.condition">${refresh_login}</stringProp>
|
||||||
|
<boolProp name="IfController.evaluateAll">false</boolProp>
|
||||||
|
<boolProp name="IfController.useExpression">true</boolProp>
|
||||||
|
</IfController>
|
||||||
|
<hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Login" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments">
|
||||||
|
<elementProp name="" elementType="HTTPArgument">
|
||||||
|
<boolProp name="HTTPArgument.always_encode">false</boolProp>
|
||||||
|
<stringProp name="Argument.value">${login_body}</stringProp>
|
||||||
|
<stringProp name="Argument.metadata">=</stringProp>
|
||||||
|
</elementProp>
|
||||||
|
</collectionProp>
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/authentication/login</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">POST</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.accessToken; vars.put('token',json.accessToken); vars.put('expires_at',(java.time.Instant.now().epochSecond + (json.expiresIn as long)).toString())
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Read profile" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/patients/me</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.patientId == vars.get('patient_id')
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Latest reading" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/patients/${patient_id}/observations/latest</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.patientId == vars.get('patient_id')
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Home resting history" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/patients/${patient_id}/observations?from=${period_from}&to=${period_to}&setting=Home&activityCondition=AtRest</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json instanceof List && !json.empty : 'Seed observations first'
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Numerical insights" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/patients/${patient_id}/insights?from=${period_from}&to=${period_to}&setting=Home&activityCondition=AtRest</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.contributingCount > 0
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Trends" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/patients/${patient_id}/trends?from=${period_from}&to=${period_to}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
|
||||||
|
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Health overview" enabled="true">
|
||||||
|
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
|
||||||
|
<collectionProp name="Arguments.arguments" />
|
||||||
|
</elementProp>
|
||||||
|
<stringProp name="HTTPSampler.domain">${__P(host,127.0.0.1)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.port">${__P(port,5443)}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.protocol">https</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.path">/api/patients/${patient_id}/overview?from=${period_from}&to=${period_to}</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.method">GET</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.connect_timeout">10000</stringProp>
|
||||||
|
<stringProp name="HTTPSampler.response_timeout">30000</stringProp>
|
||||||
|
<boolProp name="HTTPSampler.postBodyRaw">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.follow_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
|
||||||
|
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
|
||||||
|
</HTTPSamplerProxy>
|
||||||
|
<hashTree>
|
||||||
|
<JSR223Assertion guiclass="JSR223AssertionGui" testclass="JSR223Assertion" testname="Expected response" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">if (prev.getResponseCode() != '200') {
|
||||||
|
AssertionResult.setFailure(true); AssertionResult.setFailureMessage('Unexpected HTTP status: '+prev.getResponseCode()); return
|
||||||
|
}
|
||||||
|
// Expected negative outcomes (e.g. deletion confirmed with 404) are successful checks.
|
||||||
|
prev.setSuccessful(true)
|
||||||
|
def json = new groovy.json.JsonSlurper().parseText(prev.getResponseDataAsString())
|
||||||
|
assert json.patient.patientId == vars.get('patient_id'); assert json.latestObservation != null; assert json.insight != null
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Assertion>
|
||||||
|
<hashTree />
|
||||||
|
<JSR223Timer guiclass="JSR223TimerGui" testclass="JSR223Timer" testname="Gaussian interaction pause" enabled="true">
|
||||||
|
<stringProp name="scriptLanguage">groovy</stringProp>
|
||||||
|
<stringProp name="cacheKey">true</stringProp>
|
||||||
|
<stringProp name="filename" />
|
||||||
|
<stringProp name="parameters" />
|
||||||
|
<stringProp name="script">def rng = vars.getObject('user_random')
|
||||||
|
double mean = Double.parseDouble(props.getProperty('think_mean_ms','1000'))
|
||||||
|
double deviation = Double.parseDouble(props.getProperty('think_stddev_ms','250'))
|
||||||
|
double minimum = Double.parseDouble(props.getProperty('think_min_ms','500'))
|
||||||
|
// Symmetric truncation keeps the expected mean at the configured value.
|
||||||
|
double maximum = 2 * mean - minimum
|
||||||
|
if (deviation == 0 || maximum == minimum) return Math.round(mean)
|
||||||
|
double delay
|
||||||
|
while (true) {
|
||||||
|
delay = mean + rng.nextGaussian() * deviation
|
||||||
|
if (delay >= minimum && delay <= maximum) return Math.round(delay)
|
||||||
|
}
|
||||||
|
</stringProp>
|
||||||
|
</JSR223Timer>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
<TestAction guiclass="TestActionGui" testclass="TestAction" testname="Between-session pause" enabled="true">
|
||||||
|
<intProp name="ActionProcessor.action">1</intProp>
|
||||||
|
<intProp name="ActionProcessor.target">0</intProp>
|
||||||
|
<stringProp name="ActionProcessor.duration">${session_delay_ms}</stringProp>
|
||||||
|
</TestAction>
|
||||||
|
<hashTree />
|
||||||
|
</hashTree>
|
||||||
|
</hashTree>
|
||||||
|
</hashTree>
|
||||||
|
</jmeterTestPlan>
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Prepare synthetic profiles/history outside the measurement window."""
|
||||||
|
import argparse, csv, datetime as dt, json, os, ssl, urllib.request, urllib.error
|
||||||
|
from pathlib import Path
|
||||||
|
p=argparse.ArgumentParser()
|
||||||
|
p.add_argument('--base-url', required=True); p.add_argument('--ca', required=True)
|
||||||
|
p.add_argument('--accounts', required=True, help='Private JSON: AccountId, Password, Role')
|
||||||
|
p.add_argument('--output', required=True); p.add_argument('--days', type=int, default=30)
|
||||||
|
a=p.parse_args()
|
||||||
|
if not a.base_url.startswith('https://'): p.error('HTTPS is required')
|
||||||
|
if not 2 <= a.days <= 365: p.error('days must be 2..365')
|
||||||
|
context=ssl.create_default_context(cafile=a.ca)
|
||||||
|
def call(method,path,body=None,token=None):
|
||||||
|
headers={'Content-Type':'application/json'}
|
||||||
|
if token: headers['Authorization']='Bearer '+token
|
||||||
|
req=urllib.request.Request(a.base_url.rstrip('/')+path, data=json.dumps(body).encode() if body is not None else None, headers=headers,method=method)
|
||||||
|
try:
|
||||||
|
with urllib.request.urlopen(req,context=context,timeout=60) as r: return r.status,json.load(r)
|
||||||
|
except urllib.error.HTTPError as e:
|
||||||
|
if e.code==404: return 404,None
|
||||||
|
raise RuntimeError(f'{method} {path}: HTTP {e.code}') from None
|
||||||
|
out=Path(a.output)
|
||||||
|
out.mkdir(mode=0o700,parents=True,exist_ok=True); os.chmod(out,0o700)
|
||||||
|
if (out/'users.csv').exists(): p.error('Output users.csv already exists; use a new directory')
|
||||||
|
rows=[]
|
||||||
|
for account in json.loads(Path(a.accounts).read_text()):
|
||||||
|
if account['Role']!='Patient' or account['AccountId']=='installation-check': continue
|
||||||
|
_,login=call('POST','/api/authentication/login',{'accountId':account['AccountId'],'password':account['Password']})
|
||||||
|
token=login['accessToken']
|
||||||
|
status,profile=call('GET','/api/patients/me',token=token)
|
||||||
|
if status==404:
|
||||||
|
_,profile=call('POST','/api/patients',{'name':'Synthetic energy test '+account['AccountId'],'dateOfBirth':'1990-01-01','contactInfo':'energy@example.test'},token)
|
||||||
|
pid=profile['patientId']
|
||||||
|
now=dt.datetime.now(dt.timezone.utc)
|
||||||
|
# Seed only absent exact synthetic timestamps; rerunning does not duplicate baseline rows.
|
||||||
|
start=(now-dt.timedelta(days=a.days)).replace(hour=0,minute=0,second=0,microsecond=0)
|
||||||
|
_,existing=call('GET',f'/api/patients/{pid}/observations?from={start.isoformat().replace("+00:00","Z")}&to={now.isoformat().replace("+00:00","Z")}',token=token)
|
||||||
|
times={o['measuredAt'].rstrip('Z') for o in existing}
|
||||||
|
for day in range(a.days):
|
||||||
|
for hour in [8,18]:
|
||||||
|
instant=(start+dt.timedelta(days=day,hours=hour)).isoformat().replace('+00:00','Z')
|
||||||
|
if instant.rstrip('Z') in times: continue
|
||||||
|
call('POST',f'/api/patients/{pid}/observations',{'measuredAt':instant,'systolic':122+day%12,'diastolic':76+day%8,'pulse':62+day%10,'measurementContext':{'setting':'Clinic' if day%10==0 else 'Unknown' if day%10==1 else 'Home','activityCondition':'AfterActivity' if day%10==2 else 'Unknown' if day%10==1 else 'AtRest','restDurationMinutes':None if day%10 in [1,2] else 5,'bodyPosition':None if day%10==1 else 'Seated'},'note':'Synthetic energy baseline'},token)
|
||||||
|
rows.append([account['AccountId'],account['Password'],pid])
|
||||||
|
print('Prepared synthetic patient:',account['AccountId'])
|
||||||
|
with (out/'users.csv').open('x') as f:
|
||||||
|
os.chmod(f.name,0o600); w=csv.writer(f);w.writerow(['account_id','password','patient_id']);w.writerows(rows)
|
||||||
|
if not rows: raise SystemExit('No patient accounts supplied')
|
||||||
|
print(f'Prepared {len(rows)} patients; private CSV: {out / "users.csv"}')
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<!doctype html><html lang="en"><meta charset="utf-8"><title>HealthApp measurement report</title>
|
||||||
|
<style>body{font:15px system-ui;margin:24px;background:#f6f8fb;color:#182230}header,section{background:white;padding:18px;margin-bottom:16px;border-radius:8px}canvas{width:100%;height:210px}h2{font-size:16px;margin:0 0 8px}.controls{position:sticky;top:0;background:white;padding:12px;z-index:2;border-bottom:1px solid #ccc}input{width:220px}#cursor{font-family:monospace}small{color:#485566}</style>
|
||||||
|
<header><h1>HealthApp — one-second measurements</h1><p id="status"></p><p id="window"></p><small>All panels share the same UTC timeline. Grey shading marks warmup. Missing measurements are gaps, never zero-filled. Latency is grouped by request start time; intervals with no requests have no latency value. Counter values are the plug’s absolute Wh counter.</small></header>
|
||||||
|
<div class="controls"><button onclick="location.reload()">Refresh snapshot</button> <button id="all">Include warmup</button> <button id="measured">Measured window</button> <label>From second <input id="from" type="number" min="0"></label> <label>To second <input id="to" type="number" min="1"></label><p id="cursor">Move over any graph to inspect the same second across all panels.</p></div><main id="charts"></main>
|
||||||
|
<script type="application/json" id="data">PAYLOAD_JSON</script><script>
|
||||||
|
const data=JSON.parse(document.getElementById('data').textContent),rows=data.rows,fields=data.fields,idx=Object.fromEntries(fields.map((f,i)=>[f,i]));
|
||||||
|
const panels=[['CPU (%)',['cpu_percent','cpu_iowait_percent']],['RAM (%)',['ram_percent']],['RAM / swap (MiB)',['ram_MiB','swap_MiB']],['Power (W)',['power_watts']],['Application requests / errors per second',['requests_s','errors_s']],['Application latency (ms)',['latency_mean_ms','latency_p95_ms','latency_max_ms']],['Disk / network (KiB/s)',['disk_read_KiB_s','disk_write_KiB_s','network_receive_KiB_s','network_send_KiB_s']],['Plug counter (Wh)',['energy_counter_Wh']]];
|
||||||
|
const colors=['#176bc1','#dc5a18','#379d55','#9450bd'];let lo=0,hi=rows.length-1,selected=null;
|
||||||
|
const date=t=>new Date(t).toISOString();document.getElementById('status').textContent=`${data.scenario}: ${data.status}. ${rows.length} recorded one-second intervals.`;
|
||||||
|
document.getElementById('window').textContent=`Measured window: ${date(data.timeline.measurement_start_ms)} — ${date(data.timeline.measurement_end_ms)}. All times UTC.`;
|
||||||
|
document.getElementById('measured').disabled=rows[rows.length-1][0]<data.timeline.measurement_start_ms;
|
||||||
|
const canvases=panels.map(([title,keys])=>{const s=document.createElement('section');s.innerHTML=`<h2>${title}</h2><canvas></canvas><small></small>`;document.getElementById('charts').append(s);return {canvas:s.querySelector('canvas'),legend:s.querySelector('small'),keys}});
|
||||||
|
function draw(){for(const {canvas,legend,keys} of canvases){const rect=canvas.getBoundingClientRect(),dpr=window.devicePixelRatio||1;canvas.width=rect.width*dpr;canvas.height=210*dpr;const c=canvas.getContext('2d');c.scale(dpr,dpr);const w=rect.width,h=210,left=55,right=w-15,top=12,bottom=h-32;
|
||||||
|
const x=i=>left+(right-left)*(i-lo)/Math.max(1,hi-lo);let max=1;for(let i=lo;i<=hi;i++)for(const k of keys){const v=rows[i][idx[k]];if(v!==null)max=Math.max(max,v)}max*=1.08;const y=v=>bottom-(bottom-top)*v/max;
|
||||||
|
const warmupIndex=(data.timeline.measurement_start_ms-rows[0][0])/1000;if(warmupIndex>lo){c.fillStyle='#e9ebee';c.fillRect(left,top,Math.max(0,Math.min(right,x(warmupIndex))-left),bottom-top)}
|
||||||
|
c.font='11px system-ui';for(let j=0;j<=4;j++){const yy=bottom-j*(bottom-top)/4;c.strokeStyle='#e4e7ec';c.beginPath();c.moveTo(left,yy);c.lineTo(right,yy);c.stroke();c.fillStyle='#526070';c.fillText((max*j/4).toFixed(max<10?2:0),2,yy+3)}
|
||||||
|
keys.forEach((k,n)=>{c.strokeStyle=colors[n];c.lineWidth=1.2;c.beginPath();let pen=false;for(let i=lo;i<=hi;i++){const v=rows[i][idx[k]];if(v===null){pen=false;continue}if(!pen)c.moveTo(x(i),y(v));else c.lineTo(x(i),y(v));pen=true}c.stroke()});
|
||||||
|
c.fillStyle='#526070';for(let j=0;j<=3;j++){const i=Math.round(lo+(hi-lo)*j/3);c.fillText(date(rows[i][0]).slice(11,19),Math.max(left,Math.min(right-55,x(i)-22)),h-10)}
|
||||||
|
if(selected!==null&&selected>=lo&&selected<=hi){c.strokeStyle='#182230';c.beginPath();c.moveTo(x(selected),top);c.lineTo(x(selected),bottom);c.stroke()}
|
||||||
|
legend.innerHTML=keys.map((k,n)=>`<span style="color:${colors[n]}">${k}${selected===null?'':': '+(rows[selected][idx[k]]===null?'missing':rows[selected][idx[k]].toFixed(3))}</span>`).join(' · ');
|
||||||
|
canvas.onmousemove=e=>{selected=Math.max(lo,Math.min(hi,Math.round(lo+(e.offsetX-left)/(right-left)*Math.max(1,hi-lo))));document.getElementById('cursor').textContent=`${date(rows[selected][0])} — ${rows[selected][idx.phase]}`;draw()};}}
|
||||||
|
function limits(a,b){lo=Math.max(0,Math.min(rows.length-1,a));hi=Math.max(lo,Math.min(rows.length-1,b));selected=null;document.getElementById('from').value=lo;document.getElementById('to').value=hi;draw()}
|
||||||
|
document.getElementById('all').onclick=()=>limits(0,rows.length-1);document.getElementById('measured').onclick=()=>limits(Math.floor((data.timeline.measurement_start_ms-rows[0][0])/1000),rows.length-1);
|
||||||
|
for(const id of ['from','to'])document.getElementById(id).onchange=()=>limits(Number(document.getElementById('from').value),Number(document.getElementById('to').value));window.onresize=draw;limits(0,rows.length-1);
|
||||||
|
</script></html>
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Align raw JMeter measurements into experiment-relative one-second bins."""
|
||||||
|
import os,time
|
||||||
|
import argparse,csv,datetime as dt,json,math
|
||||||
|
from pathlib import Path
|
||||||
|
FIELDS=['timestamp_ms','phase','cpu_percent','cpu_iowait_percent','ram_percent','ram_MiB','swap_MiB','power_watts','energy_counter_Wh','disk_read_KiB_s','disk_write_KiB_s','network_receive_KiB_s','network_send_KiB_s','requests_s','errors_s','error_percent','latency_mean_ms','latency_p95_ms','latency_max_ms','power_poll_errors_s']
|
||||||
|
METRIC_FIELDS={'CPU combined':('cpu_percent',1),'CPU iowait':('cpu_iowait_percent',1),'Memory usedperc':('ram_percent',1),'Memory actualused':('ram_MiB',1/1048576),'Swap used':('swap_MiB',1/1048576),'Disks I/O readbytes':('disk_read_KiB_s',1/1024),'Disks I/O writebytes':('disk_write_KiB_s',1/1024),'Network I/O bytesrecv':('network_receive_KiB_s',1/1024),'Network I/O bytessent':('network_send_KiB_s',1/1024)}
|
||||||
|
def read_csv(path):
|
||||||
|
if not path.exists():return []
|
||||||
|
with path.open(newline='') as f:
|
||||||
|
# Autoflush can expose the final line during a write; ignore incomplete rows.
|
||||||
|
return [r for r in csv.DictReader(f) if r and None not in r and all(v is not None for v in r.values())]
|
||||||
|
def finished(meta):
|
||||||
|
return ('finished_utc' in meta
|
||||||
|
and (not meta.get('perfmon',{}).get('enabled') or 'server_metrics' in meta or 'monitoring_error' in meta)
|
||||||
|
and (not meta.get('shelly',{}).get('enabled') or 'power_energy' in meta or 'power_error' in meta))
|
||||||
|
def build(folder):
|
||||||
|
folder=Path(folder);meta=json.loads((folder/'run.json').read_text());timeline=json.loads((folder/'timeline.json').read_text())
|
||||||
|
start=timeline['warmup_start_ms'];measurement_start=timeline['measurement_start_ms'];end=timeline['measurement_end_ms']
|
||||||
|
bins={};latest=start;bad_rows=0
|
||||||
|
def bucket(timestamp):
|
||||||
|
nonlocal latest
|
||||||
|
if not start<=timestamp<end:return None
|
||||||
|
index=int((timestamp-start)//1000);latest=max(latest,timestamp)
|
||||||
|
return bins.setdefault(index,{'averages':{},'latencies':[],'requests_s':0,'errors_s':0,'power_poll_errors_s':0})
|
||||||
|
def reading(timestamp,field,value):
|
||||||
|
row=bucket(timestamp)
|
||||||
|
if row is not None and math.isfinite(value):row['averages'].setdefault(field,[]).append(value)
|
||||||
|
for r in read_csv(folder/'perfmon.csv'):
|
||||||
|
try:
|
||||||
|
if r.get('success','true').lower()!='true':continue
|
||||||
|
timestamp=float(r['timeStamp']);value=float(r['elapsed'])/1000
|
||||||
|
if value<0:continue
|
||||||
|
for suffix,(field,scale) in METRIC_FIELDS.items():
|
||||||
|
if r['label'].endswith(' '+suffix):reading(timestamp,field,value*scale);break
|
||||||
|
except (ValueError,KeyError,TypeError):bad_rows+=1
|
||||||
|
for r in read_csv(folder/'shelly.csv'):
|
||||||
|
try:
|
||||||
|
timestamp=float(r['timeStamp'])+float(r['elapsed'])/2
|
||||||
|
row=bucket(timestamp)
|
||||||
|
if r['success'].lower()!='true':
|
||||||
|
if row is not None:row['power_poll_errors_s']+=1
|
||||||
|
continue
|
||||||
|
reading(timestamp,'power_watts',float(r['shelly_power_watts']))
|
||||||
|
reading(timestamp,'energy_counter_Wh',float(r['shelly_energy_wh']))
|
||||||
|
except (ValueError,KeyError,TypeError):bad_rows+=1
|
||||||
|
for r in read_csv(folder/'samples.csv'):
|
||||||
|
try:
|
||||||
|
if not r['label'].startswith('HTTP '):continue
|
||||||
|
row=bucket(float(r['timeStamp']))
|
||||||
|
if row is None:continue
|
||||||
|
if float(r['timeStamp'])>=measurement_start and float(r['timeStamp'])+float(r['elapsed'])>end:continue
|
||||||
|
row['requests_s']+=1;row['errors_s']+=r['success'].lower()!='true';row['latencies'].append(float(r['elapsed']))
|
||||||
|
except (ValueError,KeyError,TypeError):bad_rows+=1
|
||||||
|
completed=finished(meta)
|
||||||
|
if completed:
|
||||||
|
finish=int(dt.datetime.fromisoformat(meta['finished_utc']).timestamp()*1000)
|
||||||
|
observed_end=min(end,finish)
|
||||||
|
else:observed_end=min(end,int(latest)+1)
|
||||||
|
count=max(1,math.ceil((observed_end-start)/1000));rows=[]
|
||||||
|
for index in range(count):
|
||||||
|
timestamp=start+index*1000;source=bins.get(index,{'averages':{},'latencies':[],'requests_s':0,'errors_s':0,'power_poll_errors_s':0})
|
||||||
|
row={field:None for field in FIELDS};row.update(timestamp_ms=timestamp,phase='warmup' if timestamp<measurement_start else 'measurement')
|
||||||
|
for field,values in source['averages'].items():row[field]=sum(values)/len(values)
|
||||||
|
for field in ['requests_s','errors_s','power_poll_errors_s']:row[field]=source[field]
|
||||||
|
latencies=sorted(source['latencies'])
|
||||||
|
if latencies:
|
||||||
|
row.update(error_percent=100*source['errors_s']/len(latencies),latency_mean_ms=sum(latencies)/len(latencies),latency_p95_ms=latencies[max(0,math.ceil(.95*len(latencies))-1)],latency_max_ms=max(latencies))
|
||||||
|
rows.append(row)
|
||||||
|
with (folder/'per-second.csv').open('w') as f:
|
||||||
|
w=csv.DictWriter(f,fieldnames=FIELDS);w.writeheader();w.writerows(rows)
|
||||||
|
payload={'fields':FIELDS,'rows':[[r[k] for k in FIELDS] for r in rows],'timeline':timeline,'status':'completed' if meta.get('exit_code')==0 else 'incomplete/failed' if completed else 'running — snapshot','scenario':meta['scenario'],'skipped_rows':bad_rows,'interval_ms':1000}
|
||||||
|
encoded=json.dumps(payload,separators=(',',':'),allow_nan=False).replace('<','\\u003c')
|
||||||
|
template=(Path(__file__).parent/'report-template.html').read_text()
|
||||||
|
(folder/'report.html').write_text(template.replace('PAYLOAD_JSON',encoded))
|
||||||
|
plot(rows,timeline,folder,payload['status'])
|
||||||
|
print(f'Report saved: {folder / "report.html"}; {count} one-second intervals; {payload["status"]}')
|
||||||
|
return rows
|
||||||
|
PANELS=[('CPU utilisation (%)',['cpu_percent','cpu_iowait_percent']),('RAM usage (%)',['ram_percent']),('RAM / swap (MiB)',['ram_MiB','swap_MiB']),('Power (W)',['power_watts']),('Application requests / errors per second',['requests_s','errors_s']),('Application latency (ms)',['latency_mean_ms','latency_p95_ms','latency_max_ms']),('Disk / network (KiB/s)',['disk_read_KiB_s','disk_write_KiB_s','network_receive_KiB_s','network_send_KiB_s']),('Plug energy counter (Wh)',['energy_counter_Wh'])]
|
||||||
|
def plot(rows,timeline,folder,status):
|
||||||
|
os.environ.setdefault('MPLCONFIGDIR',str(folder/'.matplotlib'))
|
||||||
|
import matplotlib
|
||||||
|
matplotlib.use('Agg')
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
import matplotlib.dates as mdates
|
||||||
|
times=[dt.datetime.fromtimestamp(r['timestamp_ms']/1000,dt.timezone.utc) for r in rows]
|
||||||
|
warmup_end=dt.datetime.fromtimestamp(timeline['measurement_start_ms']/1000,dt.timezone.utc)
|
||||||
|
finish=dt.datetime.fromtimestamp(timeline['measurement_end_ms']/1000,dt.timezone.utc)
|
||||||
|
figure,axes=plt.subplots(len(PANELS),1,sharex=True,figsize=(16,19),layout='constrained')
|
||||||
|
for ax,(title,fields) in zip(axes,PANELS):
|
||||||
|
for field in fields:ax.plot(times,[float('nan') if r[field] is None else r[field] for r in rows],label=field,linewidth=.8)
|
||||||
|
ax.set_ylabel(title);ax.grid(alpha=.2);ax.legend(loc='upper right',fontsize=7)
|
||||||
|
if times[0]<warmup_end:ax.axvspan(times[0],min(warmup_end,times[-1]),color='gray',alpha=.15)
|
||||||
|
if times[0]<=warmup_end<=times[-1]:ax.axvline(warmup_end,color='black',linestyle='--',linewidth=.8)
|
||||||
|
ax.set_ylim(bottom=0)
|
||||||
|
if fields[0]=='requests_s' and not any(r['requests_s'] for r in rows):
|
||||||
|
ax.set_ylim(-.05,1);ax.text(.5,.5,'Zero application requests',transform=ax.transAxes,ha='center')
|
||||||
|
if fields[0]=='latency_mean_ms' and all(r['latency_mean_ms'] is None for r in rows):
|
||||||
|
ax.set_ylim(0,1);ax.text(.5,.5,'No requests: response time unavailable',transform=ax.transAxes,ha='center')
|
||||||
|
axes[-1].xaxis.set_major_formatter(mdates.DateFormatter('%H:%M:%S',tz=dt.timezone.utc))
|
||||||
|
axes[-1].set_xlabel('UTC time — experiment-relative one-second bins; shaded area is warmup')
|
||||||
|
figure.suptitle('HealthApp measurements — '+status+'\nMeasured window: '+warmup_end.isoformat()+' to '+finish.isoformat(),fontsize=13)
|
||||||
|
figure.savefig(folder/'report.png',dpi=150);figure.savefig(folder/'report.svg');plt.close(figure)
|
||||||
|
if __name__=='__main__':
|
||||||
|
parser=argparse.ArgumentParser();parser.add_argument('run_folder');parser.add_argument('--follow',action='store_true');args=parser.parse_args()
|
||||||
|
while True:
|
||||||
|
build(args.run_folder)
|
||||||
|
if not args.follow or finished(json.loads((Path(args.run_folder)/'run.json').read_text())):break
|
||||||
|
time.sleep(60)
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
script_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
|
||||||
|
run_id=$(date -u +%Y%m%dT%H%M%SZ)
|
||||||
|
exec python3 "$script_dir/run.py" idle \
|
||||||
|
--host "${HEALTHAPP_HOST:-192.168.1.125}" \
|
||||||
|
--shelly-host "${SHELLY_HOST:-192.168.1.44}" \
|
||||||
|
--warmup 1800 --duration 14400 \
|
||||||
|
--perfmon-interval-ms 1000 --shelly-interval-ms 1000 \
|
||||||
|
--output "$script_dir/results/idle-$run_id" "$@"
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Preflight and run JMeter; record actual timing for external power measurements."""
|
||||||
|
import xml.etree.ElementTree as E
|
||||||
|
import argparse, csv, datetime as dt, hashlib, json, os, platform, subprocess, time, ssl, urllib.request
|
||||||
|
from pathlib import Path
|
||||||
|
from perfmon import check_agent, summarize
|
||||||
|
import shelly
|
||||||
|
HERE=Path(__file__).resolve().parent
|
||||||
|
p=argparse.ArgumentParser()
|
||||||
|
p.add_argument('scenario',choices=['recording','review','correction','professional','mixed','idle'])
|
||||||
|
p.add_argument('--host',required=True);p.add_argument('--port',type=int,default=5443)
|
||||||
|
p.add_argument('--ca');p.add_argument('--users-file');p.add_argument('--users',type=int,default=50)
|
||||||
|
p.add_argument('--warmup',type=int,default=1800);p.add_argument('--duration',type=int,default=14400);p.add_argument('--ramp',type=int,default=120)
|
||||||
|
p.add_argument('--think-min-ms',type=int,default=500);p.add_argument('--think-mean-ms',type=int,default=1000);p.add_argument('--think-stddev-ms',type=int,default=250)
|
||||||
|
p.add_argument('--session-pause-ms',type=int,default=120000)
|
||||||
|
p.add_argument('--session-stddev-ms',type=int,default=30000);p.add_argument('--seed',type=int,default=42)
|
||||||
|
p.add_argument('--output',required=True);p.add_argument('--jmeter',default=str(Path.home()/'.local/bin/jmeter'))
|
||||||
|
p.add_argument('--allow-shared-read-account',action='store_true')
|
||||||
|
p.add_argument('--capacity-trial',action='store_true',help='Read-only trial: restart a session after an error so the configured duration is retained')
|
||||||
|
p.add_argument('--perfmon-host');p.add_argument('--perfmon-port',type=int,default=4444)
|
||||||
|
p.add_argument('--perfmon-interval-ms',type=int,default=1000);p.add_argument('--no-perfmon',action='store_true')
|
||||||
|
p.add_argument('--shelly-host',default='192.168.1.44');p.add_argument('--shelly-port',type=int,default=80)
|
||||||
|
p.add_argument('--shelly-switch-id',type=int,default=0);p.add_argument('--shelly-interval-ms',type=int,default=1000);p.add_argument('--no-shelly',action='store_true')
|
||||||
|
a=p.parse_args()
|
||||||
|
if a.capacity_trial and a.scenario not in ['review','professional']:p.error('Capacity trial is restricted to read-only workloads')
|
||||||
|
if a.users<1 or a.duration<1 or a.warmup<0 or a.ramp<0 or min(a.think_min_ms,a.think_mean_ms,a.think_stddev_ms,a.session_pause_ms,a.session_stddev_ms)<0: p.error('Invalid timing/concurrency')
|
||||||
|
if a.think_mean_ms<a.think_min_ms:p.error('Think-time mean must be at least the minimum')
|
||||||
|
if a.scenario!='idle' and not a.users_file: p.error('--users-file is required')
|
||||||
|
if a.scenario!='idle' and not a.ca: p.error('--ca is required for application scenarios')
|
||||||
|
if a.scenario=='idle' and a.users_file:p.error('Idle does not use accounts; omit --users-file')
|
||||||
|
if a.perfmon_interval_ms<1000 or a.perfmon_interval_ms%1000: p.error('PerfMon interval must be a whole number of seconds, at least 1000 ms')
|
||||||
|
agent_host=a.perfmon_host or a.host
|
||||||
|
if not a.no_perfmon: check_agent(agent_host,a.perfmon_port)
|
||||||
|
if a.shelly_interval_ms<1000 or a.shelly_switch_id<0:p.error('Invalid Shelly interval/switch ID')
|
||||||
|
shelly_info=None if a.no_shelly else shelly.check_plug(a.shelly_host,a.shelly_port,a.shelly_switch_id)
|
||||||
|
rows=[]
|
||||||
|
if a.users_file:
|
||||||
|
with open(a.users_file,newline='') as f:
|
||||||
|
reader=csv.DictReader(f)
|
||||||
|
if reader.fieldnames!=['account_id','password','patient_id']: p.error('CSV columns must be account_id,password,patient_id')
|
||||||
|
rows=list(reader)
|
||||||
|
if not rows or any(not all(r.values()) or any(c in v for v in r.values() for c in ',\n\r"') for r in rows): p.error('CSV contains empty or unsupported values')
|
||||||
|
if len({r['account_id'] for r in rows})!=len(rows): p.error('CSV must contain distinct accounts')
|
||||||
|
if len(rows)<a.users:
|
||||||
|
if not a.allow_shared_read_account or a.scenario not in ['review','professional']: p.error('Provide at least one distinct account per user. Shared accounts are allowed only for explicitly labelled read-only runs.')
|
||||||
|
rows=(rows*((a.users+len(rows)-1)//len(rows)))[:a.users]
|
||||||
|
if a.scenario!='idle':
|
||||||
|
context=ssl.create_default_context(cafile=a.ca)
|
||||||
|
with urllib.request.urlopen(f'https://{a.host}:{a.port}/api/measurement-guidance',context=context,timeout=15) as r:
|
||||||
|
if r.status!=200: p.error('Gateway preflight failed')
|
||||||
|
# Fail before a long run if accounts, profiles, baseline data or assignments are missing.
|
||||||
|
def get(path,token=None,body=None):
|
||||||
|
headers={'Content-Type':'application/json'}
|
||||||
|
if token: headers['Authorization']='Bearer '+token
|
||||||
|
req=urllib.request.Request(f'https://{a.host}:{a.port}'+path,headers=headers,data=json.dumps(body).encode() if body else None)
|
||||||
|
with urllib.request.urlopen(req,context=context,timeout=60) as r: return json.load(r)
|
||||||
|
now=dt.datetime.now(dt.timezone.utc)
|
||||||
|
period_from=(now-dt.timedelta(days=31)).replace(hour=0,minute=0,second=0,microsecond=0).isoformat().replace('+00:00','Z')
|
||||||
|
period_to=(now+dt.timedelta(seconds=a.warmup+a.duration+3600)).isoformat().replace('+00:00','Z')
|
||||||
|
for row in {r['account_id']:r for r in rows}.values():
|
||||||
|
login=get('/api/authentication/login',body={'accountId':row['account_id'],'password':row['password']});token=login['accessToken']
|
||||||
|
if a.scenario=='professional':
|
||||||
|
if login['role']!='HealthcareProfessional' or not any(x['patientId']==row['patient_id'] for x in get('/api/professionals/me/patients',token)): p.error('Professional account lacks the required assignment')
|
||||||
|
elif get('/api/patients/me',token)['patientId']!=row['patient_id']: p.error('CSV patient does not belong to its account')
|
||||||
|
overview=get('/api/patients/'+row['patient_id']+'/overview?from='+period_from+'&to='+period_to,token)
|
||||||
|
if overview['insight'] is None or overview['latestObservation'] is None: p.error('Seed patient history before running')
|
||||||
|
out=Path(a.output).resolve();out.mkdir(parents=True,mode=0o700,exist_ok=False)
|
||||||
|
metadata={'scenario':a.scenario,'users':0 if a.scenario=='idle' else a.users,'measurement_duration_seconds':a.duration,'warmup_seconds':a.warmup,'ramp_seconds':0 if a.scenario=='idle' else a.ramp,'think_min_ms':a.think_min_ms,'think_max_ms':2*a.think_mean_ms-a.think_min_ms,'think_distribution':'symmetrically truncated Gaussian','think_mean_ms':a.think_mean_ms,'think_stddev_ms':a.think_stddev_ms,'session_pause_ms':a.session_pause_ms,'session_stddev_ms':a.session_stddev_ms,'random_seed':a.seed,'host':a.host,'port':a.port,'period_from':period_from,'period_to':period_to,'load_generator':platform.platform(),'distinct_accounts':len({r['account_id'] for r in rows}),'login':'none; no application requests' if a.scenario=='idle' else 'initial login and renewal before expiry included','energy':'Shelly status polled live by JMeter; calculations exclude warmup'}
|
||||||
|
runtime_csv=out/'runtime-users.csv'
|
||||||
|
with runtime_csv.open('x') as f:
|
||||||
|
os.chmod(f.name,0o600); w=csv.DictWriter(f,fieldnames=['account_id','password','patient_id']);w.writeheader();w.writerows(rows)
|
||||||
|
source_plan=HERE/'plans'/(a.scenario+'.jmx');metadata['plan_sha256']=hashlib.sha256(source_plan.read_bytes()).hexdigest()
|
||||||
|
plan=out/'runtime.jmx'; document=E.parse(source_plan)
|
||||||
|
for collector in document.iter('kg.apc.jmeter.perfmon.PerfMonCollector'):
|
||||||
|
collector.set('enabled','false' if a.no_perfmon else 'true')
|
||||||
|
for group in document.iter('ThreadGroup'):
|
||||||
|
if a.capacity_trial and group.get('testname')=='Users':
|
||||||
|
for setting in group.findall('stringProp'):
|
||||||
|
if setting.get('name')=='ThreadGroup.on_sample_error':setting.text='startnextloop'
|
||||||
|
if group.get('testname')=='Shelly live power':group.set('enabled','false' if a.no_shelly else 'true')
|
||||||
|
document.write(plan,encoding='utf-8',xml_declaration=True)
|
||||||
|
drain_seconds=max(5,a.shelly_interval_ms//1000+5) if not a.no_shelly else 5
|
||||||
|
total_duration_seconds=a.warmup+a.duration+drain_seconds
|
||||||
|
cmd=[a.jmeter,'-n','-t',str(plan),'-l',str(out/'samples.csv'),'-j',str(out/'jmeter.log'),'-Jhost='+a.host,'-Jport='+str(a.port),'-Jusers_file='+str(runtime_csv),'-Jusers='+str(a.users),'-Jduration_seconds='+str(a.duration),'-Jwarmup_seconds='+str(a.warmup),'-Jtotal_duration_seconds='+str(total_duration_seconds),'-Jtimeline_file='+str(out/'timeline.json'),'-Jramp_seconds='+str(a.ramp),'-Jthink_min_ms='+str(a.think_min_ms),'-Jthink_mean_ms='+str(a.think_mean_ms),'-Jthink_stddev_ms='+str(a.think_stddev_ms),'-Jsession_pause_ms='+str(a.session_pause_ms),'-Jsession_stddev_ms='+str(a.session_stddev_ms),'-Jrandom_seed='+str(a.seed),'-Jperiod_from='+period_from,'-Jperiod_to='+period_to,'-Jjmeter.save.saveservice.autoflush=true','-Jjmeter.save.saveservice.output_format=csv','-Jjmeter.save.saveservice.print_field_names=true','-Jjmeter.save.saveservice.response_data=false','-Jjmeter.save.saveservice.samplerData=false','-Jjmeter.save.saveservice.requestHeaders=false','-Jjmeter.save.saveservice.responseHeaders=false']
|
||||||
|
metadata['jmeter_version']=subprocess.check_output([a.jmeter,'--version'],text=True).strip()
|
||||||
|
cmd += ['-Jperfmon_host='+agent_host,'-Jperfmon_port='+str(a.perfmon_port),'-Jperfmon_file='+str(out/'perfmon.csv'),'-JjmeterPlugin.perfmon.interval='+str(a.perfmon_interval_ms),'-JjmeterPlugin.perfmon.useUDP=false']
|
||||||
|
cmd += ['-Jshelly_host='+a.shelly_host,'-Jshelly_port='+str(a.shelly_port),'-Jshelly_switch_id='+str(a.shelly_switch_id),'-Jshelly_interval_ms='+str(a.shelly_interval_ms),'-Jshelly_file='+str(out/'shelly.csv'),'-Jsample_variables='+','.join(shelly.VARIABLES)]
|
||||||
|
metadata['capacity_trial']=a.capacity_trial
|
||||||
|
metadata['error_policy']='restart session on error' if a.capacity_trial else 'stop user on error'
|
||||||
|
metadata['shelly']={'enabled':not a.no_shelly,'host':a.shelly_host,'port':a.shelly_port,'switch_id':a.shelly_switch_id,'interval_ms':a.shelly_interval_ms,'device':shelly_info}
|
||||||
|
metadata['perfmon']={'enabled':not a.no_perfmon,'host':agent_host,'port':a.perfmon_port,'interval_ms':a.perfmon_interval_ms}
|
||||||
|
metadata['started_utc']=dt.datetime.now(dt.timezone.utc).isoformat(); started=time.monotonic()
|
||||||
|
(out/'run.json').write_text(json.dumps(metadata,indent=2))
|
||||||
|
print('Measurement workload starts:',metadata['started_utc'],flush=True)
|
||||||
|
code=0
|
||||||
|
try:
|
||||||
|
code=subprocess.call(cmd)
|
||||||
|
except KeyboardInterrupt: code=130
|
||||||
|
finally:
|
||||||
|
metadata['finished_utc']=dt.datetime.now(dt.timezone.utc).isoformat();metadata['actual_elapsed_seconds']=time.monotonic()-started;metadata['exit_code']=code
|
||||||
|
(out/'run.json').write_text(json.dumps(metadata,indent=2))
|
||||||
|
runtime_csv.unlink(missing_ok=True)
|
||||||
|
if (out/'timeline.json').exists():
|
||||||
|
timeline=json.loads((out/'timeline.json').read_text());metadata.update(timeline)
|
||||||
|
for name in ['warmup_start','measurement_start','measurement_end']:
|
||||||
|
metadata[name+'_utc']=dt.datetime.fromtimestamp(timeline[name+'_ms']/1000,dt.timezone.utc).isoformat()
|
||||||
|
if a.scenario=='idle':
|
||||||
|
with (out/'samples.csv').open() as f: idle_samples=list(csv.DictReader(f))
|
||||||
|
app_samples=[r for r in idle_samples if r['label'].startswith('HTTP ')]
|
||||||
|
metadata.update(http_samples=len(app_samples),measured_http_samples=len(app_samples),measured_http_requests_per_second=0,failed_samples_including_scripts=sum(r['success'].lower()!='true' for r in idle_samples))
|
||||||
|
if app_samples or metadata['failed_samples_including_scripts']:
|
||||||
|
print('Idle baseline contains application requests or failed samples');code=1
|
||||||
|
if metadata['actual_elapsed_seconds']+2<a.warmup+a.duration:
|
||||||
|
print('Idle baseline stopped early; measurement is incomplete');code=1
|
||||||
|
if a.scenario!='idle' and (out/'samples.csv').exists():
|
||||||
|
with (out/'samples.csv').open() as f: all_samples=list(csv.DictReader(f))
|
||||||
|
samples=[r for r in all_samples if r['label'].startswith('HTTP ')]
|
||||||
|
all_failed=sum(r['success'].lower()!='true' for r in all_samples)
|
||||||
|
failed=sum(r['success'].lower()!='true' for r in samples)
|
||||||
|
measured=[r for r in samples if metadata.get('measurement_start_ms',float('inf')) <= int(r['timeStamp']) and int(r['timeStamp'])+int(r['elapsed']) <= metadata.get('measurement_end_ms',0)]
|
||||||
|
if measured:
|
||||||
|
with (out/'measured.csv').open('w') as f:
|
||||||
|
w=csv.DictWriter(f,fieldnames=list(measured[0]));w.writeheader();w.writerows(measured)
|
||||||
|
latencies=sorted(int(r['elapsed']) for r in measured)
|
||||||
|
metadata.update(failed_samples_including_scripts=all_failed,http_samples=len(samples),failed_http_samples=failed,measured_http_samples=len(measured),measured_failed_http_samples=sum(r['success'].lower()!='true' for r in measured),measured_http_requests_per_second=len(measured)/a.duration,p95_latency_ms=latencies[min(len(latencies)-1,int(len(latencies)*.95))] if latencies else None)
|
||||||
|
print(f'HTTP samples: {len(samples)}; failures: {failed}; measured samples: {len(measured)}')
|
||||||
|
if all_failed or not measured: code=1
|
||||||
|
if metadata['actual_elapsed_seconds']+2<a.warmup+a.duration: print('Run stopped early; measurement is incomplete');code=1
|
||||||
|
if not a.no_perfmon:
|
||||||
|
try:
|
||||||
|
metadata['server_metrics']=summarize(out/'perfmon.csv',out/'perfmon-measured.csv',metadata['measurement_start_ms'],metadata['measurement_end_ms'],a.perfmon_interval_ms)
|
||||||
|
print('Live PerfMon metrics saved and measurement interval validated')
|
||||||
|
except (OSError,ValueError,KeyError) as error:
|
||||||
|
metadata['monitoring_error']=str(error);print('Invalid monitoring:',error);code=1
|
||||||
|
if not a.no_shelly:
|
||||||
|
try:
|
||||||
|
metadata['power_energy']=shelly.summarize(out/'shelly.csv',out/'shelly-measured.csv',metadata['measurement_start_ms'],metadata['measurement_end_ms'],a.shelly_interval_ms)
|
||||||
|
print('Live Shelly power and measured-window energy saved')
|
||||||
|
except (OSError,ValueError,KeyError) as error:
|
||||||
|
metadata['power_error']=str(error);print('Invalid power measurement:',error);code=1
|
||||||
|
metadata['exit_code']=code
|
||||||
|
(out/'run.json').write_text(json.dumps(metadata,indent=2))
|
||||||
|
if (out/'timeline.json').exists():
|
||||||
|
try:
|
||||||
|
from report import build
|
||||||
|
build(out)
|
||||||
|
except Exception as error:
|
||||||
|
print('Graph generation failed; raw measurements are preserved:',error)
|
||||||
|
metadata['report_error']=str(error);(out/'run.json').write_text(json.dumps(metadata,indent=2))
|
||||||
|
raise SystemExit(code)
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
"""Shelly read-only preflight and measured-window energy calculations."""
|
||||||
|
import csv, json, math, urllib.request
|
||||||
|
VARIABLES=['shelly_power_watts','shelly_voltage_volts','shelly_current_amps','shelly_energy_wh']
|
||||||
|
def check_plug(host,port=80,switch_id=0):
|
||||||
|
def read(method):
|
||||||
|
with urllib.request.urlopen(f'http://{host}:{port}/rpc/{method}',timeout=5) as r:return json.load(r)
|
||||||
|
info=read('Shelly.GetDeviceInfo');status=read(f'Switch.GetStatus?id={switch_id}')
|
||||||
|
if info.get('auth_en'):raise ValueError('Shelly authentication is enabled; this integration requires the current unauthenticated LAN API')
|
||||||
|
if status.get('output') is not True:raise ValueError('Shelly outlet is off')
|
||||||
|
values=[status.get('apower'),status.get('voltage'),status.get('current'),status.get('aenergy',{}).get('total')]
|
||||||
|
if any(not isinstance(v,(float,int)) or not math.isfinite(v) or v<0 for v in values):raise ValueError('Shelly power/voltage/current/energy readings are unavailable')
|
||||||
|
return {k:info.get(k) for k in ['model','gen','ver','app']}
|
||||||
|
def summarize(raw,measured,start_ms,end_ms,interval_ms):
|
||||||
|
with raw.open() as f:rows=list(csv.DictReader(f))
|
||||||
|
points=[]
|
||||||
|
for row in rows:
|
||||||
|
if row['label']!='POWER Shelly status':continue
|
||||||
|
if row['success'].lower()!='true':raise ValueError('A Shelly status poll failed; energy measurement is incomplete')
|
||||||
|
values=[float(row[k]) for k in VARIABLES]
|
||||||
|
if any(not math.isfinite(v) or v<0 for v in values):raise ValueError('Invalid Shelly metric')
|
||||||
|
# Approximate the device sampling instant by the HTTP request midpoint.
|
||||||
|
timestamp=int(row['timeStamp'])+int(row['elapsed'])/2
|
||||||
|
points.append((timestamp,*values))
|
||||||
|
points.sort()
|
||||||
|
if len(points)<2 or points[0][0]>start_ms or points[-1][0]<end_ms:raise ValueError('Shelly samples do not bracket the full measured interval')
|
||||||
|
if any(b[0]<=a[0] or b[0]-a[0]>interval_ms*3 or b[4]<a[4] for a,b in zip(points,points[1:])):raise ValueError('Shelly samples contain gaps, duplicate timestamps or an energy counter reset')
|
||||||
|
def boundary(time):
|
||||||
|
for a,b in zip(points,points[1:]):
|
||||||
|
if a[0]<=time<=b[0]:return (time,*(a[i]+(b[i]-a[i])*(time-a[0])/(b[0]-a[0]) for i in range(1,5)))
|
||||||
|
raise ValueError('Missing boundary')
|
||||||
|
selected=[boundary(start_ms),*(p for p in points if start_ms<p[0]<end_ms),boundary(end_ms)]
|
||||||
|
# Each recorded power reading represents one nominal polling interval.
|
||||||
|
# Do not interpolate power or invent readings at the window boundaries.
|
||||||
|
measured_points=[p for p in points if start_ms<=p[0]<end_ms]
|
||||||
|
if not measured_points:raise ValueError('No Shelly power readings inside the measured interval')
|
||||||
|
joules=sum(p[1] for p in measured_points)*(interval_ms/1000)
|
||||||
|
watt_hours=selected[-1][4]-selected[0][4]
|
||||||
|
with measured.open('w') as f:
|
||||||
|
w=csv.writer(f);w.writerow(['timestamp_ms','power_watts','voltage_volts','current_amps','energy_wh']);w.writerows(selected)
|
||||||
|
return {'measurement_seconds':(end_ms-start_ms)/1000,'samples_including_interpolated_boundaries':len(selected),'power_sample_count':len(measured_points),'nominal_sample_interval_ms':interval_ms,'nominal_sample_coverage_seconds':len(measured_points)*interval_ms/1000,'energy_method':'sum of recorded power readings multiplied by nominal polling interval; assumes each reading represents that interval','integrated_joules':joules,'integrated_kWh':joules/3600000,'average_watts':sum(p[1] for p in measured_points)/len(measured_points),'counter_delta_Wh':watt_hours,'counter_joules':watt_hours*3600,'counter_kWh':watt_hours/1000,'boundary_method':'Energy counter and exported plot boundaries interpolated; power sum uses only recorded in-window samples; timestamps approximate HTTP request midpoint'}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Verify the idle runner makes zero application requests, including preflight."""
|
||||||
|
import csv,json,subprocess,tempfile,threading
|
||||||
|
from pathlib import Path
|
||||||
|
from http.server import BaseHTTPRequestHandler,ThreadingHTTPServer
|
||||||
|
HERE=Path(__file__).parent
|
||||||
|
class Application(BaseHTTPRequestHandler):
|
||||||
|
requests=0
|
||||||
|
def do_GET(self):
|
||||||
|
type(self).requests+=1;self.send_response(500);self.end_headers()
|
||||||
|
do_POST=do_GET
|
||||||
|
def log_message(self,*args):pass
|
||||||
|
server=ThreadingHTTPServer(('127.0.0.1',0),Application)
|
||||||
|
threading.Thread(target=server.serve_forever,daemon=True).start()
|
||||||
|
try:
|
||||||
|
with tempfile.TemporaryDirectory(prefix='healthapp-idle-') as name:
|
||||||
|
out=Path(name)/'run'
|
||||||
|
result=subprocess.run(['python3',str(HERE/'run.py'),'idle','--host','127.0.0.1','--port',str(server.server_port),'--no-perfmon','--no-shelly','--warmup','1','--duration','3','--output',str(out)],capture_output=True,text=True)
|
||||||
|
assert result.returncode==0,result.stdout+result.stderr
|
||||||
|
data=json.loads((out/'run.json').read_text())
|
||||||
|
assert Application.requests==0 and data['http_samples']==0 and data['users']==0
|
||||||
|
assert data['measurement_end_ms']-data['measurement_start_ms']==3000
|
||||||
|
assert data['measurement_start_ms']-data['warmup_start_ms']==1000
|
||||||
|
with (out/'samples.csv').open() as f:assert all(not r['label'].startswith('HTTP ') for r in csv.DictReader(f))
|
||||||
|
print('Idle baseline passed: no application calls or login, no CA/accounts needed, warmup excluded')
|
||||||
|
finally:server.shutdown()
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Verify metric decoding; optionally verify a live JMeter-to-agent connection."""
|
||||||
|
import argparse, csv, json, subprocess, tempfile, time
|
||||||
|
from pathlib import Path
|
||||||
|
import xml.etree.ElementTree as E
|
||||||
|
from perfmon import METRICS, check_agent, summarize
|
||||||
|
p=argparse.ArgumentParser();p.add_argument('--host');p.add_argument('--port',type=int,default=4444);p.add_argument('--output');a=p.parse_args()
|
||||||
|
with tempfile.TemporaryDirectory(prefix='healthapp-perfmon-unit-') as name:
|
||||||
|
root=Path(name);raw=root/'raw.csv'
|
||||||
|
def fixture(skip=None,gap=False):
|
||||||
|
with raw.open('w') as f:
|
||||||
|
writer=csv.DictWriter(f,fieldnames=['timeStamp','elapsed','label']);writer.writeheader()
|
||||||
|
for timestamp in ([5000,25000] if gap else range(0,30001,5000)):
|
||||||
|
for kind,param,unit in METRICS:
|
||||||
|
if (kind,param)==skip:continue
|
||||||
|
writer.writerow({'timeStamp':timestamp,'elapsed':73250 if kind=='CPU' else 123000,'label':'fixture '+kind+' '+param})
|
||||||
|
fixture();stats=summarize(raw,root/'measured.csv',5000,25000,5000)
|
||||||
|
assert stats['fixture CPU combined']['mean']==73.25
|
||||||
|
assert len(stats)==9 and all(s['samples']==5 for s in stats.values())
|
||||||
|
for skipped,gap in [(('CPU','combined'),False),(None,True)]:
|
||||||
|
fixture(skipped,gap)
|
||||||
|
try:summarize(raw,root/'invalid.csv',5000,25000,5000)
|
||||||
|
except ValueError:pass
|
||||||
|
else:raise AssertionError('Missing metrics/collection gaps were accepted')
|
||||||
|
print('Metric decoding, warmup exclusion and gap detection passed')
|
||||||
|
if a.host:
|
||||||
|
if not a.output:p.error('--output is required for a live check')
|
||||||
|
check_agent(a.host,a.port)
|
||||||
|
out=Path(a.output).resolve();out.mkdir(parents=True,mode=0o700,exist_ok=False)
|
||||||
|
document=E.parse(Path(__file__).parent/'plans/idle.jmx')
|
||||||
|
for group in document.iter('ThreadGroup'):
|
||||||
|
if group.get('testname')=='Shelly live power':group.set('enabled','false')
|
||||||
|
plan=out/'idle.jmx';document.write(plan)
|
||||||
|
cmd=[str(Path.home()/'.local/bin/jmeter'),'-n','-t',str(plan),'-l',str(out/'samples.csv'),'-j',str(out/'jmeter.log'),'-Jperfmon_host='+a.host,'-Jperfmon_port='+str(a.port),'-Jperfmon_file='+str(out/'perfmon.csv'),'-JjmeterPlugin.perfmon.interval=5000','-JjmeterPlugin.perfmon.useUDP=false','-Jjmeter.save.saveservice.autoflush=true','-Jwarmup_seconds=5','-Jduration_seconds=20','-Jtotal_duration_seconds=30','-Jtimeline_file='+str(out/'timeline.json')]
|
||||||
|
process=subprocess.Popen(cmd);saved_live=False
|
||||||
|
while process.poll() is None:
|
||||||
|
raw=out/'perfmon.csv'
|
||||||
|
if raw.exists() and raw.stat().st_size>0:saved_live=True
|
||||||
|
time.sleep(.25)
|
||||||
|
assert process.returncode==0 and saved_live, 'Metrics were not saved while JMeter was running'
|
||||||
|
timeline=json.loads((out/'timeline.json').read_text())
|
||||||
|
stats=summarize(out/'perfmon.csv',out/'perfmon-measured.csv',timeline['measurement_start_ms'],timeline['measurement_end_ms'],5000)
|
||||||
|
(out/'summary.json').write_text(json.dumps(stats,indent=2))
|
||||||
|
print('Live JMeter collection passed: nine metrics written during the run; no application load sent')
|
||||||
|
print('Results:',out)
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Exercise every generated plan against a local HTTPS contract stub, not testserver."""
|
||||||
|
import datetime, json, os, ssl, subprocess, tempfile, threading, uuid
|
||||||
|
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
||||||
|
from pathlib import Path
|
||||||
|
import xml.etree.ElementTree as E
|
||||||
|
from urllib.parse import urlsplit
|
||||||
|
HERE=Path(__file__).resolve().parent
|
||||||
|
class Handler(BaseHTTPRequestHandler):
|
||||||
|
protocol_version='HTTP/1.1'
|
||||||
|
observations={}; tokens={}; logins=0; break_insights=False
|
||||||
|
def log_message(self,*args): pass
|
||||||
|
def handle_request(self):
|
||||||
|
path=urlsplit(self.path).path
|
||||||
|
body=json.loads(self.rfile.read(int(self.headers.get('Content-Length',0))) or '{}')
|
||||||
|
code=200; data={}
|
||||||
|
if path=='/api/measurement-guidance': data={'available':True}
|
||||||
|
elif path=='/api/authentication/login':
|
||||||
|
if body.get('password')!='test': code=401
|
||||||
|
else:
|
||||||
|
token=str(uuid.uuid4());self.tokens[token]=body['accountId'];type(self).logins+=1
|
||||||
|
data={'accessToken':token,'expiresIn':65,'role':'Patient','tokenType':'Bearer'}
|
||||||
|
elif self.headers.get('Authorization','').removeprefix('Bearer ') not in self.tokens: code=401
|
||||||
|
elif path=='/api/professionals/me/patients': data=[{'patientId':'patient-0'},{'patientId':'patient-1'}]
|
||||||
|
elif path=='/api/patients/me':
|
||||||
|
account=self.tokens[self.headers['Authorization'].removeprefix('Bearer ')]
|
||||||
|
data={'patientId':'patient-'+account.split('-')[-1]}
|
||||||
|
elif path.startswith('/api/observations/'):
|
||||||
|
oid=path.split('/')[-1]
|
||||||
|
if oid not in self.observations: code=404
|
||||||
|
elif self.command=='DELETE': del self.observations[oid];code=204
|
||||||
|
else:
|
||||||
|
if self.command=='PATCH':self.observations[oid].update(body)
|
||||||
|
data=self.observations[oid]
|
||||||
|
elif path.startswith('/api/patients/'):
|
||||||
|
pid=path.split('/')[3];profile={'patientId':pid}
|
||||||
|
baseline={'patientId':pid,'observationId':'baseline','systolic':128,'diastolic':82,'pulse':68,'measuredAt':'2026-09-01T08:00:00'}
|
||||||
|
if path.endswith('/observations'):
|
||||||
|
if self.command=='POST':
|
||||||
|
if not body.get('measuredAt') or body.get('measurementContext',{}).get('setting') not in ['Home','Clinic','Other','Unknown']:code=400
|
||||||
|
else:
|
||||||
|
oid=str(uuid.uuid4());data=dict(body,patientId=pid,observationId=oid);self.observations[oid]=data;code=201
|
||||||
|
else:data=[baseline]
|
||||||
|
elif path.endswith('/latest'):data=baseline
|
||||||
|
elif path.endswith('/overview'):data={'patient':profile,'latestObservation':baseline,'insight':{'contributingCount':60}}
|
||||||
|
elif path.endswith('/insights'):
|
||||||
|
data={'contributingCount':60}
|
||||||
|
if self.break_insights: code=503
|
||||||
|
elif path.endswith('/trends'):data={'patientId':pid}
|
||||||
|
else:data=profile
|
||||||
|
else:code=404
|
||||||
|
payload=b'' if code==204 else json.dumps(data).encode()
|
||||||
|
self.send_response(code);self.send_header('Content-Type','application/json');self.send_header('Content-Length',str(len(payload)));self.end_headers();self.wfile.write(payload)
|
||||||
|
do_GET=do_POST=do_PATCH=do_DELETE=handle_request
|
||||||
|
with tempfile.TemporaryDirectory(prefix='healthapp-jmeter-verify-') as temp:
|
||||||
|
root=Path(temp);cert=root/'cert.pem';key=root/'key.pem'
|
||||||
|
subprocess.run(['openssl','req','-x509','-newkey','rsa:2048','-nodes','-days','1','-keyout',str(key),'-out',str(cert),'-subj','/CN=127.0.0.1','-addext','subjectAltName=IP:127.0.0.1'],check=True,capture_output=True)
|
||||||
|
server=ThreadingHTTPServer(('127.0.0.1',0),Handler);context=ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER);context.load_cert_chain(cert,key);server.socket=context.wrap_socket(server.socket,server_side=True)
|
||||||
|
threading.Thread(target=server.serve_forever,daemon=True).start()
|
||||||
|
users=root/'users.csv';users.write_text('account_id,password,patient_id\naccount-0,test,patient-0\naccount-1,test,patient-1\n')
|
||||||
|
accounts=root/'accounts.json'
|
||||||
|
accounts.write_text(json.dumps([{'AccountId':f'account-{i}','Password':'test','Role':'Patient'} for i in range(2)]))
|
||||||
|
prepared=subprocess.run(['python3',str(HERE/'prepare.py'),'--base-url',f'https://127.0.0.1:{server.server_port}','--ca',str(cert),'--accounts',str(accounts),'--output',str(root/'dataset'),'--days','4'],capture_output=True,text=True)
|
||||||
|
assert prepared.returncode==0, prepared.stderr
|
||||||
|
assert len(Handler.observations)==16
|
||||||
|
assert set(o['measurementContext']['setting'] for o in Handler.observations.values())=={'Home','Clinic','Unknown'}
|
||||||
|
assert (root/'dataset/users.csv').stat().st_mode & 0o777 == 0o600
|
||||||
|
print('Synthetic dataset preparation passed')
|
||||||
|
# Professional runner preflight is intentionally separate: fixture credentials are patient roles.
|
||||||
|
for scenario in ['recording','review','correction','mixed']:
|
||||||
|
initial_logins=Handler.logins
|
||||||
|
result=subprocess.run(['python3',str(HERE/'run.py'),scenario,'--no-perfmon','--no-shelly','--host','127.0.0.1','--port',str(server.server_port),'--ca',str(cert),'--users-file',str(users),'--users','2','--warmup','1','--duration','6','--ramp','0','--think-min-ms','0','--think-mean-ms','10','--think-stddev-ms','5','--session-pause-ms','100','--session-stddev-ms','25','--output',str(root/scenario)],capture_output=True,text=True)
|
||||||
|
if result.returncode:
|
||||||
|
print(result.stdout,result.stderr)
|
||||||
|
print((root/scenario/'jmeter.log').read_text()[-6000:])
|
||||||
|
raise SystemExit('Plan verification failed: '+scenario)
|
||||||
|
assert Handler.logins - initial_logins >= 6, 'Initial login and token renewal were not exercised'
|
||||||
|
data=json.loads((root/scenario/'run.json').read_text());assert data['measurement_end_ms']-data['measurement_start_ms']==6000; assert data['measured_http_samples']>0; print(scenario, 'passed;',data['http_samples'],'HTTP samples;', data['failed_http_samples'],'failures')
|
||||||
|
# Run the professional plan directly so its assigned-patient semantic assertion is exercised.
|
||||||
|
professional=E.parse(HERE/'plans/professional.jmx')
|
||||||
|
for collector in professional.iter('kg.apc.jmeter.perfmon.PerfMonCollector'):collector.set('enabled','false')
|
||||||
|
for group in professional.iter('ThreadGroup'):
|
||||||
|
if group.get('testname')=='Shelly live power':group.set('enabled','false')
|
||||||
|
professional.write(root/'professional.jmx')
|
||||||
|
result=subprocess.run([str(Path.home()/'.local/bin/jmeter'),'-n','-t',str(root/'professional.jmx'),'-l',str(root/'professional.csv'),'-j',str(root/'professional.log'),'-Jperfmon_enabled=false','-Jhost=127.0.0.1','-Jport='+str(server.server_port),'-Jusers_file='+str(users),'-Jusers=2','-Jtotal_duration_seconds=8','-Jramp_seconds=0','-Jthink_min_ms=0','-Jthink_mean_ms=0','-Jthink_stddev_ms=0','-Jsession_pause_ms=100','-Jsession_stddev_ms=25','-Jperiod_from=2026-01-01T00:00:00Z','-Jperiod_to=2027-01-01T00:00:00Z'],capture_output=True,text=True)
|
||||||
|
import csv
|
||||||
|
with (root/'professional.csv').open() as f: samples=list(csv.DictReader(f))
|
||||||
|
assert result.returncode==0 and samples and all(r['success']=='true' for r in samples), result.stdout+result.stderr
|
||||||
|
print('professional passed;',len(samples),'samples; token renewal exercised across all plans')
|
||||||
|
Handler.break_insights=True
|
||||||
|
failed=subprocess.run(['python3',str(HERE/'run.py'),'review','--no-perfmon','--no-shelly','--host','127.0.0.1','--port',str(server.server_port),'--ca',str(cert),'--users-file',str(users),'--users','2','--warmup','0','--duration','5','--ramp','0','--think-min-ms','0','--think-mean-ms','0','--think-stddev-ms','0','--session-pause-ms','0','--session-stddev-ms','0','--output',str(root/'expected-failure')],capture_output=True,text=True)
|
||||||
|
assert failed.returncode!=0
|
||||||
|
assert json.loads((root/'expected-failure/run.json').read_text())['failed_http_samples']>0
|
||||||
|
print('Unexpected upstream failure correctly invalidates the run')
|
||||||
|
# Constant 100 W for 4 measured hours is exactly 1,440,000 J / 0.4 kWh.
|
||||||
|
energy_run=root/'energy-run.json';energy_run.write_text(json.dumps({'measurement_start_ms':1000000,'measurement_end_ms':15400000,'measured_http_samples':100}))
|
||||||
|
power=root/'power.csv';power.write_text('timestamp,power_watts\n1970-01-01T00:00:00Z,100\n1970-01-01T05:00:00Z,100\n')
|
||||||
|
energy=subprocess.run(['python3',str(HERE/'energy.py'),str(energy_run),str(power)],capture_output=True,text=True,check=True)
|
||||||
|
energy_result=json.loads(energy.stdout); assert energy_result['joules']==1440000 and energy_result['kWh']==0.4
|
||||||
|
print('Four-hour power integration passed')
|
||||||
|
server.shutdown()
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Verify clock alignment, one-second aggregation and missing-data semantics."""
|
||||||
|
import csv,datetime as dt,json,tempfile
|
||||||
|
from pathlib import Path
|
||||||
|
import report
|
||||||
|
with tempfile.TemporaryDirectory(prefix='healthapp-report-') as name:
|
||||||
|
folder=Path(name);start=1000000
|
||||||
|
(folder/'timeline.json').write_text(json.dumps({'warmup_start_ms':start,'measurement_start_ms':start+2000,'measurement_end_ms':start+5000}))
|
||||||
|
(folder/'run.json').write_text(json.dumps({'scenario':'mixed','exit_code':0,'finished_utc':dt.datetime.fromtimestamp((start+5000)/1000,dt.timezone.utc).isoformat()}))
|
||||||
|
def write(name,fields,rows):
|
||||||
|
with (folder/name).open('w') as f:w=csv.DictWriter(f,fieldnames=fields);w.writeheader();w.writerows(rows)
|
||||||
|
write('samples.csv',['timeStamp','elapsed','label','success'],[{'timeStamp':start+2050,'elapsed':200,'label':'HTTP Read profile','success':'true'},{'timeStamp':start+2200,'elapsed':1000,'label':'HTTP Read overview','success':'false'},{'timeStamp':start+2250,'elapsed':10,'label':'POWER Shelly status','success':'true'}])
|
||||||
|
write('perfmon.csv',['timeStamp','elapsed','label','success'],[{'timeStamp':start+2100,'elapsed':30000,'label':'NUC CPU combined','success':'true'},{'timeStamp':start+2800,'elapsed':50000,'label':'NUC CPU combined','success':'true'},{'timeStamp':start+2110,'elapsed':104857600000,'label':'NUC Memory actualused','success':'true'}])
|
||||||
|
write('shelly.csv',['timeStamp','elapsed','label','success','shelly_power_watts','shelly_energy_wh'],[{'timeStamp':start+2150,'elapsed':100,'label':'POWER Shelly status','success':'true','shelly_power_watts':20,'shelly_energy_wh':3}])
|
||||||
|
original=report.plot;report.plot=lambda *args:None
|
||||||
|
rows=report.build(folder)
|
||||||
|
report.plot=original
|
||||||
|
assert len(rows)==5
|
||||||
|
assert rows[2]['phase']=='measurement' and rows[1]['phase']=='warmup'
|
||||||
|
assert rows[2]['cpu_percent']==40 and rows[2]['ram_MiB']==100 and rows[2]['power_watts']==20
|
||||||
|
assert rows[2]['requests_s']==2 and rows[2]['errors_s']==1 and rows[2]['error_percent']==50
|
||||||
|
assert rows[2]['latency_mean_ms']==600 and rows[2]['latency_p95_ms']==1000
|
||||||
|
assert rows[3]['cpu_percent'] is None and rows[3]['latency_mean_ms'] is None and rows[3]['requests_s']==0
|
||||||
|
assert (folder/'report.html').exists() and (folder/'per-second.csv').exists()
|
||||||
|
print('One-second request/latency/error aggregation, UTC alignment, warmup and missing measurements passed')
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Check power math and optionally exercise live JMeter-to-Shelly collection."""
|
||||||
|
import argparse, csv, json, subprocess, tempfile, time, xml.etree.ElementTree as E
|
||||||
|
from pathlib import Path
|
||||||
|
import shelly
|
||||||
|
p=argparse.ArgumentParser();p.add_argument('--host');p.add_argument('--port',type=int,default=80);p.add_argument('--output');a=p.parse_args()
|
||||||
|
with tempfile.TemporaryDirectory(prefix='healthapp-shelly-test-') as name:
|
||||||
|
root=Path(name);raw=root/'power.csv'
|
||||||
|
with raw.open('w') as f:
|
||||||
|
fields=['timeStamp','elapsed','label','success',*shelly.VARIABLES];w=csv.DictWriter(f,fieldnames=fields);w.writeheader()
|
||||||
|
for t in range(0,20001,1000):
|
||||||
|
w.writerow(dict(zip(fields,[t,0,'POWER Shelly status','true',100,230,.5,t/36000])))
|
||||||
|
result=shelly.summarize(raw,root/'measured.csv',2500,17500,1000)
|
||||||
|
assert result['integrated_joules']==1500 and abs(result['counter_joules']-1500)<.0001
|
||||||
|
assert result['measurement_seconds']==15 and result['average_watts']==100
|
||||||
|
assert result['power_sample_count']==15 and result['nominal_sample_coverage_seconds']==15
|
||||||
|
# Variable power distinguishes a direct sample sum from trapezoidal integration.
|
||||||
|
with raw.open() as f: variable=list(csv.DictReader(f))
|
||||||
|
variable[3]['shelly_power_watts']='200'
|
||||||
|
with raw.open('w') as f:
|
||||||
|
w=csv.DictWriter(f,fieldnames=fields);w.writeheader();w.writerows(variable)
|
||||||
|
variable_result=shelly.summarize(raw,root/'variable.csv',2500,17500,1000)
|
||||||
|
assert variable_result['integrated_joules']==1600
|
||||||
|
for start,end in [(-1000,17500),(2500,25000)]:
|
||||||
|
try:shelly.summarize(raw,root/'bad.csv',start,end,1000)
|
||||||
|
except ValueError:pass
|
||||||
|
else:raise AssertionError('Incomplete coverage accepted')
|
||||||
|
with raw.open() as f:rows=list(csv.DictReader(f))
|
||||||
|
for variant in ['gap','reset','failed']:
|
||||||
|
bad=list(rows)
|
||||||
|
if variant=='gap':bad=[r for r in bad if not 5000<int(r['timeStamp'])<15000]
|
||||||
|
elif variant=='reset':bad=[dict(r,shelly_energy_wh='0') if int(r['timeStamp'])>=10000 else r for r in bad]
|
||||||
|
else:bad[6]=dict(bad[6],success='false')
|
||||||
|
path=root/(variant+'.csv')
|
||||||
|
with path.open('w') as f:w=csv.DictWriter(f,fieldnames=fields);w.writeheader();w.writerows(bad)
|
||||||
|
try:shelly.summarize(path,root/'bad.csv',2500,17500,1000)
|
||||||
|
except ValueError:pass
|
||||||
|
else:raise AssertionError(variant+' accepted')
|
||||||
|
with raw.open('w') as f:
|
||||||
|
w=csv.DictWriter(f,fieldnames=fields);w.writeheader()
|
||||||
|
for t in range(0,16500001,300000):
|
||||||
|
w.writerow(dict(zip(fields,[t,0,'POWER Shelly status','true',100,230,.5,t/36000])))
|
||||||
|
long_run=shelly.summarize(raw,root/'four-hours.csv',1800000,16200000,300000)
|
||||||
|
assert long_run['measurement_seconds']==14400 and long_run['integrated_joules']==1440000
|
||||||
|
assert long_run['counter_kWh']==.4
|
||||||
|
print('Shelly energy calculation, warmup exclusion, gaps, resets and failed-poll checks passed')
|
||||||
|
if a.host:
|
||||||
|
if not a.output:p.error('--output is required for live verification')
|
||||||
|
print('Device:',shelly.check_plug(a.host,a.port))
|
||||||
|
out=Path(a.output).resolve();out.mkdir(parents=True,mode=0o700,exist_ok=False)
|
||||||
|
document=E.parse(Path(__file__).parent/'plans/idle.jmx')
|
||||||
|
for collector in document.iter('kg.apc.jmeter.perfmon.PerfMonCollector'):collector.set('enabled','false')
|
||||||
|
plan=out/'idle.jmx';document.write(plan)
|
||||||
|
command=[str(Path.home()/'.local/bin/jmeter'),'-n','-t',str(plan),'-l',str(out/'samples.csv'),'-j',str(out/'jmeter.log'),'-Jshelly_host='+a.host,'-Jshelly_port='+str(a.port),'-Jshelly_file='+str(out/'shelly.csv'),'-Jsample_variables='+','.join(shelly.VARIABLES),'-Jjmeter.save.saveservice.autoflush=true','-Jwarmup_seconds=5','-Jduration_seconds=20','-Jtotal_duration_seconds=35','-Jtimeline_file='+str(out/'timeline.json')]
|
||||||
|
process=subprocess.Popen(command);live=False
|
||||||
|
while process.poll() is None:
|
||||||
|
file=out/'shelly.csv'
|
||||||
|
if file.exists() and file.stat().st_size>0:live=True
|
||||||
|
time.sleep(.25)
|
||||||
|
assert process.returncode==0 and live,'Power readings were not written while JMeter was running'
|
||||||
|
timeline=json.loads((out/'timeline.json').read_text())
|
||||||
|
result=shelly.summarize(out/'shelly.csv',out/'shelly-measured.csv',timeline['measurement_start_ms'],timeline['measurement_end_ms'],5000)
|
||||||
|
(out/'summary.json').write_text(json.dumps(result,indent=2));print(json.dumps(result,indent=2))
|
||||||
|
print('Live Shelly JMeter collection passed; no switching commands or application requests sent')
|
||||||