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; }
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 {
public static ExternalIdentifierType createExternalIdentifier(String id, String scheme, String registryObject, String value, String name) { ExternalIdentifierType ei = rimFactory.createExternalIdentifierType(); ei.setId(id); ei.setIdentificationScheme(scheme); ei.setObjectType("urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:ExternalIdentifier"); ei.setRegistryObject(registryObject); ei.setValue(value); InternationalStringType is = rimFactory.createInternationalStringType(); LocalizedStringType v = rimFactory.createLocalizedStringType(); v.setValue(name); is.getLocalizedString().add(v); ei.setName(is); return ei; }
private void copyExternalIdentifierType(Set<ExternalIdentifier> externalIdentifiers, RegistryObjectType roType) { if (externalIdentifiers != null) { List<ExternalIdentifierType> eiTypes = roType.getExternalIdentifier(); ExternalIdentifierType eiType; for (ExternalIdentifier ei : externalIdentifiers) { eiType = factory.createExternalIdentifierType(); toEbXmlObj(ei, eiType); if (ei.getIdentificationScheme() != null) { eiType.setIdentificationScheme(ei.getIdentificationScheme().getId()); } else { log.error("IdentificationScheme is null! ExternalIdentifier id:"+ei.getId()); eiType.setIdentificationScheme("urn:willi:12345-abcd-123"); } eiType.setValue(ei.getValue()); if (ei.getRegistryObject() != null) { eiType.setRegistryObject(ei.getRegistryObject().getId()); } else { log.error("RegistryObject is null! ExternalIdentifier id:"+ei.getId()); eiType.setRegistryObject("urn:willi:12345-abcd-456"); } eiTypes.add(eiType); } } }