{
  "resourceType": "StructureDefinition",
  "id": "FTBundle-eb4c68e8-0567-4042-9de6-da47cd8d3bd6",
  "url": "https://www.esante.lu/fhir-spec/StructureDefinition/FTBundle",
  "version": "0.0.1",
  "name": "FTBundle",
  "status": "draft",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "cda",
      "uri": "http://hl7.org/v3/cda",
      "name": "CDA (R2)"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Bundle",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Bundle",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Bundle",
        "path": "Bundle",
        "condition": [
          "val-FTSameCommAsHP"
        ],
        "constraint": [
          {
            "key": "val-FTSameCommAsHP",
            "severity": "error",
            "human": "There shall be as many Communication as Practitioners",
            "expression": "Bundle.entry.resource.ofType(Communication).count()=Bundle.entry.resource.ofType(Practitioner).count()",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/FTBundle"
          }
        ]
      },
      {
        "id": "Bundle.meta",
        "path": "Bundle.meta",
        "min": 1
      },
      {
        "id": "Bundle.meta.id",
        "path": "Bundle.meta.id",
        "max": "0"
      },
      {
        "id": "Bundle.meta.versionId",
        "path": "Bundle.meta.versionId",
        "max": "0"
      },
      {
        "id": "Bundle.meta.lastUpdated",
        "path": "Bundle.meta.lastUpdated",
        "max": "0"
      },
      {
        "id": "Bundle.meta.source",
        "path": "Bundle.meta.source",
        "max": "0"
      },
      {
        "id": "Bundle.meta.profile",
        "path": "Bundle.meta.profile",
        "min": 1,
        "max": "1",
        "fixedCanonical": "https://www.esante.lu/fhir-spec/StructureDefinition/FTBundle"
      },
      {
        "id": "Bundle.meta.security",
        "path": "Bundle.meta.security",
        "max": "0"
      },
      {
        "id": "Bundle.meta.tag",
        "path": "Bundle.meta.tag",
        "max": "0"
      },
      {
        "id": "Bundle.implicitRules",
        "path": "Bundle.implicitRules",
        "max": "0"
      },
      {
        "id": "Bundle.language",
        "path": "Bundle.language",
        "max": "0"
      },
      {
        "id": "Bundle.identifier",
        "path": "Bundle.identifier",
        "max": "0"
      },
      {
        "id": "Bundle.type",
        "path": "Bundle.type",
        "definition": "Constant value",
        "fixedCode": "transaction"
      },
      {
        "id": "Bundle.timestamp",
        "path": "Bundle.timestamp",
        "max": "0"
      },
      {
        "id": "Bundle.total",
        "path": "Bundle.total",
        "max": "0"
      },
      {
        "id": "Bundle.link",
        "path": "Bundle.link",
        "max": "0"
      },
      {
        "id": "Bundle.entry",
        "path": "Bundle.entry",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "resource.meta.profile"
            }
          ],
          "rules": "closed"
        },
        "min": 3
      },
      {
        "id": "Bundle.entry:FTResPDF",
        "path": "Bundle.entry",
        "sliceName": "FTResPDF",
        "short": "The result as PDF",
        "min": 0,
        "max": "*"
      },
      {
        "id": "Bundle.entry:FTResPDF.id",
        "path": "Bundle.entry.id",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTResPDF.link",
        "path": "Bundle.entry.link",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTResPDF.fullUrl",
        "path": "Bundle.entry.fullUrl",
        "short": "UUID of the resource",
        "definition": "This is a UUID to identify the element inside the Bundle.\r\nIt SHALL start with urn:uuid: and then an UUID version 4 randomly generated. Its scope is only the Bundle, it is not linked outside from it and not saved.",
        "min": 1,
        "example": [
          {
            "label": "Valid example",
            "valueUri": "urn:uuid:d00069b7-1fc8-4397-bc7c-c9571319d890"
          }
        ],
        "condition": [
          "val-uuid"
        ],
        "constraint": [
          {
            "key": "val-uuid",
            "severity": "error",
            "human": "SHALL be a v4 UUID prefixed by urn:uuid:",
            "expression": "startsWith('urn:uuid:') and length()=45",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/FTBundle"
          }
        ]
      },
      {
        "id": "Bundle.entry:FTResPDF.resource",
        "path": "Bundle.entry.resource",
        "short": "The result as PDF",
        "min": 1,
        "type": [
          {
            "code": "DocumentReference",
            "profile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/FTResPDF"
            ]
          }
        ]
      },
      {
        "id": "Bundle.entry:FTResPDF.search",
        "path": "Bundle.entry.search",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTResPDF.request",
        "path": "Bundle.entry.request",
        "min": 1
      },
      {
        "id": "Bundle.entry:FTResPDF.request.id",
        "path": "Bundle.entry.request.id",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTResPDF.request.method",
        "path": "Bundle.entry.request.method",
        "definition": "Constant",
        "fixedCode": "POST"
      },
      {
        "id": "Bundle.entry:FTResPDF.request.url",
        "path": "Bundle.entry.request.url",
        "short": "Constant",
        "fixedUri": "DocumentReference"
      },
      {
        "id": "Bundle.entry:FTResPDF.request.ifNoneMatch",
        "path": "Bundle.entry.request.ifNoneMatch",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTResPDF.request.ifModifiedSince",
        "path": "Bundle.entry.request.ifModifiedSince",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTResPDF.request.ifMatch",
        "path": "Bundle.entry.request.ifMatch",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTResPDF.request.ifNoneExist",
        "path": "Bundle.entry.request.ifNoneExist",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTResPDF.response",
        "path": "Bundle.entry.response",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTCommunication",
        "path": "Bundle.entry",
        "sliceName": "FTCommunication",
        "short": "The Communication(s). One Communication is for 1 Health professional, however the XML and PDF DocumentReference can be reused inside the Communication object",
        "min": 1,
        "max": "*"
      },
      {
        "id": "Bundle.entry:FTCommunication.id",
        "path": "Bundle.entry.id",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTCommunication.link",
        "path": "Bundle.entry.link",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTCommunication.fullUrl",
        "path": "Bundle.entry.fullUrl",
        "short": "UUID of the resource",
        "definition": "This is a UUID to identify the element inside the Bundle.\r\nIt SHALL start with urn:uuid: and then an UUID version 4 randomly generated. Its scope is only the Bundle, it is not linked outside from it and not saved.",
        "min": 1,
        "condition": [
          "val-uuid"
        ],
        "constraint": [
          {
            "key": "val-uuid",
            "severity": "error",
            "human": "SHALL be a v4 UUID prefixed by urn:uuid:",
            "expression": "startsWith('urn:uuid:') and length()=45",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/FTBundle"
          }
        ]
      },
      {
        "id": "Bundle.entry:FTCommunication.resource",
        "path": "Bundle.entry.resource",
        "short": "The communications",
        "min": 1,
        "type": [
          {
            "code": "Communication",
            "profile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/FTCommunication"
            ]
          }
        ]
      },
      {
        "id": "Bundle.entry:FTCommunication.search",
        "path": "Bundle.entry.search",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTCommunication.request",
        "path": "Bundle.entry.request",
        "min": 1
      },
      {
        "id": "Bundle.entry:FTCommunication.request.id",
        "path": "Bundle.entry.request.id",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTCommunication.request.method",
        "path": "Bundle.entry.request.method",
        "definition": "Constant",
        "fixedCode": "POST"
      },
      {
        "id": "Bundle.entry:FTCommunication.request.url",
        "path": "Bundle.entry.request.url",
        "definition": "Constant",
        "fixedUri": "Communication"
      },
      {
        "id": "Bundle.entry:FTCommunication.request.ifNoneMatch",
        "path": "Bundle.entry.request.ifNoneMatch",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTCommunication.request.ifModifiedSince",
        "path": "Bundle.entry.request.ifModifiedSince",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTCommunication.request.ifMatch",
        "path": "Bundle.entry.request.ifMatch",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTCommunication.request.ifNoneExist",
        "path": "Bundle.entry.request.ifNoneExist",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTCommunication.response",
        "path": "Bundle.entry.response",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTDiagReport",
        "path": "Bundle.entry",
        "sliceName": "FTDiagReport",
        "short": "DiagnostivReport One Communication is for 1 Health professional, however the XML and PDF DocumentReference can be reused inside the Communication object",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Bundle.entry:FTDiagReport.id",
        "path": "Bundle.entry.id",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTDiagReport.link",
        "path": "Bundle.entry.link",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTDiagReport.fullUrl",
        "path": "Bundle.entry.fullUrl",
        "short": "UUID of the resource",
        "definition": "This is a UUID to identify the element inside the Bundle.\r\nIt SHALL start with urn:uuid: and then an UUID version 4 randomly generated. Its scope is only the Bundle, it is not linked outside from it and not saved.",
        "min": 1,
        "condition": [
          "val-uuid"
        ],
        "constraint": [
          {
            "key": "val-uuid",
            "severity": "error",
            "human": "SHALL be a v4 UUID prefixed by urn:uuid:",
            "expression": "startsWith('urn:uuid:') and length()=45",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/FTBundle"
          }
        ]
      },
      {
        "id": "Bundle.entry:FTDiagReport.resource",
        "path": "Bundle.entry.resource",
        "short": "The result envelope",
        "min": 1,
        "type": [
          {
            "code": "DiagnosticReport",
            "profile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/FTDiagReport"
            ]
          }
        ]
      },
      {
        "id": "Bundle.entry:FTDiagReport.search",
        "path": "Bundle.entry.search",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTDiagReport.request",
        "path": "Bundle.entry.request",
        "min": 1
      },
      {
        "id": "Bundle.entry:FTDiagReport.request.id",
        "path": "Bundle.entry.request.id",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTDiagReport.request.method",
        "path": "Bundle.entry.request.method",
        "definition": "Constant",
        "fixedCode": "POST"
      },
      {
        "id": "Bundle.entry:FTDiagReport.request.url",
        "path": "Bundle.entry.request.url",
        "definition": "Constant",
        "fixedUri": "DiagnosticReport"
      },
      {
        "id": "Bundle.entry:FTDiagReport.request.ifNoneMatch",
        "path": "Bundle.entry.request.ifNoneMatch",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTDiagReport.request.ifModifiedSince",
        "path": "Bundle.entry.request.ifModifiedSince",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTDiagReport.request.ifMatch",
        "path": "Bundle.entry.request.ifMatch",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTDiagReport.request.ifNoneExist",
        "path": "Bundle.entry.request.ifNoneExist",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTDiagReport.response",
        "path": "Bundle.entry.response",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTPractitioner",
        "path": "Bundle.entry",
        "sliceName": "FTPractitioner",
        "short": "The practitioners",
        "min": 1,
        "max": "*"
      },
      {
        "id": "Bundle.entry:FTPractitioner.id",
        "path": "Bundle.entry.id",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTPractitioner.link",
        "path": "Bundle.entry.link",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTPractitioner.fullUrl",
        "path": "Bundle.entry.fullUrl",
        "short": "UUID of the resource",
        "definition": "This is a UUID to identify the element inside the Bundle.\r\nIt SHALL start with urn:uuid: and then an UUID version 4 randomly generated. Its scope is only the Bundle, it is not linked outside from it and not saved.",
        "min": 1,
        "example": [
          {
            "label": "Valid example",
            "valueUri": "urn:uuid:d00069b7-1fc8-4397-bc7c-c9571319d890"
          }
        ],
        "condition": [
          "val-uuid"
        ],
        "constraint": [
          {
            "key": "val-uuid",
            "severity": "error",
            "human": "SHALL be a v4 UUID prefixed by urn:uuid:",
            "expression": "startsWith('urn:uuid:') and length()=45",
            "source": "https://www.esante.lu/fhir-spec/StructureDefinition/FTBundle"
          }
        ]
      },
      {
        "id": "Bundle.entry:FTPractitioner.resource",
        "path": "Bundle.entry.resource",
        "short": "The practitioners",
        "min": 1,
        "type": [
          {
            "code": "Practitioner",
            "profile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/FTPractitioner"
            ]
          }
        ]
      },
      {
        "id": "Bundle.entry:FTPractitioner.search",
        "path": "Bundle.entry.search",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTPractitioner.request",
        "path": "Bundle.entry.request",
        "min": 1
      },
      {
        "id": "Bundle.entry:FTPractitioner.request.id",
        "path": "Bundle.entry.request.id",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTPractitioner.request.method",
        "path": "Bundle.entry.request.method",
        "definition": "Constant",
        "fixedCode": "POST"
      },
      {
        "id": "Bundle.entry:FTPractitioner.request.url",
        "path": "Bundle.entry.request.url",
        "fixedUri": "Practitioner"
      },
      {
        "id": "Bundle.entry:FTPractitioner.request.ifNoneMatch",
        "path": "Bundle.entry.request.ifNoneMatch",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTPractitioner.request.ifModifiedSince",
        "path": "Bundle.entry.request.ifModifiedSince",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTPractitioner.request.ifMatch",
        "path": "Bundle.entry.request.ifMatch",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTPractitioner.request.ifNoneExist",
        "path": "Bundle.entry.request.ifNoneExist",
        "max": "0"
      },
      {
        "id": "Bundle.entry:FTPractitioner.response",
        "path": "Bundle.entry.response",
        "max": "0"
      },
      {
        "id": "Bundle.signature",
        "path": "Bundle.signature",
        "max": "0"
      }
    ]
  }
}