Search in sources :

Example 1 with DvState

use of com.nedap.archie.rm.datavalues.DvState in project openEHR_SDK by ehrbase.

the class DvStateValidatorTest method testValidate.

@Test
void testValidate() throws Exception {
    var node = parseNode("/webtemplate_nodes/dv_state.json");
    var dvState = new DvState();
    dvState.setValue(new DvCodedText("Test", new CodePhrase(new TerminologyId("local"), "at0010")));
    var result = validator.validate(dvState, node);
    assertTrue(result.isEmpty());
}
Also used : TerminologyId(com.nedap.archie.rm.support.identification.TerminologyId) DvState(com.nedap.archie.rm.datavalues.DvState) DvCodedText(com.nedap.archie.rm.datavalues.DvCodedText) CodePhrase(com.nedap.archie.rm.datatypes.CodePhrase) Test(org.junit.jupiter.api.Test)

Example 2 with DvState

use of com.nedap.archie.rm.datavalues.DvState in project openEHR_SDK by ehrbase.

the class DvStateValidatorTest method testValidate_List.

@Test
void testValidate_List() throws Exception {
    var node = parseNode("/webtemplate_nodes/dv_state_codedtext.json");
    var dvState = new DvState();
    dvState.setValue(new DvCodedText("First", new CodePhrase(new TerminologyId("local"), "at0028")));
    var result = validator.validate(dvState, node);
    assertTrue(result.isEmpty());
    dvState.setValue(new DvCodedText("Test", new CodePhrase(new TerminologyId("local"), "at0010")));
    result = validator.validate(dvState, node);
    assertEquals(1, result.size());
}
Also used : TerminologyId(com.nedap.archie.rm.support.identification.TerminologyId) DvState(com.nedap.archie.rm.datavalues.DvState) DvCodedText(com.nedap.archie.rm.datavalues.DvCodedText) CodePhrase(com.nedap.archie.rm.datatypes.CodePhrase) Test(org.junit.jupiter.api.Test)

Aggregations

CodePhrase (com.nedap.archie.rm.datatypes.CodePhrase)2 DvCodedText (com.nedap.archie.rm.datavalues.DvCodedText)2 DvState (com.nedap.archie.rm.datavalues.DvState)2 TerminologyId (com.nedap.archie.rm.support.identification.TerminologyId)2 Test (org.junit.jupiter.api.Test)2