Search in sources :

Example 1 with GetSubmissionSetAndContentsQuery

use of org.openehealth.ipf.commons.ihe.xds.core.requests.query.GetSubmissionSetAndContentsQuery in project ipf by oehf.

the class GetSubmissionSetAndContentsQueryTransformerTest method setUp.

@BeforeEach
public void setUp() {
    transformer = new GetSubmissionSetAndContentsQueryTransformer();
    query = new GetSubmissionSetAndContentsQuery();
    query.setUuid("uuid1");
    query.setUniqueId("uniqueId1");
    query.setHomeCommunityId("home");
    var confidentialityCodes = new QueryList<Code>();
    confidentialityCodes.getOuterList().add(Arrays.asList(new Code("code10", null, "scheme10"), new Code("code11", null, "scheme11")));
    confidentialityCodes.getOuterList().add(Collections.singletonList(new Code("code12", null, "scheme12")));
    query.setConfidentialityCodes(confidentialityCodes);
    query.setFormatCodes(Arrays.asList(new Code("code13", null, "scheme13"), new Code("code14", null, "scheme14")));
    query.setDocumentEntryTypes(Arrays.asList(DocumentEntryType.STABLE, DocumentEntryType.ON_DEMAND));
    ebXML = new EbXMLFactory30().createAdhocQueryRequest();
}
Also used : EbXMLFactory30(org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLFactory30) GetSubmissionSetAndContentsQueryTransformer(org.openehealth.ipf.commons.ihe.xds.core.transform.requests.query.GetSubmissionSetAndContentsQueryTransformer) GetSubmissionSetAndContentsQuery(org.openehealth.ipf.commons.ihe.xds.core.requests.query.GetSubmissionSetAndContentsQuery) QueryList(org.openehealth.ipf.commons.ihe.xds.core.requests.query.QueryList) Code(org.openehealth.ipf.commons.ihe.xds.core.metadata.Code) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with GetSubmissionSetAndContentsQuery

use of org.openehealth.ipf.commons.ihe.xds.core.requests.query.GetSubmissionSetAndContentsQuery in project ipf by oehf.

the class GetSubmissionSetAndContentsQueryTransformerTest method testFromEbXMLEmpty.

@Test
public void testFromEbXMLEmpty() {
    var result = new GetSubmissionSetAndContentsQuery();
    transformer.fromEbXML(result, ebXML);
    assertEquals(new GetSubmissionSetAndContentsQuery(), result);
}
Also used : GetSubmissionSetAndContentsQuery(org.openehealth.ipf.commons.ihe.xds.core.requests.query.GetSubmissionSetAndContentsQuery) Test(org.junit.jupiter.api.Test)

Example 3 with GetSubmissionSetAndContentsQuery

use of org.openehealth.ipf.commons.ihe.xds.core.requests.query.GetSubmissionSetAndContentsQuery in project ipf by oehf.

the class GetSubmissionSetAndContentsQueryTransformerTest method testToEbXMLEmpty.

@Test
public void testToEbXMLEmpty() {
    transformer.toEbXML(new GetSubmissionSetAndContentsQuery(), ebXML);
    assertEquals(0, ebXML.getSlots().size());
}
Also used : GetSubmissionSetAndContentsQuery(org.openehealth.ipf.commons.ihe.xds.core.requests.query.GetSubmissionSetAndContentsQuery) Test(org.junit.jupiter.api.Test)

Example 4 with GetSubmissionSetAndContentsQuery

use of org.openehealth.ipf.commons.ihe.xds.core.requests.query.GetSubmissionSetAndContentsQuery in project ipf by oehf.

the class GetSubmissionSetAndContentsQueryTransformerTest method testFromEbXMLNull.

@Test
public void testFromEbXMLNull() {
    var result = new GetSubmissionSetAndContentsQuery();
    transformer.fromEbXML(result, null);
    assertEquals(new GetSubmissionSetAndContentsQuery(), result);
}
Also used : GetSubmissionSetAndContentsQuery(org.openehealth.ipf.commons.ihe.xds.core.requests.query.GetSubmissionSetAndContentsQuery) Test(org.junit.jupiter.api.Test)

Example 5 with GetSubmissionSetAndContentsQuery

use of org.openehealth.ipf.commons.ihe.xds.core.requests.query.GetSubmissionSetAndContentsQuery in project MobileAccessGateway by i4mi.

the class IdRequestConverter method idToGetDocumentsQuery.

/**
 * convert DocumentManifest id to GetSubmissionSetAndContentsQuery converter
 *
 * @param fhirHttpUri MAG defines uniqueId as FHIR id
 * @return
 */
public QueryRegistry idToGetDocumentsQuery(@Header(value = "FhirHttpUri") String fhirHttpUri) {
    if (fhirHttpUri != null && fhirHttpUri.contains("/")) {
        boolean getLeafClass = true;
        String uuid = fhirHttpUri.substring(fhirHttpUri.lastIndexOf("/") + 1);
        GetSubmissionSetAndContentsQuery query = new GetSubmissionSetAndContentsQuery();
        final QueryRegistry queryRegistry = new QueryRegistry(query);
        query.setUuid(uuid);
        queryRegistry.setReturnType((getLeafClass) ? QueryReturnType.LEAF_CLASS : QueryReturnType.OBJECT_REF);
        return queryRegistry;
    }
    return null;
}
Also used : QueryRegistry(org.openehealth.ipf.commons.ihe.xds.core.requests.QueryRegistry) GetSubmissionSetAndContentsQuery(org.openehealth.ipf.commons.ihe.xds.core.requests.query.GetSubmissionSetAndContentsQuery)

Aggregations

GetSubmissionSetAndContentsQuery (org.openehealth.ipf.commons.ihe.xds.core.requests.query.GetSubmissionSetAndContentsQuery)6 Test (org.junit.jupiter.api.Test)3 QueryRegistry (org.openehealth.ipf.commons.ihe.xds.core.requests.QueryRegistry)2 DateParam (ca.uhn.fhir.rest.param.DateParam)1 DateRangeParam (ca.uhn.fhir.rest.param.DateRangeParam)1 ReferenceParam (ca.uhn.fhir.rest.param.ReferenceParam)1 StringParam (ca.uhn.fhir.rest.param.StringParam)1 TokenOrListParam (ca.uhn.fhir.rest.param.TokenOrListParam)1 TokenParam (ca.uhn.fhir.rest.param.TokenParam)1 InvalidRequestException (ca.uhn.fhir.rest.server.exceptions.InvalidRequestException)1 ArrayList (java.util.ArrayList)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 EbXMLFactory30 (org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLFactory30)1 AssigningAuthority (org.openehealth.ipf.commons.ihe.xds.core.metadata.AssigningAuthority)1 AvailabilityStatus (org.openehealth.ipf.commons.ihe.xds.core.metadata.AvailabilityStatus)1 Code (org.openehealth.ipf.commons.ihe.xds.core.metadata.Code)1 Identifiable (org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable)1 FindSubmissionSetsQuery (org.openehealth.ipf.commons.ihe.xds.core.requests.query.FindSubmissionSetsQuery)1 Query (org.openehealth.ipf.commons.ihe.xds.core.requests.query.Query)1 QueryList (org.openehealth.ipf.commons.ihe.xds.core.requests.query.QueryList)1