<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="ApplicationDomain" />
  <url value="http://hl7.org/fhir/StructureDefinition/ApplicationDomain" />
  <version value="0.1" />
  <name value="ApplicationDomain" />
  <status value="draft" />
  <publisher value="Synapxe" />
  <copyright value="Copyright (C) 2024 Synapxe" />
  <fhirVersion value="5.0.0" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="ApplicationDomain" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
  <derivation value="specialization" />
  <differential>
    <element id="ApplicationDomain">
      <path value="ApplicationDomain" />
      <constraint>
        <key value="dom-3" />
        <severity value="error" />
        <human value="If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource" />
        <expression value="contained.where(((id.exists() and ('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url)))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(uri) = '#').exists()).not()).trace('unmatched', id).empty()" />
      </constraint>
    </element>
    <element id="ApplicationDomain.domainName">
      <path value="ApplicationDomain.domainName" />
      <max value="1" />
      <type>
        <code value="string" />
      </type>
      <isModifier value="false" />
      <binding>
        <strength value="required" />
        <valueSet value="https://fhir.synapxe.sg/CodeSystem/domain" />
      </binding>
    </element>
    <element id="ApplicationDomain.agcSpoc">
      <path value="ApplicationDomain.agcSpoc" />
      <max value="1" />
      <type>
        <code value="Reference" />
      </type>
      <isModifier value="false" />
    </element>
  </differential>
</StructureDefinition>