Netherlands - Generic Functions for data exchange Implementation Guide
0.2.0-ballot - ci-build

Netherlands - Generic Functions for data exchange Implementation Guide, published by Ministerie van Volksgezondheid, Welzijn en Sport. This guide is not an authorized publication; it is the continuous build for version 0.2.0-ballot built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/minvws/generiekefuncties-docs/ and changes regularly. See the Directory of published versions

## StructureMap: KVK Basisprofiel naar FHIR Organization

Official URL: http://minvws.github.io/generiekefuncties-docs/StructureMap/KvkBasisprofielToOrganization | Version: 0.2.0-ballot
Draft as of 2026-03-24 | Computable Name: KvkBasisprofielToOrganization

StructureMap die een KVK Basisprofiel API response transformeert naar een FHIR Organization resource.

    map "http://minvws.github.io/generiekefuncties-docs/StructureMap/KvkBasisprofielToOrganization" = "KvkBasisprofielToOrganization"

    // StructureMap die een KVK Basisprofiel API response transformeert naar een FHIR Organization resource.

    uses "http://minvws.github.io/generiekefuncties-docs/StructureDefinition/KvkBasisprofiel" alias KvkBasisprofiel as source
    uses "http://minvws.github.io/generiekefuncties-docs/StructureDefinition/nl-gf-organization" alias NlGfOrganization as target

    group KvkBasisprofielToOrganization(source src : KvkBasisprofiel, target tgt : Organization) {
      src -> tgt.meta as meta then {
        src -> meta.profile = 'http://minvws.github.io/generiekefuncties-docs/StructureDefinition/nl-gf-organization' "setProfileUrl";
      } "setProfile";
      src.kvkNummer as kvkNum -> tgt.identifier as kvkId then {
        kvkNum -> kvkId.use = 'official' "kvkUse";
        kvkNum -> kvkId.system = 'http://fhir.nl/fhir/NamingSystem/kvk' "kvkSystem";
        kvkNum -> kvkId.value = kvkNum "kvkValue";
      };
      src.uraNummer as uraNum -> tgt.identifier as uraId then {
        uraNum -> uraId.use = 'official' "uraUse";
        uraNum -> uraId.system = 'http://fhir.nl/fhir/NamingSystem/ura' "uraSystem";
        uraNum -> uraId.value = uraNum "uraValue";
        uraNum -> uraId.assigner as assignerRef then {
          uraNum -> assignerRef.identifier as assignerId then {
            uraNum -> assignerId.system = 'http://fhir.nl/fhir/NamingSystem/kvk' "assignerIdSystem";
            uraNum -> assignerId.value = '50000535' "assignerIdValue";
            uraNum -> assignerId.type as assignerIdType then {
              uraNum -> assignerIdType.coding as assignerIdTypeCoding then {
                uraNum -> assignerIdTypeCoding.system = 'http://terminology.hl7.org/CodeSystem/provenance-participant-type' "assignerIdTypeCodingSystem";
                uraNum -> assignerIdTypeCoding.code = 'custodian' "assignerIdTypeCodingCode";
              } "assignerIdTypeCoding";
            } "assignerIdType";
          } "assignerIdentifier";
        } "uraAssigner";
      };
      src.naam as naam -> tgt.name = naam;
      src -> tgt.active = true "setActive";
      src.statutaireNaam as statNaam -> tgt.alias = statNaam;
      src.handelsnamen as hn then KvkHandelsnaamToAlias(hn, tgt);
      src.sbiActiviteiten as sbi -> tgt.type as cc then KvkSBIToCodeableConcept(sbi, cc);
      src.embedded as emb then {
        emb.eigenaar as eig then {
          eig.rsin as rsin -> tgt.identifier as rsinId then {
            rsin -> rsinId.system = 'http://fhir.nl/fhir/NamingSystem/rsin' "rsinSystem";
            rsin -> rsinId.value = rsin "rsinValue";
          };
        };
        emb.hoofdvestiging as hv then {
          hv.adressen as adres -> tgt.address as addr then KvkAdresToAddress(adres, addr);
          hv.websites as web -> tgt.telecom as tel then KvkWebsiteToContactPoint(web, tel);
        };
      };
    }

    group KvkHandelsnaamToAlias(source src, target tgt : Organization) {
      src.naam as naam -> tgt.alias = naam;
    }

    group KvkSBIToCodeableConcept(source src, target tgt : CodeableConcept) {
      src -> tgt.coding as coding then {
        src -> coding.system = 'http://minvws.github.io/generiekefuncties-docs/CodeSystem/nl-gf-sbi-cs' "sbiSystem";
        src.sbiCode as code -> coding.code = code;
        src.sbiOmschrijving as omschr -> coding.display = omschr "sbiDisplay";
      } "sbiCoding";
    }

    group KvkAdresToAddress(source src, target tgt : Address) {
      src.volledigAdres as volledigAdres -> tgt.text = volledigAdres;
      src.straatnaam as straat -> tgt.line = cast(straat, 'string') as addrLine then {
        straat -> addrLine.extension as ext then {
          straat -> ext.url = 'http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-streetName' "streetNameExtUrl";
          straat -> ext.value = straat "streetNameExtValue";
        } "streetNameExt";
      };
      src.huisnummer as huisnr -> tgt.line = cast(huisnr, 'string') as addrLine2 then {
        huisnr -> addrLine2.extension as ext then {
          huisnr -> ext.url = 'http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-houseNumber' "houseNumberExtUrl";
          huisnr -> ext.value = cast(huisnr, 'string') "houseNumberExtValue";
        } "houseNumberExt";
      };
      src.huisletter as huisltr -> tgt.line = cast(huisltr, 'string') as addrLine3 then {
        huisltr -> addrLine3.extension as ext then {
          huisltr -> ext.url = 'http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-buildingNumberSuffix' "houseLetterExtUrl";
          huisltr -> ext.value = huisltr "houseLetterExtValue";
        } "houseLetterExt";
      };
      src.huisnummerToevoeging as huisnrToev -> tgt.line = cast(huisnrToev, 'string') as addrLine4 then {
        huisnrToev -> addrLine4.extension as ext then {
          huisnrToev -> ext.url = 'http://hl7.org/fhir/StructureDefinition/iso21090-ADXP-additionalLocator' "houseNumberAdditionExtUrl";
          huisnrToev -> ext.value = huisnrToev "houseNumberAdditionExtValue";
        } "houseNumberAdditionExt";
      };
      src.postcode as pc -> tgt.postalCode = pc;
      src.plaats as plaats -> tgt.city = plaats;
      src.land as land -> tgt.country = land;
      src -> tgt.use = 'work' "setUse";
    }

    group KvkWebsiteToContactPoint(source src, target tgt : ContactPoint) {
      src -> tgt.system = 'url' "setSystem";
      src as url -> tgt.value = url "setValue";
      src -> tgt.use = 'work' "setUse";
    }