/** * Tests a group against a group section of a profile. */ public List<HL7Exception> testGroup(Group group, SegGroup profile, String profileID) throws ProfileException { return doTestGroup(group, 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); }
public List<HL7Exception> testField(Type type, Field profile, boolean escape, String profileID) throws ProfileException, HL7Exception { return doTestField(type, profile, escape, profileID, true); }
protected void checkConstantValue(String value, String encoded, List<HL7Exception> exList) { // check constant value if (value != null && value.length() > 0) { if (!encoded.equals(value)) exList.add(new ProfileNotFollowedException("'" + encoded + "' doesn't equal constant value of '" + value + "'")); } }
public ca.uhn.hl7v2.conf.check.Validator getConformanceValidator() { return new ca.uhn.hl7v2.conf.check.DefaultValidator(this); }
public List<HL7Exception> testComponent(Type type, Component profile, String profileID) throws ProfileException, HL7Exception { return doTestComponent(type, profile, profileID, true); }
protected void addTableTestResult(String profileID, String codeSystem, String value, List<HL7Exception> exList) { if (codeSystem != null && value != null && validateChildren) { testValueAgainstTable(profileID, codeSystem, value, exList); } }
protected void checkConstantValue(String value, String encoded, List<HL7Exception> exList) { // check constant value if (value != null && value.length() > 0) { if (!encoded.equals(value)) exList.add(new ProfileNotFollowedException("'" + encoded + "' doesn't equal constant value of '" + value + "'")); } }
public ca.uhn.hl7v2.conf.check.Validator getConformanceValidator() { return new ca.uhn.hl7v2.conf.check.DefaultValidator(this); }
/** * Tests a group against a group section of a profile. */ public List<HL7Exception> testGroup(Group group, SegGroup profile, String profileID) throws ProfileException { return doTestGroup(group, 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); }
public List<HL7Exception> testField(Type type, Field profile, boolean escape, String profileID) throws ProfileException, HL7Exception { return doTestField(type, profile, escape, profileID, true); }
public List<HL7Exception> testComponent(Type type, Component profile, String profileID) throws ProfileException, HL7Exception { return doTestComponent(type, profile, profileID, true); }
protected void addTableTestResult(String profileID, String codeSystem, String value, List<HL7Exception> exList) { if (codeSystem != null && value != null && validateChildren) { testValueAgainstTable(profileID, codeSystem, value, exList); } }
protected void checkLength(long length, String name, String encoded, List<HL7Exception> exList) { // check length if (encoded.length() > length) exList.add(new ProfileNotFollowedException("The type " + name + " has length " + encoded.length() + " which exceeds max of " + length)); }
protected void checkLength(long length, String name, String encoded, List<HL7Exception> exList) { // check length if (encoded.length() > length) exList.add(new ProfileNotFollowedException("The type " + name + " has length " + encoded.length() + " which exceeds max of " + length)); }
/** * Tests whether the given type falls within a maximum length. * * @return null of OK, an HL7Exception otherwise */ public HL7Exception testLength(Type type, int maxLength) { HL7Exception e = null; String encoded = PipeParser.encode(type, this.enc); if (encoded.length() > maxLength) { e = new ProfileNotFollowedException("Length of " + encoded.length() + " exceeds maximum of " + maxLength); } return e; }
protected void checkMessageType(String msgType, StaticDef profile, List<HL7Exception> exList) throws HL7Exception { if (!msgType.equals(profile.getMsgType())) { HL7Exception e = new ProfileNotFollowedException("Message type " + msgType + " doesn't match profile type of " + profile.getMsgType()); exList.add(e); } }
protected void checkMessageStructure(String msgStruct, StaticDef profile, List<HL7Exception> exList) { if (msgStruct == null || !msgStruct.equals(profile.getMsgStructID())) { HL7Exception e = new ProfileNotFollowedException("Message structure " + msgStruct + " doesn't match profile type of " + profile.getMsgStructID()); exList.add(e); } }
protected void checkEventType(String evType, StaticDef profile, List<HL7Exception> exList) throws HL7Exception { if (!evType.equals(profile.getEventType()) && !profile.getEventType().equalsIgnoreCase("ALL")) { HL7Exception e = new ProfileNotFollowedException("Event type " + evType + " doesn't match profile type of " + profile.getEventType()); exList.add(e); } }