<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="spark1635" />
  <meta>
    <versionId value="spark2005" />
    <lastUpdated value="2015-11-19T12:01:09.222+00:00" />
  </meta>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm">
    <valueInteger value="3" />
  </extension>
  <url value="http://mais.org.ar/fhir/StructureDefinition/TransaccionFacturacionMais" />
  <name value="TransaccionFHIRFacturacion" />
  <status value="draft" />
  <date value="2015-09-22T20:02:49+10:00" />
  <description value="Transacción de Facturación" />
  <requirements value="Intercambiar información de facturación entre prestadores y financiadores unificando los formatos en uso actualmente" />
  <copyright value="(C) 2015 HL7 Argentina &amp; Usuaria" />
  <fhirVersion value="1.0.1" />
  <mapping>
    <identity value="v2" />
    <uri value="http://hl7.org/v2" />
    <name value="HL7 v2" />
  </mapping>
  <mapping>
    <identity value="rim" />
    <uri value="http://hl7.org/v3" />
    <name value="RIM" />
  </mapping>
  <mapping>
    <identity value="w5" />
    <uri value="http://hl7.org/fhir/w5" />
    <name value="W5 Mapping" />
  </mapping>
  <kind value="resource" />
  <constrainedType value="Bundle" />
  <abstract value="false" />
  <base value="http://hl7.org/fhir/StructureDefinition/Bundle" />
  <differential>
    <element>
      <path value="Bundle" />
      <short value="Contains a collection of resources" />
      <definition value="A container for a collection of resources." />
      <min value="0" />
      <max value="*" />
      <type>
        <code value="Bundle" />
      </type>
      <isSummary value="true" />
      <mapping>
        <identity value="v2" />
        <map value="N/A" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="infrastructure.structure" />
      </mapping>
    </element>
    <element>
      <path value="Bundle.type" />
      <name value="TransaccionCompleta" />
      <short value="document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection" />
      <definition value="Indicates the purpose of this bundle- how it was intended to be used." />
      <comments value="It's possible to use a bundle for other purposes (e.g. a document can be accepted as a transaction). This is primarily defined so that there can be specific rules for some of the bundle types." />
      <requirements value="Es una transaccion que incluye todos los elementos que se liquidan en un mes" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="code" />
      </type>
      <fixedCode value="transaction" />
      <isSummary value="true" />
      <binding>
        <strength value="required" />
        <description value="Indicates the purpose of a bundle - how it was intended to be used." />
        <valueSetReference>
          <reference value="http://hl7.org/fhir/ValueSet/bundle-type" />
        </valueSetReference>
      </binding>
      <mapping>
        <identity value="w5" />
        <map value="class" />
      </mapping>
    </element>
    <element>
      <path value="Bundle.total" />
      <short value="If search, the total number of matches" />
      <definition value="If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)." />
      <comments value="Only used if the bundle is a search result set." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="unsignedInt" />
      </type>
      <condition value="bdl-1" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.link" />
      <name value="link" />
      <short value="Links related to this Bundle" />
      <definition value="A series of links that provide context to this bundle." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="BackboneElement" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry" />
      <slicing>
        <rules value="openAtEnd" />
      </slicing>
      <short value="Entry in the bundle - will have a resource, or information" />
      <definition value="An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)." />
      <min value="0" />
      <max value="*" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.link" />
      <short value="Links related to this entry" />
      <definition value="A series of links that provide context to this entry." />
      <min value="0" />
      <max value="0" />
      <nameReference value="link" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.fullUrl" />
      <short value="Absolute URL for resource (server address, or UUID/OID)" />
      <definition value="The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource." />
      <comments value="fullUrl may not be [unique in the context of a resource](bundle.html#bundle-unique). Note that since [FHIR resources do not need to be served through the FHIR API](references.html), the absolute URL may not end with the logical id of the resource (Resource.id), but if the fullUrl does look like a RESTful server URL (e.g. meets the [regex](references.html#regex), then it SHALL end with the Resource.id." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="uri" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.search" />
      <short value="Search related information" />
      <definition value="Information about the search process that lead to the creation of this entry." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="bdl-2" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.request" />
      <short value="Transaction Related Information" />
      <definition value="Additional information about how this entry should be processed as part of a transaction." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="bdl-3" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.response" />
      <short value="Transaction Related Information" />
      <definition value="Additional information about how this entry should be processed as part of a transaction." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="bdl-4" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry" />
      <name value="OrganizacionPrestadora" />
      <short value="Entry in the bundle - will have a resource, or information" />
      <definition value="An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="BackboneElement" />
      </type>
      <constraint>
        <key value="bdl-5" />
        <severity value="error" />
        <human value="must be a resource unless there's a transaction or transaction response" />
        <xpath value="f:resource or f:request or f:response" />
      </constraint>
      <constraint>
        <key value="bdl-6" />
        <severity value="error" />
        <human value="The fullUrl element must be present when a resource is present, and not present otherwise" />
        <xpath value="(not(exists(f:fullUrl)) and not(exists(f:resource))) or (exists(f:fullUrl) and exists(f:resource))" />
      </constraint>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.link" />
      <short value="Links related to this entry" />
      <definition value="A series of links that provide context to this entry." />
      <min value="0" />
      <max value="0" />
      <nameReference value="link" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.fullUrl" />
      <short value="Absolute URL for resource (server address, or UUID/OID)" />
      <definition value="The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource." />
      <comments value="fullUrl may not be [unique in the context of a resource](bundle.html#bundle-unique). Note that since [FHIR resources do not need to be served through the FHIR API](references.html), the absolute URL may not end with the logical id of the resource (Resource.id), but if the fullUrl does look like a RESTful server URL (e.g. meets the [regex](references.html#regex), then it SHALL end with the Resource.id." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="uri" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.resource" />
      <short value="La organización que prestó los servicios liquidados" />
      <definition value="La organización que prestó los servicios liquidados" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Resource" />
        <profile value="http://mais.org.ar/fhir/StructureDefinition/OrganizacionPrestadora" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.search" />
      <short value="Search related information" />
      <definition value="Information about the search process that lead to the creation of this entry." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="bdl-2" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.request" />
      <short value="Transaction Related Information" />
      <definition value="Additional information about how this entry should be processed as part of a transaction." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="bdl-3" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.response" />
      <short value="Transaction Related Information" />
      <definition value="Additional information about how this entry should be processed as part of a transaction." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="bdl-4" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry" />
      <name value="OrganizacionFinanciadora" />
      <short value="La organización que debe financiar los servicios liquidados" />
      <definition value="La organización que debe financiar los servicios liquidados" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="BackboneElement" />
      </type>
      <constraint>
        <key value="bdl-5" />
        <severity value="error" />
        <human value="must be a resource unless there's a transaction or transaction response" />
        <xpath value="f:resource or f:request or f:response" />
      </constraint>
      <constraint>
        <key value="bdl-6" />
        <severity value="error" />
        <human value="The fullUrl element must be present when a resource is present, and not present otherwise" />
        <xpath value="(not(exists(f:fullUrl)) and not(exists(f:resource))) or (exists(f:fullUrl) and exists(f:resource))" />
      </constraint>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.link" />
      <short value="Links related to this entry" />
      <definition value="A series of links that provide context to this entry." />
      <min value="0" />
      <max value="0" />
      <nameReference value="link" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.fullUrl" />
      <short value="Absolute URL for resource (server address, or UUID/OID)" />
      <definition value="The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource." />
      <comments value="fullUrl may not be [unique in the context of a resource](bundle.html#bundle-unique). Note that since [FHIR resources do not need to be served through the FHIR API](references.html), the absolute URL may not end with the logical id of the resource (Resource.id), but if the fullUrl does look like a RESTful server URL (e.g. meets the [regex](references.html#regex), then it SHALL end with the Resource.id." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="uri" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.resource" />
      <short value="Organización que financia los servicios prestados" />
      <definition value="Organización que financia los servicios prestados" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Resource" />
        <profile value="http://mais.org.ar/fhir/StructureDefinition/OrganizacionFinanciadora" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.search" />
      <short value="Search related information" />
      <definition value="Information about the search process that lead to the creation of this entry." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="bdl-2" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.request" />
      <short value="Transaction Related Information" />
      <definition value="Additional information about how this entry should be processed as part of a transaction." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="bdl-3" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.response" />
      <short value="Transaction Related Information" />
      <definition value="Additional information about how this entry should be processed as part of a transaction." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="bdl-4" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry" />
      <name value="ItemFacturable" />
      <short value="Cada uno de los servicios o items facturados en la liquidación" />
      <definition value="Cada uno de los servicios o items facturados en la liquidación" />
      <min value="1" />
      <max value="*" />
      <type>
        <code value="BackboneElement" />
      </type>
      <constraint>
        <key value="bdl-5" />
        <severity value="error" />
        <human value="must be a resource unless there's a transaction or transaction response" />
        <xpath value="f:resource or f:request or f:response" />
      </constraint>
      <constraint>
        <key value="bdl-6" />
        <severity value="error" />
        <human value="The fullUrl element must be present when a resource is present, and not present otherwise" />
        <xpath value="(not(exists(f:fullUrl)) and not(exists(f:resource))) or (exists(f:fullUrl) and exists(f:resource))" />
      </constraint>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.link" />
      <short value="Links related to this entry" />
      <definition value="A series of links that provide context to this entry." />
      <min value="0" />
      <max value="0" />
      <nameReference value="link" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.fullUrl" />
      <short value="Absolute URL for resource (server address, or UUID/OID)" />
      <definition value="The Absolute URL for the resource. This must be provided for all resources. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource." />
      <comments value="fullUrl may not be [unique in the context of a resource](bundle.html#bundle-unique). Note that since [FHIR resources do not need to be served through the FHIR API](references.html), the absolute URL may not end with the logical id of the resource (Resource.id), but if the fullUrl does look like a RESTful server URL (e.g. meets the [regex](references.html#regex), then it SHALL end with the Resource.id." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="uri" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.resource" />
      <short value="A resource in the bundle" />
      <definition value="The Resources for the entry." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Resource" />
        <profile value="http://mais.org.ar/fhir/StructureDefinition/ItemFacturacion" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.search" />
      <short value="Search related information" />
      <definition value="Information about the search process that lead to the creation of this entry." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="bdl-2" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.request" />
      <short value="Transaction Related Information" />
      <definition value="Additional information about how this entry should be processed as part of a transaction." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="bdl-3" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.entry.response" />
      <short value="Transaction Related Information" />
      <definition value="Additional information about how this entry should be processed as part of a transaction." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="BackboneElement" />
      </type>
      <condition value="bdl-4" />
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.signature" />
      <short value="Digital Signature" />
      <definition value="Digital Signature - base64 encoded. XML DigSIg or a JWT." />
      <comments value="The signature could be created by the &quot;author&quot; of the bundle or by the originating device.   Requirements around inclusion of a signature, verification of signatures and treatment of signed/non-signed bundles is implementation-environment specific." />
      <requirements value="This element allows capturing signatures on documents. It also allows signatures on messages, transactions or even query responses. It may support content-authentication, non-repudiation or other business cases. This is primarily relevant where the bundle may travel through multiple hops or via other mechanisms where HTTPS non-repudiation is insufficient." />
      <min value="0" />
      <max value="0" />
      <type>
        <code value="Signature" />
      </type>
      <isSummary value="true" />
    </element>
    <element>
      <path value="Bundle.signature.who[x]" />
      <short value="Who signed the signature" />
      <definition value="A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key)." />
      <comments value="This should agree with the information in the signature." />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="uri" />
      </type>
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
      </type>
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
      </type>
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Patient" />
      </type>
      <type>
        <code value="Reference" />
        <profile value="http://hl7.org/fhir/StructureDefinition/Device" />
      </type>
      <type>
        <code value="Reference" />
        <profile value="http://mais.org.ar/fhir/StructureDefinition/OrganizacionPrestadora" />
      </type>
      <isSummary value="true" />
    </element>
  </differential>
</StructureDefinition>