Class VersionConversionService

java.lang.Object
org.hl7.fhir.convertors.VersionConversionService

public class VersionConversionService extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    VersionConversionService(boolean system, String txServer)
    use the package manager to load relevant conversion packages, and then initialise internally as required
  • Method Summary

    Modifier and Type
    Method
    Description
    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)
    convert from one version to another.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 required

      not thread safe

      Parameters:
      system - - true if the software is running in system context, not in a user context
      txServer - - 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 convert
      srcVersion - - the version of the resource to convert
      dstVersion - - 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 fails
      IOException