private String getSourceID(ProvideAndRegisterDocumentSetRequestType req) { List<JAXBElement<? extends IdentifiableType>> objs = req.getSubmitObjectsRequest().getRegistryObjectList().getIdentifiable(); IdentifiableType obj; for (int i = 0, len = objs.size() ; i < len ; i++) { obj = objs.get(i).getValue(); if (obj instanceof RegistryPackageType) { return InfosetUtil.getExternalIdentifierValue(XDSConstants.UUID_XDSSubmissionSet_sourceId, (RegistryPackageType)obj); } } return null; }
private String checkPatientIDs(ProvideAndRegisterDocumentSetRequestType req, RegistryPackageType submissionSet, List<ExtrinsicObjectType> extrObjs) throws XDSException { String submissionPatId = InfosetUtil.getExternalIdentifierValue(XDSConstants.UUID_XDSSubmissionSet_patientId, submissionSet); String docPatId; ExtrinsicObjectType eo; for ( int i = 0, len = extrObjs.size() ; i < len ; i++ ) { eo = extrObjs.get(i); docPatId = InfosetUtil.getExternalIdentifierValue(XDSConstants.UUID_XDSDocumentEntry_patientId, eo); if ( docPatId != null && !docPatId.equals(submissionPatId)) { String msg = "XDSDocumentEntry.patientId ("+docPatId+")and XDSSubmissionSet.patientId ("+submissionPatId+") doesn't match! ExtrinsicObject.Id:"+eo.getId(); log.warn(msg); throw new XDSException(XDSException.XDS_ERR_PATID_DOESNOT_MATCH, msg, null); } } RegistryPackageType folder = InfosetUtil.getRegistryPackage(req.getSubmitObjectsRequest(), XDSConstants.UUID_XDSFolder); String folderPatId = folder == null ? null : InfosetUtil.getExternalIdentifierValue(XDSConstants.UUID_XDSFolder_patientId, folder); if ( folderPatId != null && !folderPatId.equals(submissionPatId)) { String msg = "XDSFolder.patientId ("+folderPatId+")and XDSSubmissionSet.patientId ("+submissionPatId+") doesn't match!"; log.warn(msg); throw new XDSException(XDSException.XDS_ERR_PATID_DOESNOT_MATCH, msg, null); } return submissionPatId; }
private String checkPatientIDs(ProvideAndRegisterDocumentSetRequestType req, RegistryPackageType submissionSet, List<ExtrinsicObjectType> extrObjs) throws XDSException { String submissionPatId = InfosetUtil.getExternalIdentifierValue(XDSConstants.UUID_XDSSubmissionSet_patientId, submissionSet); String docPatId; ExtrinsicObjectType eo; for ( int i = 0, len = extrObjs.size() ; i < len ; i++ ) { eo = extrObjs.get(i); docPatId = InfosetUtil.getExternalIdentifierValue(XDSConstants.UUID_XDSDocumentEntry_patientId, eo); if ( docPatId != null && !docPatId.equals(submissionPatId)) { String msg = "XDSDocumentEntry.patientId ("+docPatId+")and XDSSubmissionSet.patientId ("+submissionPatId+") doesn't match! ExtrinsicObject.Id:"+eo.getId(); log.warn(msg); throw new XDSException(XDSException.XDS_ERR_PATID_DOESNOT_MATCH, msg, null); } } RegistryPackageType folder = InfosetUtil.getRegistryPackage(req.getSubmitObjectsRequest(), XDSConstants.UUID_XDSFolder); String folderPatId = InfosetUtil.getExternalIdentifierValue(XDSConstants.UUID_XDSFolder_patientId, folder); if ( folderPatId != null && !folderPatId.equals(submissionPatId)) { String msg = "XDSFolder.patientId ("+folderPatId+")and XDSSubmissionSet.patientId ("+submissionPatId+") doesn't match!"; log.warn(msg); throw new XDSException(XDSException.XDS_ERR_PATID_DOESNOT_MATCH, msg, null); } return submissionPatId; }
private String getSourceID(ProvideAndRegisterDocumentSetRequestType req) throws XDSException { List<JAXBElement<? extends IdentifiableType>> objs = req.getSubmitObjectsRequest().getRegistryObjectList().getIdentifiable(); IdentifiableType obj; for (int i = 0, len = objs.size() ; i < len ; i++) { obj = objs.get(i).getValue(); if (obj instanceof RegistryPackageType) { return InfosetUtil.getExternalIdentifierValue(XDSConstants.UUID_XDSSubmissionSet_sourceId, (RegistryPackageType)obj); } } throw new XDSException(XDSException.XDS_ERR_REPOSITORY_METADATA_ERROR, "Missing XDSSubmissionSet.sourceId!", null); }
eo = extrObjs.get(i); doc = docs.get(eo.getId()); docUID = InfosetUtil.getExternalIdentifierValue(XDSConstants.UUID_XDSDocumentEntry_uniqueId, eo); if (mimetypes != null) { boolean unsupportedMimetype = true;
throw new XDSException(XDSException.XDS_ERR_REPOSITORY_METADATA_ERROR, "Missing XDSDocumentEntry.entryUUID!", null); doc = docs.get(eo.getId()); docUID = InfosetUtil.getExternalIdentifierValue(XDSConstants.UUID_XDSDocumentEntry_uniqueId, eo); if (docUID == null) throw new XDSException(XDSException.XDS_ERR_REPOSITORY_METADATA_ERROR, "Missing XDSDocumentEntry.uniqueId!", null);