Search in sources :

Example 1 with FhirTerminologyValidation

use of org.ehrbase.validation.terminology.FhirTerminologyValidation in project openEHR_SDK by ehrbase.

the class DvCodedTextTest method testFailOnError_Disabled.

@Test
void testFailOnError_Disabled() throws Exception {
    var validationSupport = new FhirTerminologyValidation("https://wrong.terminology.server/fhir");
    var codePhrase = new CodePhrase(new TerminologyId("http://hl7.org/fhir/observation-status"), "B");
    var dvCodedText = new DvCodedText("Buccal", codePhrase);
    var validator = new DvCodedTextValidator(validationSupport);
    var node = parseNode("/webtemplate_nodes/dv_codedtext_fhir_valueset.json");
    assertThrows(ExternalTerminologyValidationException.class, () -> validator.validate(dvCodedText, node));
}
Also used : TerminologyId(com.nedap.archie.rm.support.identification.TerminologyId) CodePhrase(com.nedap.archie.rm.datatypes.CodePhrase) DvCodedText(com.nedap.archie.rm.datavalues.DvCodedText) FhirTerminologyValidation(org.ehrbase.validation.terminology.FhirTerminologyValidation) Test(org.junit.jupiter.api.Test)

Example 2 with FhirTerminologyValidation

use of org.ehrbase.validation.terminology.FhirTerminologyValidation in project openEHR_SDK by ehrbase.

the class DvCodedTextTest method testFailOnError_Enabled.

@Test
void testFailOnError_Enabled() throws Exception {
    var validationSupport = new FhirTerminologyValidation("https://wrong.terminology.server/fhir");
    var codePhrase = new CodePhrase(new TerminologyId("http://hl7.org/fhir/observation-status"), "B");
    var dvCodedText = new DvCodedText("Buccal", codePhrase);
    var validator = new DvCodedTextValidator(validationSupport);
    var node = parseNode("/webtemplate_nodes/dv_codedtext_fhir_valueset.json");
    assertThrows(ExternalTerminologyValidationException.class, () -> validator.validate(dvCodedText, node));
}
Also used : TerminologyId(com.nedap.archie.rm.support.identification.TerminologyId) CodePhrase(com.nedap.archie.rm.datatypes.CodePhrase) DvCodedText(com.nedap.archie.rm.datavalues.DvCodedText) FhirTerminologyValidation(org.ehrbase.validation.terminology.FhirTerminologyValidation) Test(org.junit.jupiter.api.Test)

Aggregations

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