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")));
}
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());
}
Aggregations