<OperationDefinition xmlns="http://hl7.org/fhir">
  <id value="initiate-onboarding" />
  <text>
    <status value="additional" />
    <div xmlns="http://www.w3.org/1999/xhtml">
      <p>The $initiate-onboarding operation is a HALO-defined operation used by a Point of Care (PoC) system to begin onboarding with a target system and provide the initial context needed to determine the appropriate next steps for future backend service interactions. The operation is intentionally broader than Dynamic Client Registration. Depending on the jurisdiction, PoC implementation, and target system, the supplied context may be used to retrieve SMART metadata, evaluate whether the PoC is trusted, perform registration or another onboarding step, discover token or FHIR endpoints, determine that no additional onboarding is required, or decide that no further backend service interaction should proceed.</p>
      <p>The target system uses the supplied iss to determine its next steps, for example retrieving the PoC's SMART configuration from /.well-known/smart-configuration to identify metadata such as the registration_endpoint, token_endpoint, supported capabilities, or other deployment-specific backend service prerequisites. It also stores the supplied offboardingChallenge alongside the resulting relationship so that a later $offboard invocation can be verified as originating from the same PoC (or one of its trusted subsystems) that completed onboarding.</p>
    </div>
  </text>
  <url value="http://fhir.infoway-inforoute.ca/io/HALO/OperationDefinition/initiate-onboarding" />
  <version value="1.0.0" />
  <name value="InitiateOnboarding" />
  <title value="Initiate Onboarding" />
  <status value="draft" />
  <kind value="operation" />
  <experimental value="false" />
  <publisher value="Canada Health Infoway" />
  <description value="Allows a Point of Care Solution to initiate onboarding with a target system by providing the initial context needed to determine the appropriate next steps, if any, for enabling future backend service interactions." />
  <jurisdiction>
    <coding>
      <system value="urn:iso:std:iso:3166" />
      <code value="CA" />
      <display value="Canada" />
    </coding>
  </jurisdiction>
  <code value="initiate-onboarding" />
  <system value="true" />
  <type value="false" />
  <instance value="false" />
  <parameter>
    <name value="iss" />
    <use value="in" />
    <min value="1" />
    <max value="1" />
    <documentation value="The base URL of the Point of Care FHIR server. The target system can use this value as input to its backend service discovery and onboarding logic. For example, it might retrieve SMART server metadata from the server's `/.well-known/smart-configuration` endpoint to identify relevant capabilities and endpoints." />
    <type value="uri" />
  </parameter>
  <parameter>
    <name value="offboardingChallenge" />
    <use value="in" />
    <min value="1" />
    <max value="1" />
    <documentation value="A Base64url-encoded SHA-256 hash of an offboarding verifier generated and retained by the PoC. The target system stores this value alongside the established relationship and uses it to authorize a subsequent `$offboard` request." />
    <type value="string" />
  </parameter>
  <parameter>
    <name value="outcome" />
    <use value="out" />
    <min value="1" />
    <max value="1" />
    <documentation value="An OperationOutcome resource detailing the outcome of the operation." />
    <type value="OperationOutcome" />
  </parameter>
</OperationDefinition>