<OperationDefinition xmlns="http://hl7.org/fhir">
  <id value="clear-context" />
  <text>
    <status value="additional" />
    <div xmlns="http://www.w3.org/1999/xhtml">
      <p>The $clear-context operation allows launching applications, such as Point of Care (PoC) systems, to remove clinical contexts previously established during a SMART on FHIR Accelerator (SoFA) launch. This operation ensures data hygiene and supports compliance with jurisdictional data retention policies by deleting context-related data that is no longer needed.</p>
      <p>The operation requires the launchID generated by a prior $set-context invocation to identify and remove associated FHIR resources stored in the SoFA for the specified session. These resources may include those created by the launching application through the $set-context operation or by the SMART application after the launch.</p>
      <p>The outcome of the operation is returned in an OperationOutcome resource, which provides details on the success or failure of the context-clearing process.</p>
    </div>
  </text>
  <url value="http://fhir.infoway-inforoute.ca/io/HALO/OperationDefinition/clear-context" />
  <version value="1.0.0" />
  <name value="ClearContext" />
  <title value="Clear Context" />
  <status value="active" />
  <kind value="operation" />
  <experimental value="false" />
  <description value="Clears the context, specified by the provided launchID, along with any resources that have been created for the current session within the SoFA." />
  <code value="clear-context" />
  <system value="true" />
  <type value="false" />
  <instance value="false" />
  <parameter>
    <name value="launchID" />
    <use value="in" />
    <min value="1" />
    <max value="1" />
    <documentation value="The launchID is a required parameter. It is returned by the $set-context operation when the context was first established." />
    <type value="string" />
  </parameter>
  <parameter>
    <name value="outcome" />
    <use value="out" />
    <min value="1" />
    <max value="*" />
    <documentation value="An OperationOutcome resource detailing the outcome (e.g., success, failure) of the operation." />
    <type value="OperationOutcome" />
  </parameter>
</OperationDefinition>