FHIR Release 3 (STU) 4

This page is part of the FHIR Specification (v3.0.2: (v4.0.1: R4 - Mixed Normative and STU 3). ) in it's permanent home (it will always be available at this URL). The current version which supercedes this version is 5.0.0 . For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4 R3 R4 R3

Patient Administration Work Group Maturity Level : N/A Ballot Standards Status : Informative Security Category : Business Compartments : Not linked to any defined compartments

R2 : R3 Converson : R4 Conversion maps for HealthcareService.

Functional status for this map: 1 test that all execute ok. 1 fail All tests pass round-trip testing and all 1 r3 resources are valid. invalid (0 errors). ( see documentation)

map "http://hl7.org/fhir/StructureMap/HealthcareService2to3" = "R2 to R3 Conversions for HealthcareService"

uses "http://hl7.org/fhir/DSTU2/StructureDefinition/HealthcareService" alias HealthcareServiceR2 as source
uses "http://hl7.org/fhir/StructureDefinition/HealthcareService" alias HealthcareService as target

imports "http://hl7.org/fhir/StructureMap/*2to3"

group for type+types HealthcareService extends DomainResource
  input src : HealthcareServiceR2 as source
  input tgt : HealthcareService as target

map "http://hl7.org/fhir/StructureMap/HealthcareService3to4" = "R3 to R4 Conversions for HealthcareService"


  "HealthcareService-identifier" : for src.identifier make tgt.identifier
  "HealthcareService-providedBy" : for src.providedBy make tgt.providedBy
  "HealthcareService-serviceCategory" : for src.serviceCategory make tgt.category
  "HealthcareService-serviceType" : for src.serviceType as v then hsvcType(v, tgt)
  "HealthcareService-location" : for src.location make tgt.location
  "HealthcareService-serviceName" : for src.serviceName make tgt.name
  "HealthcareService-comment" : for src.comment make tgt.comment
  "HealthcareService-extraDetails" : for src.extraDetails make tgt.extraDetails
  "HealthcareService-photo" : for src.photo make tgt.photo
  "HealthcareService-telecom" : for src.telecom make tgt.telecom
  "HealthcareService-coverageArea" : for src.coverageArea make tgt.coverageArea
  "HealthcareService-serviceProvisionCode" : for src.serviceProvisionCode make tgt.serviceProvisionCode
  "HealthcareService-eligibility" : for src.eligibility make tgt.eligibility
  "HealthcareService-eligibilityNote" : for src.eligibilityNote make tgt.eligibilityNote
  "HealthcareService-programName" : for src.programName make tgt.programName
  "HealthcareService-characteristic" : for src.characteristic make tgt.characteristic
  "HealthcareService-referralMethod" : for src.referralMethod make tgt.referralMethod
  "HealthcareService-appointmentRequired" : for src.appointmentRequired make tgt.appointmentRequired
  "HealthcareService-availableTime" : for src.availableTime as vs0 make tgt.availableTime as vt0 then hsvcAvailable(vs0, vt0)
  "HealthcareService-notAvailable" : for src.notAvailable as vs0 make tgt.notAvailable as vt0 then hsvcNotAvailable(vs0, vt0)
  "HealthcareService-availabilityExceptions" : for src.availabilityExceptions make tgt.availabilityExceptions
endgroup

uses "http://hl7.org/fhir/3.0/StructureDefinition/HealthcareService" alias HealthcareServiceR3 as source
uses "http://hl7.org/fhir/StructureDefinition/HealthcareService" alias HealthcareService as target


group hsvcAvailable extends BackboneElement
  input src as source
  input tgt as target

imports "http://hl7.org/fhir/StructureMap/*3to4"


  "HealthcareService.availableTime-daysOfWeek" : for src.daysOfWeek make tgt.daysOfWeek
  "HealthcareService.availableTime-allDay" : for src.allDay make tgt.allDay
  "HealthcareService.availableTime-availableStartTime" : for src.availableStartTime make tgt.availableStartTime
  "HealthcareService.availableTime-availableEndTime" : for src.availableEndTime make tgt.availableEndTime
endgroup

group HealthcareService(source src : HealthcareServiceR3, target tgt : HealthcareService) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.active -> tgt.active;
  src.providedBy -> tgt.providedBy;
  src.category -> tgt.category;
  src.type -> tgt.type;
  src.specialty -> tgt.specialty;
  src.location -> tgt.location;
  src.name -> tgt.name;
  src.comment -> tgt.comment;
  src.extraDetails -> tgt.extraDetails;
  src.photo -> tgt.photo;
  src.telecom -> tgt.telecom;
  src.coverageArea -> tgt.coverageArea;
  src.serviceProvisionCode -> tgt.serviceProvisionCode;
  src.eligibility as vs -> tgt.eligibility as vt then eligibility(vs, vt, src);
  src.programName as v ->  tgt.program as cc,  cc.text = v;
  src.characteristic -> tgt.characteristic;
  src.referralMethod -> tgt.referralMethod;
  src.appointmentRequired -> tgt.appointmentRequired;
  src.availableTime as vs -> tgt.availableTime as vt then availableTime(vs, vt);
  src.notAvailable as vs -> tgt.notAvailable as vt then notAvailable(vs, vt);
  src.availabilityExceptions -> tgt.availabilityExceptions;
  src.endpoint -> tgt.endpoint;
}


group hsvcNotAvailable extends BackboneElement
  input src as source
  input tgt as target

group eligibility(source src, target tgt, source res) {
  src as vs -> tgt.code as vt then CodeableConcept(vs, vt) "code";
  res.eligibilityNote -> tgt.comment;
}


  "HealthcareService.notAvailable-description" : for src.description make tgt.description
  "HealthcareService.notAvailable-during" : for src.during make tgt.during
endgroup

group availableTime(source src, target tgt) extends BackboneElement {
  src.daysOfWeek -> tgt.daysOfWeek;
  src.allDay -> tgt.allDay;
  src.availableStartTime -> tgt.availableStartTime;
  src.availableEndTime -> tgt.availableEndTime;
}


group hsvcType extends BackboneElement
  input src as source
  input tgt as target

group notAvailable(source src, target tgt) extends BackboneElement {
  src.description -> tgt.description;
  src.during -> tgt.during;
}


  "HealthcareService.serviceType-type" : for src.type make tgt.type
  "HealthcareService.serviceType-speciality" : for src.specialty make tgt.specialty
endgroup


map "http://hl7.org/fhir/StructureMap/HealthcareService3to2" = "R3 to R2 Conversion for HealthcareService"

uses "http://hl7.org/fhir/StructureDefinition/HealthcareService" alias HealthcareService as source
uses "http://hl7.org/fhir/DSTU2/StructureDefinition/HealthcareService" alias HealthcareServiceR2 as target

map "http://hl7.org/fhir/StructureMap/HealthcareService4to3" = "R4 to R3 Conversion for HealthcareService"


imports "http://hl7.org/fhir/StructureMap/*3to2"

uses "http://hl7.org/fhir/StructureDefinition/HealthcareService" alias HealthcareService as source
uses "http://hl7.org/fhir/3.0/StructureDefinition/HealthcareService" alias HealthcareServiceR3 as target


group for type+types  HealthcareService extends DomainResource
  input src : HealthcareService as source
  input tgt : HealthcareServiceR2 as target

imports "http://hl7.org/fhir/StructureMap/*4to3"


  "HealthcareService-identifier" : for src.identifier make tgt.identifier
  "HealthcareService-providedBy" : for src.providedBy make tgt.providedBy
  "HealthcareService-serviceCategory" : for src.category make tgt.serviceCategory
  "HealthcareService-serviceType" : for src.type as vs make tgt.serviceType as vt, vt.type as vt then CodeableConcept(vs, vt)
  "HealthcareService-speciality" : for src.specialty as vs make tgt.serviceType as vt first, vt.specialty as vt then CodeableConcept(vs, vt) // put all the specialties on the first type
  "HealthcareService-location" : for src.location make tgt.location
  "HealthcareService-serviceName" : for src.name make tgt.serviceName
  "HealthcareService-comment" : for src.comment make tgt.comment
  "HealthcareService-extraDetails" : for src.extraDetails make tgt.extraDetails
  "HealthcareService-photo" : for src.photo make tgt.photo
  "HealthcareService-telecom" : for src.telecom make tgt.telecom
  "HealthcareService-coverageArea" : for src.coverageArea make tgt.coverageArea
  "HealthcareService-serviceProvisionCode" : for src.serviceProvisionCode make tgt.serviceProvisionCode
  "HealthcareService-eligibility" : for src.eligibility make tgt.eligibility
  "HealthcareService-eligibilityNote" : for src.eligibilityNote make tgt.eligibilityNote
  "HealthcareService-programName" : for src.programName make tgt.programName
  "HealthcareService-characteristic" : for src.characteristic make tgt.characteristic
  "HealthcareService-referralMethod" : for src.referralMethod make tgt.referralMethod
  "HealthcareService-appointmentRequired" : for src.appointmentRequired make tgt.appointmentRequired
  "HealthcareService-availableTime" : for src.availableTime as vs0 make tgt.availableTime as vt0 then hsvcAvailable(vs0, vt0)
  "HealthcareService-notAvailable" : for src.notAvailable as vs0 make tgt.notAvailable as vt0 then hsvcNotAvailable(vs0, vt0)
  "HealthcareService-availabilityExceptions" : for src.availabilityExceptions make tgt.availabilityExceptions
endgroup

group HealthcareService(source src : HealthcareService, target tgt : HealthcareServiceR3) extends DomainResource <<type+>> {
  src.identifier -> tgt.identifier;
  src.active -> tgt.active;
  src.providedBy -> tgt.providedBy;
  src.category -> tgt.category;
  src.type -> tgt.type;
  src.specialty -> tgt.specialty;
  src.location -> tgt.location;
  src.name -> tgt.name;
  src.comment -> tgt.comment;
  src.extraDetails -> tgt.extraDetails;
  src.photo -> tgt.photo;
  src.telecom -> tgt.telecom;
  src.coverageArea -> tgt.coverageArea;
  src.serviceProvisionCode -> tgt.serviceProvisionCode;
  src.eligibility as vs -> tgt.eligibility as vt then eligibility(vs, vt, tgt);
  src.program as cc then {
    cc.text -> tgt.programName;
  };
  src.characteristic -> tgt.characteristic;
  src.referralMethod -> tgt.referralMethod;
  src.appointmentRequired -> tgt.appointmentRequired;
  src.availableTime as vs -> tgt.availableTime as vt then availableTime(vs, vt);
  src.notAvailable as vs -> tgt.notAvailable as vt then notAvailable(vs, vt);
  src.availabilityExceptions -> tgt.availabilityExceptions;
  src.endpoint -> tgt.endpoint;
}


group hsvcAvailable extends BackboneElement
  input src as source
  input tgt as target

group eligibility(source src, target tgt, target res) {
  src.code as vs then CodeableConcept(vs, tgt);
  src.comment -> res.eligibilityNote;
}


  "HealthcareService.availableTime-daysOfWeek" : for src.daysOfWeek make tgt.daysOfWeek
  "HealthcareService.availableTime-allDay" : for src.allDay make tgt.allDay
  "HealthcareService.availableTime-availableStartTime" : for src.availableStartTime make tgt.availableStartTime
  "HealthcareService.availableTime-availableEndTime" : for src.availableEndTime make tgt.availableEndTime
endgroup

group availableTime(source src, target tgt) extends BackboneElement {
  src.daysOfWeek -> tgt.daysOfWeek;
  src.allDay -> tgt.allDay;
  src.availableStartTime -> tgt.availableStartTime;
  src.availableEndTime -> tgt.availableEndTime;
}


group hsvcNotAvailable extends BackboneElement
  input src as source
  input tgt as target

group notAvailable(source src, target tgt) extends BackboneElement {
  src.description -> tgt.description;
  src.during -> tgt.during;
}


  "HealthcareService.notAvailable-description" : for src.description make tgt.description
  "HealthcareService.notAvailable-during" : for src.during make tgt.during
endgroup


<p>No validation errors - all conversions are clean</p>