/** * Tests a segment against a segment section of a profile. */ public List<HL7Exception> testSegment(ca.uhn.hl7v2.model.Segment segment, Seg profile, String profileID) throws ProfileException { return doTestSegment(segment, profile, profileID, true); }
/** * Tests a segment against a segment section of a profile. */ public List<HL7Exception> testSegment(ca.uhn.hl7v2.model.Segment segment, Seg profile, String profileID) throws ProfileException { return doTestSegment(segment, profile, profileID, true); }
/** * Tests a structure (segment or group) against the corresponding part of a profile. */ public List<HL7Exception> testStructure(Structure s, ProfileStructure profile, String profileID) throws ProfileException { List<HL7Exception> exList = new ArrayList<HL7Exception>(); if (profile instanceof Seg) { if (Segment.class.isAssignableFrom(s.getClass())) { exList.addAll(doTestSegment((Segment) s, (Seg) profile, profileID, validateChildren)); } else { exList.add(new ProfileNotHL7CompliantException( "Mismatch between a segment in the profile and the structure " + s.getClass().getName() + " in the message")); } } else if (profile instanceof SegGroup) { if (Group.class.isAssignableFrom(s.getClass())) { exList.addAll(testGroup((Group) s, (SegGroup) profile, profileID)); } else { exList.add(new ProfileNotHL7CompliantException( "Mismatch between a group in the profile and the structure " + s.getClass().getName() + " in the message")); } } return exList; }
/** * Tests a structure (segment or group) against the corresponding part of a profile. */ public List<HL7Exception> testStructure(Structure s, ProfileStructure profile, String profileID) throws ProfileException { List<HL7Exception> exList = new ArrayList<HL7Exception>(); if (profile instanceof Seg) { if (Segment.class.isAssignableFrom(s.getClass())) { exList.addAll(doTestSegment((Segment) s, (Seg) profile, profileID, validateChildren)); } else { exList.add(new ProfileNotHL7CompliantException( "Mismatch between a segment in the profile and the structure " + s.getClass().getName() + " in the message")); } } else if (profile instanceof SegGroup) { if (Group.class.isAssignableFrom(s.getClass())) { exList.addAll(testGroup((Group) s, (SegGroup) profile, profileID)); } else { exList.add(new ProfileNotHL7CompliantException( "Mismatch between a group in the profile and the structure " + s.getClass().getName() + " in the message")); } } return exList; }