Search in sources :

Example 1 with Identifiable

use of org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable in project ipf by oehf.

the class AdhocQueryRequestValidatorTest method testDuplicateSlotForFindDocumentsQueryValidationWithSuccess.

@Test
public void testDuplicateSlotForFindDocumentsQueryValidationWithSuccess() {
    var query = new FindDocumentsQuery();
    query.setPatientId(new Identifiable("id3", new AssigningAuthority("1.3")));
    var ebXML = transformer.toEbXML(request);
    ebXML.addSlot(QueryParameter.DOC_ENTRY_EVENT_CODE.getSlotName(), "('event-code-1^^event-code-scheme-1')");
    ebXML.addSlot(QueryParameter.DOC_ENTRY_EVENT_CODE.getSlotName(), "('event-code-2^^event-code-scheme-2')");
    try {
        validator.validate(ebXML, ITI_18);
    } catch (XDSMetaDataException e) {
        fail("Test should succeed, but failed with exception: " + XDSMetaDataException.class);
    }
}
Also used : XDSMetaDataException(org.openehealth.ipf.commons.ihe.xds.core.validate.XDSMetaDataException) AssigningAuthority(org.openehealth.ipf.commons.ihe.xds.core.metadata.AssigningAuthority) Identifiable(org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable) Test(org.junit.jupiter.api.Test)

Example 2 with Identifiable

use of org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable in project ipf by oehf.

the class DocumentTest method setUp.

@BeforeEach
public void setUp() throws Exception {
    var somePatientID = new Identifiable("id1", new AssigningAuthority("1.3"));
    someData = SampleData.createDataHandler();
    docEntry = SampleData.createDocumentEntry(somePatientID);
    var conversionService = new GenericConversionService();
    conversionService.addConverter(new DataHandlerToByteArrayConverter());
    conversionService.addConverter(new ByteArrayToStringConverter());
    conversionService.addConverter(new ByteArrayToClinicalDocumentConverter());
    conversionService.addConverter(new ByteArrayToDomConverter());
    Document.setConversionService(new SpringTypeConverter(conversionService));
}
Also used : ByteArrayToStringConverter(org.openehealth.ipf.platform.camel.ihe.continua.hrn.converters.ByteArrayToStringConverter) ByteArrayToDomConverter(org.openehealth.ipf.platform.camel.ihe.continua.hrn.converters.ByteArrayToDomConverter) DataHandlerToByteArrayConverter(org.openehealth.ipf.platform.camel.ihe.continua.hrn.converters.DataHandlerToByteArrayConverter) AssigningAuthority(org.openehealth.ipf.commons.ihe.xds.core.metadata.AssigningAuthority) SpringTypeConverter(org.openehealth.ipf.commons.spring.core.config.SpringTypeConverter) GenericConversionService(org.springframework.core.convert.support.GenericConversionService) ByteArrayToClinicalDocumentConverter(org.openehealth.ipf.platform.camel.ihe.continua.hrn.converters.ByteArrayToClinicalDocumentConverter) Identifiable(org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 3 with Identifiable

use of org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable in project ipf by oehf.

the class FindDispensesQueryTransformerTest method setUp.

@BeforeEach
public void setUp() {
    transformer = new FindDispensesQueryTransformer();
    query = new FindDispensesQuery();
    query.setPatientId(new Identifiable("id3", new AssigningAuthority("uni3", "uniType3")));
    query.setHomeCommunityId("12.21.41");
    query.setConfidentialityCodes(Arrays.asList(new Code("code10", null, "scheme10"), new Code("code11", null, "scheme11")));
    query.getCreationTime().setFrom("1980");
    query.getCreationTime().setTo("1981");
    query.getServiceStartTime().setFrom("1982");
    query.getServiceStartTime().setTo("1983");
    query.getServiceStopTime().setFrom("1984");
    query.getServiceStopTime().setTo("1985");
    query.setStatus(Arrays.asList(AvailabilityStatus.APPROVED, AvailabilityStatus.SUBMITTED));
    query.setUuids(Arrays.asList("uuid1", "uuid2"));
    query.setUniqueIds(Arrays.asList("uniqueId1", "uniqueId2"));
    query.setPracticeSettingCodes(Arrays.asList(new Code("code3", null, "scheme3"), new Code("code4", null, "scheme4")));
    query.setHealthcareFacilityTypeCodes(Arrays.asList(new Code("code5", null, "scheme5"), new Code("code6", null, "scheme6")));
    query.setEventCodes(Arrays.asList(new Code("code7", null, "scheme7"), new Code("code8", null, "scheme8")));
    query.setAuthorPersons(Arrays.asList("per'son1", "person2"));
    ebXML = new EbXMLFactory30().createAdhocQueryRequest();
}
Also used : EbXMLFactory30(org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLFactory30) FindDispensesQuery(org.openehealth.ipf.commons.ihe.xds.core.requests.query.FindDispensesQuery) AssigningAuthority(org.openehealth.ipf.commons.ihe.xds.core.metadata.AssigningAuthority) FindDispensesQueryTransformer(org.openehealth.ipf.commons.ihe.xds.core.transform.requests.query.FindDispensesQueryTransformer) Code(org.openehealth.ipf.commons.ihe.xds.core.metadata.Code) Identifiable(org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 4 with Identifiable

use of org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable in project ipf by oehf.

the class FindFoldersQueryTransformerTest method setUp.

@BeforeEach
public void setUp() {
    transformer = new FindFoldersQueryTransformer();
    query = new FindFoldersQuery();
    query.setPatientId(new Identifiable("id1", new AssigningAuthority("uni1", "uniType1")));
    query.getLastUpdateTime().setFrom("20150102030405");
    query.getLastUpdateTime().setTo("20150102030406");
    var codes = new QueryList<Code>();
    codes.getOuterList().add(Arrays.asList(new Code("code7", null, "scheme7"), new Code("code8", null, "scheme8")));
    codes.getOuterList().add(Collections.singletonList(new Code("code9", null, "scheme9")));
    query.setCodes(codes);
    query.setStatus(Arrays.asList(AvailabilityStatus.APPROVED, AvailabilityStatus.SUBMITTED));
    query.setHomeCommunityId("12.21.41");
    ebXML = new EbXMLFactory30().createAdhocQueryRequest();
}
Also used : EbXMLFactory30(org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLFactory30) FindFoldersQueryTransformer(org.openehealth.ipf.commons.ihe.xds.core.transform.requests.query.FindFoldersQueryTransformer) FindFoldersQuery(org.openehealth.ipf.commons.ihe.xds.core.requests.query.FindFoldersQuery) AssigningAuthority(org.openehealth.ipf.commons.ihe.xds.core.metadata.AssigningAuthority) QueryList(org.openehealth.ipf.commons.ihe.xds.core.requests.query.QueryList) Code(org.openehealth.ipf.commons.ihe.xds.core.metadata.Code) Identifiable(org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 5 with Identifiable

use of org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable in project ipf by oehf.

the class FindMedicationAdministrationsTransformerTest method setUp.

@BeforeEach
public void setUp() {
    transformer = new FindMedicationAdministrationsQueryTransformer();
    query = new FindMedicationAdministrationsQuery();
    query.setPatientId(new Identifiable("id1", new AssigningAuthority("uni1", "uniType1")));
    query.setHomeCommunityId("12.21.41");
    query.setConfidentialityCodes(Arrays.asList(new Code("code10", null, "scheme10"), new Code("code11", null, "scheme11")));
    query.getCreationTime().setFrom("1980");
    query.getCreationTime().setTo("1981");
    query.getServiceStartTime().setFrom("1982");
    query.getServiceStartTime().setTo("1983");
    query.getServiceStopTime().setFrom("1984");
    query.getServiceStopTime().setTo("1985");
    query.setStatus(Arrays.asList(AvailabilityStatus.APPROVED, AvailabilityStatus.SUBMITTED));
    query.setUuids(Arrays.asList("uuid1", "uuid2"));
    query.setUniqueIds(Arrays.asList("uniqueId1", "uniqueId2"));
    query.setPracticeSettingCodes(Arrays.asList(new Code("code3", null, "scheme3"), new Code("code4", null, "scheme4")));
    query.setHealthcareFacilityTypeCodes(Arrays.asList(new Code("code5", null, "scheme5"), new Code("code6", null, "scheme6")));
    query.setEventCodes(Arrays.asList(new Code("code7", null, "scheme7"), new Code("code8", null, "scheme8")));
    query.setAuthorPersons(Arrays.asList("per'son1", "person2"));
    ebXML = new EbXMLFactory30().createAdhocQueryRequest();
}
Also used : EbXMLFactory30(org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLFactory30) FindMedicationAdministrationsQueryTransformer(org.openehealth.ipf.commons.ihe.xds.core.transform.requests.query.FindMedicationAdministrationsQueryTransformer) FindMedicationAdministrationsQuery(org.openehealth.ipf.commons.ihe.xds.core.requests.query.FindMedicationAdministrationsQuery) AssigningAuthority(org.openehealth.ipf.commons.ihe.xds.core.metadata.AssigningAuthority) Code(org.openehealth.ipf.commons.ihe.xds.core.metadata.Code) Identifiable(org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

Identifiable (org.openehealth.ipf.commons.ihe.xds.core.metadata.Identifiable)30 AssigningAuthority (org.openehealth.ipf.commons.ihe.xds.core.metadata.AssigningAuthority)21 Code (org.openehealth.ipf.commons.ihe.xds.core.metadata.Code)12 BeforeEach (org.junit.jupiter.api.BeforeEach)11 EbXMLFactory30 (org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLFactory30)9 Practitioner (org.hl7.fhir.r4.model.Practitioner)7 InvalidRequestException (ca.uhn.fhir.rest.server.exceptions.InvalidRequestException)6 Identifier (org.hl7.fhir.r4.model.Identifier)6 ListResource (org.hl7.fhir.r4.model.ListResource)6 Patient (org.hl7.fhir.r4.model.Patient)6 PractitionerRole (org.hl7.fhir.r4.model.PractitionerRole)6 Reference (org.hl7.fhir.r4.model.Reference)6 Test (org.junit.jupiter.api.Test)6 CXiAssigningAuthority (org.openehealth.ipf.commons.ihe.xds.core.metadata.CXiAssigningAuthority)6 LocalizedString (org.openehealth.ipf.commons.ihe.xds.core.metadata.LocalizedString)6 ArrayList (java.util.ArrayList)5 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)5 Coding (org.hl7.fhir.r4.model.Coding)5 DomainResource (org.hl7.fhir.r4.model.DomainResource)5 Resource (org.hl7.fhir.r4.model.Resource)5