use of org.ehrbase.building.OptSkeletonBuilder in project openEHR_SDK by ehrbase.
the class NormalizerTest method normalize.
@Test
public void normalize() throws IOException, XmlException {
OPERATIONALTEMPLATE template = TemplateDocument.Factory.parse(OperationalTemplateTestData.ALL_TYPES.getStream()).getTemplate();
OptSkeletonBuilder skeletonBuilder = new OptSkeletonBuilder();
RMObject rmObject = skeletonBuilder.generate(template);
Normalizer cut = new Normalizer();
Composition actual = (Composition) cut.normalize(rmObject);
assertThat(actual).isNotNull();
assertThat(actual.getContent()).size().isEqualTo(0);
}
use of org.ehrbase.building.OptSkeletonBuilder in project openEHR_SDK by ehrbase.
the class OptSkeletonBuilderTest method testGenerateCorona.
@Test
public void testGenerateCorona() throws Exception {
org.openehr.schemas.v1.TemplateDocument document = org.openehr.schemas.v1.TemplateDocument.Factory.parse(OperationalTemplateTestData.CORONA_ANAMNESE.getStream());
OPERATIONALTEMPLATE operationaltemplate = document.getTemplate();
OptSkeletonBuilder cut = new OptSkeletonBuilder();
Composition generate = (Composition) cut.generate(operationaltemplate);
assertThat(generate.getContent()).extracting(Locatable::getName).extracting(DvText::getValue).containsExactlyInAnyOrder("Geschichte/Historie", "Symptome", "Kontakt", "Risikogebiet", "Allgemeine Angaben");
}
use of org.ehrbase.building.OptSkeletonBuilder in project openEHR_SDK by ehrbase.
the class OptSkeletonBuilderTest method testGenerateEpisodeOfCare.
@Test
public void testGenerateEpisodeOfCare() throws Exception {
org.openehr.schemas.v1.TemplateDocument document = org.openehr.schemas.v1.TemplateDocument.Factory.parse(OperationalTemplateTestData.EPISODE_OF_CARE.getStream());
OPERATIONALTEMPLATE operationaltemplate = document.getTemplate();
OptSkeletonBuilder cut = new OptSkeletonBuilder();
Composition generate = (Composition) cut.generate(operationaltemplate);
assertThat(generate).isNotNull();
assertThat(generate.itemAtPath("/composer")).isNotNull();
assertThat(generate.itemAtPath("/context/end_time")).isNotNull();
assertThat(generate.itemAtPath("/name")).extracting(d -> ((DvText) d).getValue()).isEqualTo("EpisodeOfCare");
}
use of org.ehrbase.building.OptSkeletonBuilder in project openEHR_SDK by ehrbase.
the class OptSkeletonBuilderTest method testGenerate.
@Test
public void testGenerate() throws Exception {
org.openehr.schemas.v1.TemplateDocument document = org.openehr.schemas.v1.TemplateDocument.Factory.parse(OperationalTemplateTestData.BLOOD_PRESSURE_SIMPLE.getStream());
OPERATIONALTEMPLATE operationaltemplate = document.getTemplate();
OptSkeletonBuilder cut = new OptSkeletonBuilder();
Composition generate = (Composition) cut.generate(operationaltemplate);
assertThat(generate).isNotNull();
assertThat(generate.itemAtPath("/composer")).isNotNull();
assertThat(generate.itemAtPath("/context/end_time")).isNotNull();
assertThat(generate.itemAtPath("/content[openEHR-EHR-OBSERVATION.sample_blood_pressure.v1]/data[at0001]/events[at0002]/state[at0007]/items[at1005]/value")).isNotNull();
}
Aggregations