public class RuleTypeBuilder<S extends RuleTypeBuilder<S,T>,T extends Rule<?>> extends BuilderSupport
The recursive type parameter allows the builder methods common to all subclasses (e.g.
refersToSection(java.lang.String), active, test(T)) to return their specific builder type.
| Modifier and Type | Class and Description |
|---|---|
class |
RuleTypeBuilder.MessageExpressionBuilder
Helper builder when the versions are not given explicitly but in form of an expression.
|
| Modifier | Constructor and Description |
|---|---|
protected |
RuleTypeBuilder() |
protected |
RuleTypeBuilder(List<RuleBinding<? extends Rule<?>>> rules,
Set<Version> versions) |
protected |
RuleTypeBuilder(List<RuleBinding<? extends Rule<?>>> rules,
Version... versions) |
| Modifier and Type | Method and Description |
|---|---|
protected Collection<RuleBinding<T>> |
activate(Collection<RuleBinding<T>> bindings) |
S |
active(boolean active)
Marks the rule as being active (default) or inactive
|
protected void |
addRuleBindings(T rule)
Add
RuleBindings for the rule that have been built |
S |
description(String description)
Adds a description to the rule
|
EncodingRuleBuilder |
encoding(String encoding)
Builds
MessageRules for the specified encoding |
protected Collection<RuleBinding<T>> |
getRuleBindings(T rule,
String version)
Builder implementation must overwrite this method to return all
RuleBindings for
rules that have been built. |
protected List<RuleBinding<? extends Rule<?>>> |
getRules() |
protected S |
instance() |
RuleTypeBuilder.MessageExpressionBuilder |
message()
Builds
MessageRules for event types and triggers to be specified
using the returned MessageExpressionBuilder. |
MessageRuleBuilder |
message(String eventType,
String triggerEvent)
Builds
MessageRules for the specified event types and triggers |
protected T |
prepareRule(T rule) |
PrimitiveRuleBuilder |
primitive(String... type)
Builds
PrimitiveTypeRules for the specified types |
S |
refersToSection(String sectionReference)
Adds a HL7 section reference to a rule
|
S |
severity(Severity severity)
Sets the severity of the rule
|
S |
test(T rule)
Adds the specified rule to the set of rules.
|
allOf, allOf, always, alwaysFails, anyOf, anyOf, date, dateTime, dateTime25, empty, emptyOr, in, in, isEqual, isEqualIgnoreCase, matches, matches, matches, maxLength, nonNegativeInteger, not, number, oid, startsWith, time, usPhoneNumber, uuid, withdrawnprotected RuleTypeBuilder()
protected RuleTypeBuilder(List<RuleBinding<? extends Rule<?>>> rules, Set<Version> versions)
protected RuleTypeBuilder(List<RuleBinding<? extends Rule<?>>> rules, Version... versions)
protected List<RuleBinding<? extends Rule<?>>> getRules()
protected T prepareRule(T rule)
public S description(String description)
description - descriptionpublic S refersToSection(String sectionReference)
sectionReference - the section in the HL7 specificationpublic S severity(Severity severity)
severity - the the severity of the rulepublic S active(boolean active)
active - true if this rule shall be activepublic S test(T rule)
rule - the rule to be testedpublic PrimitiveRuleBuilder primitive(String... type)
PrimitiveTypeRules for the specified typestype - an array of typespublic MessageRuleBuilder message(String eventType, String triggerEvent)
MessageRules for the specified event types and triggerseventType - Event type, e.g. "ADT", or "*" for all typestriggerEvent, - e.g. "A01" or "*" for all trigger eventspublic RuleTypeBuilder.MessageExpressionBuilder message()
MessageRules for event types and triggers to be specified
using the returned MessageExpressionBuilder.public EncodingRuleBuilder encoding(String encoding)
MessageRules for the specified encodingencoding - "XML" or "VB"protected void addRuleBindings(T rule)
RuleBindings for the rule that have been builtrule - the rule for which bindings shall be addedprotected Collection<RuleBinding<T>> getRuleBindings(T rule, String version)
RuleBindings for
rules that have been built.rule - the rule for which bindings shall be retrievedversion - the HL7 version for which bindings shall be retrievedRuleBindingsprotected Collection<RuleBinding<T>> activate(Collection<RuleBinding<T>> bindings)
Copyright © 2001-2014 University Health Network. All Rights Reserved.