private static boolean isTimestamp(final Type field) throws HL7Exception { if (isEmpty(field)) { return false; } final String fieldName = field.getName(); return (fieldName.equals("TS") || fieldName.equals("DT") || fieldName.equals("TM")); }
final Type type = types[i]; if (!isEmpty(type)) { String fieldName = field.getName(); if (fieldName.equals("CM_MSG")) { fieldName = "CM";
public String getName() { String name = "*"; if (this.data != null) { name = this.data.getName(); } return name; }
public String getName() { String name = "*"; if (this.data != null) { name = this.data.getName(); } return name; }
protected void checkDataType(String dataType, Type type, List<HL7Exception> exList) { // check datatype String typeName = type.getName(); if (!(type instanceof Varies || typeName.equals(dataType))) { exList.add(new ProfileNotHL7CompliantException("HL7 datatype " + typeName + " doesn't match profile datatype " + dataType)); } }
protected void checkDataType(String dataType, Type type, List<HL7Exception> exList) { // check datatype String typeName = type.getName(); if (!(type instanceof Varies || typeName.equals(dataType))) { exList.add(new ProfileNotHL7CompliantException("HL7 datatype " + typeName + " doesn't match profile datatype " + dataType)); } }
public String getName() { return getDelegate().getName(); }
public String getName() { return getDelegate().getName(); }
|| type instanceof ca.uhn.hl7v2.model.v24.datatype.TSComponentOne) && !dataType.equals("ST")) { profileNotHL7Compliant(exList, HL7_DATATYPE_MISMATCH, type.getName(), dataType); } else if (!(type instanceof TSComponentOne) && !type.getName().contains(dataType)) { profileViolatedWhen(!(type.getClass().getSimpleName().equals("Varies") || type.getClass().getSimpleName().equals("QIP")), exList, HL7_DATATYPE_MISMATCH, type.getName(), dataType );
/** * Tests table values for ID, IS, and CE types. An empty list is returned for all other types or * if the table name or number is missing. */ protected void testTypeAgainstTable(Type type, AbstractComponent<?> profile, String profileID, List<HL7Exception> exList) { if (profile.getTable() != null && (type.getName().equals("IS") || type.getName().equals("ID"))) { String codeSystem = String.format("HL7%1$4s", profile.getTable()).replace(" ", "0"); String value = ((Primitive) type).getValue(); addTableTestResult(profileID, codeSystem, value, exList); } else if (type.getName().equals("CE")) { String value = Terser.getPrimitive(type, 1, 1).getValue(); String codeSystem = Terser.getPrimitive(type, 3, 1).getValue(); addTableTestResult(profileID, codeSystem, value, exList); value = Terser.getPrimitive(type, 4, 1).getValue(); codeSystem = Terser.getPrimitive(type, 6, 1).getValue(); addTableTestResult(profileID, codeSystem, value, exList); } }
/** * Tests table values for ID, IS, and CE types. An empty list is returned for all other types or * if the table name or number is missing. */ protected void testTypeAgainstTable(Type type, AbstractComponent<?> profile, String profileID, List<HL7Exception> exList) { if (profile.getTable() != null && (type.getName().equals("IS") || type.getName().equals("ID"))) { String codeSystem = String.format("HL7%1$4s", profile.getTable()).replace(" ", "0"); String value = ((Primitive) type).getValue(); addTableTestResult(profileID, codeSystem, value, exList); } else if (type.getName().equals("CE")) { String value = Terser.getPrimitive(type, 1, 1).getValue(); String codeSystem = Terser.getPrimitive(type, 3, 1).getValue(); addTableTestResult(profileID, codeSystem, value, exList); value = Terser.getPrimitive(type, 4, 1).getValue(); codeSystem = Terser.getPrimitive(type, 6, 1).getValue(); addTableTestResult(profileID, codeSystem, value, exList); } }
exList.addAll(testType(sub, subComponent.getDatatype(), scUsage, null)); } catch (DataTypeException de) { profileNotHL7Compliant(exList, SUBCOMPONENT_TYPE_MISMATCH, type.getName(), i);
profileNotHL7Compliant(exList, COMPONENT_TYPE_MISMATCH, type.getName(), i);