National Directory of Healthcare Providers & Services (NDH) Implementation Guide
2.0.0-current - ci-build United States of America flag

National Directory of Healthcare Providers & Services (NDH) Implementation Guide, published by HL7 International / Patient Administration. This guide is not an authorized publication; it is the continuous build for version 2.0.0-current built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/fhir-us-ndh/ and changes regularly. See the Directory of published versions

StructureMap: This StructureMap defines the mapping from Plan-Net Location to NDH Location.

Official URL: http://hl7.org/fhir/us/ndh/StructureMap/PlanNetToNdhLocationSM Version: 2.0.0-current
Standards status: Trial-use Maturity Level: 4 Computable Name: PlanNetToNdhLocationSM
Other Identifiers: OID:2.999.1.2.3.4.43.4

This StructureMap defines the mapping from Plan-Net Location to NDH Location.

Language: en

map "http://hl7.org/fhir/us/ndh/StructureMap/PlanNetToNdhLocationSM" = "PlanNetToNdhLocationSM"

// This StructureMap defines the mapping from Plan-Net Location to NDH Location.

uses "http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/plannet-Location" alias LocationPN as source
uses "http://hl7.org/fhir/us/ndh/StructureDefinition/ndh-Location" alias LocationNDH as target

group PlanNetToNdhLocation(source src : LocationPN, target tgt : LocationNDH) {
  src.language as vLanguage -> tgt.language = vLanguage;
  src.text as vText -> tgt.text = vText;
  src.extension as vNewPatientsSrc where (url = 'http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/newpatients') -> tgt.extension as vNewPatientsTgt then {
    vNewPatientsSrc as vNewPatientsForUrl -> vNewPatientsTgt.url = 'http://hl7.org/fhir/us/ndh/StructureDefinition/base-ext-newpatients' "setNewPatientsUrl";
    vNewPatientsSrc.extension as vFromNetworkSrc where (url = 'fromNetwork') -> vNewPatientsTgt.extension = vFromNetworkSrc "copyNewPatientsFromNetwork";
    vNewPatientsSrc.extension as vCharacteristicsSrc where (url = 'characteristics') -> vNewPatientsTgt.extension = vCharacteristicsSrc "copyNewPatientsCharacteristics";
    vNewPatientsSrc.extension as vAcceptingPatientsSrc where (url = 'acceptingPatients') -> vNewPatientsTgt.extension as vAcceptingPatientsTgt then {
      vAcceptingPatientsSrc.url as vAcceptingPatientsUrl -> vAcceptingPatientsTgt.url = vAcceptingPatientsUrl "copyAcceptingPatientsUrl";
      vAcceptingPatientsSrc.value as vAcceptingPatientsValueSrc where (coding.exists()) -> vAcceptingPatientsTgt.value = create('CodeableConcept') as vAcceptingPatientsValueTgt then {
        vAcceptingPatientsValueSrc.coding as vAcceptingPatientsCodingSrc where (system = 'http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/AcceptingPatientsCS') -> vAcceptingPatientsValueTgt.coding = translate(vAcceptingPatientsCodingSrc, 'http://hl7.org/fhir/us/ndh/ConceptMap/plannet-to-ndh-accepting-patients', 'Coding') "translateAcceptingPatientsCoding";
        vAcceptingPatientsValueSrc.coding as vAcceptingPatientsOtherCodingSrc where (system != 'http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/AcceptingPatientsCS') -> vAcceptingPatientsValueTgt.coding = vAcceptingPatientsOtherCodingSrc "copyAcceptingPatientsOtherCoding";
      } "copyAcceptingPatientsValue";
    } "copyNewPatientsAcceptingPatients";
  } "copyNewPatientsExtension";
  src.extension as vAccessibilitySrc where (url = 'http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/accessibility') -> tgt.extension as vAccessibilityTgt then {
    vAccessibilitySrc as vAccessibilityForUrl -> vAccessibilityTgt.url = 'http://hl7.org/fhir/us/ndh/StructureDefinition/base-ext-accessibility' "setAccessibilityUrl";
    vAccessibilitySrc.value as vAccessibilityValueSrc where (coding.exists()) -> vAccessibilityTgt.value = create('CodeableConcept') as vAccessibilityValueTgt then {
      vAccessibilityValueSrc.coding as vAccessibilityCodingSrc where (system = 'http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/AccessibilityCS') -> vAccessibilityValueTgt.coding = translate(vAccessibilityCodingSrc, 'http://hl7.org/fhir/us/ndh/ConceptMap/plannet-to-ndh-accessibility', 'Coding') "translateAccessibilityCoding";
      vAccessibilityValueSrc.coding as vAccessibilityOtherCodingSrc where (system != 'http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/AccessibilityCS') -> vAccessibilityValueTgt.coding = vAccessibilityOtherCodingSrc "copyAccessibilityOtherCoding";
    } "copyAccessibilityValue";
  } "copyAccessibilityExtension";
  src.extension as vRegion where (url = 'http://hl7.org/fhir/StructureDefinition/location-boundary-geojson') -> tgt.extension = vRegion "copyRegionExtension";
  src.identifier as vIdentifier -> tgt.identifier = vIdentifier;
  src.status as vStatus -> tgt.status = vStatus;
  src.operationalStatus as vOperationalStatus -> tgt.operationalStatus = vOperationalStatus;
  src.name as vName -> tgt.name = vName;
  src.alias as vAlias -> tgt.alias = vAlias;
  src.description as vDescription -> tgt.description = vDescription;
  src.type as vType -> tgt.type = vType;
  src.telecom as vTelecomSrc -> tgt.telecom as vTelecomTgt then {
    vTelecomSrc.system as vTelecomSystem -> vTelecomTgt.system = vTelecomSystem "copyTelecomSystem";
    vTelecomSrc.value as vTelecomValue -> vTelecomTgt.value = vTelecomValue "copyTelecomValue";
    vTelecomSrc.use as vTelecomUse -> vTelecomTgt.use = vTelecomUse "copyTelecomUse";
    vTelecomSrc.rank as vTelecomRank -> vTelecomTgt.rank = vTelecomRank "copyTelecomRank";
    vTelecomSrc.period as vTelecomPeriod -> vTelecomTgt.period = vTelecomPeriod "copyTelecomPeriod";
    vTelecomSrc.extension as vDroppedContactpointAvailabletimeSrc where (url = 'http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/contactpoint-availabletime') "dropPlanNetContactpointAvailabletime"; // intentionally not mapped because ContactPointAvailableTime was removed from NDH.
    vTelecomSrc.extension as vDroppedViaIntermediarySrc where (url = 'http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/via-intermediary') "dropPlanNetViaIntermediary"; // intentionally not mapped because ViaIntermediary was removed from NDH.
  } "copyTelecom";
  src.address as vAddress -> tgt.address = vAddress;
  src.physicalType as vPhysicalType -> tgt.physicalType = vPhysicalType;
  src.position as vPosition -> tgt.position = vPosition;
  src.managingOrganization as vManagingOrganization -> tgt.managingOrganization = vManagingOrganization;
  src.partOf as vPartOf -> tgt.partOf = vPartOf;
  src.hoursOfOperation as vHoursOfOperation -> tgt.hoursOfOperation = vHoursOfOperation;
  src.availabilityExceptions as vAvailabilityExceptions -> tgt.availabilityExceptions = vAvailabilityExceptions;
  src.endpoint as vEndpoint -> tgt.endpoint = vEndpoint;
  src.meta as vMetaSrc -> tgt.meta as vMetaTgt then {
    vMetaSrc.lastUpdated as vLastUpdated -> vMetaTgt.lastUpdated = vLastUpdated "copyMetaLastUpdated";
    vMetaSrc as vMetaProfileSrc -> vMetaTgt.profile = 'http://hl7.org/fhir/us/ndh/StructureDefinition/ndh-Location' "setTargetProfile";
  } "copyMeta";
}