Class HapiContextFactory
java.lang.Object
org.openehealth.ipf.commons.ihe.hl7v2.definitions.HapiContextFactory
This factory creates HapiContext instances that are required to derive
ModelClassFactory
and ValidationContext
valid for the given
HL7v2 transaction
.
By default, the HapiContext defines the transaction-specific conformance profile and profile store, and disables validation during parsing.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic HapiContext
Returns a default HapiContextstatic HapiContext
createHapiContext
(ModelClassFactory modelClassFactory) Returns a HapiContext for the provided model class factorystatic HapiContext
createHapiContext
(ModelClassFactory modelClassFactory, ValidationRuleBuilder validationRuleBuilder, ProfileStore profileStore) static HapiContext
createHapiContext
(ModelClassFactory modelClassFactory, org.openehealth.ipf.gazelle.validation.profile.HL7v2Transactions transactions) Returns a HapiContext for the providedHL7v2 transaction
, using a custom HL7 model.static HapiContext
createHapiContext
(org.openehealth.ipf.gazelle.validation.profile.HL7v2Transactions transactions) Returns a HapiContext for the providedHL7v2 transaction
, using adefault HL7 model
static void
setIdGenerator
(IDGenerator generator) Allows to globally set theIDGenerator
that generates IDs for new HL7 messages from new HapiContext instances.
-
Constructor Details
-
HapiContextFactory
public HapiContextFactory()
-
-
Method Details
-
setIdGenerator
Allows to globally set theIDGenerator
that generates IDs for new HL7 messages from new HapiContext instances. This does not affect the ID generation of already created HapiContexts nor does it do any cleanup of the previous generator.- Parameters:
generator
- global ID generator
-
createHapiContext
Returns a default HapiContext- Returns:
- default HapiContext
-
createHapiContext
Returns a HapiContext for the provided model class factory- Parameters:
modelClassFactory
- model clas factory- Returns:
- HapiContext
-
createHapiContext
public static HapiContext createHapiContext(org.openehealth.ipf.gazelle.validation.profile.HL7v2Transactions transactions) Returns a HapiContext for the providedHL7v2 transaction
, using adefault HL7 model
- Parameters:
transactions
- profile enumeration- Returns:
- HapiContext
-
createHapiContext
public static HapiContext createHapiContext(ModelClassFactory modelClassFactory, org.openehealth.ipf.gazelle.validation.profile.HL7v2Transactions transactions) Returns a HapiContext for the providedHL7v2 transaction
, using a custom HL7 model.- Parameters:
modelClassFactory
- transaction-specific model-class factorytransactions
- profile enumeration- Returns:
- HapiContext
-
createHapiContext
public static HapiContext createHapiContext(ModelClassFactory modelClassFactory, ValidationRuleBuilder validationRuleBuilder, ProfileStore profileStore) - Parameters:
modelClassFactory
- transaction-specific model-class factoryvalidationRuleBuilder
- validation rule builderprofileStore
- profile store- Returns:
- HapiContext
-