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

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


        //test children
        if (profile.getSubComponents() > 0 && !profile.getUsage().equals("X") && hasContent(type)) {
            if (Composite.class.isAssignableFrom(type.getClass())) {
                Composite comp = (Composite) type;
                for (int i = 1; i <= profile.getSubComponents(); i++) {
                    SubComponent childProfile = profile.getSubComponent(i);
                    try {
                        Type child = comp.getComponent(i-1);
                        addToList(testType(child, childProfile, null, profileID), exList);
                    } catch (DataTypeException de) {
                        exList.add(new ProfileNotHL7CompliantException("More subcomponents in profile than allowed in message: " + de.getMessage()));
View Full Code Here


            if (Composite.class.isAssignableFrom(type.getClass())) {
                Composite comp = (Composite) type;
               
                if (theValidateChildren) {
                  for (int i = 1; i <= profile.getSubComponents(); i++) {
                      SubComponent childProfile = profile.getSubComponent(i);
                      try {
                          Type child = comp.getComponent(i-1);
                          addToList(testType(child, childProfile, null, profileID), exList);
                      } catch (DataTypeException de) {
                          exList.add(new ProfileNotHL7CompliantException("More subcomponents in profile than allowed in message: " + de.getMessage()));
View Full Code Here

  /** Parses a component profile */
  private AbstractComponent parseComponentProfile(Element elem, boolean isSubComponent) throws ProfileException {
    AbstractComponent comp = null;
    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);
        if (n.getNodeType() == Node.ELEMENT_NODE) {
          Element child = (Element) n;
          if (child.getNodeName().equalsIgnoreCase("SubComponent")) {
            SubComponent subcomp = (SubComponent) parseComponentProfile(child, true);
            ((Component) comp).setSubComponent(childIndex++, subcomp);
          }
        }
      }
    }
View Full Code Here

      if (Composite.class.isAssignableFrom(type.getClass())) {
        Composite comp = (Composite) type;

        if (theValidateChildren) {
          for (int i = 1; i <= profile.getSubComponents(); i++) {
            SubComponent childProfile = profile.getSubComponent(i);
            try {
              Type child = comp.getComponent(i - 1);
              exList.addAll(testType(child, childProfile, null, profileID));
            } catch (DataTypeException de) {
              exList.add(new ProfileNotHL7CompliantException(
View Full Code Here

  private AbstractComponent<?> parseComponentProfile(Element elem, boolean isSubComponent)
      throws ProfileException {
    AbstractComponent<?> comp = null;
    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);
        if (n.getNodeType() == Node.ELEMENT_NODE) {
          Element child = (Element) n;
          if (child.getNodeName().equalsIgnoreCase("SubComponent")) {
            SubComponent subcomp = (SubComponent) parseComponentProfile(child, true);
            ((Component) comp).setSubComponent(childIndex++, subcomp);
          }
        }
      }
    }
View Full Code Here

  /** Parses a component profile */
  private AbstractComponent parseComponentProfile(Element elem, boolean isSubComponent) throws ProfileException {
    AbstractComponent comp = null;
    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);
        if (n.getNodeType() == Node.ELEMENT_NODE) {
          Element child = (Element) n;
          if (child.getNodeName().equalsIgnoreCase("SubComponent")) {
            SubComponent subcomp = (SubComponent) parseComponentProfile(child, true);
            ((Component) comp).setSubComponent(childIndex++, subcomp);
          }
        }
      }
    }
View Full Code Here

      if (Composite.class.isAssignableFrom(type.getClass())) {
        Composite comp = (Composite) type;

        if (theValidateChildren) {
          for (int i = 1; i <= profile.getSubComponents(); i++) {
            SubComponent childProfile = profile.getSubComponent(i);
            try {
              Type child = comp.getComponent(i - 1);
              exList.addAll(testType(child, childProfile, null, profileID));
            } 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

TOP

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

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.