Skip to content

Commit

Permalink
Sync to master
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesagnew committed Mar 29, 2018
1 parent 53c2d8a commit 180336e
Show file tree
Hide file tree
Showing 56 changed files with 113 additions and 170 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion example-projects/hapi-fhir-jpaserver-cds-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion example-projects/hapi-fhir-jpaserver-dynamic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>hapi-fhir-standalone-overlay-example</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion hapi-deployable-pom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-android/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-cli/hapi-fhir-cli-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-cli</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-cli</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-client-okhttp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

Expand Down
20 changes: 10 additions & 10 deletions hapi-fhir-converter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

Expand All @@ -16,14 +16,14 @@
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-base</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
</dependency>

<!-- Server -->
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-server</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<optional>true</optional>
</dependency>
<dependency>
Expand All @@ -35,43 +35,43 @@
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-dstu2</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-hl7org-dstu2</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-dstu2.1</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-dstu3</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-r4</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-validation-resources-dstu2</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-validation-resources-dstu3</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<optional>true</optional>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-igpacks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>hapi-deployable-pom</artifactId>
<groupId>ca.uhn.hapi.fhir</groupId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jacoco/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jaxrsserver-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jaxrsserver-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jpaserver-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.3.0</version>
<version>3.4.0-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,12 +487,8 @@ private Map<BundleEntryComponent, ResourceTable> doTransactionWriteOperations(Se
* end.
*/

for (Iterator<DeleteConflict> iter = deleteConflicts.iterator(); iter.hasNext(); ) {
DeleteConflict next = iter.next();
if (deletedResources.contains(next.getTargetId().toUnqualifiedVersionless().getValue())) {
iter.remove();
}
}
deleteConflicts.removeIf(next ->
deletedResources.contains(next.getTargetId().toUnqualifiedVersionless().getValue()));
validateDeleteConflictsEmptyOrThrowException(deleteConflicts);

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1516,13 +1516,33 @@ public void testTransactionDoesNotLeavePlaceholderIds() throws Exception {

@Test
public void testTransactionDoesntDoubleCreate() throws IOException {
String inputString = IOUtils.toString(FhirSystemDaoR4Test.class.getResourceAsStream("/r4/musc-obs-transaction.xml"), Charsets.UTF_8);

Bundle output;
Bundle output, input;
BundleEntryResponseComponent respEntry;
IdType createdId;

Bundle input = myFhirCtx.newXmlParser().parseResource(Bundle.class, inputString);
input = new Bundle();

Patient pat = new Patient();
pat.setId(IdType.newRandomUuid());
pat.addIdentifier().setSystem("foo").setValue("bar");
input
.addEntry()
.setResource(pat)
.setFullUrl(pat.getId())
.getRequest()
.setMethod(HTTPVerb.POST)
.setUrl("/Patient")
.setIfNoneExist("Patient?identifier=foo|bar");
Observation obs = new Observation();
obs.addIdentifier().setSystem("foo").setValue("dog");
obs.getSubject().setReference(pat.getId());
input
.addEntry()
.setResource(obs)
.getRequest()
.setMethod(HTTPVerb.PUT)
.setUrl("/Observation?identifier=foo|dog");

output = mySystemDao.transaction(mySrd, input);
respEntry = output.getEntry().get(0).getResponse();
assertEquals("201 Created", respEntry.getStatus());
Expand All @@ -1533,18 +1553,35 @@ public void testTransactionDoesntDoubleCreate() throws IOException {
respEntry = output.getEntry().get(1).getResponse();
assertEquals("201 Created", respEntry.getStatus());
createdId = new IdType(respEntry.getLocation());
assertEquals("Encounter", createdId.getResourceType());
assertEquals("1", createdId.getVersionIdPart());

respEntry = output.getEntry().get(0).getResponse();
assertEquals("201 Created", respEntry.getStatus());
createdId = new IdType(respEntry.getLocation());
assertEquals("Observation", createdId.getResourceType());
assertEquals("1", createdId.getVersionIdPart());

// Same bundle again

input = myFhirCtx.newXmlParser().parseResource(Bundle.class, inputString);
input = new Bundle();

pat = new Patient();
pat.setId(IdType.newRandomUuid());
pat.addIdentifier().setSystem("foo").setValue("bar");
input
.addEntry()
.setResource(pat)
.setFullUrl(pat.getId())
.getRequest()
.setMethod(HTTPVerb.POST)
.setUrl("/Patient")
.setIfNoneExist("Patient?identifier=foo|bar");
obs = new Observation();
obs.addIdentifier().setSystem("foo").setValue("dog");
obs.getSubject().setReference(pat.getId());
input
.addEntry()
.setResource(obs)
.getRequest()
.setMethod(HTTPVerb.PUT)
.setUrl("/Observation?identifier=foo|dog");


output = mySystemDao.transaction(mySrd, input);
respEntry = output.getEntry().get(0).getResponse();
assertEquals("200 OK", respEntry.getStatus());
Expand All @@ -1555,12 +1592,6 @@ public void testTransactionDoesntDoubleCreate() throws IOException {
respEntry = output.getEntry().get(1).getResponse();
assertEquals("200 OK", respEntry.getStatus());
createdId = new IdType(respEntry.getLocation());
assertEquals("Encounter", createdId.getResourceType());
assertEquals("1", createdId.getVersionIdPart());

respEntry = output.getEntry().get(0).getResponse();
assertEquals("200 OK", respEntry.getStatus());
createdId = new IdType(respEntry.getLocation());
assertEquals("Observation", createdId.getResourceType());
assertEquals("1", createdId.getVersionIdPart());

Expand Down
Loading

0 comments on commit 180336e

Please sign in to comment.