public static String getExternalIdentifierValue(String urn, RegistryObjectType ro) { List<ExternalIdentifierType> list = ro.getExternalIdentifier(); ExternalIdentifierType ei; for ( int i = 0, len = list.size() ; i < len ; i++ ) { ei = list.get(i); if ( ei.getIdentificationScheme().equals(urn)) { return ei.getValue(); } } return null; } public static String setExternalIdentifierValue(String urn, String value, RegistryObjectType ro) {
private String getPatID(ExternalIdentifierType eiType) { if (XDSConstants.UUID_XDSDocumentEntry_patientId.equals(eiType.getIdentificationScheme()) || XDSConstants.UUID_XDSFolder_patientId.equals(eiType.getIdentificationScheme()) || XDSConstants.UUID_XDSSubmissionSet_patientId.equals(eiType.getIdentificationScheme()) ) { return eiType.getValue() != null ? eiType.getValue() : ""; } return null; }
private String[] getSubmissionUIDandPatID(SubmitObjectsRequest req) { String[] result = new String[]{UNKNOWN, UNKNOWN}; List<JAXBElement<? extends IdentifiableType>> objs = req.getRegistryObjectList().getIdentifiable(); IdentifiableType obj; whole: for (int i=0,len=objs.size() ; i < len ; i++) { obj = objs.get(i).getValue(); if (obj instanceof RegistryPackageType) { List<ExternalIdentifierType> list = ((RegistryPackageType)obj).getExternalIdentifier(); if (list != null) { for (ExternalIdentifierType eiType : list) { if (XDSConstants.UUID_XDSSubmissionSet_patientId.equals(eiType.getIdentificationScheme())) { if (eiType.getValue() != null) result[1] = eiType.getValue(); } else if (XDSConstants.UUID_XDSSubmissionSet_uniqueId.equals(eiType.getIdentificationScheme())) { if (eiType.getValue() != null) result[0] = eiType.getValue(); } else { continue; } if (result[0] != UNKNOWN && result[1] != UNKNOWN) break whole; } } } } return result; }
private XADPatient getPatient(ExternalIdentifierType eiType) throws XDSException { XADPatient pat = getPatient(eiType.getValue(), cfg.isCreateMissingPIDs()); if (pat.getIssuerOfPatientID().getNamespaceID() != null) { log.debug("XAD PatientID ("+eiType.getValue()+") contains Namespace ID! Corrected in metadata!"); eiType.setValue(pat.getXADPatientID()); } return pat; } private XADPatient getPatient(String pid, boolean createMissing) throws XDSException {
private String[] getSubmissionUIDandPatID(SubmitObjectsRequest req) { String[] result = new String[2]; List<JAXBElement<? extends IdentifiableType>> objs = req.getRegistryObjectList().getIdentifiable(); IdentifiableType obj; whole: for (int i=0,len=objs.size() ; i < len ; i++) { obj = objs.get(i).getValue(); if (obj instanceof RegistryPackageType) { List<ExternalIdentifierType> list = ((RegistryPackageType)obj).getExternalIdentifier(); if (list != null) { for (ExternalIdentifierType eiType : list) { if (XDSConstants.UUID_XDSSubmissionSet_patientId.equals(eiType.getIdentificationScheme())) { result[1] = eiType.getValue(); } else if (XDSConstants.UUID_XDSSubmissionSet_uniqueId.equals(eiType.getIdentificationScheme())) { result[0] = eiType.getValue(); } else { continue; } if (result[0] != null && result[1] != null) break whole; } } } } return result; }
private String[] getSubmissionUIDandPatID(SubmitObjectsRequest req) { String[] result = new String[2]; List<JAXBElement<? extends IdentifiableType>> objs = req.getRegistryObjectList().getIdentifiable(); IdentifiableType obj; whole: for (int i=0,len=objs.size() ; i < len ; i++) { obj = objs.get(i).getValue(); if (obj instanceof RegistryPackageType) { List<ExternalIdentifierType> list = ((RegistryPackageType)obj).getExternalIdentifier(); if (list != null) { for (ExternalIdentifierType eiType : list) { if (XDSConstants.UUID_XDSSubmissionSet_patientId.equals(eiType.getIdentificationScheme())) { result[1] = eiType.getValue(); } else if (XDSConstants.UUID_XDSSubmissionSet_uniqueId.equals(eiType.getIdentificationScheme())) { result[0] = eiType.getValue(); } else { continue; } if (result[0] != null && result[1] != null) break whole; } } } } return result; }
public static String setExternalIdentifierValue(String urn, String value, RegistryObjectType ro) { List<ExternalIdentifierType> list = ro.getExternalIdentifier(); ExternalIdentifierType ei; for ( int i = 0, len = list.size() ; i < len ; i++ ) { ei = list.get(i); if ( ei.getIdentificationScheme().equals(urn)) { String oldValue = ei.getValue(); ei.setValue(value); return oldValue; } } ei = new ExternalIdentifierType(); ei.setIdentificationScheme(urn); ei.setValue(value); list.add(ei); return null; }
public ExtrinsicObject toExtrinsicObject(ExtrinsicObjectType eoType) throws XDSException { ExtrinsicObject eo; XDSDocumentEntry doc = null; if (XDSConstants.UUID_XDSDocumentEntry.equals(eoType.getObjectType())) { XDSValidator.checkDocumentEntryMetadata(eoType); doc = new XDSDocumentEntry(); eo = doc; List<ExternalIdentifierType> list = eoType.getExternalIdentifier(); if (list != null) { for (ExternalIdentifierType eiType : list) { if (XDSConstants.UUID_XDSDocumentEntry_patientId.equals(eiType.getIdentificationScheme())) { doc.setPatient(getPatient(eiType)); } else if (XDSConstants.UUID_XDSDocumentEntry_uniqueId.equals(eiType.getIdentificationScheme())) { XDSValidator.checkAlreadyExists(eiType.getValue(), eoType, session); doc.setUniqueId(eiType.getValue()); } } } doc.setSourcePatient(getPatient(getSlotValue(eoType, XDSConstants.SLOT_NAME_SOURCE_PATIENT_ID), true)); } else { eo = new ExtrinsicObject(); } toPersistenceObj(eoType, eo); eo.setMimeType(eoType.getMimeType()); return eo; }
private void copyExternalIdentifier(List<ExternalIdentifierType> list, RegistryObject ro) throws XDSException { if (list != null) { ExternalIdentifier ei; for (ExternalIdentifierType eiType : list) { ei = new ExternalIdentifier(); toPersistenceObj(eiType, ei); ei.setIdentificationScheme((ClassificationScheme) getRegistryObject(eiType.getIdentificationScheme())); ei.setValue(eiType.getValue()); ei.setRegistryObject(eiType.getRegistryObject() != null ? getRegistryObject(eiType.getRegistryObject()) : ro); ro.getExternalIdentifiers().add(ei); } } }