{
  "resourceType": "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition",
  "resource": "Bundle",
  "id": "ViewDefinition-Vitalegegevens",
  "title": "Vitale gegevens",
  "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": "effectiveDateTime",
          "name": "Datum",
          "type": "dateTime",
          "tag": [ { "name": "Zib element", "value": "*DatumTijd" } ]
        },
        {
          "path": "code.text | code.coding[0].display",
          "name": "Meting",
          "type": "string",
          "tag": [ { "name": "Zib element", "value": "MetingNaam" } ]
        },
        {
          "path": "valueQuantity.value.toString()+' '+valueQuantity.unit | valueString | valueCodeableConcept.coding.display",
          "name": "Waarde",
          "type": "string",
          "tag": [ { "name": "Zib element", "value": "Uitslag/Waarde" } ]
        },
        {
          "path": "component.valueQuantity.value.select(toString()).join('/')+' '+component[0].valueQuantity.unit",
          "name": "Waarde componenten",
          "type": "string",
          "tag": [ { "name": "Zib element", "value": "*Waarde" } ]
        },
        {
          "path": "performer.display",
          "name": "Uitvoerder",
          "type": "string",
          "tag": [ { "name": "Zib element", "value": "Auteur" } ]
        },
        {
          "path": "method.text",
          "name": "+Methode",
          "type": "string",
          "tag": [ { "name": "Zib element", "value": "*Type" } ]
        },
        {
          "path": "iif(bodySite.text='Body Site',bodySite.coding[1].display,bodySite.text)",
          "name": "+MeetLocatie",
          "type": "string",
          "tag": [ { "name": "Zib element", "value": "MeetLocatie" } ]
        },
        {
          "path": "code.coding.where(system='http://loinc.org').select('LOINC#' + code + ' ' + display)",
          "name": "+Meting",
          "description": "Meerdere codes mogelijk.<br/>Ignore NullFlavor.<br/>Lookup system label middels <code>&lt;terminologie-base&gt;/CodeSystem?url=&lt;system&gt;</code> en gebruik dan <code>CodeSystem.title</code>",
          "type": "string",
          "tag": [ { "name": "Zib element", "value": "MetingNaam" } ]
        },
        {
          "path": "code.coding.where(system='https://referentiemodel.nhg.org/tabellen/nhg-tabel-45-diagnostische-bepalingen').select('NHG45#' + code + ' ' + display)",
          "name": "+Meting",
          "description": "",
          "type": "string",
          "tag": [ { "name": "Zib element", "value": "MetingNaam" } ]
        },
        {
          "path": "comment | note.text",
          "name": "+Toelichting",
          "description": "<b>LET OP:</b> <code>note.text</code> is een FHIR R4 veld",
          "type": "string",
          "tag": [ { "name": "Zib element", "value": "Toelichting" } ]
        },
        {
          "path": "code.coding.where(system='http://loinc.org' and code!='8716-3').translate('vital-signs-groups').target[0].display | code.coding.where(system='https://referentiemodel.nhg.org/tabellen/nhg-tabel-45-diagnostische-bepalingen').translate('vital-signs-groups').target[0].display",
          "name": "(Groep)",
          "description": "Lookup LOINC 'groep' code middels <code>&lt;terminologie-base&gt;<a href='ConceptMap-vital-signs-groups.html'>/ConceptMap/vital-signs-groups</a>$translate?code=&lt;code&gt;</code><br/>Gebruik deze om de regels te groeperen.<br>Verberg regels die <b>GEEN</b> groep hebben.",
          "type": "code",
          "tag": [ { "name": "Zib element", "value": "nvt" } ]
        }
      ],
      "forEach": "entry.resource.where(resourceType='Observation' and category.coding.code='vital-signs')"
    }
  ]
}