Search in sources :

Example 1 with CodeSetAccess

use of org.ehrbase.terminology.openehr.CodeSetAccess in project openEHR_SDK by ehrbase.

the class CodeSetAccessTest method testCodeSetAccess.

@Test
public void testCodeSetAccess() throws Exception {
    TerminologyInterface simpleTerminologyInterface = new SimpleTerminologyInterface("en");
    CodeSetAccess codeSetAccess = simpleTerminologyInterface.codeSetForId(OpenEHRCodeSetIdentifiers.INTEGRITY_CHECK_ALGORITHMS);
    assertEquals("openehr_integrity_check_algorithms", codeSetAccess.id());
    assertEquals(2, codeSetAccess.allCodes().size());
    assertTrue(codeSetAccess.hasCode(new CodePhrase(new TerminologyId("openehr_integrity_check_algorithms"), "SHA-1")));
}
Also used : TerminologyId(com.nedap.archie.rm.support.identification.TerminologyId) TerminologyInterface(org.ehrbase.terminology.openehr.TerminologyInterface) CodePhrase(com.nedap.archie.rm.datatypes.CodePhrase) CodeSetAccess(org.ehrbase.terminology.openehr.CodeSetAccess) Test(org.junit.Test)

Example 2 with CodeSetAccess

use of org.ehrbase.terminology.openehr.CodeSetAccess in project openEHR_SDK by ehrbase.

the class SimpleTerminologyInterfaceTest method testSimpleTerminologyService.

@Test
public void testSimpleTerminologyService() throws Exception {
    TerminologyInterface simpleTerminologyInterface = new SimpleTerminologyInterface("en");
    assertNotNull(simpleTerminologyInterface);
    // test interfaces with the defined terminologies
    TerminologyAccess terminologyAccess = simpleTerminologyInterface.terminology("openehr");
    assertNotNull(terminologyAccess);
    // external id
    CodeSetAccess codeSetAccess = simpleTerminologyInterface.codeSet("openehr_normal_statuses");
    assertNotNull(codeSetAccess);
    // internal (openehr) id
    codeSetAccess = simpleTerminologyInterface.codeSetForId(OpenEHRCodeSetIdentifiers.NORMAL_STATUSES);
    assertNotNull(codeSetAccess);
    assertTrue(simpleTerminologyInterface.hasTerminology("openehr"));
    assertTrue(simpleTerminologyInterface.hasCodeSet("normal statuses"));
    List<String> terminologies = simpleTerminologyInterface.codeSetIdentifiers();
    assertEquals(7, terminologies.size());
    Map<String, String> openehrCodeSets = simpleTerminologyInterface.openehrCodeSets();
    assertEquals(7, openehrCodeSets.size());
}
Also used : TerminologyInterface(org.ehrbase.terminology.openehr.TerminologyInterface) TerminologyAccess(org.ehrbase.terminology.openehr.TerminologyAccess) CodeSetAccess(org.ehrbase.terminology.openehr.CodeSetAccess) Test(org.junit.Test)

Aggregations

CodeSetAccess (org.ehrbase.terminology.openehr.CodeSetAccess)2 TerminologyInterface (org.ehrbase.terminology.openehr.TerminologyInterface)2 Test (org.junit.Test)2 CodePhrase (com.nedap.archie.rm.datatypes.CodePhrase)1 TerminologyId (com.nedap.archie.rm.support.identification.TerminologyId)1 TerminologyAccess (org.ehrbase.terminology.openehr.TerminologyAccess)1