Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/oehf/ipf
Browse files Browse the repository at this point in the history
  • Loading branch information
ohr committed Mar 23, 2017
2 parents 55e1224 + b707462 commit 2850162
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 13 deletions.
2 changes: 2 additions & 0 deletions boot/ipf-atna-spring-boot-starter/pom.xml
Expand Up @@ -9,6 +9,8 @@
</parent>

<artifactId>ipf-atna-spring-boot-starter</artifactId>
<name>ipf-atna-spring-boot-starter</name>
<description>Spring Boot support for Audit Trail</description>

<dependencies>
<dependency>
Expand Down
5 changes: 3 additions & 2 deletions boot/ipf-fhir-spring-boot-starter/pom.xml
Expand Up @@ -8,10 +8,11 @@
<version>3.3-SNAPSHOT</version>
</parent>

<artifactId>ipf-fhir-spring-boot-starter</artifactId>
<artifactId>ipf-fhir-spring-boot-starter</artifactId>
<name>ipf-fhir-spring-boot-starter</name>
<description>Spring Boot support for FHIR components</description>

<dependencies>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
Expand Down
5 changes: 3 additions & 2 deletions boot/ipf-hl7-spring-boot-starter/pom.xml
Expand Up @@ -8,10 +8,11 @@
<version>3.3-SNAPSHOT</version>
</parent>

<artifactId>ipf-hl7-spring-boot-starter</artifactId>
<artifactId>ipf-hl7-spring-boot-starter</artifactId>
<name>ipf-hl7-spring-boot-starter</name>
<description>Spring Boot support for HL7 v2 components</description>

<dependencies>

<!-- Camel Spring Boot Support -->
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
4 changes: 3 additions & 1 deletion boot/ipf-hl7v3-spring-boot-starter/pom.xml
Expand Up @@ -9,9 +9,11 @@
</parent>

<artifactId>ipf-hl7v3-spring-boot-starter</artifactId>
<name>ipf-hl7v3-spring-boot-starter</name>
<description>Spring Boot support for HL7 v3 components</description>

<dependencies>

<!-- Camel Spring Boot Support -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
Expand Down
4 changes: 3 additions & 1 deletion boot/ipf-hpd-spring-boot-starter/pom.xml
Expand Up @@ -9,9 +9,11 @@
</parent>

<artifactId>ipf-hpd-spring-boot-starter</artifactId>
<name>ipf-hpd-spring-boot-starter</name>
<description>Spring Boot support for HPD components</description>

<dependencies>

<!-- Camel Spring Boot Support -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
Expand Down
4 changes: 3 additions & 1 deletion boot/ipf-spring-boot-starter/pom.xml
Expand Up @@ -8,7 +8,9 @@
<version>3.3-SNAPSHOT</version>
</parent>

<artifactId>ipf-spring-boot-starter</artifactId>
<artifactId>ipf-spring-boot-starter</artifactId>
<name>ipf-spring-boot-starter</name>
<description>Generic Spring Boot support</description>

<dependencies>
<dependency>
Expand Down
3 changes: 2 additions & 1 deletion boot/ipf-xds-spring-boot-starter/pom.xml
Expand Up @@ -9,9 +9,10 @@
</parent>

<artifactId>ipf-xds-spring-boot-starter</artifactId>
<name>ipf-xds-spring-boot-starter</name>
<description>Spring Boot support for XD* components</description>

<dependencies>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
Expand Down
2 changes: 2 additions & 0 deletions boot/pom.xml
Expand Up @@ -11,6 +11,8 @@
<groupId>org.openehealth.ipf.boot</groupId>
<artifactId>ipf-spring-boot</artifactId>
<packaging>pom</packaging>
<name>ipf-spring-boot</name>
<description>Spring Boot support for IPF</description>

<modules>
<module>ipf-spring-boot-starter</module>
Expand Down
Expand Up @@ -19,6 +19,7 @@
import org.openehealth.ipf.commons.ihe.xds.core.ebxml.EbXMLRemoveObjectsRequest;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.ObjectReference;
import org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.lcm.RemoveObjectsRequest;
import org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.AdhocQueryType;
import org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.ObjectRefListType;
import org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.ObjectRefType;

Expand Down Expand Up @@ -93,7 +94,7 @@ public void setDeletionScope(String deletionScope) {
*/
@Delegate
private EbXMLSlotList30 getSlotList() {
return new EbXMLSlotList30(removeObjectsRequest.getAdhocQuery().getSlot());
return new EbXMLSlotList30(getAdhocQuery().getSlot());
}

@Override
Expand All @@ -116,24 +117,31 @@ public String getReturnType() {
return null;
}

private AdhocQueryType getAdhocQuery(){
if (removeObjectsRequest.getAdhocQuery() == null){
removeObjectsRequest.setAdhocQuery(new AdhocQueryType());
}
return removeObjectsRequest.getAdhocQuery();
}

@Override
public void setId(String id) {
removeObjectsRequest.getAdhocQuery().setId(id);
getAdhocQuery().setId(id);
}

@Override
public String getId() {
return removeObjectsRequest.getAdhocQuery().getId();
return getAdhocQuery().getId();
}

@Override
public void setHome(String homeCommunityID) {
removeObjectsRequest.getAdhocQuery().setHome(homeCommunityID);
getAdhocQuery().setHome(homeCommunityID);
}

@Override
public String getHome() {
return removeObjectsRequest.getAdhocQuery().getHome();
return getAdhocQuery().getHome();
}

@Override
Expand Down
Expand Up @@ -19,12 +19,18 @@
import org.junit.Test;
import org.openehealth.ipf.commons.ihe.xds.core.SampleData;
import org.openehealth.ipf.commons.ihe.xds.core.ebxml.EbXMLRemoveObjectsRequest;
import org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLRemoveObjectsRequest30;
import org.openehealth.ipf.commons.ihe.xds.core.requests.RemoveDocumentSet;
import org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.lcm.RemoveObjectsRequest;
import org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.ObjectRefListType;
import org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.ObjectRefType;
import org.openehealth.ipf.commons.ihe.xds.core.transform.requests.RemoveDocumentSetTransformer;
import org.openehealth.ipf.commons.ihe.xds.core.validate.ValidationMessage;
import org.openehealth.ipf.commons.ihe.xds.core.validate.ValidationProfile;
import org.openehealth.ipf.commons.ihe.xds.core.validate.XDSMetaDataException;

import java.util.UUID;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.openehealth.ipf.commons.ihe.xds.XDS_B.Interactions.ITI_62;
Expand Down Expand Up @@ -57,6 +63,20 @@ public void testValidateEmptyReferences() {
expectFailure(EMPTY_REFERENCE_LIST);
}

@Test
public void testIssue150() {
String[] uuids = {UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString()};
RemoveObjectsRequest request = new RemoveObjectsRequest();
request.setObjectRefList(new ObjectRefListType());
for (String uuid : uuids) {
ObjectRefType reference = new ObjectRefType();
reference.setId(uuid);
request.getObjectRefList().getObjectRef().add(reference);
}
EbXMLRemoveObjectsRequest ebXml = new EbXMLRemoveObjectsRequest30(request);
validator.validate(ebXml, ITI_62);
}

private void expectFailure(ValidationMessage expectedMessage) {
expectFailure(expectedMessage, transformer.toEbXML(request));
}
Expand Down

0 comments on commit 2850162

Please sign in to comment.