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 versaTo 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
Constructors Constructor Description R2R3ConversionManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]convert(byte[] source, boolean r2ToR3, org.hl7.fhir.dstu3.elementmodel.Manager.FhirFormat format)voidconvert(InputStream source, OutputStream dest, boolean r2ToR3, org.hl7.fhir.dstu3.elementmodel.Manager.FhirFormat format)org.hl7.fhir.dstu3.model.Resourceconvert(org.hl7.fhir.dstu2.model.Resource source)org.hl7.fhir.dstu2.model.Resourceconvert(org.hl7.fhir.dstu3.model.Resource source)org.hl7.fhir.dstu3.model.BasecreateResource(Object appInfo, org.hl7.fhir.dstu3.model.Base res)org.hl7.fhir.dstu3.model.BasecreateType(Object appInfo, String name)List<org.hl7.fhir.dstu3.model.Resource>getExtras()org.hl7.fhir.dstu3.formats.IParser.OutputStylegetStyle()voidlog(String message)static voidmain(String[] args)List<org.hl7.fhir.dstu3.model.Base>performSearch(Object appContext, String url)org.hl7.fhir.dstu3.model.BaseresolveReference(Object appContext, String url)voidsetMappingLibrary(InputStream stream)voidsetMappingLibrary(String source)voidsetR2Definitions(InputStream stream)voidsetR2Definitions(String source)voidsetR3Definitions(InputStream stream)voidsetR3Definitions(String source)voidsetStyle(org.hl7.fhir.dstu3.formats.IParser.OutputStyle style)org.hl7.fhir.dstu3.model.Codingtranslate(Object appInfo, org.hl7.fhir.dstu3.model.Coding source, String conceptMapUrl)
-
-
-
Constructor Detail
-
R2R3ConversionManager
public R2R3ConversionManager()
-
-
Method Detail
-
main
public static void main(String[] args) throws IOException, org.hl7.fhir.exceptions.FHIRException
- Throws:
IOExceptionorg.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)
-
setR2Definitions
public void setR2Definitions(InputStream stream) throws IOException, org.hl7.fhir.exceptions.FHIRException
- Throws:
IOExceptionorg.hl7.fhir.exceptions.FHIRException
-
setR2Definitions
public void setR2Definitions(String source) throws IOException, org.hl7.fhir.exceptions.FHIRException
- Throws:
IOExceptionorg.hl7.fhir.exceptions.FHIRException
-
setR3Definitions
public void setR3Definitions(InputStream stream) throws IOException, org.hl7.fhir.exceptions.FHIRException
- Throws:
IOExceptionorg.hl7.fhir.exceptions.FHIRException
-
setR3Definitions
public void setR3Definitions(String source) throws IOException, org.hl7.fhir.exceptions.FHIRException
- Throws:
IOExceptionorg.hl7.fhir.exceptions.FHIRException
-
setMappingLibrary
public void setMappingLibrary(InputStream stream) throws IOException, org.hl7.fhir.exceptions.FHIRException
- Throws:
IOExceptionorg.hl7.fhir.exceptions.FHIRException
-
setMappingLibrary
public void setMappingLibrary(String source) throws IOException, org.hl7.fhir.exceptions.FHIRException
- Throws:
IOExceptionorg.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.FHIRExceptionIOException
-
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.FHIRExceptionIOException
-
convert
public org.hl7.fhir.dstu2.model.Resource convert(org.hl7.fhir.dstu3.model.Resource source) throws IOException, org.hl7.fhir.exceptions.FHIRException
- Throws:
IOExceptionorg.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:
IOExceptionorg.hl7.fhir.exceptions.FHIRException
-
log
public void log(String message)
- Specified by:
login 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:
createTypein 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:
createResourcein 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:
translatein interfaceorg.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:
resolveReferencein interfaceorg.hl7.fhir.dstu3.utils.StructureMapUtilities.ITransformerServices
-
performSearch
public List<org.hl7.fhir.dstu3.model.Base> performSearch(Object appContext, String url)
- Specified by:
performSearchin interfaceorg.hl7.fhir.dstu3.utils.StructureMapUtilities.ITransformerServices
-
-