{
  "resourceType": "StructureDefinition",
  "id": "spark1635",
  "meta": {
    "versionId": "spark2005",
    "lastUpdated": "2015-11-19T12:01:09.222+00:00"
  },
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm",
      "valueInteger": 3
    }
  ],
  "url": "http://mais.org.ar/fhir/StructureDefinition/TransaccionFacturacionMais",
  "name": "TransaccionFHIRFacturacion",
  "status": "draft",
  "date": "2015-09-22T10:02:49+00:00",
  "description": "Transacción de Facturación",
  "requirements": "Intercambiar información de facturación entre prestadores y financiadores unificando los formatos en uso actualmente",
  "copyright": "(C) 2015 HL7 Argentina & Usuaria",
  "fhirVersion": "1.0.1",
  "mapping": [
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/w5",
      "name": "W5 Mapping"
    }
  ],
  "kind": "resource",
  "constrainedType": "Bundle",
  "abstract": false,
  "base": "http://hl7.org/fhir/StructureDefinition/Bundle",
  "differential": {
    "element": [
      {
        "path": "Bundle",
        "short": "Contains a collection of resources",
        "definition": "A container for a collection of resources.",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Bundle"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "v2",
            "map": "N/A"
          },
          {
            "identity": "rim",
            "map": "N/A"
          },
          {
            "identity": "w5",
            "map": "infrastructure.structure"
          }
        ]
      },
      {
        "path": "Bundle.type",
        "name": "TransaccionCompleta",
        "short": "document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection",
        "definition": "Indicates the purpose of this bundle- how it was intended to be used.",
        "comments": "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": "Es una transaccion que incluye todos los elementos que se liquidan en un mes",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "code"
          }
        ],
        "fixedCode": "transaction",
        "isSummary": true,
        "binding": {
          "strength": "required",
          "description": "Indicates the purpose of a bundle - how it was intended to be used.",
          "valueSetReference": {
            "reference": "http://hl7.org/fhir/ValueSet/bundle-type"
          }
        },
        "mapping": [
          {
            "identity": "w5",
            "map": "class"
          }
        ]
      },
      {
        "path": "Bundle.total",
        "short": "If search, the total number of matches",
        "definition": "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": "Only used if the bundle is a search result set.",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "unsignedInt"
          }
        ],
        "condition": [
          "bdl-1"
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.link",
        "name": "link",
        "short": "Links related to this Bundle",
        "definition": "A series of links that provide context to this bundle.",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry",
        "slicing": {
          "rules": "openAtEnd"
        },
        "short": "Entry in the bundle - will have a resource, or information",
        "definition": "An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).",
        "min": 0,
        "max": "*",
        "isSummary": true
      },
      {
        "path": "Bundle.entry.link",
        "short": "Links related to this entry",
        "definition": "A series of links that provide context to this entry.",
        "min": 0,
        "max": "0",
        "nameReference": "link",
        "isSummary": true
      },
      {
        "path": "Bundle.entry.fullUrl",
        "short": "Absolute URL for resource (server address, or UUID/OID)",
        "definition": "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": "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": 0,
        "max": "0",
        "type": [
          {
            "code": "uri"
          }
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry.search",
        "short": "Search related information",
        "definition": "Information about the search process that lead to the creation of this entry.",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "condition": [
          "bdl-2"
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry.request",
        "short": "Transaction Related Information",
        "definition": "Additional information about how this entry should be processed as part of a transaction.",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "condition": [
          "bdl-3"
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry.response",
        "short": "Transaction Related Information",
        "definition": "Additional information about how this entry should be processed as part of a transaction.",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "condition": [
          "bdl-4"
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry",
        "name": "OrganizacionPrestadora",
        "short": "Entry in the bundle - will have a resource, or information",
        "definition": "An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "constraint": [
          {
            "key": "bdl-5",
            "severity": "error",
            "human": "must be a resource unless there's a transaction or transaction response",
            "xpath": "f:resource or f:request or f:response"
          },
          {
            "key": "bdl-6",
            "severity": "error",
            "human": "The fullUrl element must be present when a resource is present, and not present otherwise",
            "xpath": "(not(exists(f:fullUrl)) and not(exists(f:resource))) or (exists(f:fullUrl) and exists(f:resource))"
          }
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry.link",
        "short": "Links related to this entry",
        "definition": "A series of links that provide context to this entry.",
        "min": 0,
        "max": "0",
        "nameReference": "link",
        "isSummary": true
      },
      {
        "path": "Bundle.entry.fullUrl",
        "short": "Absolute URL for resource (server address, or UUID/OID)",
        "definition": "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": "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": 0,
        "max": "0",
        "type": [
          {
            "code": "uri"
          }
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry.resource",
        "short": "La organización que prestó los servicios liquidados",
        "definition": "La organización que prestó los servicios liquidados",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Resource",
            "profile": [
              "http://mais.org.ar/fhir/StructureDefinition/OrganizacionPrestadora"
            ]
          }
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry.search",
        "short": "Search related information",
        "definition": "Information about the search process that lead to the creation of this entry.",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "condition": [
          "bdl-2"
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry.request",
        "short": "Transaction Related Information",
        "definition": "Additional information about how this entry should be processed as part of a transaction.",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "condition": [
          "bdl-3"
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry.response",
        "short": "Transaction Related Information",
        "definition": "Additional information about how this entry should be processed as part of a transaction.",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "condition": [
          "bdl-4"
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry",
        "name": "OrganizacionFinanciadora",
        "short": "La organización que debe financiar los servicios liquidados",
        "definition": "La organización que debe financiar los servicios liquidados",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "constraint": [
          {
            "key": "bdl-5",
            "severity": "error",
            "human": "must be a resource unless there's a transaction or transaction response",
            "xpath": "f:resource or f:request or f:response"
          },
          {
            "key": "bdl-6",
            "severity": "error",
            "human": "The fullUrl element must be present when a resource is present, and not present otherwise",
            "xpath": "(not(exists(f:fullUrl)) and not(exists(f:resource))) or (exists(f:fullUrl) and exists(f:resource))"
          }
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry.link",
        "short": "Links related to this entry",
        "definition": "A series of links that provide context to this entry.",
        "min": 0,
        "max": "0",
        "nameReference": "link",
        "isSummary": true
      },
      {
        "path": "Bundle.entry.fullUrl",
        "short": "Absolute URL for resource (server address, or UUID/OID)",
        "definition": "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": "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": 0,
        "max": "0",
        "type": [
          {
            "code": "uri"
          }
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry.resource",
        "short": "Organización que financia los servicios prestados",
        "definition": "Organización que financia los servicios prestados",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Resource",
            "profile": [
              "http://mais.org.ar/fhir/StructureDefinition/OrganizacionFinanciadora"
            ]
          }
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry.search",
        "short": "Search related information",
        "definition": "Information about the search process that lead to the creation of this entry.",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "condition": [
          "bdl-2"
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry.request",
        "short": "Transaction Related Information",
        "definition": "Additional information about how this entry should be processed as part of a transaction.",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "condition": [
          "bdl-3"
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry.response",
        "short": "Transaction Related Information",
        "definition": "Additional information about how this entry should be processed as part of a transaction.",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "condition": [
          "bdl-4"
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry",
        "name": "ItemFacturable",
        "short": "Cada uno de los servicios o items facturados en la liquidación",
        "definition": "Cada uno de los servicios o items facturados en la liquidación",
        "min": 1,
        "max": "*",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "constraint": [
          {
            "key": "bdl-5",
            "severity": "error",
            "human": "must be a resource unless there's a transaction or transaction response",
            "xpath": "f:resource or f:request or f:response"
          },
          {
            "key": "bdl-6",
            "severity": "error",
            "human": "The fullUrl element must be present when a resource is present, and not present otherwise",
            "xpath": "(not(exists(f:fullUrl)) and not(exists(f:resource))) or (exists(f:fullUrl) and exists(f:resource))"
          }
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry.link",
        "short": "Links related to this entry",
        "definition": "A series of links that provide context to this entry.",
        "min": 0,
        "max": "0",
        "nameReference": "link",
        "isSummary": true
      },
      {
        "path": "Bundle.entry.fullUrl",
        "short": "Absolute URL for resource (server address, or UUID/OID)",
        "definition": "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": "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": 0,
        "max": "0",
        "type": [
          {
            "code": "uri"
          }
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry.resource",
        "short": "A resource in the bundle",
        "definition": "The Resources for the entry.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Resource",
            "profile": [
              "http://mais.org.ar/fhir/StructureDefinition/ItemFacturacion"
            ]
          }
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry.search",
        "short": "Search related information",
        "definition": "Information about the search process that lead to the creation of this entry.",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "condition": [
          "bdl-2"
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry.request",
        "short": "Transaction Related Information",
        "definition": "Additional information about how this entry should be processed as part of a transaction.",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "condition": [
          "bdl-3"
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.entry.response",
        "short": "Transaction Related Information",
        "definition": "Additional information about how this entry should be processed as part of a transaction.",
        "min": 0,
        "max": "0",
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "condition": [
          "bdl-4"
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.signature",
        "short": "Digital Signature",
        "definition": "Digital Signature - base64 encoded. XML DigSIg or a JWT.",
        "comments": "The signature could be created by the \"author\" 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": "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": 0,
        "max": "0",
        "type": [
          {
            "code": "Signature"
          }
        ],
        "isSummary": true
      },
      {
        "path": "Bundle.signature.who[x]",
        "short": "Who signed the signature",
        "definition": "A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).",
        "comments": "This should agree with the information in the signature.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "uri"
          },
          {
            "code": "Reference",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/Practitioner"
            ]
          },
          {
            "code": "Reference",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/RelatedPerson"
            ]
          },
          {
            "code": "Reference",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/Patient"
            ]
          },
          {
            "code": "Reference",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/Device"
            ]
          },
          {
            "code": "Reference",
            "profile": [
              "http://mais.org.ar/fhir/StructureDefinition/OrganizacionPrestadora"
            ]
          }
        ],
        "isSummary": true
      }
    ]
  }
}