From fb5a775fbd66a73d09bca5210695103d394fda8d Mon Sep 17 00:00:00 2001 From: jamesagnew Date: Fri, 9 Jan 2015 22:02:31 -0500 Subject: [PATCH] Add support for bundle entry states --- .../java/ca/uhn/fhir/model/api/Bundle.java | 7 + .../model/api/ResourceMetadataKeyEnum.java | 40 + .../java/ca/uhn/fhir/parser/ParserState.java | 13 +- .../uhn/fhir/rest/server/RestfulServer.java | 6 +- .../ca/uhn/fhir/jpa/dao/FhirResourceDao.java | 4 + hapi-fhir-jpaserver-test/pom.xml | 5 + .../test/CompleteResourceProviderTest.java | 92 ++- .../CompleteResourceProviderTestDstu1.java | 538 ++++++++++++++ .../ca/uhn/fhir/parser/XmlParserTest.java | 18 + pom.xml.orig | 694 ------------------ 10 files changed, 689 insertions(+), 728 deletions(-) create mode 100644 hapi-fhir-jpaserver-test/src/test/java/ca/uhn/fhir/jpa/test/CompleteResourceProviderTestDstu1.java delete mode 100644 pom.xml.orig diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Bundle.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Bundle.java index 6e195700112..63635d2cdb4 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Bundle.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Bundle.java @@ -40,6 +40,7 @@ import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.model.primitive.IntegerDt; import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.model.valueset.BundleEntryStatusEnum; import ca.uhn.fhir.model.valueset.BundleTypeEnum; import ca.uhn.fhir.rest.server.Constants; import ca.uhn.fhir.util.UrlUtil; @@ -174,6 +175,12 @@ public class Bundle extends BaseBundle /* implements IElement */{ } entry.getLinkAlternate().setValue(linkSearch); } + + BundleEntryStatusEnum entryStatus = ResourceMetadataKeyEnum.ENTRY_STATUS.get(theResource); + if (entryStatus != null) { + entry.getStatus().setValueAsEnum(entryStatus); + } + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/ResourceMetadataKeyEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/ResourceMetadataKeyEnum.java index 322dc1a875c..5f5aa638590 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/ResourceMetadataKeyEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/ResourceMetadataKeyEnum.java @@ -29,6 +29,7 @@ import org.apache.commons.lang3.StringUtils; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.InstantDt; +import ca.uhn.fhir.model.valueset.BundleEntryStatusEnum; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; /** @@ -264,6 +265,31 @@ public abstract class ResourceMetadataKeyEnum { } }; + /** + * If present and populated with a {@link BundleEntryStatusEnum}, contains the "bundle entry status", + * which is the value of the status field in the Bundle.entry containing this resource. This value can be + * set to provide a status value of "include" for included resources being returned by a server, or to + * set the value on a transaction, etc. + *

+ * Note that status is only used in FHIR DSTU2 and later. + *

+ *

+ * Values for this key are of type {@link BundleEntryStatusEnum} + *

+ */ + public static final ResourceMetadataKeyEnum ENTRY_STATUS = new ResourceMetadataKeyEnum("ENTRY_STATUS") { + @Override + public BundleEntryStatusEnum get(IResource theResource) { + return getEnumFromMetadataOrNullIfNone(theResource.getResourceMetadata(), ENTRY_STATUS, BundleEntryStatusEnum.class, BundleEntryStatusEnum.VALUESET_BINDER); + } + + @Override + public void put(IResource theResource, BundleEntryStatusEnum theObject) { + theResource.getResourceMetadata().put(ENTRY_STATUS, theObject); + } + }; + + private final String myValue; public ResourceMetadataKeyEnum(String theValue) { @@ -348,6 +374,20 @@ public abstract class ResourceMetadataKeyEnum { + InstantDt.class.getCanonicalName()); } + @SuppressWarnings("unchecked") + private static > T getEnumFromMetadataOrNullIfNone(Map, Object> theResourceMetadata, ResourceMetadataKeyEnum theKey, Class theEnumType, IValueSetEnumBinder theBinder) { + Object retValObj = theResourceMetadata.get(theKey); + if (retValObj == null) { + return null; + } else if (theEnumType.equals(retValObj.getClass())) { + return (T) retValObj; + } else if (retValObj instanceof String) { + return theBinder.fromCodeString((String) retValObj); + } + throw new InternalErrorException("Found an object of type '" + retValObj.getClass().getCanonicalName() + "' in resource metadata for key " + theKey.name() + " - Expected " + + InstantDt.class.getCanonicalName()); + } + private static String getStringFromMetadataOrNullIfNone(Map, Object> theResourceMetadata, ResourceMetadataKeyEnum theKey) { Object retValObj = theResourceMetadata.get(theKey); if (retValObj == null) { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java index 803d7958c91..8790b49a8bb 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java @@ -1009,7 +1009,9 @@ class ParserState { if (!myEntry.getLinkSearch().isEmpty()) { ResourceMetadataKeyEnum.LINK_SEARCH.put(myEntry.getResource(), myEntry.getLinkSearch().getValue()); } - + if (!myEntry.getStatus().isEmpty()) { + ResourceMetadataKeyEnum.ENTRY_STATUS.put(myEntry.getResource(), myEntry.getStatus().getValueAsEnum()); + } } } @@ -1115,13 +1117,18 @@ class ParserState { String baseUrl = myInstance.getLinkBase().getValue(); String version = ResourceMetadataKeyEnum.VERSION.get(nextResource); String resourceName = myContext.getResourceDefinition(nextResource).getName(); - nextResource.setId(new IdDt(baseUrl, resourceName, nextResource.getId().getIdPart(), version)); + String idPart = nextResource.getId().getIdPart(); + if (isNotBlank(idPart)) { + nextResource.setId(new IdDt(baseUrl, resourceName, idPart, version)); + } } String bundleVersion = (String) myInstance.getResourceMetadata().get(ResourceMetadataKeyEnum.VERSION); String baseUrl = myInstance.getLinkBase().getValue(); String id = myInstance.getId().getIdPart(); - myInstance.setId(new IdDt(baseUrl, "Bundle", id, bundleVersion)); + if (isNotBlank(id)) { + myInstance.setId(new IdDt(baseUrl, "Bundle", id, bundleVersion)); + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java index 67126542d2a..41b706419ff 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java @@ -1179,7 +1179,7 @@ public class RestfulServer extends HttpServlet { } while (references.isEmpty() == false); bundle.addResource(next, theContext, theServerBase); - + } /* @@ -1188,7 +1188,9 @@ public class RestfulServer extends HttpServlet { for (IResource next : includedResources) { BundleEntry entry = bundle.addResource(next, theContext, theServerBase); if (theContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU1)) { - entry.getStatus().setValueAsEnum(BundleEntryStatusEnum.INCLUDE); + if (entry.getStatus().isEmpty()) { + entry.getStatus().setValueAsEnum(BundleEntryStatusEnum.INCLUDE); + } } } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java index db69267e2ab..74bcddf756b 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java @@ -75,6 +75,7 @@ import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.InstantDt; +import ca.uhn.fhir.model.valueset.BundleEntryStatusEnum; import ca.uhn.fhir.rest.api.MethodOutcome; import ca.uhn.fhir.rest.api.SortSpec; import ca.uhn.fhir.rest.param.CompositeParam; @@ -533,6 +534,9 @@ public class FhirResourceDao extends BaseFhirDao implements if (!includePids.isEmpty()) { ourLog.info("Loading {} included resources", includePids.size()); resources = loadResourcesById(includePids); + for (IResource next : resources) { + ResourceMetadataKeyEnum.ENTRY_STATUS.put(next, BundleEntryStatusEnum.INCLUDE); + } retVal.addAll(resources); } } while (includePids.size() > 0 && previouslyLoadedPids.size() < getConfig().getIncludeLimit()); diff --git a/hapi-fhir-jpaserver-test/pom.xml b/hapi-fhir-jpaserver-test/pom.xml index 47491689d9f..8992cc2d5f9 100644 --- a/hapi-fhir-jpaserver-test/pom.xml +++ b/hapi-fhir-jpaserver-test/pom.xml @@ -19,6 +19,11 @@ hapi-fhir-jpaserver-base 0.9-SNAPSHOT + + ca.uhn.hapi.fhir + hapi-fhir-structures-dev + 0.9-SNAPSHOT + org.thymeleaf thymeleaf diff --git a/hapi-fhir-jpaserver-test/src/test/java/ca/uhn/fhir/jpa/test/CompleteResourceProviderTest.java b/hapi-fhir-jpaserver-test/src/test/java/ca/uhn/fhir/jpa/test/CompleteResourceProviderTest.java index 415b2b4e2f4..9f3eacd7ba1 100644 --- a/hapi-fhir-jpaserver-test/src/test/java/ca/uhn/fhir/jpa/test/CompleteResourceProviderTest.java +++ b/hapi-fhir-jpaserver-test/src/test/java/ca/uhn/fhir/jpa/test/CompleteResourceProviderTest.java @@ -24,20 +24,22 @@ import ca.uhn.fhir.jpa.provider.JpaSystemProvider; import ca.uhn.fhir.jpa.testutil.RandomServerPortProvider; import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.dstu.composite.PeriodDt; +import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; +import ca.uhn.fhir.model.dev.composite.PeriodDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; -import ca.uhn.fhir.model.dstu.resource.DocumentManifest; -import ca.uhn.fhir.model.dstu.resource.DocumentReference; -import ca.uhn.fhir.model.dstu.resource.Encounter; -import ca.uhn.fhir.model.dstu.resource.ImagingStudy; -import ca.uhn.fhir.model.dstu.resource.Location; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.dstu.resource.Patient; -import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; -import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; +import ca.uhn.fhir.model.dev.resource.DiagnosticOrder; +import ca.uhn.fhir.model.dev.resource.DocumentManifest; +import ca.uhn.fhir.model.dev.resource.DocumentReference; +import ca.uhn.fhir.model.dev.resource.Encounter; +import ca.uhn.fhir.model.dev.resource.ImagingStudy; +import ca.uhn.fhir.model.dev.resource.Location; +import ca.uhn.fhir.model.dev.resource.Organization; +import ca.uhn.fhir.model.dev.resource.Patient; +import ca.uhn.fhir.model.dev.valueset.EncounterClassEnum; +import ca.uhn.fhir.model.dev.valueset.EncounterStateEnum; import ca.uhn.fhir.model.dstu.valueset.NarrativeStatusEnum; import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.model.valueset.BundleEntryStatusEnum; import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator; import ca.uhn.fhir.rest.api.MethodOutcome; import ca.uhn.fhir.rest.client.IGenericClient; @@ -72,7 +74,7 @@ public class CompleteResourceProviderTest { public void testStoreUtf8Characters() throws Exception { Organization org = new Organization(); org.setName("測試醫院"); - org.addIdentifier("urn:system", "testStoreUtf8Characters_01"); + org.addIdentifier().setSystem("urn:system").setValue("testStoreUtf8Characters_01"); IdDt orgId = ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId(); // Read back directly from the DAO @@ -91,6 +93,36 @@ public class CompleteResourceProviderTest { } } + @Test + public void testSearchWithInclude() throws Exception { + Organization org = new Organization(); + org.addIdentifier().setSystem("urn:system").setValue( "testSearchWithInclude01"); + IdDt orgId = ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId(); + + Patient pat = new Patient(); + pat.addIdentifier().setSystem("urn:system").setValue("testSearchWithInclude02"); + pat.getManagingOrganization().setReference(orgId); + ourClient.create().resource(pat).prettyPrint().encodedXml().execute().getId(); + + //@formatter:off + Bundle found = ourClient + .search() + .forResource(Patient.class) + .where(Patient.IDENTIFIER.exactly().systemAndIdentifier("urn:system","testSearchWithInclude02")) + .include(Patient.INCLUDE_MANAGINGORGANIZATION) + .execute(); + //@formatter:on + + assertEquals(2, found.size()); + assertEquals(Patient.class, found.getEntries().get(0).getResource().getClass()); + assertEquals(null, found.getEntries().get(0).getStatus().getValueAsEnum()); + assertEquals(null, found.getEntries().get(0).getResource().getResourceMetadata().get(ResourceMetadataKeyEnum.ENTRY_STATUS)); + assertEquals(Organization.class, found.getEntries().get(1).getResource().getClass()); + assertEquals(BundleEntryStatusEnum.INCLUDE, found.getEntries().get(1).getStatus().getValueAsEnum()); + assertEquals(BundleEntryStatusEnum.INCLUDE, found.getEntries().get(1).getResource().getResourceMetadata().get(ResourceMetadataKeyEnum.ENTRY_STATUS)); + } + + @Test public void testCountParam() throws Exception { // NB this does not get used- The paging provider has its own limits built in @@ -178,7 +210,7 @@ public class CompleteResourceProviderTest { int initialSize = client.search().forResource(DiagnosticOrder.class).execute().size(); DiagnosticOrder res = new DiagnosticOrder(); - res.addIdentifier("urn:foo", "123"); + res.addIdentifier().setSystem("urn:foo").setValue( "123"); client.create().resource(res).execute(); @@ -241,19 +273,19 @@ public class CompleteResourceProviderTest { deleteToken("Encounter", Encounter.SP_IDENTIFIER, "urn:foo", "testDeepChainingE1"); Location l1 = new Location(); - l1.getName().setValue("testDeepChainingL1"); + l1.getNameElement().setValue("testDeepChainingL1"); IdDt l1id = ourClient.create().resource(l1).execute().getId(); Location l2 = new Location(); - l2.getName().setValue("testDeepChainingL2"); + l2.getNameElement().setValue("testDeepChainingL2"); l2.getPartOf().setReference(l1id.toVersionless().toUnqualified()); IdDt l2id = ourClient.create().resource(l2).execute().getId(); Encounter e1 = new Encounter(); e1.addIdentifier().setSystem("urn:foo").setValue("testDeepChainingE1"); - e1.getStatus().setValueAsEnum(EncounterStateEnum.IN_PROGRESS); - e1.getClassElement().setValueAsEnum(EncounterClassEnum.HOME); - ca.uhn.fhir.model.dstu.resource.Encounter.Location location = e1.addLocation(); + e1.getStatusElement().setValueAsEnum(EncounterStateEnum.IN_PROGRESS); + e1.getClassElementElement().setValueAsEnum(EncounterClassEnum.HOME); + ca.uhn.fhir.model.dev.resource.Encounter.Location location = e1.addLocation(); location.getLocation().setReference(l2id.toUnqualifiedVersionless()); location.setPeriod(new PeriodDt().setStartWithSecondsPrecision(new Date()).setEndWithSecondsPrecision(new Date())); IdDt e1id = ourClient.create().resource(e1).execute().getId(); @@ -372,7 +404,7 @@ public class CompleteResourceProviderTest { //@formatter:off Bundle actual = ourClient.search() .forResource(Patient.class) - .where(Patient.PROVIDER.hasId(o1id.getIdPart())) + .where(Patient.ORGANIZATION.hasId(o1id.getIdPart())) .encodedJson().prettyPrint().execute(); //@formatter:on assertEquals(1, actual.size()); @@ -381,7 +413,7 @@ public class CompleteResourceProviderTest { //@formatter:off actual = ourClient.search() .forResource(Patient.class) - .where(Patient.PROVIDER.hasId(o1id.getValue())) + .where(Patient.ORGANIZATION.hasId(o1id.getValue())) .encodedJson().prettyPrint().execute(); //@formatter:on assertEquals(1, actual.size()); @@ -412,12 +444,12 @@ public class CompleteResourceProviderTest { deleteToken("Patient", Patient.SP_IDENTIFIER, "urn:system", "testUpdateRejectsInvalidTypes"); Patient p1 = new Patient(); - p1.addIdentifier("urn:system", "testUpdateRejectsInvalidTypes"); + p1.addIdentifier().setSystem("urn:system").setValue("testUpdateRejectsInvalidTypes"); p1.addName().addFamily("Tester").addGiven("testUpdateRejectsInvalidTypes"); IdDt p1id = ourClient.create().resource(p1).execute().getId(); Organization p2 = new Organization(); - p2.getName().setValue("testUpdateRejectsInvalidTypes"); + p2.getNameElement().setValue("testUpdateRejectsInvalidTypes"); try { ourClient.update().resource(p2).withId("Organization/" + p1id.getIdPart()).execute(); fail(); @@ -462,21 +494,25 @@ public class CompleteResourceProviderTest { @BeforeClass public static void beforeClass() throws Exception { int port = RandomServerPortProvider.findFreePort(); + RestfulServer restServer = new RestfulServer(); + ourFhirCtx = FhirContext.forDev(); + restServer.setFhirContext(ourFhirCtx); + String serverBase = "http://localhost:" + port + "/fhir/context"; - ourAppCtx = new ClassPathXmlApplicationContext("hapi-fhir-server-resourceproviders-dstu1.xml", "fhir-spring-test-config.xml"); + ourAppCtx = new ClassPathXmlApplicationContext("hapi-fhir-server-resourceproviders-dev.xml", "fhir-spring-test-config.xml"); ourDaoConfig = (DaoConfig) ourAppCtx.getBean(DaoConfig.class); - ourOrganizationDao = (IFhirResourceDao) ourAppCtx.getBean("myOrganizationDaoDstu1", IFhirResourceDao.class); + ourOrganizationDao = (IFhirResourceDao) ourAppCtx.getBean("myOrganizationDaoDev", IFhirResourceDao.class); - List rpsDstu1 = (List) ourAppCtx.getBean("myResourceProvidersDstu1", List.class); - restServer.setResourceProviders(rpsDstu1); + List rpsDev = (List) ourAppCtx.getBean("myResourceProvidersDev", List.class); + restServer.setResourceProviders(rpsDev); restServer.getFhirContext().setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator()); - IFhirSystemDao systemDao = (IFhirSystemDao) ourAppCtx.getBean("mySystemDaoDstu1", IFhirSystemDao.class); + IFhirSystemDao systemDao = (IFhirSystemDao) ourAppCtx.getBean("mySystemDaoDev", IFhirSystemDao.class); JpaSystemProvider systemProv = new JpaSystemProvider(systemDao); restServer.setPlainProviders(systemProv); @@ -494,8 +530,6 @@ public class CompleteResourceProviderTest { ourServer.setHandler(proxyHandler); ourServer.start(); - ourFhirCtx = restServer.getFhirContext(); - ourClient = ourFhirCtx.newRestfulGenericClient(serverBase); ourClient.registerInterceptor(new LoggingInterceptor(true)); diff --git a/hapi-fhir-jpaserver-test/src/test/java/ca/uhn/fhir/jpa/test/CompleteResourceProviderTestDstu1.java b/hapi-fhir-jpaserver-test/src/test/java/ca/uhn/fhir/jpa/test/CompleteResourceProviderTestDstu1.java new file mode 100644 index 00000000000..41463903822 --- /dev/null +++ b/hapi-fhir-jpaserver-test/src/test/java/ca/uhn/fhir/jpa/test/CompleteResourceProviderTestDstu1.java @@ -0,0 +1,538 @@ +package ca.uhn.fhir.jpa.test; + +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import org.apache.commons.io.IOUtils; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletContextHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.jpa.dao.DaoConfig; +import ca.uhn.fhir.jpa.dao.IFhirResourceDao; +import ca.uhn.fhir.jpa.dao.IFhirSystemDao; +import ca.uhn.fhir.jpa.provider.JpaSystemProvider; +import ca.uhn.fhir.jpa.testutil.RandomServerPortProvider; +import ca.uhn.fhir.model.api.Bundle; +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; +import ca.uhn.fhir.model.dstu.composite.PeriodDt; +import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.resource.DiagnosticOrder; +import ca.uhn.fhir.model.dstu.resource.DocumentManifest; +import ca.uhn.fhir.model.dstu.resource.DocumentReference; +import ca.uhn.fhir.model.dstu.resource.Encounter; +import ca.uhn.fhir.model.dstu.resource.ImagingStudy; +import ca.uhn.fhir.model.dstu.resource.Location; +import ca.uhn.fhir.model.dstu.resource.Organization; +import ca.uhn.fhir.model.dstu.resource.Patient; +import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; +import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; +import ca.uhn.fhir.model.dstu.valueset.NarrativeStatusEnum; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.model.valueset.BundleEntryStatusEnum; +import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator; +import ca.uhn.fhir.rest.api.MethodOutcome; +import ca.uhn.fhir.rest.client.IGenericClient; +import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; +import ca.uhn.fhir.rest.gclient.StringClientParam; +import ca.uhn.fhir.rest.gclient.TokenClientParam; +import ca.uhn.fhir.rest.server.FifoMemoryPagingProvider; +import ca.uhn.fhir.rest.server.IResourceProvider; +import ca.uhn.fhir.rest.server.RestfulServer; +import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; + +public class CompleteResourceProviderTestDstu1 { + + private static ClassPathXmlApplicationContext ourAppCtx; + private static IGenericClient ourClient; + private static FhirContext ourFhirCtx; + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(CompleteResourceProviderTestDstu1.class); + // private static IFhirResourceDao ourObservationDao; + // private static IFhirResourceDao ourPatientDao; + // private static IFhirResourceDao ourQuestionnaireDao; + private static Server ourServer; + private static IFhirResourceDao ourOrganizationDao; + private static DaoConfig ourDaoConfig; + + // private static JpaConformanceProvider ourConfProvider; + + /** + * Test for issue #60 + */ + @Test + public void testStoreUtf8Characters() throws Exception { + Organization org = new Organization(); + org.setName("測試醫院"); + org.addIdentifier().setSystem("urn:system").setValue("testStoreUtf8Characters_01"); + IdDt orgId = ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId(); + + // Read back directly from the DAO + { + Organization returned = ourOrganizationDao.read(orgId); + String val = ourFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(returned); + ourLog.info(val); + assertThat(val, containsString("")); + } + // Read back through the HTTP API + { + Organization returned = ourClient.read(Organization.class, orgId); + String val = ourFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(returned); + ourLog.info(val); + assertThat(val, containsString("")); + } + } + + @Test + public void testSearchWithInclude() throws Exception { + Organization org = new Organization(); + org.addIdentifier().setSystem("urn:system").setValue( "testSearchWithInclude01"); + IdDt orgId = ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId(); + + Patient pat = new Patient(); + pat.addIdentifier().setSystem("urn:system").setValue("testSearchWithInclude02"); + pat.getManagingOrganization().setReference(orgId); + ourClient.create().resource(pat).prettyPrint().encodedXml().execute().getId(); + + //@formatter:off + Bundle found = ourClient + .search() + .forResource(Patient.class) + .where(Patient.IDENTIFIER.exactly().systemAndIdentifier("urn:system","testSearchWithInclude02")) + .include(Patient.INCLUDE_MANAGINGORGANIZATION) + .execute(); + //@formatter:on + + assertEquals(2, found.size()); + assertEquals(Patient.class, found.getEntries().get(0).getResource().getClass()); + assertEquals(null, found.getEntries().get(0).getStatus().getValueAsEnum()); + assertEquals(null, found.getEntries().get(0).getResource().getResourceMetadata().get(ResourceMetadataKeyEnum.ENTRY_STATUS)); + assertEquals(Organization.class, found.getEntries().get(1).getResource().getClass()); + assertEquals(BundleEntryStatusEnum.INCLUDE, found.getEntries().get(1).getStatus().getValueAsEnum()); + assertEquals(BundleEntryStatusEnum.INCLUDE, found.getEntries().get(1).getResource().getResourceMetadata().get(ResourceMetadataKeyEnum.ENTRY_STATUS)); + } + + + @Test + public void testCountParam() throws Exception { + // NB this does not get used- The paging provider has its own limits built in + ourDaoConfig.setHardSearchLimit(100); + + List resources = new ArrayList<>(); + for (int i = 0; i < 100; i++) { + Organization org = new Organization(); + org.setName("testCountParam_01"); + resources.add(org); + } + ourClient.transaction().withResources(resources).prettyPrint().encodedXml().execute(); + + Bundle found = ourClient.search().forResource(Organization.class).where(Organization.NAME.matches().value("testCountParam_01")).limitTo(10).execute(); + assertEquals(100, found.getTotalResults().getValue().intValue()); + assertEquals(10, found.getEntries().size()); + + found = ourClient.search().forResource(Organization.class).where(Organization.NAME.matches().value("testCountParam_01")).limitTo(999).execute(); + assertEquals(100, found.getTotalResults().getValue().intValue()); + assertEquals(50, found.getEntries().size()); + + } + + /** + * See issue #52 + */ + @Test + public void testImagingStudyResources() throws Exception { + IGenericClient client = ourClient; + + int initialSize = client.search().forResource(ImagingStudy.class).execute().size(); + + String resBody = IOUtils.toString(CompleteResourceProviderTestDstu1.class.getResource("/imagingstudy.json")); + client.create().resource(resBody).execute(); + + int newSize = client.search().forResource(ImagingStudy.class).execute().size(); + + assertEquals(1, newSize - initialSize); + + } + + /** + * See issue #52 + */ + @Test + public void testDocumentManifestResources() throws Exception { + IGenericClient client = ourClient; + + int initialSize = client.search().forResource(DocumentManifest.class).execute().size(); + + String resBody = IOUtils.toString(CompleteResourceProviderTestDstu1.class.getResource("/documentmanifest.json")); + client.create().resource(resBody).execute(); + + int newSize = client.search().forResource(DocumentManifest.class).execute().size(); + + assertEquals(1, newSize - initialSize); + + } + + /** + * See issue #52 + */ + @Test + public void testDocumentReferenceResources() throws Exception { + IGenericClient client = ourClient; + + int initialSize = client.search().forResource(DocumentReference.class).execute().size(); + + String resBody = IOUtils.toString(CompleteResourceProviderTestDstu1.class.getResource("/documentreference.json")); + client.create().resource(resBody).execute(); + + int newSize = client.search().forResource(DocumentReference.class).execute().size(); + + assertEquals(1, newSize - initialSize); + + } + + /** + * See issue #52 + */ + @Test + public void testDiagnosticOrderResources() throws Exception { + IGenericClient client = ourClient; + + int initialSize = client.search().forResource(DiagnosticOrder.class).execute().size(); + + DiagnosticOrder res = new DiagnosticOrder(); + res.addIdentifier().setSystem("urn:foo").setValue( "123"); + + client.create().resource(res).execute(); + + int newSize = client.search().forResource(DiagnosticOrder.class).execute().size(); + + assertEquals(1, newSize - initialSize); + + } + + private void delete(String theResourceType, String theParamName, String theParamValue) { + Bundle resources = ourClient.search().forResource(theResourceType).where(new StringClientParam(theParamName).matches().value(theParamValue)).execute(); + for (IResource next : resources.toListOfResources()) { + ourLog.info("Deleting resource: {}", next.getId()); + ourClient.delete().resource(next).execute(); + } + } + + private void deleteToken(String theResourceType, String theParamName, String theParamSystem, String theParamValue) { + Bundle resources = ourClient.search().forResource(theResourceType).where(new TokenClientParam(theParamName).exactly().systemAndCode(theParamSystem, theParamValue)).execute(); + for (IResource next : resources.toListOfResources()) { + ourLog.info("Deleting resource: {}", next.getId()); + ourClient.delete().resource(next).execute(); + } + } + + @Test + public void testCreateWithClientSuppliedId() { + deleteToken("Patient", Patient.SP_IDENTIFIER, "urn:system", "testCreateWithId01"); + + Patient p1 = new Patient(); + p1.addIdentifier().setSystem("urn:system").setValue("testCreateWithId01"); + IdDt p1Id = ourClient.create().resource(p1).withId("testCreateWithId").execute().getId(); + + assertThat(p1Id.getValue(), containsString("Patient/testCreateWithId/_history")); + + Bundle actual = ourClient.search().forResource(Patient.class).where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system", "testCreateWithId01")).encodedJson().prettyPrint().execute(); + assertEquals(1, actual.size()); + assertEquals(p1Id.getIdPart(), actual.getEntries().get(0).getId().getIdPart()); + + /* + * ensure that trying to create the same ID again fails appropriately + */ + try { + ourClient.create().resource(p1).withId("testCreateWithId").execute().getId(); + fail(); + } catch (UnprocessableEntityException e) { + // good + } + + Bundle history = ourClient.history(null, (String) null, null, null); + + assertEquals("Expected[" + p1Id.getIdPart() + "] but was " + history.getEntries().get(0).getId(), p1Id.getIdPart(), history.getEntries().get(0).getId().getIdPart()); + assertNotNull(history.getEntries().get(0).getResource()); + } + + @Test + public void testDeepChaining() { + delete("Location", Location.SP_NAME, "testDeepChainingL1"); + delete("Location", Location.SP_NAME, "testDeepChainingL2"); + deleteToken("Encounter", Encounter.SP_IDENTIFIER, "urn:foo", "testDeepChainingE1"); + + Location l1 = new Location(); + l1.getNameElement().setValue("testDeepChainingL1"); + IdDt l1id = ourClient.create().resource(l1).execute().getId(); + + Location l2 = new Location(); + l2.getNameElement().setValue("testDeepChainingL2"); + l2.getPartOf().setReference(l1id.toVersionless().toUnqualified()); + IdDt l2id = ourClient.create().resource(l2).execute().getId(); + + Encounter e1 = new Encounter(); + e1.addIdentifier().setSystem("urn:foo").setValue("testDeepChainingE1"); + e1.getStatusElement().setValueAsEnum(EncounterStateEnum.IN_PROGRESS); + e1.getClassElementElement().setValueAsEnum(EncounterClassEnum.HOME); + ca.uhn.fhir.model.dstu.resource.Encounter.Location location = e1.addLocation(); + location.getLocation().setReference(l2id.toUnqualifiedVersionless()); + location.setPeriod(new PeriodDt().setStartWithSecondsPrecision(new Date()).setEndWithSecondsPrecision(new Date())); + IdDt e1id = ourClient.create().resource(e1).execute().getId(); + + //@formatter:off + Bundle res = ourClient.search() + .forResource(Encounter.class) + .where(Encounter.IDENTIFIER.exactly().systemAndCode("urn:foo", "testDeepChainingE1")) + .include(Encounter.INCLUDE_LOCATION_LOCATION) + .include(Location.INCLUDE_PARTOF) + .execute(); + //@formatter:on + + assertEquals(3, res.size()); + assertEquals(1, res.getResources(Encounter.class).size()); + assertEquals(e1id.toUnqualifiedVersionless(), res.getResources(Encounter.class).get(0).getId().toUnqualifiedVersionless()); + + } + + @Test + public void testSaveAndRetrieveExistingNarrative() { + deleteToken("Patient", Patient.SP_IDENTIFIER, "urn:system", "testSaveAndRetrieveExistingNarrative01"); + + Patient p1 = new Patient(); + p1.getText().setStatus(NarrativeStatusEnum.GENERATED); + p1.getText().getDiv().setValueAsString("
HELLO WORLD
"); + p1.addIdentifier().setSystem("urn:system").setValue("testSaveAndRetrieveExistingNarrative01"); + + IdDt newId = ourClient.create().resource(p1).execute().getId(); + + Patient actual = ourClient.read(Patient.class, newId); + assertEquals("
HELLO WORLD
", actual.getText().getDiv().getValueAsString()); + } + + @Test + public void testSaveAndRetrieveWithContained() { + Patient p1 = new Patient(); + p1.addIdentifier().setSystem("urn:system").setValue("testSaveAndRetrieveWithContained01"); + + Organization o1 = new Organization(); + o1.addIdentifier().setSystem("urn:system").setValue("testSaveAndRetrieveWithContained02"); + + p1.getManagingOrganization().setResource(o1); + + IdDt newId = ourClient.create().resource(p1).execute().getId(); + + Patient actual = ourClient.read(Patient.class, newId); + assertEquals(1, actual.getContained().getContainedResources().size()); + assertThat(actual.getText().getDiv().getValueAsString(), containsString("IdentifiertestSaveAndRetrieveWithContained01")); + + Bundle b = ourClient.search().forResource("Patient").where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system", "testSaveAndRetrieveWithContained01")).execute(); + assertEquals(1, b.size()); + + } + + @Test + public void testSaveAndRetrieveWithoutNarrative() { + Patient p1 = new Patient(); + p1.addIdentifier().setSystem("urn:system").setValue("testSearchByResourceChain01"); + + IdDt newId = ourClient.create().resource(p1).execute().getId(); + + Patient actual = ourClient.read(Patient.class, newId); + assertThat(actual.getText().getDiv().getValueAsString(), containsString("IdentifiertestSearchByResourceChain01")); + } + + @Test + public void testSearchByIdentifier() { + deleteToken("Patient", Patient.SP_IDENTIFIER, "urn:system", "testSearchByIdentifier01"); + deleteToken("Patient", Patient.SP_IDENTIFIER, "urn:system", "testSearchByIdentifier02"); + + Patient p1 = new Patient(); + p1.addIdentifier().setSystem("urn:system").setValue("testSearchByIdentifier01"); + p1.addName().addFamily("testSearchByIdentifierFamily01").addGiven("testSearchByIdentifierGiven01"); + IdDt p1Id = ourClient.create().resource(p1).execute().getId(); + + Patient p2 = new Patient(); + p2.addIdentifier().setSystem("urn:system").setValue("testSearchByIdentifier02"); + p2.addName().addFamily("testSearchByIdentifierFamily01").addGiven("testSearchByIdentifierGiven02"); + ourClient.create().resource(p2).execute().getId(); + + Bundle actual = ourClient.search().forResource(Patient.class).where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system", "testSearchByIdentifier01")).encodedJson().prettyPrint().execute(); + assertEquals(1, actual.size()); + assertEquals(p1Id.getIdPart(), actual.getEntries().get(0).getId().getIdPart()); + } + + @Test + public void testSearchByIdentifierWithoutSystem() { + deleteToken("Patient", Patient.SP_IDENTIFIER, "", "testSearchByIdentifierWithoutSystem01"); + + Patient p1 = new Patient(); + p1.addIdentifier().setValue("testSearchByIdentifierWithoutSystem01"); + IdDt p1Id = ourClient.create().resource(p1).execute().getId(); + + Bundle actual = ourClient.search().forResource(Patient.class).where(Patient.IDENTIFIER.exactly().systemAndCode(null, "testSearchByIdentifierWithoutSystem01")).encodedJson().prettyPrint().execute(); + assertEquals(1, actual.size()); + assertEquals(p1Id.getIdPart(), actual.getEntries().get(0).getId().getIdPart()); + + } + + @Test + public void testSearchByResourceChain() { + delete("Organization", Organization.SP_NAME, "testSearchByResourceChainName01"); + deleteToken("Patient", Patient.SP_IDENTIFIER, "urn:system", "testSearchByResourceChain01"); + + Organization o1 = new Organization(); + o1.setName("testSearchByResourceChainName01"); + IdDt o1id = ourClient.create().resource(o1).execute().getId(); + + Patient p1 = new Patient(); + p1.addIdentifier().setSystem("urn:system").setValue("testSearchByResourceChain01"); + p1.addName().addFamily("testSearchByResourceChainFamily01").addGiven("testSearchByResourceChainGiven01"); + p1.setManagingOrganization(new ResourceReferenceDt(o1id)); + IdDt p1Id = ourClient.create().resource(p1).execute().getId(); + + //@formatter:off + Bundle actual = ourClient.search() + .forResource(Patient.class) + .where(Patient.PROVIDER.hasId(o1id.getIdPart())) + .encodedJson().prettyPrint().execute(); + //@formatter:on + assertEquals(1, actual.size()); + assertEquals(p1Id.getIdPart(), actual.getEntries().get(0).getId().getIdPart()); + + //@formatter:off + actual = ourClient.search() + .forResource(Patient.class) + .where(Patient.PROVIDER.hasId(o1id.getValue())) + .encodedJson().prettyPrint().execute(); + //@formatter:on + assertEquals(1, actual.size()); + assertEquals(p1Id.getIdPart(), actual.getEntries().get(0).getId().getIdPart()); + + } + + @Test + public void testTryToCreateResourceWithReferenceThatDoesntExist() { + deleteToken("Patient", Patient.SP_IDENTIFIER, "urn:system", "testTryToCreateResourceWithReferenceThatDoesntExist01"); + + Patient p1 = new Patient(); + p1.addIdentifier().setSystem("urn:system").setValue("testTryToCreateResourceWithReferenceThatDoesntExist01"); + p1.addName().addFamily("testTryToCreateResourceWithReferenceThatDoesntExistFamily01").addGiven("testTryToCreateResourceWithReferenceThatDoesntExistGiven01"); + p1.setManagingOrganization(new ResourceReferenceDt("Organization/1323123232349875324987529835")); + + try { + ourClient.create().resource(p1).execute().getId(); + fail(); + } catch (InvalidRequestException e) { + assertThat(e.getMessage(), containsString("Organization/1323123232349875324987529835")); + } + + } + + @Test + public void testUpdateRejectsInvalidTypes() throws InterruptedException { + deleteToken("Patient", Patient.SP_IDENTIFIER, "urn:system", "testUpdateRejectsInvalidTypes"); + + Patient p1 = new Patient(); + p1.addIdentifier().setSystem("urn:system").setValue("testUpdateRejectsInvalidTypes"); + p1.addName().addFamily("Tester").addGiven("testUpdateRejectsInvalidTypes"); + IdDt p1id = ourClient.create().resource(p1).execute().getId(); + + Organization p2 = new Organization(); + p2.getNameElement().setValue("testUpdateRejectsInvalidTypes"); + try { + ourClient.update().resource(p2).withId("Organization/" + p1id.getIdPart()).execute(); + fail(); + } catch (UnprocessableEntityException e) { + // good + } + + try { + ourClient.update().resource(p2).withId("Patient/" + p1id.getIdPart()).execute(); + fail(); + } catch (UnprocessableEntityException e) { + // good + } + + } + + @Test + public void testUpdateWithClientSuppliedIdWhichDoesntExist() { + deleteToken("Patient", Patient.SP_IDENTIFIER, "urn:system", "testUpdateWithClientSuppliedIdWhichDoesntExist"); + + Patient p1 = new Patient(); + p1.addIdentifier().setSystem("urn:system").setValue("testUpdateWithClientSuppliedIdWhichDoesntExist"); + MethodOutcome outcome = ourClient.update().resource(p1).withId("testUpdateWithClientSuppliedIdWhichDoesntExist").execute(); + assertEquals(true, outcome.getCreated().booleanValue()); + IdDt p1Id = outcome.getId(); + + assertThat(p1Id.getValue(), containsString("Patient/testUpdateWithClientSuppliedIdWhichDoesntExist/_history")); + + Bundle actual = ourClient.search().forResource(Patient.class).where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system", "testUpdateWithClientSuppliedIdWhichDoesntExist")).encodedJson().prettyPrint().execute(); + assertEquals(1, actual.size()); + assertEquals(p1Id.getIdPart(), actual.getEntries().get(0).getId().getIdPart()); + + } + + @AfterClass + public static void afterClass() throws Exception { + ourServer.stop(); + ourAppCtx.stop(); + } + + @SuppressWarnings("unchecked") + @BeforeClass + public static void beforeClass() throws Exception { + int port = RandomServerPortProvider.findFreePort(); + + RestfulServer restServer = new RestfulServer(); + ourFhirCtx = FhirContext.forDstu1(); + restServer.setFhirContext(ourFhirCtx); + + String serverBase = "http://localhost:" + port + "/fhir/context"; + + ourAppCtx = new ClassPathXmlApplicationContext("hapi-fhir-server-resourceproviders-dev.xml", "fhir-spring-test-config.xml"); + + ourDaoConfig = (DaoConfig) ourAppCtx.getBean(DaoConfig.class); + + ourOrganizationDao = (IFhirResourceDao) ourAppCtx.getBean("myOrganizationDaoDev", IFhirResourceDao.class); + + List rpsDev = (List) ourAppCtx.getBean("myResourceProvidersDev", List.class); + restServer.setResourceProviders(rpsDev); + + restServer.getFhirContext().setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator()); + + IFhirSystemDao systemDao = (IFhirSystemDao) ourAppCtx.getBean("mySystemDaoDev", IFhirSystemDao.class); + JpaSystemProvider systemProv = new JpaSystemProvider(systemDao); + restServer.setPlainProviders(systemProv); + + restServer.setPagingProvider(new FifoMemoryPagingProvider(10)); + + ourServer = new Server(port); + + ServletContextHandler proxyHandler = new ServletContextHandler(); + proxyHandler.setContextPath("/"); + + ServletHolder servletHolder = new ServletHolder(); + servletHolder.setServlet(restServer); + proxyHandler.addServlet(servletHolder, "/fhir/context/*"); + + ourServer.setHandler(proxyHandler); + ourServer.start(); + + ourClient = ourFhirCtx.newRestfulGenericClient(serverBase); + ourClient.registerInterceptor(new LoggingInterceptor(true)); + + } + +} diff --git a/hapi-fhir-structures-dev/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java b/hapi-fhir-structures-dev/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java index 8b56da3bc6f..a27f92d98ff 100644 --- a/hapi-fhir-structures-dev/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java +++ b/hapi-fhir-structures-dev/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java @@ -1,5 +1,6 @@ package ca.uhn.fhir.parser; +import static org.hamcrest.Matchers.*; import static org.junit.Assert.*; import java.io.StringReader; @@ -14,8 +15,10 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; import ca.uhn.fhir.model.dev.resource.MedicationPrescription; +import ca.uhn.fhir.model.dev.resource.Organization; import ca.uhn.fhir.model.dstu.resource.Binary; import ca.uhn.fhir.model.primitive.InstantDt; +import ca.uhn.fhir.model.valueset.BundleEntryStatusEnum; public class XmlParserTest { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(XmlParserTest.class); @@ -50,6 +53,7 @@ public class XmlParserTest { assertEquals(1, parsed.getEntries().size()); assertEquals("update", parsed.getEntries().get(0).getStatus().getValue()); + assertEquals(BundleEntryStatusEnum.UPDATE, ResourceMetadataKeyEnum.ENTRY_STATUS.get(parsed.getEntries().get(0).getResource())); assertEquals("http://foo?search", parsed.getEntries().get(0).getLinkSearch().getValue()); MedicationPrescription p = (MedicationPrescription) parsed.getEntries().get(0).getResource(); @@ -65,6 +69,20 @@ public class XmlParserTest { } + @Test + public void testEncodeAndParseBundleWithoutResourceIds() { + Organization org = new Organization(); + org.addIdentifier().setSystem("urn:system").setValue("someval"); + + Bundle bundle = Bundle.withSingleResource(org); + String str = ourCtx.newXmlParser().encodeBundleToString(bundle); + ourLog.info(str); + + Bundle parsed = ourCtx.newXmlParser().parseBundle(str); + assertThat(parsed.getEntries().get(0).getResource().getId().getValue(), isEmptyOrNullString()); + assertTrue(parsed.getEntries().get(0).getResource().getId().isEmpty()); + } + @Test public void testBundleWithBinary() { //@formatter:off diff --git a/pom.xml.orig b/pom.xml.orig deleted file mode 100644 index 3283c690518..00000000000 --- a/pom.xml.orig +++ /dev/null @@ -1,694 +0,0 @@ - - - - - org.sonatype.oss - oss-parent - 9 - - - 4.0.0 - ca.uhn.hapi.fhir - hapi-fhir - pom - 0.9-SNAPSHOT - HAPI-FHIR - http://hl7api.sourceforge.net/hapi-fhir/ - - - University Health Network - http://www.uhn.ca - - - 2014 - - - GitHub - https://github.com/jamesagnew/hapi-fhir/issues/ - - - - - git.server - scm:git:git@github.com:jamesagnew/hapi-fhir.git - - - - - scm:git:git@github.com:jamesagnew/hapi-fhir.git - scm:git:git@github.com:jamesagnew/hapi-fhir.git - scm:git:git@github.com:jamesagnew/hapi-fhir.git - - - - - - - - - - 3.0.1 - - - - - jamesagnew - James Agnew - University Health Network - - - Dmitri Sotnikov - University Health Network - - - Lisa Wong - University Health Network - - - Josh Mandel - Boston Children's Hospital - - - lmds - Laura MacDougall Sookraj - University Health Network - - - Neal Acharya - University Health Network - - - David Hay - Orion Health - - - suranga - Suranga Nath Kasthurirathne - OpenMRS / Regenstrief Center for Biomedical Informatics - - - dougmartin - Doug Martin - Regenstrief Center for Biomedical Informatics - - - akley - Alexander Kley - - - preston - Preston Lee - Arizona State University - - - jjathman - Joe Athman - - - petromykhailysyn - Petro Mykhailyshyn - - - tahurac - Tahura Chaudhry - University Health Network - - - b.debeaubien - Bill de Beaubien - Systems Made Simple - - - - - - Apache Software License 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - - - - - UTF-8 - - - ${user.home}/sites/hapi-fhir - ${user.home}/sites/scm/hapi-fhir - - - 4.3.6 - 4.4 - 2.4 - 3.3.2 - 1.10 - 10.11.1.1 - 18.0 - 1.3 - 4.3.7.Final - 5.1.0.Final - 9.2.6.v20141205 - 4.3.1 - 4.12 - 1.1.2 - 2.4.1 - 2.10.1 - 1.7 - 2.18.1 - 3.4 - 2.3 - 1.1.8 - 1.10.17 - 2.7.1 - 4.3.5 - UTF-8 - 3.1.0 - 1.7.9 - 4.1.3.RELEASE - 3.2.4.RELEASE - 2.1.4.RELEASE - 1.0.1 - 4.4.0 - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.2 - - 1.6 - 1.6 - - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven_surefire_plugin_version} - - true - random -<<<<<<< HEAD -======= - ->>>>>>> 8c96bf7d9ef6d6c590c3c7420c293b815935b336 - -Dfile.encoding=UTF-8 - - - - org.apache.maven.plugins - maven-site-plugin - ${maven_site_plugin_version} - - - org.apache.maven.wagon - wagon-ssh - 1.0 - - - org.apache.maven.doxia - doxia-module-markdown - 1.6 - - - - true - true - - - - org.apache.maven.plugins - maven-deploy-plugin - 2.8.1 - - - org.apache.maven.plugins - maven-javadoc-plugin - ${maven_javadoc_plugin_version} - - - org.apache.maven.plugins - maven-source-plugin - ${maven_source_plugin_version} - - - org.codehaus.mojo - license-maven-plugin - ${maven_license_plugin_version} - - true - false - - - - maven-site-plugin - ${maven_site_plugin_version} - - false - true - - - - org.apache.maven.wagon - wagon-scm - 2.2 - - - org.apache.maven.scm - maven-scm-manager-plexus - 1.9 - - - org.apache.maven.scm - maven-scm-provider-gitexe - 1.9 - - - org.apache.maven.scm - maven-scm-api - 1.9 - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - ca.uhn.hapi.fhir - - - hapi-tinder-plugin - - - [0.8-SNAPSHOT,) - - - - generate-jparest-server - - - - - - - - - - - org.apache.maven.plugins - - - maven-antrun-plugin - - - [1.7,) - - - run - - - - - - - - - - - - - - - maven-antrun-plugin - 1.7 - false - - - copySubProjects - site - - run - - - - - - - - - - - - - - - - - addSyntaxHighlighter - site - - run - - - - Adding Syntax Highlighter - - - ]]> - - var elements = document.getElementsByClassName("source"); - for (var i=0; i < elements.length; i++) { - var pres = elements[i].getElementsByTagName("pre"); - for (var j = 0; j < pres.length; j++) { - var pre = pres[j]; - if (pre.innerHTML.match(/\/\*/)) { - pre.className = 'brush: java'; - } else if (pre.innerHTML.match(/^\/\//)) { - pre.className = 'brush: java'; - } else if (pre.innerHTML.match(/^\{/)) { - pre.className = 'brush: jscript'; - } else if (pre.innerHTML.match(/^\#/)) { - pre.className = 'brush: bash'; - } else if (pre.innerHTML.match(/\<\;\//)) { - pre.className = 'brush: xml'; - } else { - pre.className = 'brush: java'; - } - } - } - - SyntaxHighlighter.all(); - - - ]]> - - - - - - addAnalytics - post-site - - - Adding Google analytics in target/site for <body> - - - - - ]]> - - (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), - m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) - })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); - - ga('create', 'UA-1395874-5', 'auto'); - ga('require', 'displayfeatures'); - ga('require', 'linkid', 'linkid.js'); - ga('send', 'pageview'); - - - - ]]> - - Adding Google analytics in target/site for <BODY> - - - ]]> - - (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), - m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) - })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); - - ga('create', 'UA-1395874-5', 'auto'); - ga('require', 'displayfeatures'); - ga('require', 'linkid', 'linkid.js'); - ga('send', 'pageview'); - - - - ]]> - - Adding social plugins for HAPI - - - - -
-
- - -

- - -

- - ]]>
-
- - -
-
- - run - -
-
-
- - org.codehaus.mojo - animal-sniffer-maven-plugin - 1.12 - true - - - org.codehaus.mojo.signature - java16 - 1.01 - - - - - maven-site-plugin - false - - - stage-for-scm-publish - post-site - - stage - - - ${siteMainDirectory} - - - - - - org.apache.maven.plugins - maven-scm-publish-plugin - 1.1 - false - - ${scmPubCheckoutDirectory} - \${siteMainDirectory} - true - gh-pages - scm:git:git@github.com:jamesagnew/hapi-fhir.git - - - - scm-publish - site-deploy - - publish-scm - - - - -
-
- - - - - org.apache.maven.plugins - maven-changes-plugin - 2.11 - false - - - - changes-report - - - - - atom_1.0 - - https://github.com/jamesagnew/hapi-fhir/issues/%ISSUE% - - false - - - - org.apache.maven.plugins - maven-surefire-report-plugin - ${maven_surefire_plugin_version} - - true - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 2.7 - false - - - - project-team - issue-tracking - license - scm - - - - - - org.codehaus.mojo - findbugs-maven-plugin - 3.0.0 - - ./hapi-fhir-base/target/classes - - - - - findbugs - - - - - - - - - - - - ROOT - - - - - - - - - - SIGN_ARTIFACTS - - - gpg.passphrase - - - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - - SITE - - hapi-fhir-base - hapi-fhir-structures-dstu - hapi-fhir-structures-dev - examples - - - - ALLMODULES - - true - - - hapi-deployable-pom - hapi-fhir-base - - hapi-fhir-base/testmindeps - hapi-tinder-plugin - hapi-tinder-test - hapi-fhir-structures-dstu - hapi-fhir-structures-dev - hapi-fhir-jpaserver-base - hapi-fhir-jpaserver-test - restful-server-example - restful-server-example-test - hapi-fhir-testpage-overlay - hapi-fhir-jpaserver-uhnfhirtest - - - - - -