se.cambio.cds.ts
Class CSVTerminologyServicePlugin

Package class diagram package CSVTerminologyServicePlugin
java.lang.Object
  extended by se.cambio.cds.ts.CSVTerminologyServicePlugin
All Implemented Interfaces:
TerminologyService, TerminologyServicePlugin
Direct Known Subclasses:
ICD10TerminologyServicePlugin

public class CSVTerminologyServicePlugin
extends Object
implements TerminologyServicePlugin


Constructor Summary
CSVTerminologyServicePlugin(String terminologyId)
           
 
Method Summary
protected  boolean checkSubclassOf(String as, String bs)
           
protected  String getDescription(String code)
           
 Collection<String> getSupportedTerminologies()
           
 String getTerminologyId()
           
 boolean hasPropertyOfValue(org.openehr.rm.datatypes.text.CodePhrase concept, org.openehr.rm.datatypes.text.CodePhrase property, org.openehr.rm.datatypes.text.CodePhrase value)
          Checks if given concept has a named attribute of given value
 void init(InputStream is)
           
protected  boolean invalidCode(String code)
           
 boolean isSubclassOf(org.openehr.rm.datatypes.text.CodePhrase a, org.openehr.rm.datatypes.text.CodePhrase b)
          Checks if codePhrase a is subclass of b with regards to subsumption relationship
 boolean isSubclassOf(org.openehr.rm.datatypes.text.CodePhrase code, Set<org.openehr.rm.datatypes.text.CodePhrase> codes)
          Checks if the given code is subclass of any member of specified set of codes
 boolean isTerminologySupported(String terminologyId)
           
 void registerDescription(String code, String description)
           
 List<Node> retrieve(String expression, org.openehr.rm.datatypes.text.CodePhrase language)
           
 List<Node> retrieveAll(String terminologyId, org.openehr.rm.datatypes.text.CodePhrase language)
           
 List<org.openehr.rm.datatypes.text.DvCodedText> retrieveAllPossibleValues(org.openehr.rm.datatypes.text.CodePhrase property, org.openehr.rm.datatypes.text.CodePhrase language)
          Retrieves all possible values of given attribute with labels in specified language
 Node retrieveAllSubclasses(org.openehr.rm.datatypes.text.CodePhrase concept, org.openehr.rm.datatypes.text.CodePhrase language)
          Retrieves all subclasses of given concept with specified language
 String retrieveTerm(org.openehr.rm.datatypes.text.CodePhrase concept, org.openehr.rm.datatypes.text.CodePhrase language)
          Retrieves the term of a given concept in given language
protected  String retrieveTerm(String code, org.openehr.rm.datatypes.text.CodePhrase language)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVTerminologyServicePlugin

public CSVTerminologyServicePlugin(String terminologyId)
Method Detail

init

public void init(InputStream is)
          throws InternalErrorException
Specified by:
init in interface TerminologyServicePlugin
Throws:
InternalErrorException

getTerminologyId

public String getTerminologyId()
Specified by:
getTerminologyId in interface TerminologyServicePlugin

isSubclassOf

public boolean isSubclassOf(org.openehr.rm.datatypes.text.CodePhrase a,
                            org.openehr.rm.datatypes.text.CodePhrase b)
                     throws UnsupportedTerminologyException,
                            InvalidCodeException
Description copied from interface: TerminologyService
Checks if codePhrase a is subclass of b with regards to subsumption relationship

Specified by:
isSubclassOf in interface TerminologyService
Returns:
true if a is subclass of b
Throws:
UnsupportedTerminologyException
InvalidCodeException

isSubclassOf

public boolean isSubclassOf(org.openehr.rm.datatypes.text.CodePhrase code,
                            Set<org.openehr.rm.datatypes.text.CodePhrase> codes)
                     throws UnsupportedTerminologyException,
                            InvalidCodeException
Description copied from interface: TerminologyService
Checks if the given code is subclass of any member of specified set of codes

Specified by:
isSubclassOf in interface TerminologyService
Returns:
true if a is subclass of b
Throws:
UnsupportedTerminologyException
InvalidCodeException

retrieveAllSubclasses

public Node retrieveAllSubclasses(org.openehr.rm.datatypes.text.CodePhrase concept,
                                  org.openehr.rm.datatypes.text.CodePhrase language)
                           throws UnsupportedTerminologyException,
                                  UnsupportedLanguageException,
                                  InvalidCodeException
Description copied from interface: TerminologyService
Retrieves all subclasses of given concept with specified language

Specified by:
retrieveAllSubclasses in interface TerminologyService
Returns:
returns a tree representation of subclasses
Throws:
UnsupportedTerminologyException
UnsupportedLanguageException
InvalidCodeException

retrieve

public List<Node> retrieve(String expression,
                           org.openehr.rm.datatypes.text.CodePhrase language)
                    throws UnsupportedTerminologyException,
                           UnsupportedLanguageException
Specified by:
retrieve in interface TerminologyService
Throws:
UnsupportedTerminologyException
UnsupportedLanguageException

retrieveAll

public List<Node> retrieveAll(String terminologyId,
                              org.openehr.rm.datatypes.text.CodePhrase language)
                       throws UnsupportedTerminologyException,
                              UnsupportedLanguageException
Specified by:
retrieveAll in interface TerminologyService
Throws:
UnsupportedTerminologyException
UnsupportedLanguageException

hasPropertyOfValue

public boolean hasPropertyOfValue(org.openehr.rm.datatypes.text.CodePhrase concept,
                                  org.openehr.rm.datatypes.text.CodePhrase property,
                                  org.openehr.rm.datatypes.text.CodePhrase value)
                           throws UnsupportedTerminologyException,
                                  UnknownPropertyException
Description copied from interface: TerminologyService
Checks if given concept has a named attribute of given value

Specified by:
hasPropertyOfValue in interface TerminologyService
Returns:
true if the property has value
Throws:
UnsupportedTerminologyException
UnknownPropertyException

retrieveAllPossibleValues

public List<org.openehr.rm.datatypes.text.DvCodedText> retrieveAllPossibleValues(org.openehr.rm.datatypes.text.CodePhrase property,
                                                                                 org.openehr.rm.datatypes.text.CodePhrase language)
                                                                          throws UnsupportedTerminologyException,
                                                                                 UnknownPropertyException,
                                                                                 UnsupportedLanguageException
Description copied from interface: TerminologyService
Retrieves all possible values of given attribute with labels in specified language

Specified by:
retrieveAllPossibleValues in interface TerminologyService
Returns:
a list of coded texts
Throws:
UnsupportedTerminologyException
UnknownPropertyException
UnsupportedLanguageException

isTerminologySupported

public boolean isTerminologySupported(String terminologyId)
Specified by:
isTerminologySupported in interface TerminologyService

checkSubclassOf

protected boolean checkSubclassOf(String as,
                                  String bs)
                           throws UnsupportedTerminologyException,
                                  InvalidCodeException
Throws:
UnsupportedTerminologyException
InvalidCodeException

invalidCode

protected boolean invalidCode(String code)

registerDescription

public void registerDescription(String code,
                                String description)

getDescription

protected String getDescription(String code)

retrieveTerm

public String retrieveTerm(org.openehr.rm.datatypes.text.CodePhrase concept,
                           org.openehr.rm.datatypes.text.CodePhrase language)
                    throws UnsupportedTerminologyException,
                           UnsupportedLanguageException
Description copied from interface: TerminologyService
Retrieves the term of a given concept in given language

Specified by:
retrieveTerm in interface TerminologyService
Returns:
the term
Throws:
UnsupportedTerminologyException
UnsupportedLanguageException

retrieveTerm

protected String retrieveTerm(String code,
                              org.openehr.rm.datatypes.text.CodePhrase language)
                       throws UnsupportedTerminologyException,
                              UnsupportedLanguageException
Throws:
UnsupportedTerminologyException
UnsupportedLanguageException

getSupportedTerminologies

public Collection<String> getSupportedTerminologies()
Specified by:
getSupportedTerminologies in interface TerminologyService


Copyright © 2013 Cambio. All Rights Reserved.