Package org.hl7.fhir.convertors
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
convert
(byte[] source, boolean r2ToR3, org.hl7.fhir.dstu3.elementmodel.Manager.FhirFormat format) void
convert
(InputStream source, OutputStream dest, boolean r2ToR3, org.hl7.fhir.dstu3.elementmodel.Manager.FhirFormat format) org.hl7.fhir.dstu3.model.Resource
convert
(org.hl7.fhir.dstu2.model.Resource source) org.hl7.fhir.dstu2.model.Resource
convert
(org.hl7.fhir.dstu3.model.Resource source) org.hl7.fhir.dstu3.model.Base
createResource
(Object appInfo, org.hl7.fhir.dstu3.model.Base res) org.hl7.fhir.dstu3.model.Base
createType
(Object appInfo, String name) List
<org.hl7.fhir.dstu3.model.Resource> org.hl7.fhir.dstu3.formats.IParser.OutputStyle
getStyle()
void
static void
List
<org.hl7.fhir.dstu3.model.Base> performSearch
(Object appContext, String url) org.hl7.fhir.dstu3.model.Base
resolveReference
(Object appContext, String url) void
setMappingLibrary
(InputStream stream) void
setMappingLibrary
(String source) void
setR2Definitions
(InputStream stream) void
setR2Definitions
(String source) void
setR3Definitions
(InputStream stream) void
setR3Definitions
(String source) void
setStyle
(org.hl7.fhir.dstu3.formats.IParser.OutputStyle style) org.hl7.fhir.dstu3.model.Coding
-
Constructor Details
-
R2R3ConversionManager
public R2R3ConversionManager()
-
-
Method Details
-
main
- Throws:
IOException
org.hl7.fhir.exceptions.FHIRException
-
getStyle
-
setStyle
-
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
- Specified by:
log
in interfaceorg.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 interfaceorg.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 interfaceorg.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 interfaceorg.hl7.fhir.dstu3.utils.StructureMapUtilities.ITransformerServices
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
resolveReference
- Specified by:
resolveReference
in interfaceorg.hl7.fhir.dstu3.utils.StructureMapUtilities.ITransformerServices
-
performSearch
- Specified by:
performSearch
in interfaceorg.hl7.fhir.dstu3.utils.StructureMapUtilities.ITransformerServices
-