You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2018/02/19 11:25:01 UTC

[camel] 02/03: CAMEL-12221: Polished camel-fhir dataformat.

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit faf2d75771c0a25a1f16a1fee00a94cf87a68b94
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Feb 18 15:53:59 2018 +0100

    CAMEL-12221: Polished camel-fhir dataformat.
---
 .../org/apache/camel/builder/DataFormatClause.java | 12 +++----
 .../camel/model/dataformat/FhirJsonDataFormat.java | 28 ++++++++++++++--
 .../camel/model/dataformat/FhirXmlDataFormat.java  | 28 +++++++++++++++-
 components/camel-fhir/pom.xml                      |  2 +-
 .../src/main/docs/fhirJson-dataformat.adoc         | 11 +++++--
 .../src/main/docs/fhirXml-dataformat.adoc          |  7 ++--
 .../camel/component/fhir/FhirJsonDataFormat.java   | 38 ++++++++++++----------
 .../camel/component/fhir/FhirXmlDataFormat.java    | 38 ++++++++++++----------
 .../component/fhir/FhirJsonDataFormatTest.java     |  2 +-
 .../camel/component/fhir/PatientProcessor.java     |  3 +-
 .../fhir/json/FhirJsonDataFormatSpringTest.xml     |  2 +-
 .../FhirJsonDataFormatConfiguration.java           | 15 ++++++++-
 .../springboot/FhirXmlDataFormatConfiguration.java | 13 ++++++++
 13 files changed, 145 insertions(+), 54 deletions(-)

diff --git a/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java b/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java
index 239ae9a..6fe6512 100644
--- a/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java
+++ b/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java
@@ -1188,28 +1188,28 @@ public class DataFormatClause<T extends ProcessorDefinition<?>> {
     /**
      * Uses the FHIR JSON data format
      */
-    public T fhirJson(Object fhirContext) {
+    public T fhirJson() {
         FhirJsonDataFormat jsonDataFormat = new FhirJsonDataFormat();
-        jsonDataFormat.setFhirContext(fhirContext);
         return dataFormat(jsonDataFormat);
     }
 
-    public T fhirJson() {
+    public T fhirJson(String version) {
         FhirJsonDataFormat jsonDataFormat = new FhirJsonDataFormat();
+        jsonDataFormat.setFhirVersion(version);
         return dataFormat(jsonDataFormat);
     }
 
     /**
      * Uses the FHIR XML data format
      */
-    public T fhirXml(Object fhirContext) {
+    public T fhirXml() {
         FhirXmlDataFormat fhirXmlDataFormat = new FhirXmlDataFormat();
-        fhirXmlDataFormat.setFhirContext(fhirContext);
         return dataFormat(fhirXmlDataFormat);
     }
 
-    public T fhirXml() {
+    public T fhirXml(String version) {
         FhirXmlDataFormat fhirXmlDataFormat = new FhirXmlDataFormat();
+        fhirXmlDataFormat.setFhirVersion(version);
         return dataFormat(fhirXmlDataFormat);
     }
 
diff --git a/camel-core/src/main/java/org/apache/camel/model/dataformat/FhirJsonDataFormat.java b/camel-core/src/main/java/org/apache/camel/model/dataformat/FhirJsonDataFormat.java
index f477f9a..f84e178 100644
--- a/camel-core/src/main/java/org/apache/camel/model/dataformat/FhirJsonDataFormat.java
+++ b/camel-core/src/main/java/org/apache/camel/model/dataformat/FhirJsonDataFormat.java
@@ -18,22 +18,29 @@ package org.apache.camel.model.dataformat;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
 import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.spi.DataFormat;
 import org.apache.camel.spi.Metadata;
 
 /**
- * The FHIR JSON data format is used to marshall/unmarshall to/from FHIR objects to/from JSON.
+ * The FHIR JSon data format is used to marshall/unmarshall to/from FHIR objects to/from JSON.
  */
-@Metadata(firstVersion = "2.21.0", label = "dataformat,transformation,json,hl7", title = "FHIR JSON")
+@Metadata(firstVersion = "2.21.0", label = "dataformat,transformation,hl7", title = "FHIR JSon")
 @XmlRootElement(name = "fhirJson")
 @XmlAccessorType(XmlAccessType.FIELD)
 public class FhirJsonDataFormat extends DataFormatDefinition {
 
+    @XmlTransient @Metadata(label = "advanced")
     private Object fhirContext;
 
+    @XmlAttribute @Metadata(enums = "DSTU2,DSTU2_HL7ORG,DSTU2_1,DSTU3,R4", defaultValue = "DSTU3")
+    private String fhirVersion;
+
     public FhirJsonDataFormat() {
         super("fhirJson");
     }
@@ -46,10 +53,27 @@ public class FhirJsonDataFormat extends DataFormatDefinition {
         this.fhirContext = fhirContext;
     }
 
+    public String getFhirVersion() {
+        return fhirVersion;
+    }
+
+    /**
+     * The version of FHIR to use. Possible values are: DSTU2,DSTU2_HL7ORG,DSTU2_1,DSTU3,R4
+     */
+    public void setFhirVersion(String fhirVersion) {
+        this.fhirVersion = fhirVersion;
+    }
+
     @Override
     protected void configureDataFormat(DataFormat dataFormat, CamelContext camelContext) {
+        if (getContentTypeHeader() != null) {
+            setProperty(camelContext, dataFormat, "contentTypeHeader", getContentTypeHeader());
+        }
         if (getFhirContext() != null) {
             setProperty(camelContext, dataFormat, "fhirContext", getFhirContext());
         }
+        if (getFhirVersion() != null) {
+            setProperty(camelContext, dataFormat, "fhirVersion", getFhirVersion());
+        }
     }
 }
diff --git a/camel-core/src/main/java/org/apache/camel/model/dataformat/FhirXmlDataFormat.java b/camel-core/src/main/java/org/apache/camel/model/dataformat/FhirXmlDataFormat.java
index 09c168f..bdd4586 100644
--- a/camel-core/src/main/java/org/apache/camel/model/dataformat/FhirXmlDataFormat.java
+++ b/camel-core/src/main/java/org/apache/camel/model/dataformat/FhirXmlDataFormat.java
@@ -18,7 +18,10 @@ package org.apache.camel.model.dataformat;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
 import org.apache.camel.CamelContext;
 import org.apache.camel.model.DataFormatDefinition;
 import org.apache.camel.spi.DataFormat;
@@ -27,13 +30,19 @@ import org.apache.camel.spi.Metadata;
 /**
  * The FHIR XML data format is used to marshall/unmarshall from/to FHIR objects to/from XML.
  */
-@Metadata(firstVersion = "2.21.0", label = "dataformat,transformation,xml,hl7", title = "FHIR XML")
+@Metadata(firstVersion = "2.21.0", label = "dataformat,transformation,hl7", title = "FHIR XML")
 @XmlRootElement(name = "fhirXml")
 @XmlAccessorType(XmlAccessType.FIELD)
 public class FhirXmlDataFormat extends DataFormatDefinition {
 
+    @XmlTransient
+    @Metadata(label = "advanced")
     private Object fhirContext;
 
+    @XmlAttribute
+    @Metadata(enums = "DSTU2,DSTU2_HL7ORG,DSTU2_1,DSTU3,R4", defaultValue = "DSTU3")
+    private String fhirVersion;
+
     public FhirXmlDataFormat() {
         super("fhirXml");
     }
@@ -46,10 +55,27 @@ public class FhirXmlDataFormat extends DataFormatDefinition {
         this.fhirContext = fhirContext;
     }
 
+    public String getFhirVersion() {
+        return fhirVersion;
+    }
+
+    /**
+     * The version of FHIR to use. Possible values are: DSTU2,DSTU2_HL7ORG,DSTU2_1,DSTU3,R4
+     */
+    public void setFhirVersion(String fhirVersion) {
+        this.fhirVersion = fhirVersion;
+    }
+
     @Override
     protected void configureDataFormat(DataFormat dataFormat, CamelContext camelContext) {
+        if (getContentTypeHeader() != null) {
+            setProperty(camelContext, dataFormat, "contentTypeHeader", getContentTypeHeader());
+        }
         if (getFhirContext() != null) {
             setProperty(camelContext, dataFormat, "fhirContext", getFhirContext());
         }
+        if (getFhirVersion() != null) {
+            setProperty(camelContext, dataFormat, "fhirVersion", getFhirVersion());
+        }
     }
 }
diff --git a/components/camel-fhir/pom.xml b/components/camel-fhir/pom.xml
index 46ab716..1c297d3 100644
--- a/components/camel-fhir/pom.xml
+++ b/components/camel-fhir/pom.xml
@@ -13,7 +13,7 @@
   <packaging>jar</packaging>
 
   <name>Camel :: Fhir</name>
-  <description>Camel Fhir support</description>
+  <description>Camel FHIR HL7 support</description>
 
   <properties>
     <camel.osgi.export.service>
diff --git a/components/camel-fhir/src/main/docs/fhirJson-dataformat.adoc b/components/camel-fhir/src/main/docs/fhirJson-dataformat.adoc
index d82f982..f25e9c4 100644
--- a/components/camel-fhir/src/main/docs/fhirJson-dataformat.adoc
+++ b/components/camel-fhir/src/main/docs/fhirJson-dataformat.adoc
@@ -1,5 +1,10 @@
-== FHIR JSON DataFormat
+[[fhirJson-dataformat]]
+== FHIR JSon DataFormat
 *Available as of Camel version 2.21*
+*Available as of Camel version 2.21*
+*Available as of Camel version 2.21*
+
+
 
 The FHIR-JSON Data Format leverages
 link:https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/JsonParser.java[HAPI-FHIR's]
@@ -8,14 +13,14 @@ JSON parser to parse to/from JSON format to/from a HAPI-FHIR's `IBaseResource`.
 ### FHIR JSON Format Options
 
 // dataformat options: START
-The FHIR JSON dataformat supports 2 options which are listed below.
+The FHIR JSon dataformat supports 2 options which are listed below.
 
 
 
 [width="100%",cols="2s,1m,1m,6",options="header"]
 |===
 | Name | Default | Java Type | Description
-| fhirContext | FhirContext.forDstu3() | FhirContext | The FhirContext to create the JsonParser with.
+| fhirVersion | DSTU3 | String | The version of FHIR to use. Possible values are: DSTU2DSTU2_HL7ORGDSTU2_1DSTU3R4
 | contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |===
 // dataformat options: END
\ No newline at end of file
diff --git a/components/camel-fhir/src/main/docs/fhirXml-dataformat.adoc b/components/camel-fhir/src/main/docs/fhirXml-dataformat.adoc
index 4771554..63d92d6 100644
--- a/components/camel-fhir/src/main/docs/fhirXml-dataformat.adoc
+++ b/components/camel-fhir/src/main/docs/fhirXml-dataformat.adoc
@@ -1,5 +1,8 @@
+[[fhirXml-dataformat]]
 == FHIR XML DataFormat
 *Available as of Camel version 2.21*
+*Available as of Camel version 2.21*
+
 
 The FHIR-XML Data Format leverages
 link:https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/XmlParser.java[HAPI-FHIR's]
@@ -15,7 +18,7 @@ The FHIR XML dataformat supports 2 options which are listed below.
 [width="100%",cols="2s,1m,1m,6",options="header"]
 |===
 | Name | Default | Java Type | Description
-| fhirContext | FhirContext.forDstu3() | FhirContext | The FhirContext to create the XmlParser with.
+| fhirVersion | DSTU3 | String | The version of FHIR to use. Possible values are: DSTU2DSTU2_HL7ORGDSTU2_1DSTU3R4
 | contentTypeHeader | false | Boolean | Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML or application/json for data formats marshalling to JSon etc.
 |===
-// dataformat options: END
\ No newline at end of file
+// dataformat options: END
diff --git a/components/camel-fhir/src/main/java/org/apache/camel/component/fhir/FhirJsonDataFormat.java b/components/camel-fhir/src/main/java/org/apache/camel/component/fhir/FhirJsonDataFormat.java
index 9551c93..05fbfc7 100644
--- a/components/camel-fhir/src/main/java/org/apache/camel/component/fhir/FhirJsonDataFormat.java
+++ b/components/camel-fhir/src/main/java/org/apache/camel/component/fhir/FhirJsonDataFormat.java
@@ -22,6 +22,7 @@ import java.io.OutputStream;
 import java.io.OutputStreamWriter;
 
 import ca.uhn.fhir.context.FhirContext;
+import ca.uhn.fhir.context.FhirVersionEnum;
 import org.apache.camel.Exchange;
 import org.apache.camel.spi.DataFormat;
 import org.apache.camel.spi.DataFormatName;
@@ -31,15 +32,23 @@ import org.hl7.fhir.instance.model.api.IBaseResource;
 public class FhirJsonDataFormat extends ServiceSupport implements DataFormat, DataFormatName {
 
     private FhirContext fhirContext;
+    private String fhirVersion;
     private boolean contentTypeHeader = true;
 
+    public FhirContext getFhirContext() {
+        return fhirContext;
+    }
 
-    public FhirJsonDataFormat(FhirContext fhirContext) {
+    public void setFhirContext(FhirContext fhirContext) {
         this.fhirContext = fhirContext;
     }
 
-    public FhirJsonDataFormat() {
-        this.fhirContext = FhirContext.forDstu3();
+    public String getFhirVersion() {
+        return fhirVersion;
+    }
+
+    public void setFhirVersion(String fhirVersion) {
+        this.fhirVersion = fhirVersion;
     }
 
     public boolean isContentTypeHeader() {
@@ -50,14 +59,6 @@ public class FhirJsonDataFormat extends ServiceSupport implements DataFormat, Da
         this.contentTypeHeader = contentTypeHeader;
     }
 
-    public FhirContext getFhirContext() {
-        return fhirContext;
-    }
-
-    public void setFhirContext(FhirContext fhirContext) {
-        this.fhirContext = fhirContext;
-    }
-
     @Override
     public void marshal(Exchange exchange, Object o, OutputStream outputStream) throws Exception {
         IBaseResource iBaseResource;
@@ -66,13 +67,11 @@ public class FhirJsonDataFormat extends ServiceSupport implements DataFormat, Da
         } else {
             iBaseResource = (IBaseResource) o;
         }
+
         fhirContext.newJsonParser().encodeResourceToWriter(iBaseResource, new OutputStreamWriter(outputStream));
+
         if (isContentTypeHeader()) {
-            if (exchange.hasOut()) {
-                exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "application/json");
-            } else {
-                exchange.getIn().setHeader(Exchange.CONTENT_TYPE, "application/json");
-            }
+            exchange.getMessage().setHeader(Exchange.CONTENT_TYPE, "application/json");
         }
     }
 
@@ -88,7 +87,12 @@ public class FhirJsonDataFormat extends ServiceSupport implements DataFormat, Da
 
     @Override
     protected void doStart() throws Exception {
-        // noop
+        if (fhirContext == null && fhirVersion != null) {
+            FhirVersionEnum version = FhirVersionEnum.valueOf(fhirVersion);
+            fhirContext = new FhirContext(version);
+        } else if (fhirContext == null) {
+            fhirContext = FhirContext.forDstu3();
+        }
     }
 
     @Override
diff --git a/components/camel-fhir/src/main/java/org/apache/camel/component/fhir/FhirXmlDataFormat.java b/components/camel-fhir/src/main/java/org/apache/camel/component/fhir/FhirXmlDataFormat.java
index 429f926..42c13dd 100644
--- a/components/camel-fhir/src/main/java/org/apache/camel/component/fhir/FhirXmlDataFormat.java
+++ b/components/camel-fhir/src/main/java/org/apache/camel/component/fhir/FhirXmlDataFormat.java
@@ -22,6 +22,7 @@ import java.io.OutputStream;
 import java.io.OutputStreamWriter;
 
 import ca.uhn.fhir.context.FhirContext;
+import ca.uhn.fhir.context.FhirVersionEnum;
 import org.apache.camel.Exchange;
 import org.apache.camel.spi.DataFormat;
 import org.apache.camel.spi.DataFormatName;
@@ -31,15 +32,23 @@ import org.hl7.fhir.instance.model.api.IBaseResource;
 public class FhirXmlDataFormat extends ServiceSupport implements DataFormat, DataFormatName {
     
     private FhirContext fhirContext;
+    private String fhirVersion;
     private boolean contentTypeHeader = true;
 
+    public FhirContext getFhirContext() {
+        return fhirContext;
+    }
 
-    public FhirXmlDataFormat(FhirContext fhirContext) {
+    public void setFhirContext(FhirContext fhirContext) {
         this.fhirContext = fhirContext;
     }
 
-    public FhirXmlDataFormat() {
-        this.fhirContext = FhirContext.forDstu3();
+    public String getFhirVersion() {
+        return fhirVersion;
+    }
+
+    public void setFhirVersion(String fhirVersion) {
+        this.fhirVersion = fhirVersion;
     }
 
     public boolean isContentTypeHeader() {
@@ -50,14 +59,6 @@ public class FhirXmlDataFormat extends ServiceSupport implements DataFormat, Dat
         this.contentTypeHeader = contentTypeHeader;
     }
 
-    public FhirContext getFhirContext() {
-        return fhirContext;
-    }
-
-    public void setFhirContext(FhirContext fhirContext) {
-        this.fhirContext = fhirContext;
-    }
-
     @Override
     public void marshal(Exchange exchange, Object o, OutputStream outputStream) throws Exception {
         IBaseResource iBaseResource;
@@ -66,13 +67,11 @@ public class FhirXmlDataFormat extends ServiceSupport implements DataFormat, Dat
         } else {
             iBaseResource = (IBaseResource) o;
         }
+
         fhirContext.newXmlParser().encodeResourceToWriter(iBaseResource, new OutputStreamWriter(outputStream));
+
         if (isContentTypeHeader()) {
-            if (exchange.hasOut()) {
-                exchange.getOut().setHeader(Exchange.CONTENT_TYPE, "application/xml");
-            } else {
-                exchange.getIn().setHeader(Exchange.CONTENT_TYPE, "application/xml");
-            }
+            exchange.getMessage().setHeader(Exchange.CONTENT_TYPE, "application/json");
         }
     }
 
@@ -88,7 +87,12 @@ public class FhirXmlDataFormat extends ServiceSupport implements DataFormat, Dat
 
     @Override
     protected void doStart() throws Exception {
-        // noop
+        if (fhirContext == null && fhirVersion != null) {
+            FhirVersionEnum version = FhirVersionEnum.valueOf(fhirVersion);
+            fhirContext = new FhirContext(version);
+        } else if (fhirContext == null) {
+            fhirContext = FhirContext.forDstu3();
+        }
     }
 
     @Override
diff --git a/components/camel-fhir/src/test/java/org/apache/camel/component/fhir/FhirJsonDataFormatTest.java b/components/camel-fhir/src/test/java/org/apache/camel/component/fhir/FhirJsonDataFormatTest.java
index 8ecbcd4..4bb538c 100644
--- a/components/camel-fhir/src/test/java/org/apache/camel/component/fhir/FhirJsonDataFormatTest.java
+++ b/components/camel-fhir/src/test/java/org/apache/camel/component/fhir/FhirJsonDataFormatTest.java
@@ -78,7 +78,7 @@ public class FhirJsonDataFormatTest extends CamelTestSupport {
             public void configure() {
 
                 from("direct:marshal")
-                        .marshal().fhirJson()
+                        .marshal().fhirJson("DSTU3")
                         .to("mock:result");
 
                 from("direct:unmarshal")
diff --git a/components/camel-fhir/src/test/java/org/apache/camel/component/fhir/PatientProcessor.java b/components/camel-fhir/src/test/java/org/apache/camel/component/fhir/PatientProcessor.java
index e1c0416..1063ae9 100644
--- a/components/camel-fhir/src/test/java/org/apache/camel/component/fhir/PatientProcessor.java
+++ b/components/camel-fhir/src/test/java/org/apache/camel/component/fhir/PatientProcessor.java
@@ -18,7 +18,6 @@ package org.apache.camel.component.fhir;
 
 import java.util.List;
 import ca.uhn.fhir.model.base.resource.BaseOperationOutcome;
-import ca.uhn.fhir.rest.api.MethodOutcome;
 import ca.uhn.fhir.rest.api.PreferReturnEnum;
 import ca.uhn.fhir.rest.client.api.IGenericClient;
 import ca.uhn.fhir.rest.gclient.IClientExecutable;
@@ -32,7 +31,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Simple Patient precessor that converts the Patient segment of a {@link ORU_R01} message into a FHIR dtsu3 {@link Patient}.
+ * Simple Patient processor that converts the Patient segment of a {@link ORU_R01} message into a FHIR dtsu3 {@link Patient}.
  */
 public class PatientProcessor implements Processor {
     private final Logger log = LoggerFactory.getLogger(PatientProcessor.class.getName());
diff --git a/components/camel-fhir/src/test/resources/org/apache/camel/dataformat/fhir/json/FhirJsonDataFormatSpringTest.xml b/components/camel-fhir/src/test/resources/org/apache/camel/dataformat/fhir/json/FhirJsonDataFormatSpringTest.xml
index a1d3cf1..6bc1f07 100644
--- a/components/camel-fhir/src/test/resources/org/apache/camel/dataformat/fhir/json/FhirJsonDataFormatSpringTest.xml
+++ b/components/camel-fhir/src/test/resources/org/apache/camel/dataformat/fhir/json/FhirJsonDataFormatSpringTest.xml
@@ -28,7 +28,7 @@
     <route>
       <from uri="direct:marshal"/>
       <marshal>
-        <fhirJson/>
+        <fhirJson fhirVersion="DSTU3"/>
       </marshal>
       <to uri="mock:result"/>
     </route>
diff --git a/platforms/spring-boot/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirJsonDataFormatConfiguration.java b/platforms/spring-boot/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirJsonDataFormatConfiguration.java
index d3bedf0..50406d3 100644
--- a/platforms/spring-boot/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirJsonDataFormatConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirJsonDataFormatConfiguration.java
@@ -21,7 +21,7 @@ import org.apache.camel.spring.boot.DataFormatConfigurationPropertiesCommon;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 
 /**
- * The FHIR JSON data format is used to marshall/unmarshall to/from FHIR objects
+ * The FHIR JSon data format is used to marshall/unmarshall to/from FHIR objects
  * to/from JSON.
  * 
  * Generated by camel-package-maven-plugin - do not edit this file!
@@ -33,6 +33,11 @@ public class FhirJsonDataFormatConfiguration
             DataFormatConfigurationPropertiesCommon {
 
     /**
+     * The version of FHIR to use. Possible values are:
+     * DSTU2DSTU2_HL7ORGDSTU2_1DSTU3R4
+     */
+    private String fhirVersion = "DSTU3";
+    /**
      * Whether the data format should set the Content-Type header with the type
      * from the data format if the data format is capable of doing so. For
      * example application/xml for data formats marshalling to XML or
@@ -40,6 +45,14 @@ public class FhirJsonDataFormatConfiguration
      */
     private Boolean contentTypeHeader = false;
 
+    public String getFhirVersion() {
+        return fhirVersion;
+    }
+
+    public void setFhirVersion(String fhirVersion) {
+        this.fhirVersion = fhirVersion;
+    }
+
     public Boolean getContentTypeHeader() {
         return contentTypeHeader;
     }
diff --git a/platforms/spring-boot/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirXmlDataFormatConfiguration.java b/platforms/spring-boot/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirXmlDataFormatConfiguration.java
index 6aa90fe..ccbff9a 100644
--- a/platforms/spring-boot/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirXmlDataFormatConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-fhir-starter/src/main/java/org/apache/camel/component/fhir/springboot/FhirXmlDataFormatConfiguration.java
@@ -33,6 +33,11 @@ public class FhirXmlDataFormatConfiguration
             DataFormatConfigurationPropertiesCommon {
 
     /**
+     * The version of FHIR to use. Possible values are:
+     * DSTU2DSTU2_HL7ORGDSTU2_1DSTU3R4
+     */
+    private String fhirVersion = "DSTU3";
+    /**
      * Whether the data format should set the Content-Type header with the type
      * from the data format if the data format is capable of doing so. For
      * example application/xml for data formats marshalling to XML or
@@ -40,6 +45,14 @@ public class FhirXmlDataFormatConfiguration
      */
     private Boolean contentTypeHeader = false;
 
+    public String getFhirVersion() {
+        return fhirVersion;
+    }
+
+    public void setFhirVersion(String fhirVersion) {
+        this.fhirVersion = fhirVersion;
+    }
+
     public Boolean getContentTypeHeader() {
         return contentTypeHeader;
     }

-- 
To stop receiving notification emails like this one, please contact
davsclaus@apache.org.