Package org.hl7.fhir.convertors
Class VersionConversionService
java.lang.Object
org.hl7.fhir.convertors.VersionConversionService
-
Constructor Summary
ConstructorDescriptionVersionConversionService
(boolean system, String txServer) use the package manager to load relevant conversion packages, and then initialise internally as required -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
convert
(byte[] src, org.hl7.fhir.r4.elementmodel.Manager.FhirFormat srcFormat, org.hl7.fhir.r4.model.FhirPublication srcVersion, org.hl7.fhir.r4.elementmodel.Manager.FhirFormat dstFormat, org.hl7.fhir.r4.model.FhirPublication dstVersion, boolean useJava, org.hl7.fhir.r4.formats.IParser.OutputStyle style) convert from one version to another.
-
Constructor Details
-
VersionConversionService
public VersionConversionService(boolean system, String txServer) throws org.hl7.fhir.exceptions.FHIRException use the package manager to load relevant conversion packages, and then initialise internally as requirednot thread safe
- Parameters:
system
- - true if the software is running in system context, not in a user contexttxServer
- - Address of the terminology server to use (null = use http://tx.fhir.org- Throws:
org.hl7.fhir.exceptions.FHIRException
-
-
Method Details
-
convert
public byte[] convert(byte[] src, org.hl7.fhir.r4.elementmodel.Manager.FhirFormat srcFormat, org.hl7.fhir.r4.model.FhirPublication srcVersion, org.hl7.fhir.r4.elementmodel.Manager.FhirFormat dstFormat, org.hl7.fhir.r4.model.FhirPublication dstVersion, boolean useJava, org.hl7.fhir.r4.formats.IParser.OutputStyle style) throws org.hl7.fhir.exceptions.FHIRException, IOException convert from one version to another.This routine is thread safe
- Parameters:
src
- - the resource to convertsrcVersion
- - the version of the resource to convertdstVersion
- - the target version to convert to- Returns:
- the converted resource
- Throws:
org.hl7.fhir.exceptions.FHIRException
- - if the source resource cannot be parsed, no single path exists from source to dest version, or the conversion process failsIOException
-