{
  "resourceType": "StructureDefinition",
  "id": "sfm-MedicationBundle",
  "url": "http://ehelse.no/fhir/StructureDefinition/sfm-MedicationBundle",
  "version": "1.0",
  "name": "SfmMedicationBundle",
  "title": "sfm-MedicationBundle",
  "status": "active",
  "date": "2021-05-01",
  "description": "Profile on Bundle for use as container for medications and prescription data in SFM API Basis",
  "purpose": "The purpose of this profile on Bundle is to contain the structure of the service-calls provided by the SFM API Basis",
  "fhirVersion": "4.0.0",
  "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",
        "short": "Contains a collection of Medication resources",
        "definition": "A container for a collection of Medication and prescription resources for the SFM API Basis."
      },
      {
        "id": "Bundle.type",
        "path": "Bundle.type",
        "short": "document",
        "definition": "This bundle is a document intedet to contain the strucured data read from or written to SFM API Basis. Closely connected to SfmMedicationComposition",
        "comment": "Norwegian profile on Bundle to serve service oriented transactions for e-resept on FHIR",
        "fixedCode": "document"
      },
      {
        "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"
            }
          ],
          "description": "First entry will always be the SfmMedicationComposition. All other entries will be resources referred from this",
          "rules": "open"
        }
      },
      {
        "id": "Bundle.entry:SfmMedicationComposition",
        "path": "Bundle.entry",
        "sliceName": "SfmMedicationComposition",
        "short": "First entry is a SfmMedicationComposition",
        "definition": "First entry in Bundle of type \"document\" is always a Composition",
        "comment": "This Composition entry serves as a directory for the document Bundle",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Bundle.entry:SfmMedicationComposition.resource",
        "path": "Bundle.entry.resource",
        "type": [
          {
            "code": "Resource",
            "profile": [
              "http://ehelse.no/fhir/StructureDefinition/sfm-MedicationComposition"
            ]
          }
        ]
      }
    ]
  }
}