boolean is_ss_to_existing_de_hasmember(OMElement assoc) { String source = m.getAssocSource(assoc); String target = m.getAssocTarget(assoc); String type = getSimpleAssocType(assoc); if (source == null || target == null || type == null) return false; if (!type.equals("HasMember")) return false; if (!source.equals(m.getSubmissionSetId())) return false; if (submissionContains(target) || !isUUID(target)) return false; if (!is_sss_reference(assoc)) return false; return true; }
public boolean is_fol_to_de_hasmember(OMElement assoc) { String source = m.getAssocSource(assoc); String target = m.getAssocTarget(assoc); String type = getSimpleAssocType(assoc); if (source == null || target == null || type == null) return false; if (!type.equals("HasMember")) return false; if (!m.getFolderIds().contains(source)) { if (isUUID(source)) { if (rvi != null && rvi.hasRegistryIndex() && !rvi.isFolder(source)) return false; } else { return false; } } if (!m.getExtrinsicObjectIds().contains(target)) { if (isUUID(target)) { if (rvi != null && rvi.hasRegistryIndex() && !rvi.isDocumentEntry(target)) return false; } else { return false; } } return true; }
void symbolic_refs_not_in_submission(ErrorRecorder er) { List<OMElement> assocs = m.getAssociations(); for (int i=0; i<assocs.size(); i++) { OMElement assoc = (OMElement) assocs.get(i); String target = assoc.getAttributeValue(MetadataSupport.target_object_qname); String type = assoc.getAttributeValue(MetadataSupport.association_type_qname); String source = assoc.getAttributeValue(MetadataSupport.source_object_qname); if (target == null || source == null || type == null) continue; if (!isUUID(source) && !submissionContains(source)) er.err(XdsErrorCode.Code.XDSRegistryMetadataError, objectDescription(assoc) + ": sourceObject has value " + source + " which is not in the submission but cannot be in registry since it is not in UUID format", this, "ITI TF-3: 4.1.12.3"); if (!isUUID(target) && !submissionContains(target)) er.err(XdsErrorCode.Code.XDSRegistryMetadataError, objectDescription(assoc) + ": targetObject has value " + target + " which is not in the submission but cannot be in registry since it is not in UUID format", this, "ITI TF-3: 4.1.12.3"); } }
void evalRelationship(ErrorRecorder er, OMElement assoc, ValidationContext vc) { String source = m.getAssocSource(assoc); String target = m.getAssocTarget(assoc); String type = m.getAssocType(assoc); if (source == null || target == null || type == null) return; if (!isDocumentEntry(source) && !vc.isMU) er.err(XdsErrorCode.Code.XDSRegistryMetadataError, objectDescription(assoc) + ": with type " + simpleAssocType(type) + " must reference a DocumentEntry in submission with its sourceObject attribute, it references " + objectDescription(source), this, "ITI TF-3: 4.1.6.1"); if (type.equals("urn:ihe:iti:2010:AssociationType:SubmitAssociation")) { if (!vc.isMU) er.err(XdsErrorCode.Code.XDSMetadataUpdateError, "Metadata Update feature disabled", null, null); if (!source.equals(m.getSubmissionSetId())) er.err(XdsErrorCode.Code.XDSMetadataUpdateError, "SubmitAssociation Association Type must reference the SubmissionSet with its sourceObject attribute", null, null); if (!m.isAssociation(target)) er.err(XdsErrorCode.Code.XDSMetadataUpdateError, "SubmitAssociation Association Type must reference an Association in the submission with its targetObject attribute", null, null); return; } if (containsObject(target)) { // This only checks for a circular reference but not the registry collection XdsErrorCode.Code err = XdsErrorCode.Code.XDSRegistryMetadataError; if (muAssocTypes.contains(type)) err = XdsErrorCode.Code.XDSMetadataUpdateError; er.err(err, objectDescription(assoc) + ": with type " + simpleAssocType(type) + " must reference a DocumentEntry in the registry with its targetObject attribute, it references " + objectDescription(target) + " which is in the submission", this, "ITI TF-3: 4.1.6.1"); } if (!isUUID(target)) { er.err(XdsErrorCode.Code.XDSRegistryMetadataError, objectDescription(assoc) + ": with type " + simpleAssocType(type) + " must reference a DocumentEntry in the registry with its targetObject attribute, it references " + objectDescription(target) + " which is a symbolic ID that cannot reference an model in the registry", this, "ITI TF-3: 4.1.6.1"); } }