Class R2R3ConversionManager

java.lang.Object
org.hl7.fhir.convertors.R2R3ConversionManager
All Implemented Interfaces:
org.hl7.fhir.dstu3.utils.StructureMapUtilities.ITransformerServices

public class R2R3ConversionManager extends Object implements org.hl7.fhir.dstu3.utils.StructureMapUtilities.ITransformerServices
This class manages conversion from R2 to R3 and vice versa

To use this class, do the following:

- provide a stream or path (file or URL) that points to R2 definitions (from http://hl7.org/fhir/DSTU2/downloads.html) - provide a stream or a path (file or URL) that points to the R3 definitions (from http://hl7.org/fhir/STU3/downloads.html) - provide a stream or a path (file or URL) that points to R2/R3 map files (from http://hl7.org/fhir/r2r3maps.zip)

- call convert() (can call this more than once, but not multithread safe)

Author:
Grahame Grieve
  • Constructor Details

  • Method Details

    • main

      public static void main(String[] args) throws IOException, org.hl7.fhir.exceptions.FHIRException
      Throws:
      IOException
      org.hl7.fhir.exceptions.FHIRException
    • getStyle

      public org.hl7.fhir.dstu3.formats.IParser.OutputStyle getStyle()
    • setStyle

      public void setStyle(org.hl7.fhir.dstu3.formats.IParser.OutputStyle style)
    • getExtras

      public List<org.hl7.fhir.dstu3.model.Resource> getExtras()
    • setR2Definitions

      public void setR2Definitions(InputStream stream) throws IOException, org.hl7.fhir.exceptions.FHIRException
      Throws:
      IOException
      org.hl7.fhir.exceptions.FHIRException
    • setR2Definitions

      public void setR2Definitions(String source) throws IOException, org.hl7.fhir.exceptions.FHIRException
      Throws:
      IOException
      org.hl7.fhir.exceptions.FHIRException
    • setR3Definitions

      public void setR3Definitions(InputStream stream) throws IOException, org.hl7.fhir.exceptions.FHIRException
      Throws:
      IOException
      org.hl7.fhir.exceptions.FHIRException
    • setR3Definitions

      public void setR3Definitions(String source) throws IOException, org.hl7.fhir.exceptions.FHIRException
      Throws:
      IOException
      org.hl7.fhir.exceptions.FHIRException
    • setMappingLibrary

      public void setMappingLibrary(InputStream stream) throws IOException, org.hl7.fhir.exceptions.FHIRException
      Throws:
      IOException
      org.hl7.fhir.exceptions.FHIRException
    • setMappingLibrary

      public void setMappingLibrary(String source) throws IOException, org.hl7.fhir.exceptions.FHIRException
      Throws:
      IOException
      org.hl7.fhir.exceptions.FHIRException
    • convert

      public byte[] convert(byte[] source, boolean r2ToR3, org.hl7.fhir.dstu3.elementmodel.Manager.FhirFormat format) throws org.hl7.fhir.exceptions.FHIRException, IOException
      Throws:
      org.hl7.fhir.exceptions.FHIRException
      IOException
    • convert

      public void convert(InputStream source, OutputStream dest, boolean r2ToR3, org.hl7.fhir.dstu3.elementmodel.Manager.FhirFormat format) throws org.hl7.fhir.exceptions.FHIRException, IOException
      Throws:
      org.hl7.fhir.exceptions.FHIRException
      IOException
    • convert

      public org.hl7.fhir.dstu2.model.Resource convert(org.hl7.fhir.dstu3.model.Resource source) throws IOException, org.hl7.fhir.exceptions.FHIRException
      Throws:
      IOException
      org.hl7.fhir.exceptions.FHIRException
    • convert

      public org.hl7.fhir.dstu3.model.Resource convert(org.hl7.fhir.dstu2.model.Resource source) throws IOException, org.hl7.fhir.exceptions.FHIRException
      Throws:
      IOException
      org.hl7.fhir.exceptions.FHIRException
    • log

      public void log(String message)
      Specified by:
      log in interface org.hl7.fhir.dstu3.utils.StructureMapUtilities.ITransformerServices
    • createType

      public org.hl7.fhir.dstu3.model.Base createType(Object appInfo, String name) throws org.hl7.fhir.exceptions.FHIRException
      Specified by:
      createType in interface org.hl7.fhir.dstu3.utils.StructureMapUtilities.ITransformerServices
      Throws:
      org.hl7.fhir.exceptions.FHIRException
    • createResource

      public org.hl7.fhir.dstu3.model.Base createResource(Object appInfo, org.hl7.fhir.dstu3.model.Base res)
      Specified by:
      createResource in interface org.hl7.fhir.dstu3.utils.StructureMapUtilities.ITransformerServices
    • translate

      public org.hl7.fhir.dstu3.model.Coding translate(Object appInfo, org.hl7.fhir.dstu3.model.Coding source, String conceptMapUrl) throws org.hl7.fhir.exceptions.FHIRException
      Specified by:
      translate in interface org.hl7.fhir.dstu3.utils.StructureMapUtilities.ITransformerServices
      Throws:
      org.hl7.fhir.exceptions.FHIRException
    • resolveReference

      public org.hl7.fhir.dstu3.model.Base resolveReference(Object appContext, String url)
      Specified by:
      resolveReference in interface org.hl7.fhir.dstu3.utils.StructureMapUtilities.ITransformerServices
    • performSearch

      public List<org.hl7.fhir.dstu3.model.Base> performSearch(Object appContext, String url)
      Specified by:
      performSearch in interface org.hl7.fhir.dstu3.utils.StructureMapUtilities.ITransformerServices