Restructure project requirements and design documentation

This commit is contained in:
Steffen committed 2026-10-04 16:20:06 +02:00
1 parent fa5e20f4d6
commit ebf50827d6
32 files changed
+2078 -485

No files matched your search

@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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.
@@ -1,9 +1,11 @@
# US-10 Insights architecture correction
The decision in `Docs/Requirements/US_10_Correction` governs US-10.
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.jpg`.
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; this correction supersedes that table. The absence of an Insights database in `02_microservice_architecture.jpg` is intentional.
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.