use of com.nedap.archie.rm.datavalues.DvCodedText in project openEHR_SDK by ehrbase.
the class DvCodedTextIT method testValidate_FhirValueSet.
@Test
void testValidate_FhirValueSet() throws Exception {
var codePhrase = new CodePhrase(new TerminologyId("http://terminology.hl7.org/CodeSystem/v3-EntityNameUseR2"), "ANON");
var node = parseNode("/webtemplate_nodes/dv_codedtext_fhir_valueset.json");
var result = validator.validate(new DvCodedText("Anonymous", codePhrase), node);
assertTrue(result.isEmpty());
}
use of com.nedap.archie.rm.datavalues.DvCodedText in project openEHR_SDK by ehrbase.
the class DvCodedTextIT method testValidate_FhirCodeSystem_WrongCode.
@Test
void testValidate_FhirCodeSystem_WrongCode() throws Exception {
var codePhrase = new CodePhrase(new TerminologyId("http://hl7.org/fhir/observation-status"), "casual");
var node = parseNode("/webtemplate_nodes/dv_codedtext_fhir_codesystem.json");
var result = validator.validate(new DvCodedText("Casual", codePhrase), node);
assertEquals(1, result.size());
}
use of com.nedap.archie.rm.datavalues.DvCodedText in project openEHR_SDK by ehrbase.
the class DvCodedTextIT method testValidate_FhirCodeSystem.
@Test
void testValidate_FhirCodeSystem() throws Exception {
var codePhrase = new CodePhrase(new TerminologyId("http://hl7.org/fhir/observation-status"), "final");
var node = parseNode("/webtemplate_nodes/dv_codedtext_fhir_codesystem.json");
var result = validator.validate(new DvCodedText("Final", codePhrase), node);
assertTrue(result.isEmpty());
}
use of com.nedap.archie.rm.datavalues.DvCodedText 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.datavalues.DvCodedText 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();
}
}
Aggregations