Examples of ProfileStructure


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

    public HL7Exception[] testGroup(Group group, AbstractSegmentContainer profile, String profileID) throws ProfileException {
        ArrayList<HL7Exception> exList = new ArrayList<HL7Exception>(20);
        ArrayList<String> allowedStructures = new ArrayList<String>(20);
       
        for (int i = 1; i <= profile.getChildren(); i++) {
            ProfileStructure struct = profile.getChild(i);
           
            //only test a structure in detail if it isn't X
            if (!struct.getUsage().equalsIgnoreCase("X")) {
                allowedStructures.add(struct.getName());
               
                //see which instances have content
                try {
                    Structure[] instances = group.getAll(struct.getName());
                    ArrayList<Structure> instancesWithContent = new ArrayList<Structure>(10);
                    for (int j = 0; j < instances.length; j++) {
                        if (hasContent(instances[j])) instancesWithContent.add(instances[j]);
                    }
                   
                    HL7Exception ce = testCardinality(instancesWithContent.size(),
                    struct.getMin(), struct.getMax(), struct.getUsage(), struct.getName());
                    if (ce != null) exList.add(ce);
                   
                    //test children on instances with content
                    if (validateChildren) {
                      for (int j = 0; j < instancesWithContent.size(); j++) {
                          Structure s = (Structure) instancesWithContent.get(j);
                          HL7Exception[] childExceptions = testStructure(s, struct, profileID);
                          addToList(childExceptions, exList);
                      }
                    }
                   
                } catch (HL7Exception he) {
                    exList.add(new ProfileNotHL7CompliantException(struct.getName() + " not found in message"));
                }
            }
        }
    
        //complain about X structures that have content
View Full Code Here

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

    public HL7Exception[] testGroup(Group group, AbstractSegmentContainer profile, String profileID) throws ProfileException {
        ArrayList<HL7Exception> exList = new ArrayList<HL7Exception>(20);
        ArrayList<String> allowedStructures = new ArrayList<String>(20);
       
        for (int i = 1; i <= profile.getChildren(); i++) {
            ProfileStructure struct = profile.getChild(i);
           
            //only test a structure in detail if it isn't X
            if (!struct.getUsage().equalsIgnoreCase("X")) {
                allowedStructures.add(struct.getName());
               
                //see which instances have content
                try {
                    Structure[] instances = group.getAll(struct.getName());
                    ArrayList<Structure> instancesWithContent = new ArrayList<Structure>(10);
                    for (int j = 0; j < instances.length; j++) {
                        if (hasContent(instances[j])) instancesWithContent.add(instances[j]);
                    }
                   
                    HL7Exception ce = testCardinality(instancesWithContent.size(),
                    struct.getMin(), struct.getMax(), struct.getUsage(), struct.getName());
                    if (ce != null) exList.add(ce);
                   
                    //test children on instances with content
                    if (validateChildren) {
                      for (int j = 0; j < instancesWithContent.size(); j++) {
                          Structure s = (Structure) instancesWithContent.get(j);
                          HL7Exception[] childExceptions = testStructure(s, struct, profileID);
                          addToList(childExceptions, exList);
                      }
                    }
                   
                } catch (HL7Exception he) {
                    exList.add(new ProfileNotHL7CompliantException(struct.getName() + " not found in message"));
                }
            }
        }
    
        //complain about X structures that have content
View Full Code Here

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

  private HL7Exception[] doTestGroup(Group group, AbstractSegmentContainer profile, String profileID, boolean theValidateChildren) throws ProfileException {
    ArrayList<HL7Exception> exList = new ArrayList<HL7Exception>(20);
        ArrayList<String> allowedStructures = new ArrayList<String>(20);
       
        for (int i = 1; i <= profile.getChildren(); i++) {
            ProfileStructure struct = profile.getChild(i);
           
            //only test a structure in detail if it isn't X
            if (!struct.getUsage().equalsIgnoreCase("X")) {
                allowedStructures.add(struct.getName());
               
                //see which instances have content
                try {
                    Structure[] instances = group.getAll(struct.getName());
                    ArrayList<Structure> instancesWithContent = new ArrayList<Structure>(10);
                    for (int j = 0; j < instances.length; j++) {
                        if (hasContent(instances[j])) instancesWithContent.add(instances[j]);
                    }
                   
                    HL7Exception ce = testCardinality(instancesWithContent.size(),
                    struct.getMin(), struct.getMax(), struct.getUsage(), struct.getName());
                    if (ce != null) exList.add(ce);
                   
                    //test children on instances with content
                    if (theValidateChildren) {
                      for (int j = 0; j < instancesWithContent.size(); j++) {
                          Structure s = (Structure) instancesWithContent.get(j);
                          HL7Exception[] childExceptions = testStructure(s, struct, profileID);
                          addToList(childExceptions, exList);
                      }
                    }
                   
                } catch (HL7Exception he) {
                    exList.add(new ProfileNotHL7CompliantException(struct.getName() + " not found in message"));
                }
            }
        }
    
        //complain about X structures that have content
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.