Package ca.uhn.hl7v2.conf.spec.message

Examples of ca.uhn.hl7v2.conf.spec.message.Component


    if (isSubComponent) {
      log.debug("      Parsing subcomp profile: " + elem.getAttribute("Name"));
      comp = new SubComponent();
    } else {
      log.debug("    Parsing comp profile: " + elem.getAttribute("Name"));
      comp = new Component();

      int childIndex = 1;
      NodeList children = elem.getChildNodes();
      for (int i = 0; i < children.getLength(); i++) {
        Node n = children.item(i);
View Full Code Here


    if (theValidateChildren) {
      if (profile.getComponents() > 0 && !profile.getUsage().equals("X")) {
        if (Composite.class.isAssignableFrom(type.getClass())) {
          Composite comp = (Composite) type;
          for (int i = 1; i <= profile.getComponents(); i++) {
            Component childProfile = profile.getComponent(i);
            try {
              Type child = comp.getComponent(i - 1);
              exList.addAll(doTestComponent(child, childProfile, profileID, validateChildren));
            } catch (DataTypeException de) {
              exList.add(new ProfileNotHL7CompliantException(
View Full Code Here

public class HL7Server {

    private SimpleServer server;

    public HL7Server(int port) {
        LowerLayerProtocol llp = LowerLayerProtocol.makeLLP(); // The transport protocol
        PipeParser parser = new PipeParser();
        server = new SimpleServer(port, llp, parser);
    }
View Full Code Here

        return new HL7Endpoint();
    }

    @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();
View Full Code Here

    public Type getComponent(int number) throws DataTypeException {

        try {
            return this.data[number];
        } catch (ArrayIndexOutOfBoundsException e) {
            throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)");
        }
    }
View Full Code Here

    public Type getComponent(int number) throws DataTypeException {

        try {
            return this.data[number];
        } catch (ArrayIndexOutOfBoundsException e) {
            throw new DataTypeException("Element " + number + " doesn't exist (Type " + getClass().getName() + " has only " + this.data.length + " components)");
        }
    }
View Full Code Here

        return new RouteBuilder() {
            public void configure() throws Exception {
                from("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec")
                    .process(new Processor() {
                        public void process(Exchange exchange) throws Exception {
                            Message input = exchange.getIn().getBody(Message.class);

                            assertEquals("2.4", input.getVersion());
                            QRD qrd = (QRD)input.get("QRD");
                            assertEquals("0101701234", qrd.getWhoSubjectFilter(0).getIDNumber().getValue());

                            Message response = createHL7AsMessage();
                            exchange.getOut().setBody(response);
                        }
                    })
                    .to("mock:result");
            }
View Full Code Here

        return new RouteBuilder() {
            public void configure() throws Exception {
                from("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec")
                    .process(new Processor() {
                        public void process(Exchange exchange) throws Exception {
                            Message input = exchange.getIn().getBody(Message.class);

                            assertEquals("2.4", input.getVersion());
                            QRD qrd = (QRD)input.get("QRD");
                            assertEquals("0101701234", qrd.getWhoSubjectFilter(0).getIDNumber().getValue());

                            Message response = createHL7AsMessage();
                            exchange.getOut().setBody(response);
                        }
                    })
                    .to("mock:result");
            }
View Full Code Here

    @Test
    public void testDefaultValidationContext() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:test1");
        mock.expectedMessageCount(1);
        Message msg = createADT01Message();
        template.sendBody("direct:test1", msg);
        assertMockEndpointsSatisfied();
    }
View Full Code Here

    @Test(expected = CamelExecutionException.class)
    public void testCustomValidationContext() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:test2");
        mock.expectedMessageCount(0);
        Message msg = createADT01Message();
        template.sendBody("direct:test2", msg);
        assertMockEndpointsSatisfied();
    }
View Full Code Here

TOP

Related Classes of ca.uhn.hl7v2.conf.spec.message.Component

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.