Class 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
    • Method Detail

      • 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()
      • 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.FHIRFormatError,
                                                         org.hl7.fhir.exceptions.FHIRException
        Throws:
        IOException
        org.hl7.fhir.exceptions.FHIRFormatError
        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.FHIRFormatError,
                                                         org.hl7.fhir.exceptions.FHIRException
        Throws:
        IOException
        org.hl7.fhir.exceptions.FHIRFormatError
        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
      • main

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