Package ca.uhn.hl7v2

Examples of ca.uhn.hl7v2.DefaultHapiContext


 
  /**
   * Uses DefaultModelClassFactory for model class lookup.
   */
  public Parser() {
    this(new DefaultHapiContext());
  }
View Full Code Here


   * Initialize parser with custom ModelClassFactory and default ValidationContext
   *
   * @param modelClassFactory custom factory to use for model class lookup
   */
  public Parser(ModelClassFactory modelClassFactory) {
    this(new DefaultHapiContext(modelClassFactory));
  }
View Full Code Here

   *            this parser (defaults to ValidationContextFactory.DefaultValidation)
   *
   * @deprecated use a dedicated {@link HapiContext} and set its ValidationContext property
   */
  public void setValidationContext(ValidationContext context) {
    HapiContext newContext = new DefaultHapiContext(getHapiContext());
    newContext.setValidationContext(context);
    setHapiContext(newContext);
  }
View Full Code Here

   * @param configuration The parser configuration
   *
   * @deprecated use a dedicated {@link HapiContext} and set its ParserConfiguration property
   */
  public void setParserConfiguration(ParserConfiguration configuration) {
    HapiContext newContext = new DefaultHapiContext(getHapiContext());
    newContext.setParserConfiguration(configuration);
    setHapiContext(newContext);
  }
View Full Code Here

  public SimpleServer(int port, LowerLayerProtocol llp, Parser parser, boolean tls,
      ExecutorService executorService) {
    super(parser, llp, executorService);
    this.port = port;
    this.tls = tls;
    this.hapiContext = new DefaultHapiContext();
    this.queue = new LinkedBlockingQueue<AcceptedSocket>(100);
  }
View Full Code Here

   * NoValidation validation context}.
     *
     * @return PipeParser with disabled validation
   */
  public static PipeParser getInstanceWithNoValidation() {
    HapiContext context = new DefaultHapiContext();
    context.setValidationContext(ValidationContextFactory.noValidation());
    return new PipeParser(context);
  }
View Full Code Here

  /**
   * Uses DefaultModelClassFactory for model class lookup.
   */
  public Parser() {
    this(new DefaultHapiContext());
  }
View Full Code Here

        assertMockEndpointsSatisfied();
    }   

    protected RouteBuilder createRouteBuilder() throws Exception {
        HapiContext hapiContext = new DefaultHapiContext();
        hapiContext.setValidationContext(new NoValidation());
        Parser p = new GenericParser(hapiContext);
        hl7 = new HL7DataFormat();
        hl7.setParser(p);
       
        return new RouteBuilder() {
View Full Code Here


    @Override
    protected void doStart() throws Exception {
        if (hapiContext == null) {
            hapiContext = new DefaultHapiContext();
        }
        if (parser == null) {
            parser = hapiContext.getGenericParser();
        }
        if (!validate) {
View Full Code Here

    private HapiContext customContext;

    @Override
    protected void doPreSetup() throws Exception {
        defaultValidationContext = ValidationContextFactory.defaultValidation();
        defaultContext = new DefaultHapiContext(defaultValidationContext);
        // we validate separately, not during parsing or rendering
        defaultContext.getParserConfiguration().setValidating(false);

        ValidationRuleBuilder builder = new ValidationRuleBuilder() {
            @Override
            protected void configure() {
                forVersion(Version.V24)
                        .message("ADT", "A01")
                        .terser("PID-8", not(empty()));
            }
        };
        customValidationContext = ValidationContextFactory.fromBuilder(builder);
        customContext = new DefaultHapiContext(customValidationContext);
        // we validate separately, not during parsing or rendering
        customContext.getParserConfiguration().setValidating(false);
    }
View Full Code Here

TOP

Related Classes of ca.uhn.hl7v2.DefaultHapiContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.