Package ca.uhn.hl7v2

Examples of ca.uhn.hl7v2.HapiContext


        Message received = mock.getReceivedExchanges().get(0).getIn().getMandatoryBody(Message.class);
        assertEquals("O01", new Terser(received).get("MSH-9-2"));
    }   

    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


   * 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

   *            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

        return declaredProfiles.toArray(new String[declaredProfiles.size()]);
    }
   
    private ValidationException[] testAgainstProfile(Message message, String id) throws ProfileException, HL7Exception {
        HL7Exception[] exceptions;
        HapiContext context = message.getParser().getHapiContext();
        Validator validator = context.getConformanceValidator();
        try {
            ProfileStore profileStore = context.getProfileStore();
            String profileString = profileStore.getProfile(id);
            if (profileString != null) {
                RuntimeProfile profile = PARSER.parse(profileString);              
                exceptions = validator.validate(message, profile.getMessage());
            } else {
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

        return profile;
    }

    private ValidationException[] testAgainstProfile(Message message, String id) throws ProfileException, HL7Exception {
        HL7Exception[] exceptions;
        HapiContext context = message.getParser().getHapiContext();
        Validator validator = context.getConformanceValidator();
        try {
            ProfileStore profileStore = context.getProfileStore();
            String profileString = profileStore.getProfile(id);
            if (profileString != null) {
                RuntimeProfile profile = getProfile(profileString);
                exceptions = validator.validate(message, profile.getMessage());
            } else {
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

    public void start() {
        /*
        * The server may have any number of "application" objects registered to handle messages. We
        * are going to create an application to listen to ADT^A01 messages.
        */
        Application handler = new SampleApp();
        server.registerApplication("*", "*", handler);

        /*
        * Another option would be to specify a single application to handle all messages, like
        * this:
 
View Full Code Here

    @Override
    protected void startEndpoint(HL7Endpoint endpoint) throws AxisFault {
        LowerLayerProtocol llp = LowerLayerProtocol.makeLLP();
        PipeParser parser = new PipeParser();
        SimpleServer server = new SimpleServer(endpoint.getPort(), llp, parser);
        Application callback = new HL7MessageProcessor(endpoint);
        server.registerApplication("*", "*", callback);
        server.start();
        serverTable.put(endpoint, server);

        log.info("Started HL7 endpoint on port: " + endpoint.getPort());
View Full Code Here

TOP

Related Classes of ca.uhn.hl7v2.HapiContext

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.