Initial commit: architecture design instructions and documentation

This commit is contained in:
Steffen committed 2026-10-13 13:38:21 +02:00
commit 4bbf5afe3e
64 files changed
+8819

No files matched your search

@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='utf-8'?>
<mxfile host="app.diagrams.net" version="24.7.17"><diagram id="04_class_observation_service" name="Observation Service — updated class model"><mxGraphModel dx="1740" dy="1280" grid="1" gridSize="10" page="1" pageScale="1" pageWidth="1740" pageHeight="1280"><root><mxCell id="0" /><mxCell id="1" parent="0" /><mxCell id="title" value="Observation Service — updated class model" style="text;html=0;fontSize=24;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="40" y="10" width="1660" height="50" /></mxCell><mxCell id="e0" value="uses" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" edge="1" parent="1" source="c" target="a"><mxGeometry as="geometry" relative="1" /></mxCell><mxCell id="e1" value="uses" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" edge="1" parent="1" source="a" target="r"><mxGeometry as="geometry" relative="1" /></mxCell><mxCell id="e2" value="implemented by" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" edge="1" parent="1" source="r" target="sql"><mxGeometry as="geometry" relative="1" /></mxCell><mxCell id="e3" value="contains" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" edge="1" parent="1" source="o" target="ctx"><mxGeometry as="geometry" relative="1" /></mxCell><mxCell id="c" value="ObservationController" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="40" y="100" width="500" height="260" /></mxCell><mxCell id="cbody" value="record(request): acknowledgement&#10;getById(id): ObservationDto&#10;getLatest(patientId): ObservationDto?&#10;getByPeriod(patientId, period, selection)&#10;update(id, patch): acknowledgement&#10;delete(id): acknowledgement" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" vertex="1" parent="c"><mxGeometry as="geometry" x="0" y="36" width="500" height="224" /></mxCell><mxCell id="a" value="ObservationApplicationService" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="620" y="100" width="500" height="260" /></mxCell><mxCell id="abody" value="record / getById / getLatest&#10;getByPeriod(period, selection)&#10;update(id, patch) / delete(id)&#10;Validate context categories and values&#10;Preserve omitted values in partial updates" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" vertex="1" parent="a"><mxGeometry as="geometry" x="0" y="36" width="500" height="224" /></mxCell><mxCell id="r" value="ObservationRepository «interface»" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="1200" y="100" width="500" height="260" /></mxCell><mxCell id="rbody" value="save(observation)&#10;findById(id) / findLatest(patientId)&#10;findByPeriod(patientId, period, selection)&#10;update(id, patch) / delete(id)&#10;Persist context and original recording time" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" vertex="1" parent="r"><mxGeometry as="geometry" x="0" y="36" width="500" height="224" /></mxCell><mxCell id="o" value="BloodPressureObservation / ObservationDto" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="40" y="520" width="500" height="360" /></mxCell><mxCell id="obody" value="observationId: UUID; patientId: UUID&#10;measuredAt: DateTime&#10;systolic, diastolic, pulse: int&#10;measurementContext: MeasurementContext&#10;context: String? (legacy text)&#10;note: String?&#10;createdAt: DateTime (original recording)&#10;updatedAt: DateTime" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" vertex="1" parent="o"><mxGeometry as="geometry" x="0" y="36" width="500" height="324" /></mxCell><mxCell id="ctx" value="MeasurementContext «value object»" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="620" y="520" width="500" height=Line truncated
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='utf-8'?>
<mxfile host="app.diagrams.net" version="24.7.17"><diagram id="05_class_insights_service" name="Insights Service — updated class and result model"><mxGraphModel dx="1740" dy="1220" grid="1" gridSize="10" page="1" pageScale="1" pageWidth="1740" pageHeight="1220"><root><mxCell id="0" /><mxCell id="1" parent="0" /><mxCell id="title" value="Insights Service — updated class and result model" style="text;html=0;fontSize=24;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="40" y="10" width="1660" height="50" /></mxCell><mxCell id="e0" value="uses" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" edge="1" parent="1" source="c" target="a"><mxGeometry as="geometry" relative="1" /></mxCell><mxCell id="e1" value="uses" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" edge="1" parent="1" source="a" target="http"><mxGeometry as="geometry" relative="1" /></mxCell><mxCell id="e2" value="uses" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" edge="1" parent="1" source="a" target="calc"><mxGeometry as="geometry" relative="1" /></mxCell><mxCell id="e3" value="returns" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" edge="1" parent="1" source="http" target="dto"><mxGeometry as="geometry" relative="1" /></mxCell><mxCell id="e4" value="creates" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" edge="1" parent="1" source="calc" target="trend"><mxGeometry as="geometry" relative="1" /></mxCell><mxCell id="e5" value="contains three" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" edge="1" parent="1" source="trend" target="ma"><mxGeometry as="geometry" relative="1" /></mxCell><mxCell id="c" value="InsightsController" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="40" y="90" width="500" height="190" /></mxCell><mxCell id="cbody" value="getSummary(patientId, period, selection)&#10;getTrend(patientId, period, selection)&#10;Return result metadata and limitations" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" vertex="1" parent="c"><mxGeometry as="geometry" x="0" y="36" width="500" height="154" /></mxCell><mxCell id="a" value="InsightsApplicationService" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="620" y="90" width="500" height="190" /></mxCell><mxCell id="abody" value="Obtain current observations&#10;Apply requested selection&#10;Invoke summary / trend calculations" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" vertex="1" parent="a"><mxGeometry as="geometry" x="0" y="36" width="500" height="154" /></mxCell><mxCell id="http" value="ObservationServiceClient «interface»" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="1200" y="90" width="500" height="190" /></mxCell><mxCell id="httpbody" value="getByPeriod(patientId, period, selection)&#10;HttpObservationServiceClient implements it&#10;HTTP requests pass through API Gateway" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" vertex="1" parent="http"><mxGeometry as="geometry" x="0" y="36" width="500" height="154" /></mxCell><mxCell id="calc" value="InsightCalculator" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="620" y="390" width="500" height="190" /></mxCell><mxCell id="calcbody" value="calculateSummary(observations, selection)&#10;calculateTrend(observations, selection)&#10;Document mathematical methods&#10;No stored summaries or trend results" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" vertex="1" parent="calc"><mxGeometry as="geometry" x="0" y="36" width="500" height="154" /></mxCell><mxCell id="dto" value="ObservationDto" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fonLine truncated
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='utf-8'?>
<mxfile host="app.diagrams.net" version="24.7.17"><diagram id="06_class_health_overview_service" name="Health Overview Service — updated class model"><mxGraphModel dx="1740" dy="840" grid="1" gridSize="10" page="1" pageScale="1" pageWidth="1740" pageHeight="840"><root><mxCell id="0" /><mxCell id="1" parent="0" /><mxCell id="title" value="Health Overview Service — updated class model" style="text;html=0;fontSize=24;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="40" y="10" width="1660" height="50" /></mxCell><mxCell id="e0" value="uses" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" edge="1" parent="1" source="c" target="a"><mxGeometry as="geometry" relative="1" /></mxCell><mxCell id="e1" value="creates" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" edge="1" parent="1" source="a" target="v"><mxGeometry as="geometry" relative="1" /></mxCell><mxCell id="e2" value="uses" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" edge="1" parent="1" source="a" target="p"><mxGeometry as="geometry" relative="1" /></mxCell><mxCell id="e3" value="uses" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" edge="1" parent="1" source="a" target="o"><mxGeometry as="geometry" relative="1" /></mxCell><mxCell id="e4" value="uses" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" edge="1" parent="1" source="a" target="i"><mxGeometry as="geometry" relative="1" /></mxCell><mxCell id="c" value="HealthOverviewController" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="40" y="90" width="500" height="190" /></mxCell><mxCell id="cbody" value="getOverview(patientId, period, selection)&#10;selection applies to insight only&#10;Returns HealthOverviewDto" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" vertex="1" parent="c"><mxGeometry as="geometry" x="0" y="36" width="500" height="154" /></mxCell><mxCell id="a" value="HealthOverviewApplicationService" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="620" y="90" width="500" height="190" /></mxCell><mxCell id="abody" value="Load profile&#10;Load latest overall observation&#10;Load selected-period numerical insight&#10;Aggregate without own persistence" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" vertex="1" parent="a"><mxGeometry as="geometry" x="0" y="36" width="500" height="154" /></mxCell><mxCell id="v" value="HealthOverview / HealthOverviewDto" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="1200" y="90" width="500" height="240" /></mxCell><mxCell id="vbody" value="patient: PatientDto&#10;latestObservation: ObservationDto?&#10;insight: HealthInsightDto?&#10;Preserve context, selection and limitations&#10;Explain unavailable insight&#10;No implicit trend component" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" vertex="1" parent="v"><mxGeometry as="geometry" x="0" y="36" width="500" height="204" /></mxCell><mxCell id="p" value="PatientProfileServiceClient" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="40" y="440" width="500" height="210" /></mxCell><mxCell id="pbody" value="getPatient(patientId): PatientDto&#10;Implemented by HTTP client&#10;Calls through API Gateway" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" vertex="1" parent="p"><mxGeometry as="geometry" x="0" y="36" width="500" height="174" /></mxCell><mxCell id="o" value="ObservationServiceClient" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="620" y="440" width="500" height="210" /></mxCell><mxCell id="obody" value="getLatest(patientId): ObservationDto?&#10;Implemented by HTTP client&#10;CLine truncated
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='utf-8'?>
<mxfile host="app.diagrams.net" version="24.7.17"><diagram id="08_er_observation_service" name="Observation Service — updated logical persistence model"><mxGraphModel dx="1740" dy="900" grid="1" gridSize="10" page="1" pageScale="1" pageWidth="1740" pageHeight="900"><root><mxCell id="0" /><mxCell id="1" parent="0" /><mxCell id="title" value="Observation Service — updated logical persistence model" style="text;html=0;fontSize=24;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="40" y="10" width="1660" height="50" /></mxCell><mxCell id="e0" value="contains optional value" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" edge="1" parent="1" source="o" target="p"><mxGeometry as="geometry" relative="1" /></mxCell><mxCell id="o" value="BloodPressureObservation «owned record»" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="60" y="110" width="700" height="550" /></mxCell><mxCell id="obody" value="PK observation_id: UUID&#10;patient_id: UUID (external identifier)&#10;measured_at: timestamp&#10;systolic / diastolic / pulse: integers&#10;context: optional original text&#10;note: optional text&#10;setting: category or unknown&#10;activity_condition: category or unknown&#10;preparation_details: optional owned value&#10;additional_circumstances: optional text&#10;created_at: original recording timestamp&#10;updated_at: update timestamp" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" vertex="1" parent="o"><mxGeometry as="geometry" x="0" y="36" width="700" height="514" /></mxCell><mxCell id="p" value="Preparation details «logical value»" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="970" y="110" width="650" height="320" /></mxCell><mxCell id="pbody" value="rest duration (with unit), if recorded&#10;body position, if recorded&#10;measured arm, if recorded&#10;device details, if recorded&#10;cuff details, if recorded&#10;Unknown is not presumed correct technique" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" vertex="1" parent="p"><mxGeometry as="geometry" x="0" y="36" width="650" height="284" /></mxCell><mxCell id="n" value="Persistence semantics" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" vertex="1" parent="1"><mxGeometry as="geometry" x="970" y="510" width="650" height="250" /></mxCell><mxCell id="nbody" value="Context belongs to the observation&#10;No separate shared context database&#10;Partial update: omitted differs from cleared&#10;Delete removes observation context&#10;Old records preserve text and unknowns&#10;Physical column/JSON mapping is not fixed" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" vertex="1" parent="n"><mxGeometry as="geometry" x="0" y="36" width="650" height="214" /></mxCell><mxCell id="note0" value="This logical model supersedes the old field list; it does not mandate a separate preparation table." style="text;html=0;align=left;fontSize=15;" vertex="1" parent="1"><mxGeometry as="geometry" x="40" y="795" width="1660" height="25" /></mxCell><mxCell id="note1" value="Patient identifier is not a cross-service database foreign key." style="text;html=0;align=left;fontSize=15;" vertex="1" parent="1"><mxGeometry as="geometry" x="40" y="820" width="1660" height="25" /></mxCell></root></mxGraphModel></diagram></mxfile>
@@ -0,0 +1,22 @@
<mxfile host="Electron">
<diagram id="09_er_insights_service" name="Insights Service — no persisted summary entities">
<mxGraphModel dx="1721" dy="1021" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1740" pageHeight="600" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="title" parent="1" style="text;html=0;fontSize=24;fontStyle=1;align=center;" value="Insights Service — no persisted summary entities" vertex="1">
<mxGeometry height="50" width="1660" x="40" y="10" as="geometry" />
</mxCell>
<mxCell id="v" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="Calculated response objects" vertex="1">
<mxGeometry height="310" width="720" x="920" y="120" as="geometry" />
</mxCell>
<mxCell id="vbody" parent="v" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="HealthInsight: numerical summary&#xa;TrendAssessment: three metric assessments&#xa;Neither object represents a stored entity.&#xa;Observation data remains Observation-owned.&#xa;HTTP observation access passes through gateway." vertex="1">
<mxGeometry height="274" width="720" y="36" as="geometry" />
</mxCell>
<mxCell id="note0" parent="1" style="text;html=0;align=left;fontSize=15;" value="Supersedes the HealthSummary table in the former ER JPEG." vertex="1">
<mxGeometry height="25" width="1660" x="40" y="495" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

@@ -0,0 +1,73 @@
<mxfile host="Electron">
<diagram id="04_class_observation_service" name="Observation Service — updated class model">
<mxGraphModel dx="2090" dy="1240" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1740" pageHeight="1280" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="title" parent="1" style="text;html=0;fontSize=24;fontStyle=1;align=center;" value="Observation Service — updated class model" vertex="1">
<mxGeometry height="50" width="1660" x="40" y="10" as="geometry" />
</mxCell>
<mxCell id="e0" edge="1" parent="1" source="c" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="a" value="uses">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e1" edge="1" parent="1" source="a" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="r" value="uses">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e2" edge="1" parent="1" source="r" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="sql" value="implemented by">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e3" edge="1" parent="1" source="o" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="ctx" value="contains">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="c" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="ObservationController" vertex="1">
<mxGeometry height="260" width="500" x="40" y="100" as="geometry" />
</mxCell>
<mxCell id="cbody" parent="c" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="record(request): acknowledgement&#xa;getById(id): ObservationDto&#xa;getLatest(patientId): ObservationDto?&#xa;getByPeriod(patientId, period, selection)&#xa;update(id, patch): acknowledgement&#xa;delete(id): acknowledgement" vertex="1">
<mxGeometry height="224" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="a" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="ObservationApplicationService" vertex="1">
<mxGeometry height="260" width="500" x="620" y="100" as="geometry" />
</mxCell>
<mxCell id="abody" parent="a" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="record / getById / getLatest&#xa;getByPeriod(period, selection)&#xa;update(id, patch) / delete(id)&#xa;Validate context categories and values&#xa;Preserve omitted values in partial updates" vertex="1">
<mxGeometry height="224" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="r" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="ObservationRepository «interface»" vertex="1">
<mxGeometry height="260" width="500" x="1200" y="100" as="geometry" />
</mxCell>
<mxCell id="rbody" parent="r" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="save(observation)&#xa;findById(id) / findLatest(patientId)&#xa;findByPeriod(patientId, period, selection)&#xa;update(id, patch) / delete(id)&#xa;Persist context and original recording time" vertex="1">
<mxGeometry height="224" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="o" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="BloodPressureObservation / ObservationDto" vertex="1">
<mxGeometry height="360" width="500" x="40" y="520" as="geometry" />
</mxCell>
<mxCell id="obody" parent="o" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="observationId: UUID; patientId: UUID&#xa;measuredAt: DateTime&#xa;systolic, diastolic, pulse: int&#xa;measurementContext: MeasurementContext&#xa;context: String? (legacy text)&#xa;note: String?&#xa;createdAt: DateTime (original recording)&#xa;updatedAt: DateTime" vertex="1">
<mxGeometry height="324" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="ctx" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="MeasurementContext «value object»" vertex="1">
<mxGeometry height="360" width="500" x="620" y="520" as="geometry" />
</mxCell>
<mxCell id="ctxbody" parent="ctx" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="setting: Home / Clinic / Other / Unknown&#xa;activity: Rest / During / After / Unknown&#xa;restDuration: optional&#xa;bodyPosition: optional&#xa;measuredArm: optional&#xa;device / cuff details: optional&#xa;additionalCircumstances: optional&#xa;Missing details remain unknown" vertex="1">
<mxGeometry height="324" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="sql" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="SqlObservationRepository" vertex="1">
<mxGeometry height="200" width="500" x="1200" y="520" as="geometry" />
</mxCell>
<mxCell id="sqlbody" parent="sql" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="Implements ObservationRepository&#xa;Owns persistence within Observation Service&#xa;No other service accesses its database" vertex="1">
<mxGeometry height="164" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="sel" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="ContextSelection «request value»" vertex="1">
<mxGeometry height="180" width="500" x="620" y="930" as="geometry" />
</mxCell>
<mxCell id="selbody" parent="sel" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="optional setting; optional activity&#xa;Both supplied: match both&#xa;Unknown is selectable&#xa;Omitted selections include all contexts" vertex="1">
<mxGeometry height="144" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="note0" parent="1" style="text;html=0;align=left;fontSize=15;" value="Latest = measurement time, then original recording time, then documented deterministic tie rule." vertex="1">
<mxGeometry height="25" width="1660" x="40" y="1175" as="geometry" />
</mxCell>
<mxCell id="note1" parent="1" style="text;html=0;align=left;fontSize=15;" value="Gateway enforces access. Other services consume Observation APIs through the gateway." vertex="1">
<mxGeometry height="25" width="1660" x="40" y="1200" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

@@ -0,0 +1,82 @@
<mxfile host="Electron">
<diagram id="05_class_insights_service" name="Insights Service — updated class and result model">
<mxGraphModel dx="1951" dy="1157" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1740" pageHeight="1220" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="title" parent="1" style="text;html=0;fontSize=24;fontStyle=1;align=center;" value="Insights Service — updated class and result model" vertex="1">
<mxGeometry height="50" width="1660" x="40" y="10" as="geometry" />
</mxCell>
<mxCell id="e0" edge="1" parent="1" source="c" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="a" value="uses">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e1" edge="1" parent="1" source="a" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="http" value="uses">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e2" edge="1" parent="1" source="a" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="calc" value="uses">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e3" edge="1" parent="1" source="http" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="dto" value="returns">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e4" edge="1" parent="1" source="calc" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="trend" value="creates">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e5" edge="1" parent="1" source="trend" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="ma" value="contains three">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="c" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="InsightsController" vertex="1">
<mxGeometry height="190" width="500" x="40" y="90" as="geometry" />
</mxCell>
<mxCell id="cbody" parent="c" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="getSummary(patientId, period, selection)&#xa;getTrend(patientId, period, selection)&#xa;Return result metadata and limitations" vertex="1">
<mxGeometry height="154" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="a" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="InsightsApplicationService" vertex="1">
<mxGeometry height="190" width="500" x="620" y="90" as="geometry" />
</mxCell>
<mxCell id="abody" parent="a" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="Obtain current observations&#xa;Apply requested selection&#xa;Invoke summary / trend calculations" vertex="1">
<mxGeometry height="154" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="http" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="ObservationServiceClient «interface»" vertex="1">
<mxGeometry height="190" width="500" x="1200" y="90" as="geometry" />
</mxCell>
<mxCell id="httpbody" parent="http" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="getByPeriod(patientId, period, selection)&#xa;HttpObservationServiceClient implements it&#xa;HTTP requests pass through API Gateway" vertex="1">
<mxGeometry height="154" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="calc" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="InsightCalculator" vertex="1">
<mxGeometry height="190" width="500" x="620" y="390" as="geometry" />
</mxCell>
<mxCell id="calcbody" parent="calc" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="calculateSummary(observations, selection)&#xa;calculateTrend(observations, selection)&#xa;Document mathematical methods&#xa;No stored summaries or trend results" vertex="1">
<mxGeometry height="154" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="dto" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="ObservationDto" vertex="1">
<mxGeometry height="230" width="500" x="1200" y="390" as="geometry" />
</mxCell>
<mxCell id="dtobody" parent="dto" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="observationId, patientId, measuredAt&#xa;systolic, diastolic, pulse&#xa;measurementContext (setting / conditions)&#xa;legacy context text and note&#xa;Carry unknown or conflicting context" vertex="1">
<mxGeometry height="194" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="sum" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="HealthInsight" vertex="1">
<mxGeometry height="340" width="500" x="40" y="740" as="geometry" />
</mxCell>
<mxCell id="sumbody" parent="sum" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="patientId; periodStart; periodEnd&#xa;appliedSelection; contributingCount&#xa;averageSystolic / Diastolic / Pulse&#xa;minimumSystolic / maximumSystolic&#xa;minimumDiastolic / maximumDiastolic&#xa;context explanation&#xa;Final means: 2 decimals, half-up&#xa;No summary persistence identifier" vertex="1">
<mxGeometry height="304" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="trend" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="TrendAssessment" vertex="1">
<mxGeometry height="340" width="500" x="620" y="740" as="geometry" />
</mxCell>
<mxCell id="trendbody" parent="trend" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="patientId; periodStart; periodEnd&#xa;appliedSelection; contributingCount&#xa;systolic: MeasurementAssessment&#xa;diastolic: MeasurementAssessment&#xa;pulse: MeasurementAssessment&#xa;comparability evidence and limitations&#xa;Unavailable parts explained explicitly" vertex="1">
<mxGeometry height="304" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="ma" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="MeasurementAssessment «value object»" vertex="1">
<mxGeometry height="340" width="500" x="1260" y="740" as="geometry" />
</mxCell>
<mxCell id="mabody" parent="ma" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="measurement name and unit&#xa;observed level / numerical description&#xa;direction and variation when supported&#xa;interpretation and explanatory hint&#xa;reference values / guidance basis&#xa;data sufficiency and limitations&#xa;No direction inferred from storage order" vertex="1">
<mxGeometry height="304" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="note0" parent="1" style="text;html=0;align=left;fontSize=15;" value="HealthInsight is also created by InsightCalculator. All results reflect current observations." vertex="1">
<mxGeometry height="25" width="1660" x="40" y="1115" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

@@ -0,0 +1,76 @@
<mxfile host="Electron">
<diagram id="06_class_health_overview_service" name="Health Overview Service — updated class model">
<mxGraphModel dx="1721" dy="1021" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1740" pageHeight="840" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="title" parent="1" style="text;html=0;fontSize=24;fontStyle=1;align=center;" value="Health Overview Service — updated class model" vertex="1">
<mxGeometry height="50" width="1660" x="40" y="10" as="geometry" />
</mxCell>
<mxCell id="e0" edge="1" parent="1" source="c" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="a" value="uses">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e1" edge="1" parent="1" source="a" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;exitX=1;exitY=0.25;exitDx=0;exitDy=0;" target="v" value="creates">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e2" edge="1" parent="1" source="a" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="p" value="uses">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e3" edge="1" parent="1" source="a" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="o" value="uses">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="e4" edge="1" parent="1" source="a" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="i" value="uses">
<mxGeometry relative="1" x="0.0255" y="-5" as="geometry">
<mxPoint as="offset" />
<Array as="points">
<mxPoint x="1160.06" y="185" />
<mxPoint x="1160.06" y="545" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="c" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="HealthOverviewController" vertex="1">
<mxGeometry height="190" width="500" x="40" y="90" as="geometry" />
</mxCell>
<mxCell id="cbody" parent="c" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="getOverview(patientId, period, selection)&#xa;selection applies to insight only&#xa;Returns HealthOverviewDto" vertex="1">
<mxGeometry height="154" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="a" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="HealthOverviewApplicationService" vertex="1">
<mxGeometry height="190" width="500" x="620" y="90" as="geometry" />
</mxCell>
<mxCell id="abody" parent="a" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="Load profile&#xa;Load latest overall observation&#xa;Load selected-period numerical insight&#xa;Aggregate without own persistence" vertex="1">
<mxGeometry height="154" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="v" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="HealthOverview / HealthOverviewDto" vertex="1">
<mxGeometry height="240" width="500" x="1280" y="20" as="geometry" />
</mxCell>
<mxCell id="vbody" parent="v" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="patient: PatientDto&#xa;latestObservation: ObservationDto?&#xa;insight: HealthInsightDto?&#xa;Preserve context, selection and limitations&#xa;Explain unavailable insight&#xa;No implicit trend component" vertex="1">
<mxGeometry height="204" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="p" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="PatientProfileServiceClient" vertex="1">
<mxGeometry height="210" width="500" x="40" y="440" as="geometry" />
</mxCell>
<mxCell id="pbody" parent="p" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="getPatient(patientId): PatientDto&#xa;Implemented by HTTP client&#xa;Calls through API Gateway" vertex="1">
<mxGeometry height="174" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="o" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="ObservationServiceClient" vertex="1">
<mxGeometry height="210" width="500" x="620" y="440" as="geometry" />
</mxCell>
<mxCell id="obody" parent="o" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="getLatest(patientId): ObservationDto?&#xa;Implemented by HTTP client&#xa;Calls through API Gateway&#xa;Latest remains unfiltered by context" vertex="1">
<mxGeometry height="174" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="i" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="InsightsServiceClient" vertex="1">
<mxGeometry height="210" width="500" x="1200" y="440" as="geometry" />
</mxCell>
<mxCell id="ibody" parent="i" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="getSummary(patientId, period, selection)&#xa;Implemented by HTTP client&#xa;Calls through API Gateway&#xa;Propagate selection and contributing count" vertex="1">
<mxGeometry height="174" width="500" y="36" as="geometry" />
</mxCell>
<mxCell id="note0" parent="1" style="text;html=0;align=left;fontSize=15;" value="Only client abstractions are shown; arrows do not represent direct links between service-domain classes." vertex="1">
<mxGeometry height="25" width="1660" x="40" y="735" as="geometry" />
</mxCell>
<mxCell id="note1" parent="1" style="text;html=0;align=left;fontSize=15;" value="No matching insight data does not remove an available profile or latest observation." vertex="1">
<mxGeometry height="25" width="1660" x="40" y="760" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

@@ -0,0 +1,34 @@
<mxfile host="Electron">
<diagram id="08_er_observation_service" name="Observation Service — updated logical persistence model">
<mxGraphModel dx="1721" dy="1021" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1740" pageHeight="900" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="title" parent="1" style="text;html=0;fontSize=24;fontStyle=1;align=center;" value="Observation Service — updated logical persistence model" vertex="1">
<mxGeometry height="50" width="1660" x="40" y="10" as="geometry" />
</mxCell>
<mxCell id="e0" edge="1" parent="1" source="o" style="edgeStyle=orthogonalEdgeStyle;rounded=0;html=0;endArrow=open;dashed=1;fontSize=13;labelBackgroundColor=#ffffff;" target="p" value="contains optional value">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="o" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="BloodPressureObservation «owned record»" vertex="1">
<mxGeometry height="550" width="700" x="60" y="110" as="geometry" />
</mxCell>
<mxCell id="obody" parent="o" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="PK observation_id: UUID&#xa;patient_id: UUID (external identifier)&#xa;measured_at: timestamp&#xa;systolic / diastolic / pulse: integers&#xa;context: optional original text&#xa;note: optional text&#xa;setting: category or unknown&#xa;activity_condition: category or unknown&#xa;preparation_details: optional owned value&#xa;additional_circumstances: optional text&#xa;created_at: original recording timestamp&#xa;updated_at: update timestamp" vertex="1">
<mxGeometry height="514" width="700" y="36" as="geometry" />
</mxCell>
<mxCell id="p" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="Preparation details «logical value»" vertex="1">
<mxGeometry height="320" width="650" x="970" y="110" as="geometry" />
</mxCell>
<mxCell id="pbody" parent="p" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="rest duration (with unit), if recorded&#xa;body position, if recorded&#xa;measured arm, if recorded&#xa;device details, if recorded&#xa;cuff details, if recorded&#xa;Unknown is not presumed correct technique" vertex="1">
<mxGeometry height="284" width="650" y="36" as="geometry" />
</mxCell>
<mxCell id="note0" parent="1" style="text;html=0;align=left;fontSize=15;" value="This logical model supersedes the old field list; it does not mandate a separate preparation table." vertex="1">
<mxGeometry height="25" width="1660" x="40" y="795" as="geometry" />
</mxCell>
<mxCell id="note1" parent="1" style="text;html=0;align=left;fontSize=15;" value="Patient identifier is not a cross-service database foreign key." vertex="1">
<mxGeometry height="25" width="1660" x="40" y="820" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

@@ -0,0 +1,28 @@
<mxfile host="Electron">
<diagram id="09_er_insights_service" name="Insights Service — no persisted summary entities">
<mxGraphModel dx="1721" dy="1021" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1740" pageHeight="600" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="title" parent="1" style="text;html=0;fontSize=24;fontStyle=1;align=center;" value="Insights Service — no persisted summary entities" vertex="1">
<mxGeometry height="50" width="1660" x="40" y="10" as="geometry" />
</mxCell>
<mxCell id="n" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="Baseline persistence decision" vertex="1">
<mxGeometry height="310" width="720" x="80" y="120" as="geometry" />
</mxCell>
<mxCell id="nbody" parent="n" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="Insights owns no database or repository.&#xa;HealthSummary is not a persisted table.&#xa;No generated-summary persistence ID.&#xa;Summaries and trends use current observations.&#xa;Recalculate on request in the baseline.&#xa;Corrections and deletions affect new results." vertex="1">
<mxGeometry height="274" width="720" y="36" as="geometry" />
</mxCell>
<mxCell id="v" parent="1" style="swimlane;html=0;startSize=36;horizontal=1;fillColor=#eeeeee;swimlaneFillColor=#ffffff;strokeColor=#333333;fontColor=#111111;fontSize=17;fontStyle=1;align=center;" value="Calculated response objects" vertex="1">
<mxGeometry height="310" width="720" x="920" y="120" as="geometry" />
</mxCell>
<mxCell id="vbody" parent="v" style="text;html=0;align=left;verticalAlign=top;spacing=10;fontSize=15;fontFamily=Helvetica;whiteSpace=wrap;overflow=hidden;" value="HealthInsight: numerical summary&#xa;TrendAssessment: three metric assessments&#xa;Neither object represents a stored entity.&#xa;Observation data remains Observation-owned.&#xa;HTTP observation access passes through gateway." vertex="1">
<mxGeometry height="274" width="720" y="36" as="geometry" />
</mxCell>
<mxCell id="note0" parent="1" style="text;html=0;align=left;fontSize=15;" value="Supersedes the HealthSummary table in the former ER JPEG." vertex="1">
<mxGeometry height="25" width="1660" x="40" y="495" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
+13
View File
@@ -0,0 +1,13 @@
# Architecture diagrams
The editable draw.io files below are the current definitions for the changed diagrams. Open them in draw.io / diagrams.net. Their same-stem JPEGs are retained historical snapshots and are superseded, including where they show older fields or signatures.
- [04_class_observation_service.drawio](04_class_observation_service.drawio)
- [05_class_insights_service.drawio](05_class_insights_service.drawio)
- [06_class_health_overview_service.drawio](06_class_health_overview_service.drawio)
- [08_er_observation_service.drawio](08_er_observation_service.drawio)
- [09_er_insights_service.drawio](09_er_insights_service.drawio)
Unlisted diagrams remain as supplied. The changes preserve independent processes, service-owned persistence and gateway-routed communication. New shapes express required context and assessment data; logical optional values do not mandate additional tables or services.
The baseline Insights persistence decision is recorded in [us10-insights-correction.md](us10-insights-correction.md). Updated functional requirements are in ../Requirements. Exact contract field names, physical mapping and mathematical methods can be developed within those requirements and the repository's implementation rules.
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

@@ -0,0 +1,11 @@
# US-10 Insights architecture correction
This document is the baseline architecture decision for US-10 and US-11. It incorporates the former `Docs/Requirements/US_10_Correction`; that duplicate requirement file has been retired. Functional requirements are in `../Requirements/us10-calculated-insight.md` and `../Requirements/us11-health-trend.md`.
The Insights Service is an independent process and calculates summaries on demand. Its HTTP observation client retrieves observations through the API Gateway. `InsightsController`, `InsightsApplicationService`, `InsightCalculator`, and the observation client follow `05_class_insights_service.drawio`.
The service has no database, repository, stored summary identifier, or generated-summary persistence. `HealthInsight` is a calculated response object. The `HealthSummary` table shown in `09_er_insights_service.jpg` is an architectural inconsistency and does not apply; `09_er_insights_service.drawio` and this correction supersede that table. The absence of an Insights database in `02_microservice_architecture.jpg` is intentional.
Each summary request uses current observations, including corrections and deletions. Trend calculation remains under US-11.
Trend assessments also use current observations and are calculated on demand without storing generated assessments. This is a baseline design constraint, not an invariant persistence constraint on all architectural variants. Any experimental variant must retain the required freshness and access behaviour.