diff --git a/hapi-fhir-structures-dev/src/test/java/ca/uhn/fhir/parser/MixedResourcesTest.java b/hapi-fhir-structures-dev/src/test/java/ca/uhn/fhir/parser/MixedResourcesTest.java
index 2201e2cf591..7c69d480123 100644
--- a/hapi-fhir-structures-dev/src/test/java/ca/uhn/fhir/parser/MixedResourcesTest.java
+++ b/hapi-fhir-structures-dev/src/test/java/ca/uhn/fhir/parser/MixedResourcesTest.java
@@ -1,13 +1,35 @@
package ca.uhn.fhir.parser;
+import static org.junit.Assert.*;
+
import org.junit.Test;
+import ca.uhn.fhir.context.FhirContext;
+import ca.uhn.fhir.model.dstu.resource.Appointment;
+import ca.uhn.fhir.model.primitive.DateTimeDt;
+
public class MixedResourcesTest {
+ private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(MixedResourcesTest.class);
@Test
public void testMixedResources() {
+ // dstu
+ Appointment a1 = new Appointment();
+ a1.getSchedule().addEvent().setStart(new DateTimeDt("2001-01-02T12:00:00"));
+
+ ca.uhn.fhir.model.dev.resource.Appointment a2 = new ca.uhn.fhir.model.dev.resource.Appointment();
+ a2.getStartElement().setValueAsString("2001-01-02T12:00:00");
+
+ IParser parser = new FhirContext().newXmlParser();
+ String string = parser.encodeResourceToString(a1);
+ ourLog.info(string);
+ assertEquals("
- The easiest way to get started with HAPI-FHIR is to either download the
- source code from our
- Git Repository
- , or to use Maven:
+ Important note to users of HAPI 0.7 and before: The section below
+ references "hapi-fhir-structures-dstu-[version].jar", which was added for
+ HAPI 0.8 (and this version has not yet been released). If you are using HAPI
+ FHIR 0.7 or before, you only need to include the
+ To use HAPI in your application, at a minimum you need to include the HAPI-FHIR core
+ JAR
+ If you use Maven, you can include these JARs with the following dependency tags:
+ HAPI also has a
+ If you are using Maven, ad the following dependency to include DEV resources:
+
@@ -51,6 +90,12 @@
+ Non Maven users can often also find snapshot builds in the Maven repository
+ manually by searching
+ here.
+ hapi-fhir-base
+ JAR, not the structures one.
+ hapi-fhir-base-[version].jar
, as well as at least one "structures" JAR.
+ The structures JAR contains classes with the resource and datatype definitions for a given
+ version of FHIR. At this time, the only official release of FHIR is the "DSTU1" release,
+ which is available by including the hapi-fhir-structures-dstu-[version].jar
.
+ hapi-fhir-structures-dev-[version].jar
, which
+ contains the latest versions of the releases. You can include this JAR on
+ your classpath if you want to use resources that were created or updated by
+ HL7 after the DSTU1 release. Be warned though that using these resources
+ can lead to incompatibility between your application and other applications
+ if those applications use libraries that do not support DEV resources.
+
+ HAPI requires SLF4j for logging support, and it is recommended to include + an underlying logging framework such as Logback. See the + logging documentation for + more information. +
+ +