Projo FHIR Documentation
0.1.0 - ci-build
Projo FHIR Documentation - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions
| Draft as of 2024-01-01 |
XML representation of the conversational-state logical model.
<StructureDefinition xmlns="http://hl7.org/fhir">
<id value="conversational-state"/>
<text>
<status value="extensions"/>
<div xmlns="http://www.w3.org/1999/xhtml"><p class="res-header-id"><b>Generated Narrative: StructureDefinition conversational-state</b></p><table border="0" cellpadding="0" cellspacing="0" style="border: 0px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top;"><tr style="border: 1px #F0F0F0 solid; font-size: 11px; font-family: verdana; vertical-align: top"><th style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px" class="hierarchy"><a href="https://build.fhir.org/ig/FHIR/ig-guidance/readingIgs.html#table-views" title="The logical name of the element">Name</a></th><th style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px" class="hierarchy"><a href="https://build.fhir.org/ig/FHIR/ig-guidance/readingIgs.html#table-views" title="Information about the use of the element">Flags</a></th><th style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px" class="hierarchy"><a href="https://build.fhir.org/ig/FHIR/ig-guidance/readingIgs.html#table-views" title="Minimum and Maximum # of times the element can appear in the instance">Card.</a></th><th style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px; width: 100px" class="hierarchy"><a href="https://build.fhir.org/ig/FHIR/ig-guidance/readingIgs.html#table-views" title="Reference to the type of the element">Type</a></th><th style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; padding-top: 3px; padding-bottom: 3px" class="hierarchy"><a href="https://build.fhir.org/ig/FHIR/ig-guidance/readingIgs.html#table-views" title="Additional information about the element">Description & Constraints</a><span style="float: right"><a href="https://build.fhir.org/ig/FHIR/ig-guidance/readingIgs.html#table-views" title="Legend for this format"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3goXBCwdPqAP0wAAAldJREFUOMuNk0tIlFEYhp9z/vE2jHkhxXA0zJCMitrUQlq4lnSltEqCFhFG2MJFhIvIFpkEWaTQqjaWZRkp0g26URZkTpbaaOJkDqk10szoODP//7XIMUe0elcfnPd9zsfLOYplGrpRwZaqTtw3K7PtGem7Q6FoidbGgqHVy/HRb669R+56zx7eRV1L31JGxYbBtjKK93cxeqfyQHbehkZbUkK20goELEuIzEd+dHS+qz/Y8PTSif0FnGkbiwcAjHaU1+QWOptFiyCLp/LnKptpqIuXHx6rbR26kJcBX3yLgBfnd7CxwJmflpP2wUg0HIAoUUpZBmKzELGWcN8nAr6Gpu7tLU/CkwAaoKTWRSQyt89Q8w6J+oVQkKnBoblH7V0PPvUOvDYXfopE/SJmALsxnVm6LbkotrUtNowMeIrVrBcBpaMmdS0j9df7abpSuy7HWehwJdt1lhVwi/J58U5beXGAF6c3UXLycw1wdFklArBn87xdh0ZsZtArghBdAA3+OEDVubG4UEzP6x1FOWneHh2VDAHBAt80IbdXDcesNoCvs3E5AFyNSU5nbrDPZpcUEQQTFZiEVx+51fxMhhyJEAgvlriadIJZZksRuwBYMOPBbO3hePVVqgEJhFeUuFLhIPkRP6BQLIBrmMenujm/3g4zc398awIe90Zb5A1vREALqneMcYgP/xVQWlG+Ncu5vgwwlaUNx+3799rfe96u9K0JSDXcOzOTJg4B6IgmXfsygc7/Bvg9g9E58/cDVmGIBOP/zT8Bz1zqWqpbXIsd0O9hajXfL6u4BaOS6SeWAAAAAElFTkSuQmCC" alt="doco" style="background-color: inherit"/></a></span></th></tr><tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white"><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck1.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_element.gif" alt="." style="background-color: white; background-color: inherit" title="Element" class="hierarchy"/> <a href="StructureDefinition-conversational-state-definitions.html#conversational-state" title="The sidecar's stateless projection of conversational state, computed from FHIR resources on each inbound message. The sidecar has NO private database — every state view is a pure function of FHIR queries. Five projection helpers live in lib/projection/: isDuplicateInbound, compute24hWindow, currentQuestion, conversationState, lastActivityForCR. Any new sidecar state view must add a new projection here, never a cache.">conversational-state</a><a name="conversational-state"> </a></td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><span style="opacity: 0.5">0</span><span style="opacity: 0.5">..</span><span style="opacity: 0.5">*</span></td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><a href="http://build.fhir.org/types.html#Base">Base</a></td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">Conversational State (Stateless Projection)<br/><span style="font-weight:bold">Instances of this type can be the target of a Reference</span></td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: #F7F7F7"><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck10.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_primitive.png" alt="." style="background-color: #F7F7F7; background-color: inherit" title="Primitive Data Type" class="hierarchy"/> <a href="StructureDefinition-conversational-state-definitions.html#conversational-state.duplicateCheck" title="Is this inbound message a duplicate (Communication?identifier=wamid)?">duplicateCheck</a><a name="conversational-state.duplicateCheck"> </a></td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">0..1</td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><a href="http://hl7.org/fhir/R4/datatypes.html#boolean">boolean</a></td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">Is this inbound message a duplicate (Communication?identifier=wamid)?</td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white"><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck10.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_primitive.png" alt="." style="background-color: white; background-color: inherit" title="Primitive Data Type" class="hierarchy"/> <a href="StructureDefinition-conversational-state-definitions.html#conversational-state.window24h" title="Most recent inbound Communication timestamp within the 24h window (Communication?recipient=...&status=in-progress,completed&_sort=-sent&_count=1)">window24h</a><a name="conversational-state.window24h"> </a></td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">0..1</td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><a href="http://hl7.org/fhir/R4/datatypes.html#dateTime">dateTime</a></td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">Most recent inbound Communication timestamp within the 24h window (Communication?recipient=...&status=in-progress,completed&_sort=-sent&_count=1)</td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: #F7F7F7"><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck10.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_primitive.png" alt="." style="background-color: #F7F7F7; background-color: inherit" title="Primitive Data Type" class="hierarchy"/> <a href="StructureDefinition-conversational-state-definitions.html#conversational-state.currentQuestion" title="The linkId of the next question to ask (derived from QR.item structure + Questionnaire navigation)">currentQuestion</a><a name="conversational-state.currentQuestion"> </a></td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">0..1</td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><a href="http://hl7.org/fhir/R4/datatypes.html#string">string</a></td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">The linkId of the next question to ask (derived from QR.item structure + Questionnaire navigation)</td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white"><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck10.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_primitive.png" alt="." style="background-color: white; background-color: inherit" title="Primitive Data Type" class="hierarchy"/> <a href="StructureDefinition-conversational-state-definitions.html#conversational-state.conversationState" title="in-progress | completed (derived from QR.status)">conversationState</a><a name="conversational-state.conversationState"> </a></td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">0..1</td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><a href="http://hl7.org/fhir/R4/datatypes.html#code">code</a></td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">in-progress | completed (derived from QR.status)</td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: #F7F7F7"><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck10.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_primitive.png" alt="." style="background-color: #F7F7F7; background-color: inherit" title="Primitive Data Type" class="hierarchy"/> <a href="StructureDefinition-conversational-state-definitions.html#conversational-state.lastActivity" title="Last activity timestamp for the CR (derived from Communications + extensions)">lastActivity</a><a name="conversational-state.lastActivity"> </a></td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">0..1</td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><a href="http://hl7.org/fhir/R4/datatypes.html#dateTime">dateTime</a></td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: #F7F7F7; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">Last activity timestamp for the CR (derived from Communications + extensions)</td></tr>
<tr style="border: 0px #F0F0F0 solid; padding:0px; vertical-align: top; background-color: white"><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px; white-space: nowrap; background-image: url(tbl_bck00.png)" class="hierarchy"><img src="tbl_spacer.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="tbl_vjoin_end.png" alt="." style="background-color: inherit" class="hierarchy"/><img src="icon_reference.png" alt="." style="background-color: white; background-color: inherit" title="Reference to another Resource" class="hierarchy"/> <a href="StructureDefinition-conversational-state-definitions.html#conversational-state.activeCR" title="The active CR this message should attach to (CommunicationRequest?recipient=...&status=active)">activeCR</a><a name="conversational-state.activeCR"> </a></td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"/><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">0..1</td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy"><a href="http://hl7.org/fhir/R4/references.html">Reference</a>(<a href="http://hl7.org/fhir/R4/communicationrequest.html">CommunicationRequest</a>)</td><td style="vertical-align: top; text-align : var(--ig-left,left); background-color: white; border: 0px #F0F0F0 solid; padding:0px 4px 0px 4px" class="hierarchy">The active CR this message should attach to (CommunicationRequest?recipient=...&status=active)</td></tr>
<tr><td colspan="5" class="hierarchy"><br/><a href="https://build.fhir.org/ig/FHIR/ig-guidance/readingIgs.html#table-views" title="Legend for this format"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3goXBCwdPqAP0wAAAldJREFUOMuNk0tIlFEYhp9z/vE2jHkhxXA0zJCMitrUQlq4lnSltEqCFhFG2MJFhIvIFpkEWaTQqjaWZRkp0g26URZkTpbaaOJkDqk10szoODP//7XIMUe0elcfnPd9zsfLOYplGrpRwZaqTtw3K7PtGem7Q6FoidbGgqHVy/HRb669R+56zx7eRV1L31JGxYbBtjKK93cxeqfyQHbehkZbUkK20goELEuIzEd+dHS+qz/Y8PTSif0FnGkbiwcAjHaU1+QWOptFiyCLp/LnKptpqIuXHx6rbR26kJcBX3yLgBfnd7CxwJmflpP2wUg0HIAoUUpZBmKzELGWcN8nAr6Gpu7tLU/CkwAaoKTWRSQyt89Q8w6J+oVQkKnBoblH7V0PPvUOvDYXfopE/SJmALsxnVm6LbkotrUtNowMeIrVrBcBpaMmdS0j9df7abpSuy7HWehwJdt1lhVwi/J58U5beXGAF6c3UXLycw1wdFklArBn87xdh0ZsZtArghBdAA3+OEDVubG4UEzP6x1FOWneHh2VDAHBAt80IbdXDcesNoCvs3E5AFyNSU5nbrDPZpcUEQQTFZiEVx+51fxMhhyJEAgvlriadIJZZksRuwBYMOPBbO3hePVVqgEJhFeUuFLhIPkRP6BQLIBrmMenujm/3g4zc398awIe90Zb5A1vREALqneMcYgP/xVQWlG+Ncu5vgwwlaUNx+3799rfe96u9K0JSDXcOzOTJg4B6IgmXfsygc7/Bvg9g9E58/cDVmGIBOP/zT8Bz1zqWqpbXIsd0O9hajXfL6u4BaOS6SeWAAAAAElFTkSuQmCC" alt="doco" style="background-color: inherit"/> Documentation for this format</a></td></tr></table></div>
</text>
<extension
url="http://hl7.org/fhir/StructureDefinition/structuredefinition-type-characteristics">
<valueCode value="can-be-target"/>
</extension>
<url
value="https://projo.evoleen.com/fhir/StructureDefinition/conversational-state"/>
<version value="0.1.0"/>
<name value="ConversationalState"/>
<title value="Conversational State (Stateless Projection)"/>
<status value="draft"/>
<experimental value="true"/>
<date value="2024-01-01"/>
<publisher value="Projo"/>
<contact>
<name value="Projo"/>
<telecom>
<system value="url"/>
<value value="https://projo.evoleen.com"/>
</telecom>
</contact>
<description
value="The sidecar's stateless projection of conversational state, computed from FHIR resources on each inbound message. The sidecar has NO private database — every state view is a pure function of FHIR queries. Five projection helpers live in lib/projection/: isDuplicateInbound, compute24hWindow, currentQuestion, conversationState, lastActivityForCR. Any new sidecar state view must add a new projection here, never a cache."/>
<jurisdiction>
<coding>
<system value="urn:iso:std:iso:3166"/>
<code value="CH"/>
<display value="Switzerland"/>
</coding>
</jurisdiction>
<purpose
value="Documents the stateless-projection invariant: the sidecar never stores conversational state locally. Each field is derived from a FHIR query at read time."/>
<copyright
value="Copyright (c) Projo. Licensed under CC0-1.0 (public domain dedication). FHIR(R) is the registered trademark of HL7 and is used with permission. This IG references WhatsApp(R), a trademark of Meta Platforms, Inc., for descriptive purposes only."/>
<fhirVersion value="4.0.1"/>
<kind value="logical"/>
<abstract value="false"/>
<type
value="https://projo.evoleen.com/fhir/StructureDefinition/conversational-state"/>
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/Base"/>
<derivation value="specialization"/>
<snapshot>
<extension
url="http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version">
<valueString value="4.0.1"/>
</extension>
<element id="conversational-state">
<path value="conversational-state"/>
<short value="Conversational State (Stateless Projection)"/>
<definition
value="The sidecar's stateless projection of conversational state, computed from FHIR resources on each inbound message. The sidecar has NO private database — every state view is a pure function of FHIR queries. Five projection helpers live in lib/projection/: isDuplicateInbound, compute24hWindow, currentQuestion, conversationState, lastActivityForCR. Any new sidecar state view must add a new projection here, never a cache."/>
<min value="0"/>
<max value="*"/>
<base>
<path value="Base"/>
<min value="0"/>
<max value="*"/>
</base>
<isModifier value="false"/>
</element>
<element id="conversational-state.duplicateCheck">
<path value="conversational-state.duplicateCheck"/>
<short
value="Is this inbound message a duplicate (Communication?identifier=wamid)?"/>
<definition
value="Is this inbound message a duplicate (Communication?identifier=wamid)?"/>
<min value="0"/>
<max value="1"/>
<base>
<path value="conversational-state.duplicateCheck"/>
<min value="0"/>
<max value="1"/>
</base>
<type>
<code value="boolean"/>
</type>
</element>
<element id="conversational-state.window24h">
<path value="conversational-state.window24h"/>
<short
value="Most recent inbound Communication timestamp within the 24h window (Communication?recipient=...&status=in-progress,completed&_sort=-sent&_count=1)"/>
<definition
value="Most recent inbound Communication timestamp within the 24h window (Communication?recipient=...&status=in-progress,completed&_sort=-sent&_count=1)"/>
<min value="0"/>
<max value="1"/>
<base>
<path value="conversational-state.window24h"/>
<min value="0"/>
<max value="1"/>
</base>
<type>
<code value="dateTime"/>
</type>
</element>
<element id="conversational-state.currentQuestion">
<path value="conversational-state.currentQuestion"/>
<short
value="The linkId of the next question to ask (derived from QR.item structure + Questionnaire navigation)"/>
<definition
value="The linkId of the next question to ask (derived from QR.item structure + Questionnaire navigation)"/>
<min value="0"/>
<max value="1"/>
<base>
<path value="conversational-state.currentQuestion"/>
<min value="0"/>
<max value="1"/>
</base>
<type>
<code value="string"/>
</type>
</element>
<element id="conversational-state.conversationState">
<path value="conversational-state.conversationState"/>
<short value="in-progress | completed (derived from QR.status)"/>
<definition value="in-progress | completed (derived from QR.status)"/>
<min value="0"/>
<max value="1"/>
<base>
<path value="conversational-state.conversationState"/>
<min value="0"/>
<max value="1"/>
</base>
<type>
<code value="code"/>
</type>
</element>
<element id="conversational-state.lastActivity">
<path value="conversational-state.lastActivity"/>
<short
value="Last activity timestamp for the CR (derived from Communications + extensions)"/>
<definition
value="Last activity timestamp for the CR (derived from Communications + extensions)"/>
<min value="0"/>
<max value="1"/>
<base>
<path value="conversational-state.lastActivity"/>
<min value="0"/>
<max value="1"/>
</base>
<type>
<code value="dateTime"/>
</type>
</element>
<element id="conversational-state.activeCR">
<path value="conversational-state.activeCR"/>
<short
value="The active CR this message should attach to (CommunicationRequest?recipient=...&status=active)"/>
<definition
value="The active CR this message should attach to (CommunicationRequest?recipient=...&status=active)"/>
<min value="0"/>
<max value="1"/>
<base>
<path value="conversational-state.activeCR"/>
<min value="0"/>
<max value="1"/>
</base>
<type>
<code value="Reference"/>
<targetProfile
value="http://hl7.org/fhir/StructureDefinition/CommunicationRequest"/>
</type>
</element>
</snapshot>
<differential>
<element id="conversational-state">
<path value="conversational-state"/>
<short value="Conversational State (Stateless Projection)"/>
<definition
value="The sidecar's stateless projection of conversational state, computed from FHIR resources on each inbound message. The sidecar has NO private database — every state view is a pure function of FHIR queries. Five projection helpers live in lib/projection/: isDuplicateInbound, compute24hWindow, currentQuestion, conversationState, lastActivityForCR. Any new sidecar state view must add a new projection here, never a cache."/>
</element>
<element id="conversational-state.duplicateCheck">
<path value="conversational-state.duplicateCheck"/>
<short
value="Is this inbound message a duplicate (Communication?identifier=wamid)?"/>
<definition
value="Is this inbound message a duplicate (Communication?identifier=wamid)?"/>
<min value="0"/>
<max value="1"/>
<type>
<code value="boolean"/>
</type>
</element>
<element id="conversational-state.window24h">
<path value="conversational-state.window24h"/>
<short
value="Most recent inbound Communication timestamp within the 24h window (Communication?recipient=...&status=in-progress,completed&_sort=-sent&_count=1)"/>
<definition
value="Most recent inbound Communication timestamp within the 24h window (Communication?recipient=...&status=in-progress,completed&_sort=-sent&_count=1)"/>
<min value="0"/>
<max value="1"/>
<type>
<code value="dateTime"/>
</type>
</element>
<element id="conversational-state.currentQuestion">
<path value="conversational-state.currentQuestion"/>
<short
value="The linkId of the next question to ask (derived from QR.item structure + Questionnaire navigation)"/>
<definition
value="The linkId of the next question to ask (derived from QR.item structure + Questionnaire navigation)"/>
<min value="0"/>
<max value="1"/>
<type>
<code value="string"/>
</type>
</element>
<element id="conversational-state.conversationState">
<path value="conversational-state.conversationState"/>
<short value="in-progress | completed (derived from QR.status)"/>
<definition value="in-progress | completed (derived from QR.status)"/>
<min value="0"/>
<max value="1"/>
<type>
<code value="code"/>
</type>
</element>
<element id="conversational-state.lastActivity">
<path value="conversational-state.lastActivity"/>
<short
value="Last activity timestamp for the CR (derived from Communications + extensions)"/>
<definition
value="Last activity timestamp for the CR (derived from Communications + extensions)"/>
<min value="0"/>
<max value="1"/>
<type>
<code value="dateTime"/>
</type>
</element>
<element id="conversational-state.activeCR">
<path value="conversational-state.activeCR"/>
<short
value="The active CR this message should attach to (CommunicationRequest?recipient=...&status=active)"/>
<definition
value="The active CR this message should attach to (CommunicationRequest?recipient=...&status=active)"/>
<min value="0"/>
<max value="1"/>
<type>
<code value="Reference"/>
<targetProfile
value="http://hl7.org/fhir/StructureDefinition/CommunicationRequest"/>
</type>
</element>
</differential>
</StructureDefinition>