{
  "resourceType": "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition",
  "resource": "Bundle",
  "id": "ViewDefinition-MedicationRequest",
  "title": "Medicatie Afspraken",
  "select": [
    {
      "column": [
        {
          "path": "meta.extension('http://hl7.org/fhir/4.0/StructureDefinition/extension-Meta.source').valueUri",
          "name": "Bron",
          "description": "Lookup adhv uri (AGB-Z of OID) <code>&lt;adressering-base&gt;/Organization?identifier=&lt;.meta.tag.code&gt;</code> en gebruik dan <code>Organization.name</code>",
          "type": "string",
          "tag": [ { "name": "Zib element", "value": "nvt" } ]
        },
        {
          "path": "extension('http://nictiz.nl/fhir/StructureDefinition/zib-Medication-PeriodOfUse').valuePeriod.start | extension('http://nictiz.nl/fhir/StructureDefinition/ext-TimeInterval.Period').valuePeriod.start",
          "name": "Start",
          "description": "",
          "type": "dateTime",
          "tag": [ { "name": "Zib element", "value": "Gebruiksperiode::TijdsInterval/startDatumTijd" } ]
        },
        {
          "path": "extension('http://nictiz.nl/fhir/StructureDefinition/zib-Medication-PeriodOfUse').valuePeriod.end | extension('http://nictiz.nl/fhir/StructureDefinition/ext-TimeInterval.Period').valuePeriod.end",
          "name": "Eind",
          "description": "",
          "type": "dateTime",
          "tag": [ { "name": "Zib element", "value": "Gebruiksperiode::TijdsInterval/eindDatumTijd" } ]
        },
        {
          "path": "medication.display",
          "name": "Medicatie",
          "description": "",
          "type": "string",
          "tag": [ { "name": "Zib element", "value": "Afgesprokengeneesmiddel::Product" } ]
        },
        {
          "path": "dosageInstruction.text | extension('http://nictiz.nl/fhir/StructureDefinition/ext-RenderedDosageInstruction').valueString",
          "name": "Dosering & instructies",
          "description": "N.B. Als text niet beschikbaar dan samenstellen uit discrete informatie en markeren met een icoontje &#9432;",
          "type": "string",
          "tag": [ { "name": "Zib element", "value": "Gebruiksinstructie/Omschrijving, Gebruiksinstructie/AanvullendeInstructie" } ]
        },
        {
          "path": "iif(exists(dosageInstruction.route.text), dosageInstruction.route.text, dosageInstruction.route.coding.display)",
          "name": "Toedieningsweg",
          "type": "string",
          "tag": [ { "name": "Zib element", "value": "Gebruiksinstructie/Toedieningsweg" } ]
        },
        {
          "path": "modifierExtension.where(url='http://nictiz.nl/fhir/StructureDefinition/zib-Medication-StopType').valueCodeableConcept.coding.display",
          "name": "Stop type",
          "type": "string",
          "tag": [ { "name": "Zib element", "value": "StopType" } ]
        },
        {
          "path": "medication.resolve().form.coding.display",
          "name": "+Medicatie vorm",
          "type": "string",
          "tag": [ { "name": "Zib element", "value": "Afgesprokengeneesmiddel::FarmaceutischProduct/FarmaceutischeVorm" } ]
        },
        {
          "path": "authoredOn",
          "name": "+Afspraakdatum",
          "type": "dateTime",
          "tag": [ { "name": "Zib element", "value": "MedicatieafspraakDatumTijd" } ]
        },
        {
          "path": "requester.agent.display | requester.display",
          "name": "+Voorschrijver",
          "description": "<b>LET OP:</b> <code>requester.display</code> is een FHIR R4 veld",
          "type": "string",
          "tag": [ { "name": "Zib element", "value": "Voorschrijver::Zorgverlener" } ]
        }
      ],
      "forEach": "entry.resource.where(resourceType='MedicationRequest')"
    }
  ]
}