{
  "resourceType": "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition",
  "resource": "Bundle",
  "id": "ViewDefinition-AllergyIntolerance",
  "title": "Allergieen en intoleranties",
  "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": "onsetPeriod.start | onsetDateTime",
          "name": "Datum",
          "type": "dateTime",
          "tag": [ { "name": "Zib element", "value": "StartDateTime" } ]
        },
        {
          "path": "code.text | code.coding[0].display",
          "name": "Stof",
          "type": "string",
          "tag": [ { "name": "Zib element", "value": "CausativeAgent" } ]
        },
        {
          "path": "note.text",
          "name": "Toelichting",
          "type": "string",
          "tag": [ { "name": "Zib element", "value": "Comment" } ]
        },
        {
          "path": "category.extension('http://nictiz.nl/fhir/StructureDefinition/code-specification').valueCodeableConcept.text | category.join(',')",
          "name": "Categorie",
          "description": "Meerdere opties die tegelijk getoond kunnen worden",
          "type": "code",
          "tag": [ { "name": "Zib element", "value": "nvt" } ]
        },
        {
          "path": "criticality.extension('http://nictiz.nl/fhir/StructureDefinition/code-specification').valueCodeableConcept.text | criticality",
          "name": "Ernst(1)",
          "description": "",
          "type": "code",
          "tag": [ 
            { "name": "Zib element", "value": "MateVanKritiek" } ]
        },
        {
          "path": "reaction[0].severity",
          "name": "Ernst(2)",
          "description": "",
          "type": "code",
          "tag": [ { "name": "Zib element", "value": "Reactie/Ernst" } ]
        },
        {
          "path": "reaction[0].manifestation[0].text",
          "name": "Reacties",
          "description": "",
          "type": "string",
          "tag": [ { "name": "Zib element", "value": "Reactie/Symptoom" } ]
        },
        {
          "path": "clinicalStatus",
          "name": "Status",
          "description": "<code>Actief</code>, <code>Niet meer aanwezig</code>, <code>Achterhaald</code> en <code>Foutief</code> status wordt niet getoond in de Zorgviewer (wordt uitgefilterd). Indien geen extensie aanwezig, dan worden de waarden als volgt gemapped: <code>active</code> -> <code>Actief</code>; <code>inactive</code> -> <code>Achterhaald</code>; <code>resolved</code> -> <code>Niet meer aanwezig</code>",
          "type": "code",
          "tag": [ { "name": "Zib element", "value": "AllergieStatus" } ]
        },
        {
          "path": "clinicalStatus.extension('http://nictiz.nl/fhir/StructureDefinition/code-specification').valueCodeableConcept.text",
          "name": "StatusCS",
          "description": "Zie Status",
          "type": "code",
          "tag": [ { "name": "Zib element", "value": "AllergieStatus" } ]
        },
        {
          "path": "verificationStatus",
          "name": "(VStatus)",
          "description": "",
          "type": "code",
          "tag": [ { "name": "Zib element", "value": "AllergieStatus" } ]
        }
      ],
      "forEach": "entry.resource.where(resourceType='AllergyIntolerance')"
    }
  ]
}