use of com.nedap.archie.rm.support.identification.TerminologyId in project openEHR_SDK by ehrbase.
the class DvCodedTextIT method testValidate_UnsupportedExternalTerminology.
@Test
void testValidate_UnsupportedExternalTerminology() throws Exception {
var node = parseNode("/webtemplate_nodes/dv_codedtext_unsupported.json");
var dvCodedText = new DvCodedText("Iodine-deficiency related thyroid disorders and allied conditions", new CodePhrase(new TerminologyId("ICD10"), "E01"));
var result = validator.validate(dvCodedText, node);
assertTrue(result.isEmpty());
}
use of com.nedap.archie.rm.support.identification.TerminologyId in project openEHR_SDK by ehrbase.
the class ItemValidatorTest method matchValidator.
@Test
public void matchValidator() throws NoSuchMethodException, IllegalAccessException, ClassNotFoundException {
ItemValidator itemValidator = new ItemValidator();
itemValidator.add(new org.ehrbase.validation.terminology.validator.DvCodedText());
DvCodedText dvCodedText = new DvCodedText("secondary allied health care", new CodePhrase(new TerminologyId("openehr"), "234"));
assertTrue(itemValidator.isValidatedRmObjectType(dvCodedText));
try {
itemValidator.validate(new LocalizedTerminologies().locale("en"), AttributeCodesetMapping.getInstance(), "setting", dvCodedText, "en");
} catch (Throwable throwable) {
fail();
}
}
use of com.nedap.archie.rm.support.identification.TerminologyId in project openEHR_SDK by ehrbase.
the class TerminologyCheckTest method testSimpleValidationWrongCode.
@Test
public void testSimpleValidationWrongCode() throws Exception {
DvCodedText category = new DvCodedText("event", new CodePhrase(new TerminologyId("openehr"), "999"));
try {
org.ehrbase.validation.terminology.validator.DvCodedText.validate(localizedTerminologies.locale("en"), codesetMapping, "category", category, "en");
fail("should have detected a bad code");
} catch (Exception e) {
}
}
use of com.nedap.archie.rm.support.identification.TerminologyId in project openEHR_SDK by ehrbase.
the class TerminologyCheckTest method testSimpleValidationLanguageWrong.
@Test
public void testSimpleValidationLanguageWrong() throws Exception {
CodePhrase codePhrase = new CodePhrase(new TerminologyId("ISO_3166-1"), "ZZ");
try {
org.ehrbase.validation.terminology.validator.DvCodedText.validate(localizedTerminologies.locale("en"), codesetMapping, "territory", codePhrase, "en");
fail("should have detected a wrong value");
} catch (Exception e) {
}
}
use of com.nedap.archie.rm.support.identification.TerminologyId in project openEHR_SDK by ehrbase.
the class TerminologyCheckTest method testSimpleValidation.
@Test
public void testSimpleValidation() throws Exception {
DvCodedText category = new DvCodedText("event", new CodePhrase(new TerminologyId("openehr"), "433"));
org.ehrbase.validation.terminology.validator.DvCodedText.validate(localizedTerminologies.locale("en"), codesetMapping, "category", category, "en");
}
Aggregations