From c3e9f618eb9a2181171131675799c0ea618fcb84 Mon Sep 17 00:00:00 2001
From: James Agnew
Date: Tue, 12 Jul 2016 11:12:07 -0400
Subject: [PATCH] Version bump to 2.0-SNAPSHOT
---
examples/pom.xml | 16 +-
hapi-deployable-pom/pom.xml | 2 +-
hapi-fhir-android/pom.xml | 10 +-
hapi-fhir-base-example-embedded-ws/pom.xml | 2 +-
hapi-fhir-base-test-mindeps-client/pom.xml | 8 +-
hapi-fhir-base-test-mindeps-server/pom.xml | 8 +-
hapi-fhir-base/pom.xml | 2 +-
.../ca/uhn/fhir/context/FhirVersionEnum.java | 2 +-
.../java/ca/uhn/fhir/parser/ParserState.java | 6 +-
.../fhir/rest/gclient/TokenClientParam.java | 17 +-
.../uhn/fhir/rest/gclient/TokenCriterion.java | 18 +++
hapi-fhir-cli/hapi-fhir-cli-app/pom.xml | 22 +--
hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml | 14 +-
hapi-fhir-cli/pom.xml | 2 +-
hapi-fhir-cobertura/pom.xml | 18 +--
hapi-fhir-dist/pom.xml | 20 +--
hapi-fhir-jacoco/pom.xml | 18 +--
hapi-fhir-jaxrsserver-base/pom.xml | 8 +-
hapi-fhir-jaxrsserver-example/pom.xml | 4 +-
hapi-fhir-jpaserver-base/pom.xml | 26 ++--
.../fhir/jpa/dao/BaseHapiFhirResourceDao.java | 122 +++++++++------
.../ca/uhn/fhir/jpa/dao/IFhirResourceDao.java | 54 +++++--
.../SubscriptionWebsocketHandlerDstu2.java | 2 +-
.../SubscriptionWebsocketHandlerDstu3.java | 2 +-
.../dstu3/FhirResourceDaoDstu3UpdateTest.java | 41 +++++
.../dstu3/ResourceProviderDstu3Test.java | 1 +
hapi-fhir-jpaserver-example/pom.xml | 14 +-
hapi-fhir-jpaserver-uhnfhirtest/pom.xml | 15 +-
hapi-fhir-osgi-core/pom.xml | 16 +-
hapi-fhir-structures-dstu/pom.xml | 6 +-
.../ca/uhn/fhir/parser/XmlParserTest.java | 21 ++-
.../src/test/resources/old_07_feed.xml | 53 +++++++
hapi-fhir-structures-dstu2/pom.xml | 8 +-
hapi-fhir-structures-dstu3/pom.xml | 6 +-
.../uhn/fhir/parser/JsonParserDstu3Test.java | 18 +++
.../uhn/fhir/parser/XmlParserDstu3Test.java | 86 +++++------
.../rest/client/GenericClientDstu3Test.java | 38 ++++-
...estionnaireResponseValidatorDstu3Test.java | 3 +
.../src/test/resources/tara-test.json | 146 ++++++++++++++++++
hapi-fhir-structures-hl7org-dstu2/pom.xml | 6 +-
.../QuestionnaireResponseValidator.java | 9 +-
...naireResponseValidatorIntegrationTest.java | 15 ++
.../questionnaire-20160712-response.json | 76 +++++++++
.../resources/questionnaire-20160712.json | 58 +++++++
hapi-fhir-testpage-overlay/pom.xml | 12 +-
hapi-fhir-validation-resources-dstu2/pom.xml | 2 +-
hapi-fhir-validation-resources-dstu3/pom.xml | 4 +-
hapi-tinder-plugin/pom.xml | 6 +-
hapi-tinder-test/pom.xml | 16 +-
pom.xml | 2 +-
restful-server-example-test/pom.xml | 6 +-
restful-server-example/pom.xml | 10 +-
src/changes/changes.xml | 10 ++
src/site/xdoc/download.xml.vm | 10 +-
src/site/xdoc/index.xml | 2 +-
55 files changed, 845 insertions(+), 274 deletions(-)
create mode 100644 hapi-fhir-structures-dstu/src/test/resources/old_07_feed.xml
create mode 100644 hapi-fhir-structures-dstu3/src/test/resources/tara-test.json
create mode 100644 hapi-fhir-structures-hl7org-dstu2/src/test/resources/questionnaire-20160712-response.json
create mode 100644 hapi-fhir-structures-hl7org-dstu2/src/test/resources/questionnaire-20160712.json
diff --git a/examples/pom.xml b/examples/pom.xml
index 0a2909a7ed6..0d709625e7f 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 1.6
+ 2.0-SNAPSHOT
../pom.xml
@@ -18,32 +18,32 @@
ca.uhn.hapi.fhir
hapi-fhir-base
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu3
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-hl7org-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-validation-resources-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-jaxrsserver-base
- 1.6
+ 2.0-SNAPSHOT
javax.servlet
@@ -54,7 +54,7 @@
ca.uhn.hapi.fhir
hapi-fhir-jaxrsserver-base
- 1.6
+ 2.0-SNAPSHOT
javax.ws.rs
diff --git a/hapi-deployable-pom/pom.xml b/hapi-deployable-pom/pom.xml
index 1c6fd82c1f0..d12e3ba7d8a 100644
--- a/hapi-deployable-pom/pom.xml
+++ b/hapi-deployable-pom/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 1.6
+ 2.0-SNAPSHOT
../pom.xml
diff --git a/hapi-fhir-android/pom.xml b/hapi-fhir-android/pom.xml
index 6ce75370970..e3afc0a4db6 100644
--- a/hapi-fhir-android/pom.xml
+++ b/hapi-fhir-android/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 1.6
+ 2.0-SNAPSHOT
../pom.xml
@@ -30,7 +30,7 @@
ca.uhn.hapi.fhir
hapi-fhir-base
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-jpaserver-base
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-testpage-overlay
- 1.6
+ 2.0-SNAPSHOT
war
provided
ca.uhn.hapi.fhir
hapi-fhir-testpage-overlay
- 1.6
+ 2.0-SNAPSHOT
classes
provided
diff --git a/hapi-fhir-cli/pom.xml b/hapi-fhir-cli/pom.xml
index 18691cb78a7..1567dda2a37 100644
--- a/hapi-fhir-cli/pom.xml
+++ b/hapi-fhir-cli/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 1.6
+ 2.0-SNAPSHOT
../pom.xml
diff --git a/hapi-fhir-cobertura/pom.xml b/hapi-fhir-cobertura/pom.xml
index 333281946be..39ccb98db0d 100644
--- a/hapi-fhir-cobertura/pom.xml
+++ b/hapi-fhir-cobertura/pom.xml
@@ -6,7 +6,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 1.6
+ 2.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
@@ -19,42 +19,42 @@
ca.uhn.hapi.fhir
hapi-fhir-base
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu3
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-hl7org-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-validation-resources-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-validation-resources-dstu3
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-jpaserver-base
- 1.6
+ 2.0-SNAPSHOT
diff --git a/hapi-fhir-dist/pom.xml b/hapi-fhir-dist/pom.xml
index f817f9578d8..7d4c95e7f43 100644
--- a/hapi-fhir-dist/pom.xml
+++ b/hapi-fhir-dist/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 1.6
+ 2.0-SNAPSHOT
../pom.xml
@@ -18,49 +18,49 @@
ca.uhn.hapi.fhir
hapi-fhir-base
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-hl7org-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu3
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-validation-resources-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-validation-resources-dstu3
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-cli-app
- 1.6
+ 2.0-SNAPSHOT
provided
ca.uhn.hapi.fhir
hapi-fhir-android
- 1.6
+ 2.0-SNAPSHOT
provided
diff --git a/hapi-fhir-jacoco/pom.xml b/hapi-fhir-jacoco/pom.xml
index 636b7d41d97..cbdd5361599 100644
--- a/hapi-fhir-jacoco/pom.xml
+++ b/hapi-fhir-jacoco/pom.xml
@@ -6,7 +6,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 1.6
+ 2.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
@@ -19,42 +19,42 @@
ca.uhn.hapi.fhir
hapi-fhir-base
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu3
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-hl7org-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-validation-resources-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-validation-resources-dstu3
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-jpaserver-base
- 1.6
+ 2.0-SNAPSHOT
diff --git a/hapi-fhir-jaxrsserver-base/pom.xml b/hapi-fhir-jaxrsserver-base/pom.xml
index 03afaa1c27a..e094d1698aa 100644
--- a/hapi-fhir-jaxrsserver-base/pom.xml
+++ b/hapi-fhir-jaxrsserver-base/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 1.6
+ 2.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
@@ -18,7 +18,7 @@
ca.uhn.hapi.fhir
hapi-fhir-base
- 1.6
+ 2.0-SNAPSHOT
commons-logging
@@ -38,12 +38,12 @@
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu3
- 1.6
+ 2.0-SNAPSHOT
diff --git a/hapi-fhir-jaxrsserver-example/pom.xml b/hapi-fhir-jaxrsserver-example/pom.xml
index 36303e65247..f586f473c6d 100644
--- a/hapi-fhir-jaxrsserver-example/pom.xml
+++ b/hapi-fhir-jaxrsserver-example/pom.xml
@@ -6,7 +6,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 1.6
+ 2.0-SNAPSHOT
../pom.xml
@@ -31,7 +31,7 @@
ca.uhn.hapi.fhir
hapi-fhir-jaxrsserver-base
- 1.6
+ 2.0-SNAPSHOT
diff --git a/hapi-fhir-jpaserver-base/pom.xml b/hapi-fhir-jpaserver-base/pom.xml
index 3dce684595d..a2c10dc4acb 100644
--- a/hapi-fhir-jpaserver-base/pom.xml
+++ b/hapi-fhir-jpaserver-base/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 1.6
+ 2.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
@@ -36,7 +36,7 @@
ca.uhn.hapi.fhir
hapi-fhir-base
- 1.6
+ 2.0-SNAPSHOT
commons-logging
@@ -47,32 +47,32 @@
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu3
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-hl7org-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-validation-resources-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-validation-resources-dstu3
- 1.6
+ 2.0-SNAPSHOT
@@ -370,7 +370,7 @@
ca.uhn.hapi.fhir
hapi-tinder-plugin
- 1.6
+ 2.0-SNAPSHOT
build_dstu1
@@ -422,22 +422,22 @@
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu3
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-validation-resources-dstu3
- 1.6
+ 2.0-SNAPSHOT
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java
index dc1a608192e..29fbbd49ed9 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java
@@ -97,13 +97,10 @@ public abstract class BaseHapiFhirResourceDao extends B
@Autowired
private DaoConfig myDaoConfig;
-
@Autowired
protected PlatformTransactionManager myPlatformTransactionManager;
-
@Autowired
private IResourceHistoryTableDao myResourceHistoryTableDao;
-
@Autowired()
protected IResourceIndexedSearchParamUriDao myResourceIndexedSearchParamUriDao;
private String myResourceName;
@@ -112,9 +109,7 @@ public abstract class BaseHapiFhirResourceDao extends B
protected IFulltextSearchSvc mySearchDao;
@Autowired()
protected ISearchResultDao mySearchResultDao;
-
private String mySecondaryPrimaryKeyParamName;
-
@Autowired()
protected IHapiTerminologySvc myTerminologySvc;
@@ -147,11 +142,21 @@ public abstract class BaseHapiFhirResourceDao extends B
ourLog.info("Processed addTag {}/{} on {} in {}ms", new Object[] { theScheme, theTerm, theId, w.getMillisAndRestart() });
}
+ @Override
+ public DaoMethodOutcome create(final T theResource) {
+ return create(theResource, null, true, null);
+ }
+
@Override
public DaoMethodOutcome create(final T theResource, RequestDetails theRequestDetails) {
return create(theResource, null, true, theRequestDetails);
}
+ @Override
+ public DaoMethodOutcome create(final T theResource, String theIfNoneExist) {
+ return create(theResource, theIfNoneExist, null);
+ }
+
@Override
public DaoMethodOutcome create(T theResource, String theIfNoneExist, boolean thePerformIndexing, RequestDetails theRequestDetails) {
if (isNotBlank(theResource.getIdElement().getIdPart())) {
@@ -201,7 +206,7 @@ public abstract class BaseHapiFhirResourceDao extends B
ActionRequestDetails requestDetails = new ActionRequestDetails(theRequestDetails, getContext(), theId.getResourceType(), theId);
notifyInterceptors(RestOperationTypeEnum.DELETE, requestDetails);
}
-
+
Date updateTime = new Date();
ResourceTable savedEntity = updateEntity(null, entity, updateTime, updateTime);
@@ -216,10 +221,15 @@ public abstract class BaseHapiFhirResourceDao extends B
}
}
}
-
+
return savedEntity;
}
+ @Override
+ public DaoMethodOutcome delete(IIdType theId) {
+ return delete(theId, null);
+ }
+
@Override
public DaoMethodOutcome delete(IIdType theId, RequestDetails theRequestDetails) {
List deleteConflicts = new ArrayList();
@@ -332,7 +342,7 @@ public abstract class BaseHapiFhirResourceDao extends B
ActionRequestDetails requestDetails = new ActionRequestDetails(theRequestDetails, getContext(), theResource);
notifyInterceptors(RestOperationTypeEnum.CREATE, requestDetails);
}
-
+
// Perform actual DB update
updateEntity(theResource, entity, null, thePerformIndexing, true, theUpdateTime);
theResource.setId(entity.getIdDt());
@@ -347,7 +357,7 @@ public abstract class BaseHapiFhirResourceDao extends B
}
}
}
-
+
DaoMethodOutcome outcome = toMethodOutcome(entity, theResource).setCreated(true);
String msg = getContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "successfulCreate", outcome.getId(), w.getMillisAndRestart());
@@ -473,6 +483,36 @@ public abstract class BaseHapiFhirResourceDao extends B
return retVal;
}
+ @Override
+ public MT metaAddOperation(IIdType theResourceId, MT theMetaAdd, RequestDetails theRequestDetails) {
+ // Notify interceptors
+ ActionRequestDetails requestDetails = new ActionRequestDetails(theRequestDetails, getResourceName(), theResourceId);
+ notifyInterceptors(RestOperationTypeEnum.META_ADD, requestDetails);
+
+ StopWatch w = new StopWatch();
+ BaseHasResource entity = readEntity(theResourceId);
+ if (entity == null) {
+ throw new ResourceNotFoundException(theResourceId);
+ }
+
+ ResourceTable latestVersion = readEntityLatestVersion(theResourceId);
+ if (latestVersion.getVersion() != entity.getVersion()) {
+ doMetaAdd(theMetaAdd, entity);
+ } else {
+ doMetaAdd(theMetaAdd, latestVersion);
+
+ // Also update history entry
+ ResourceHistoryTable history = myResourceHistoryTableDao.findForIdAndVersion(entity.getId(), entity.getVersion());
+ doMetaAdd(theMetaAdd, history);
+ }
+
+ ourLog.info("Processed metaAddOperation on {} in {}ms", new Object[] { theResourceId, w.getMillisAndRestart() });
+
+ @SuppressWarnings("unchecked")
+ MT retVal = (MT) metaGetOperation(theMetaAdd.getClass(), theResourceId, theRequestDetails);
+ return retVal;
+ }
+
// @Override
// public IBundleProvider everything(IIdType theId) {
// Search search = new Search();
@@ -555,36 +595,6 @@ public abstract class BaseHapiFhirResourceDao extends B
// };
// }
- @Override
- public MT metaAddOperation(IIdType theResourceId, MT theMetaAdd, RequestDetails theRequestDetails) {
- // Notify interceptors
- ActionRequestDetails requestDetails = new ActionRequestDetails(theRequestDetails, getResourceName(), theResourceId);
- notifyInterceptors(RestOperationTypeEnum.META_ADD, requestDetails);
-
- StopWatch w = new StopWatch();
- BaseHasResource entity = readEntity(theResourceId);
- if (entity == null) {
- throw new ResourceNotFoundException(theResourceId);
- }
-
- ResourceTable latestVersion = readEntityLatestVersion(theResourceId);
- if (latestVersion.getVersion() != entity.getVersion()) {
- doMetaAdd(theMetaAdd, entity);
- } else {
- doMetaAdd(theMetaAdd, latestVersion);
-
- // Also update history entry
- ResourceHistoryTable history = myResourceHistoryTableDao.findForIdAndVersion(entity.getId(), entity.getVersion());
- doMetaAdd(theMetaAdd, history);
- }
-
- ourLog.info("Processed metaAddOperation on {} in {}ms", new Object[] { theResourceId, w.getMillisAndRestart() });
-
- @SuppressWarnings("unchecked")
- MT retVal = (MT) metaGetOperation(theMetaAdd.getClass(), theResourceId, theRequestDetails);
- return retVal;
- }
-
@Override
public MT metaDeleteOperation(IIdType theResourceId, MT theMetaDel, RequestDetails theRequestDetails) {
// Notify interceptors
@@ -710,6 +720,11 @@ public abstract class BaseHapiFhirResourceDao extends B
return processMatchUrl(theMatchUrl, getResourceType());
}
+ @Override
+ public T read(IIdType theId) {
+ return read(theId, null);
+ }
+
@Override
public T read(IIdType theId, RequestDetails theRequestDetails) {
validateResourceTypeAndThrowIllegalArgumentException(theId);
@@ -720,7 +735,7 @@ public abstract class BaseHapiFhirResourceDao extends B
RestOperationTypeEnum operationType = theId.hasVersionIdPart() ? RestOperationTypeEnum.VREAD : RestOperationTypeEnum.READ;
notifyInterceptors(operationType, requestDetails);
}
-
+
StopWatch w = new StopWatch();
BaseHasResource entity = readEntity(theId);
validateResourceType(entity);
@@ -970,6 +985,11 @@ public abstract class BaseHapiFhirResourceDao extends B
return retVal;
}
+ @Override
+ public DaoMethodOutcome update(T theResource) {
+ return update(theResource, null, null);
+ }
+
@Override
public DaoMethodOutcome update(T theResource, RequestDetails theRequestDetails) {
return update(theResource, null, theRequestDetails);
@@ -1023,17 +1043,22 @@ public abstract class BaseHapiFhirResourceDao extends B
}
// Notify interceptors
- ActionRequestDetails requestDetails = new ActionRequestDetails(theRequestDetails, theResource, getResourceName(), resourceId);
- notifyInterceptors(RestOperationTypeEnum.UPDATE, requestDetails);
+ ActionRequestDetails requestDetails = null;
+ if (theRequestDetails != null) {
+ requestDetails = new ActionRequestDetails(theRequestDetails, theResource, getResourceName(), resourceId);
+ notifyInterceptors(RestOperationTypeEnum.UPDATE, requestDetails);
+ }
// Perform update
ResourceTable savedEntity = updateEntity(theResource, entity, null, thePerformIndexing, true, new Date());
// Notify interceptors
- theRequestDetails.getRequestOperationCallback().resourceUpdated(theResource);
- for (IServerInterceptor next : getConfig().getInterceptors()) {
- if (next instanceof IJpaServerInterceptor) {
- ((IJpaServerInterceptor) next).resourceUpdated(requestDetails, entity);
+ if (theRequestDetails != null) {
+ theRequestDetails.getRequestOperationCallback().resourceUpdated(theResource);
+ for (IServerInterceptor next : getConfig().getInterceptors()) {
+ if (next instanceof IJpaServerInterceptor) {
+ ((IJpaServerInterceptor) next).resourceUpdated(requestDetails, entity);
+ }
}
}
@@ -1046,6 +1071,11 @@ public abstract class BaseHapiFhirResourceDao extends B
return outcome;
}
+ @Override
+ public DaoMethodOutcome update(T theResource, String theMatchUrl) {
+ return update(theResource, theMatchUrl, null);
+ }
+
@Override
public DaoMethodOutcome update(T theResource, String theMatchUrl, RequestDetails theRequestDetails) {
return update(theResource, theMatchUrl, true, theRequestDetails);
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IFhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IFhirResourceDao.java
index dd44dfc8818..3ef1d9737dc 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IFhirResourceDao.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IFhirResourceDao.java
@@ -46,9 +46,19 @@ public interface IFhirResourceDao extends IDao {
void addTag(IIdType theId, TagTypeEnum theTagType, String theScheme, String theTerm, String theLabel);
+ /**
+ * Create a resource - Note that this variant of the method does not take in a {@link RequestDetails} and
+ * therefore can not fire any interceptors. Use only for internal system calls
+ */
+ DaoMethodOutcome create(T theResource);
+
DaoMethodOutcome create(T theResource, RequestDetails theRequestDetails);
- DaoMethodOutcome create(T theResource, String theIfNoneExist, RequestDetails theRequestDetails);
+ /**
+ * Create a resource - Note that this variant of the method does not take in a {@link RequestDetails} and
+ * therefore can not fire any interceptors. Use only for internal system calls
+ */
+ DaoMethodOutcome create(T theResource, String theIfNoneExist);
/**
* @param thePerformIndexing
@@ -58,11 +68,13 @@ public interface IFhirResourceDao extends IDao {
*/
DaoMethodOutcome create(T theResource, String theIfNoneExist, boolean thePerformIndexing, RequestDetails theRequestDetails);
+ DaoMethodOutcome create(T theResource, String theIfNoneExist, RequestDetails theRequestDetails);
+
/**
- * This method throws an exception if there are delete conflicts
- * @param theRequestDetails TODO
+ * Delete a resource - Note that this variant of the method does not take in a {@link RequestDetails} and
+ * therefore can not fire any interceptors. Use only for internal system calls
*/
- DaoMethodOutcome delete(IIdType theResource, RequestDetails theRequestDetails);
+ DaoMethodOutcome delete(IIdType theResource);
/**
* This method does not throw an exception if there are delete conflicts, but populates them
@@ -73,18 +85,20 @@ public interface IFhirResourceDao extends IDao {
/**
* This method throws an exception if there are delete conflicts
- * @param theRequestDetails TODO
*/
- DaoMethodOutcome deleteByUrl(String theString, RequestDetails theRequestDetails);
+ DaoMethodOutcome delete(IIdType theResource, RequestDetails theRequestDetails);
/**
* This method does not throw an exception if there are delete conflicts, but populates them
* in the provided list
- * @param theRequestDetails TODO
- * @return
*/
List deleteByUrl(String theUrl, List theDeleteConflictsListToPopulate, RequestDetails theRequestDetails);
+ /**
+ * This method throws an exception if there are delete conflicts
+ */
+ DaoMethodOutcome deleteByUrl(String theString, RequestDetails theRequestDetails);
+
TagList getAllResourceTags(RequestDetails theRequestDetails);
Class getResourceType();
@@ -111,16 +125,22 @@ public interface IFhirResourceDao extends IDao {
* Not supported in DSTU1!
* @param theRequestDetails TODO
*/
- MT metaGetOperation(Class theType, RequestDetails theRequestDetails);
+ MT metaGetOperation(Class theType, IIdType theId, RequestDetails theRequestDetails);
/**
* Not supported in DSTU1!
* @param theRequestDetails TODO
*/
- MT metaGetOperation(Class theType, IIdType theId, RequestDetails theRequestDetails);
+ MT metaGetOperation(Class theType, RequestDetails theRequestDetails);
Set processMatchUrl(String theMatchUrl);
+ /**
+ * Read a resource - Note that this variant of the method does not take in a {@link RequestDetails} and
+ * therefore can not fire any interceptors. Use only for internal system calls
+ */
+ T read(IIdType theId);
+
/**
*
* @param theId
@@ -160,9 +180,19 @@ public interface IFhirResourceDao extends IDao {
Set searchForIdsWithAndOr(SearchParameterMap theParams);
+ /**
+ * Update a resource - Note that this variant of the method does not take in a {@link RequestDetails} and
+ * therefore can not fire any interceptors. Use only for internal system calls
+ */
+ DaoMethodOutcome update(T theResource);
+
DaoMethodOutcome update(T theResource, RequestDetails theRequestDetails);
- DaoMethodOutcome update(T theResource, String theMatchUrl, RequestDetails theRequestDetails);
+ /**
+ * Update a resource - Note that this variant of the method does not take in a {@link RequestDetails} and
+ * therefore can not fire any interceptors. Use only for internal system calls
+ */
+ DaoMethodOutcome update(T theResource, String theMatchUrl);
/**
* @param thePerformIndexing
@@ -172,6 +202,8 @@ public interface IFhirResourceDao extends IDao {
*/
DaoMethodOutcome update(T theResource, String theMatchUrl, boolean thePerformIndexing, RequestDetails theRequestDetails);
+ DaoMethodOutcome update(T theResource, String theMatchUrl, RequestDetails theRequestDetails);
+
/**
* Not supported in DSTU1!
* @param theRequestDetails TODO
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/SubscriptionWebsocketHandlerDstu2.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/SubscriptionWebsocketHandlerDstu2.java
index 5acbf713d8d..54b32de78b2 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/SubscriptionWebsocketHandlerDstu2.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/SubscriptionWebsocketHandlerDstu2.java
@@ -270,7 +270,7 @@ public class SubscriptionWebsocketHandlerDstu2 extends TextWebSocketHandler impl
}
}
- IIdType id = mySubscriptionDao.create(subscription, null).getId();
+ IIdType id = mySubscriptionDao.create(subscription).getId();
mySubscriptionPid = mySubscriptionDao.getSubscriptionTablePidForSubscriptionResource(id);
mySubscriptionId = subscription.getIdElement();
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/SubscriptionWebsocketHandlerDstu3.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/SubscriptionWebsocketHandlerDstu3.java
index 459a1736f0a..bddb1af9cfc 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/SubscriptionWebsocketHandlerDstu3.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/subscription/SubscriptionWebsocketHandlerDstu3.java
@@ -270,7 +270,7 @@ public class SubscriptionWebsocketHandlerDstu3 extends TextWebSocketHandler impl
}
}
- IIdType id = mySubscriptionDao.create(subscription, null).getId();
+ IIdType id = mySubscriptionDao.create(subscription).getId();
mySubscriptionPid = mySubscriptionDao.getSubscriptionTablePidForSubscriptionResource(id);
mySubscriptionId = subscription.getIdElement();
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3UpdateTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3UpdateTest.java
index 3ed2e4c6c13..447bf7c0f85 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3UpdateTest.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3UpdateTest.java
@@ -43,6 +43,7 @@ import ca.uhn.fhir.rest.api.RestOperationTypeEnum;
import ca.uhn.fhir.rest.param.StringParam;
import ca.uhn.fhir.rest.server.IBundleProvider;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
+import ca.uhn.fhir.rest.server.exceptions.ResourceGoneException;
import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException;
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails;
import ca.uhn.fhir.rest.server.servlet.ServletRequestDetails;
@@ -151,6 +152,46 @@ public class FhirResourceDaoDstu3UpdateTest extends BaseJpaDstu3Test {
}
+ @Test
+ public void testCreateAndUpdateWithoutRequest() throws Exception {
+ String methodName = "testUpdateByUrl";
+
+ Patient p = new Patient();
+ p.addIdentifier().setSystem("urn:system").setValue(methodName + "2");
+ IIdType id = myPatientDao.create(p).getId().toUnqualified();
+
+ p = new Patient();
+ p.addIdentifier().setSystem("urn:system").setValue(methodName + "2");
+ IIdType id2 = myPatientDao.create(p, "Patient?identifier=urn:system|" + methodName + "2").getId().toUnqualified();
+ assertEquals(id.getValue(), id2.getValue());
+
+ p = new Patient();
+ p.setId(id);
+ p.addIdentifier().setSystem("urn:system").setValue(methodName + "2");
+ myPatientDao.update(p).getId();
+
+ id2 = myPatientDao.update(p, "Patient?identifier=urn:system|" + methodName + "2").getId().toUnqualified();
+ assertEquals(id.getIdPart(), id2.getIdPart());
+ assertEquals("3", id2.getVersionIdPart());
+
+ Patient newPatient = myPatientDao.read(id);
+ assertEquals("1", newPatient.getIdElement().getVersionIdPart());
+
+ newPatient = myPatientDao.read(id.toVersionless());
+ assertEquals("3", newPatient.getIdElement().getVersionIdPart());
+
+ myPatientDao.delete(id.toVersionless());
+
+ try {
+ myPatientDao.read(id.toVersionless());
+ fail();
+ } catch (ResourceGoneException e) {
+ // nothing
+ }
+
+ }
+
+
@Test
public void testUpdateConditionalByLastUpdated() throws Exception {
String methodName = "testUpdateByUrl";
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3Test.java
index f5e2739f926..76948f34e59 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/dstu3/ResourceProviderDstu3Test.java
@@ -173,6 +173,7 @@ public class ResourceProviderDstu3Test extends BaseResourceProviderDstu3Test {
for (int i = 0; i < 10; i++) {
Thread.sleep(100);
preDates.add(new Date());
+ Thread.sleep(100);
patient.setId(id);
patient.getName().get(0).getFamily().get(0).setValue(methodName + "_i");
ids.add(myPatientDao.update(patient, mySrd).getId().toUnqualified().getValue());
diff --git a/hapi-fhir-jpaserver-example/pom.xml b/hapi-fhir-jpaserver-example/pom.xml
index d89ab64e181..5751a39978e 100644
--- a/hapi-fhir-jpaserver-example/pom.xml
+++ b/hapi-fhir-jpaserver-example/pom.xml
@@ -6,7 +6,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 1.6
+ 2.0-SNAPSHOT
../pom.xml
@@ -31,40 +31,40 @@
ca.uhn.hapi.fhir
hapi-fhir-base
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-jpaserver-base
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-testpage-overlay
- 1.6
+ 2.0-SNAPSHOT
war
provided
ca.uhn.hapi.fhir
hapi-fhir-testpage-overlay
- 1.6
+ 2.0-SNAPSHOT
classes
provided
diff --git a/hapi-fhir-jpaserver-uhnfhirtest/pom.xml b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml
index 6fd1f9d1ada..b78f0146e5b 100644
--- a/hapi-fhir-jpaserver-uhnfhirtest/pom.xml
+++ b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 1.6
+ 2.0-SNAPSHOT
../pom.xml
@@ -18,34 +18,34 @@
ca.uhn.hapi.fhir
hapi-fhir-jpaserver-base
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-hl7org-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-testpage-overlay
- 1.6
+ 2.0-SNAPSHOT
war
provided
ca.uhn.hapi.fhir
hapi-fhir-testpage-overlay
- 1.6
+ 2.0-SNAPSHOT
classes
provided
@@ -178,7 +178,6 @@
/
true
-
diff --git a/hapi-fhir-osgi-core/pom.xml b/hapi-fhir-osgi-core/pom.xml
index c63082a1f4f..71ebf9d344b 100644
--- a/hapi-fhir-osgi-core/pom.xml
+++ b/hapi-fhir-osgi-core/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 1.6
+ 2.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
@@ -19,37 +19,37 @@
ca.uhn.hapi.fhir
hapi-fhir-base
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-hl7org-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu3
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-validation-resources-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-validation-resources-dstu3
- 1.6
+ 2.0-SNAPSHOT
diff --git a/hapi-fhir-structures-dstu/pom.xml b/hapi-fhir-structures-dstu/pom.xml
index f4abb5576cb..994594b2b2e 100644
--- a/hapi-fhir-structures-dstu/pom.xml
+++ b/hapi-fhir-structures-dstu/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 1.6
+ 2.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
@@ -17,7 +17,7 @@
ca.uhn.hapi.fhir
hapi-fhir-base
- 1.6
+ 2.0-SNAPSHOT
diff --git a/hapi-fhir-validation-resources-dstu2/pom.xml b/hapi-fhir-validation-resources-dstu2/pom.xml
index acbe2c408d2..fbb6ce9ed55 100644
--- a/hapi-fhir-validation-resources-dstu2/pom.xml
+++ b/hapi-fhir-validation-resources-dstu2/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 1.6
+ 2.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-validation-resources-dstu3/pom.xml b/hapi-fhir-validation-resources-dstu3/pom.xml
index 28e3cdaf60b..7827cbb09ad 100644
--- a/hapi-fhir-validation-resources-dstu3/pom.xml
+++ b/hapi-fhir-validation-resources-dstu3/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 1.6
+ 2.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
@@ -17,7 +17,7 @@
ca.uhn.hapi.fhir
hapi-fhir-base
- 1.6
+ 2.0-SNAPSHOT
ch.qos.logback
diff --git a/hapi-tinder-plugin/pom.xml b/hapi-tinder-plugin/pom.xml
index 15e4a6b0c4b..fe979afd347 100644
--- a/hapi-tinder-plugin/pom.xml
+++ b/hapi-tinder-plugin/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 1.6
+ 2.0-SNAPSHOT
../pom.xml
@@ -19,7 +19,7 @@
ca.uhn.hapi.fhir
hapi-fhir-base
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-structures-dstu2
- 1.6
+ 2.0-SNAPSHOT
ca.uhn.hapi.fhir
hapi-fhir-testpage-overlay
- 1.6
+ 2.0-SNAPSHOT
war
provided
ca.uhn.hapi.fhir
hapi-fhir-testpage-overlay
- 1.6
+ 2.0-SNAPSHOT
classes
provided
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 43fbb4ed4da..44d83509538 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -6,6 +6,16 @@
HAPI FHIR Changelog
+
+
+ Fix issue in DSTU1 Bundle parsing where unexpected elements in the bundle resulted in a failure
+ to parse.
+
+
+ DSTU2 QuestionnaireResponse validator failed with an exception if the
+ QuestionnaireResponse contained certain groups with no content
+
+
Performance has been improved for the initial FhirContext
diff --git a/src/site/xdoc/download.xml.vm b/src/site/xdoc/download.xml.vm
index 93880bbf7f7..792e5ed9499 100644
--- a/src/site/xdoc/download.xml.vm
+++ b/src/site/xdoc/download.xml.vm
@@ -20,7 +20,7 @@
hapi-fhir-structures-dstu |
- 1.1 - 1.6 |
+ 1.1 - 1.6.1 |
DSTU1 0.0.82 |
@@ -33,7 +33,7 @@
DSTU2 1.0.0 |
- 1.3 - 1.6 |
+ 1.3 - 1.6.1 |
DSTU2 1.0.2 |
@@ -50,7 +50,7 @@
DSTU2 1.0.2 |
- hapi-fhir-structures-dstu3 |
+ hapi-fhir-structures-dstu3 |
1.4 |
DSTU3 1.3.0 Snapshot (SVN 7602) |
@@ -62,6 +62,10 @@
1.6 |
DSTU3 1.4.0 Snapshot (SVN 8636) |
+
+ 1.6.1 |
+ DSTU3 1.5.0 Snapshot (SVN 8636) |
+
diff --git a/src/site/xdoc/index.xml b/src/site/xdoc/index.xml
index 3726243fa98..da050de4c42 100644
--- a/src/site/xdoc/index.xml
+++ b/src/site/xdoc/index.xml
@@ -71,7 +71,7 @@
of changes in this version. Among the enhancements in this release are:
- - Significant enhancements to FhirConetxt startup performance (especially on Android)
+ - Significant enhancements to FhirContext startup performance (especially on Android)
- Support for STU3 terminology services in the JPA module, including support for importing SNOMED CT and LOINC
- Update of the STU3 resources and validator to the latest snapshot
- Plenty of bug fixes