use of org.ehrbase.client.classgenerator.examples.patientenaufenthaltcomposition.definition.StandortClusterContainment in project openEHR_SDK by ehrbase.
the class CoronaTestIT method testNUMResearchCase_1_2.
/**
* see https://wiki.vitagroup.ag/display/NUM/Research+Repository
* containment test:
* contains COMPOSITION c[openEHR-EHR-COMPOSITION.event_summary.v0]
* contains ADMIN_ENTRY m[openEHR-EHR-ADMIN_ENTRY.hospitalization.v0]
* contains CLUSTER k[openEHR-EHR-CLUSTER.location.v1]
*/
@Test
public void testNUMResearchCase_1_2() {
ehr = openEhrClient.ehrEndpoint().createEhr();
openEhrClient.compositionEndpoint(ehr).mergeCompositionEntity(TestData.buildTestPatientenaufenthaltComposition());
// build AQL
PatientenaufenthaltCompositionContainment patientenaufenthaltCompositionContainment = PatientenaufenthaltCompositionContainment.getInstance();
VersorgungsortAdminEntryContainment versorgungsortAdminEntryContainment = VersorgungsortAdminEntryContainment.getInstance();
StandortClusterContainment standortClusterContainment = StandortClusterContainment.getInstance();
versorgungsortAdminEntryContainment.setContains(standortClusterContainment);
patientenaufenthaltCompositionContainment.setContains(versorgungsortAdminEntryContainment);
// select set values from test data
EntityQuery<Record3<String, String, StandortschlusselDefiningCode>> entityQuery = Query.buildEntityQuery(patientenaufenthaltCompositionContainment, standortClusterContainment.STANDORTTYP_VALUE, standortClusterContainment.STANDORTBESCHREIBUNG_VALUE, standortClusterContainment.STANDORTSCHLUSSEL_DEFINING_CODE);
Parameter<UUID> ehrIdParameter = entityQuery.buildParameter();
entityQuery.where(Condition.equal(EhrFields.EHR_ID(), ehrIdParameter));
List<Record3<String, String, StandortschlusselDefiningCode>> actual = openEhrClient.aqlEndpoint().execute(entityQuery, ehrIdParameter.setValue(ehr));
assertThat(actual).extracting(Record3::value1, Record3::value2, Record3::value3).containsExactlyInAnyOrder(new Tuple("Test", "Beschreibung", StandortschlusselDefiningCode.ANGIOLOGIE));
}
use of org.ehrbase.client.classgenerator.examples.patientenaufenthaltcomposition.definition.StandortClusterContainment in project openEHR_SDK by ehrbase.
the class CoronaTestIT method testNUMResearchCase_5.
/**
* see https://wiki.vitagroup.ag/display/NUM/Research+Repository
*
* Containment test:
*
* contains COMPOSITION c[openEHR-EHR-COMPOSITION.event_summary.v0]
* contains
* (CLUSTER n[openEHR-EHR-CLUSTER.case_identification.v0]
* and ADMIN_ENTRY u[openEHR-EHR-ADMIN_ENTRY.hospitalization.v0]
* contains (CLUSTER a[openEHR-EHR-CLUSTER.location.v1]))
*/
@Test
public void testNUMResearchCase_5() {
ehr = openEhrClient.ehrEndpoint().createEhr();
openEhrClient.compositionEndpoint(ehr).mergeCompositionEntity(TestData.buildTestPatientenaufenthaltComposition());
// build AQL
PatientenaufenthaltCompositionContainment patientenaufenthaltCompositionContainment = PatientenaufenthaltCompositionContainment.getInstance();
AbteilungsfallClusterContainment abteilungsfallClusterContainment = AbteilungsfallClusterContainment.getInstance();
VersorgungsortAdminEntryContainment versorgungsortAdminEntryContainment = VersorgungsortAdminEntryContainment.getInstance();
StandortClusterContainment standortClusterContainment = StandortClusterContainment.getInstance();
ContainmentExpression containmentExpression = patientenaufenthaltCompositionContainment.contains(abteilungsfallClusterContainment.and(versorgungsortAdminEntryContainment.contains(standortClusterContainment)));
// select set values from test data
EntityQuery<Record3<TemporalAccessor, TemporalAccessor, String>> entityQuery = Query.buildEntityQuery(containmentExpression, versorgungsortAdminEntryContainment.BEGINN_VALUE, versorgungsortAdminEntryContainment.ENDE_VALUE, versorgungsortAdminEntryContainment.GRUND_DES_AUFENTHALTES_VALUE);
Parameter<UUID> ehrIdParameter = entityQuery.buildParameter();
entityQuery.where(Condition.equal(EhrFields.EHR_ID(), ehrIdParameter));
List<Record3<TemporalAccessor, TemporalAccessor, String>> actual = openEhrClient.aqlEndpoint().execute(entityQuery, ehrIdParameter.setValue(ehr));
assertThat(actual).extracting(Record3::value1, Record3::value2, Record3::value3).containsExactlyInAnyOrder(new Tuple(new DvDateTime("2020-01-01T10:00Z").getValue(), new DvDateTime("2020-01-01T12:00Z").getValue(), "test value"));
}
use of org.ehrbase.client.classgenerator.examples.patientenaufenthaltcomposition.definition.StandortClusterContainment in project openEHR_SDK by ehrbase.
the class ContainmentNUMResearchTest method test_1.
@Test
public void test_1() {
PatientenaufenthaltCompositionContainment patientenaufenthaltCompositionContainment = PatientenaufenthaltCompositionContainment.getInstance();
// build AQL expression
VersorgungsortAdminEntryContainment versorgungsortAdminEntryContainment = VersorgungsortAdminEntryContainment.getInstance();
StandortClusterContainment standortClusterContainment = StandortClusterContainment.getInstance();
versorgungsortAdminEntryContainment.setContains(standortClusterContainment);
patientenaufenthaltCompositionContainment.setContains(versorgungsortAdminEntryContainment);
Query.buildEntityQuery(patientenaufenthaltCompositionContainment);
String aql = patientenaufenthaltCompositionContainment.buildAQL();
assertNotNull(aql);
}
Aggregations