ca.infoway.messagebuilder.resolver
Class CodeResolverRegistry

Package class diagram package CodeResolverRegistry
java.lang.Object
  extended by ca.infoway.messagebuilder.resolver.CodeResolverRegistry

public abstract class CodeResolverRegistry
extends Object

This class functions is generally used in one of two ways. Either:

  1. Register one monolithic Code Resolver that handles all lookup requests. (This approach is currently used by the HealthWatch project, and their resolver is backed by a database, and is sometimes used in test cases, in which case we're usually using the TrivialCodeResolver). To use this approach, a project should call the register(codeResolver) method and set the instance static variable.
  2. Register one resolver for each domain interface (This approach is currently used by the eReferrals and Panacea projects).

Additionally, this class can automatically resolve:

  1. enums; and
  2. classes that follow the enum pattern (having static constants -- see, for example the Country class

In both cases the class or enum must implement the Code interface.

Author:
Intelliware Development

Constructor Summary
CodeResolverRegistry()
           
 
Method Summary
static
<T extends Code>
CodeResolver
getResolver(Class<T> type)
          Gets the resolver.
static boolean isInitialized()
          Checks if is initialized.
static
<T extends Code>
Collection<T>
lookup(Class<T> type)
          Lookup.
static
<T extends Code>
T
lookup(Class<T> type, String code)
          Lookup.
static
<T extends Code>
T
lookup(Class<T> type, String code, String codeSystemOid)
          Lookup.
static void register(CodeResolver codeResolver)
          Register.
static void registerResolver(Class<? extends Code> type, CodeResolver codeResolver)
          Register resolver.
static void unregisterAll()
          Unregister all.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodeResolverRegistry

public CodeResolverRegistry()
Method Detail

lookup

public static <T extends Code> Collection<T> lookup(Class<T> type)

Lookup.

Type Parameters:
T - the generic type
Parameters:
type - the type
Returns:
the collection

lookup

public static <T extends Code> T lookup(Class<T> type,
                                        String code)

Lookup.

Type Parameters:
T - the generic type
Parameters:
type - the type
code - the code
Returns:
the t

lookup

public static <T extends Code> T lookup(Class<T> type,
                                        String code,
                                        String codeSystemOid)

Lookup.

Type Parameters:
T - the generic type
Parameters:
type - the type
code - the code
codeSystemOid - the code system oid
Returns:
the t

getResolver

public static <T extends Code> CodeResolver getResolver(Class<T> type)

Gets the resolver.

Type Parameters:
T - the generic type
Parameters:
type - the type
Returns:
the resolver

isInitialized

public static boolean isInitialized()

Checks if is initialized.

Returns:
true, if is initialized

register

public static void register(CodeResolver codeResolver)

Register.

Parameters:
codeResolver - the code resolver

registerResolver

public static void registerResolver(Class<? extends Code> type,
                                    CodeResolver codeResolver)

Register resolver.

Parameters:
type - the type
codeResolver - the code resolver

unregisterAll

public static void unregisterAll()

Unregister all.



Copyright © 2013. All Rights Reserved.