/** * Create an instance of {@link IdentifiableType } * */ public IdentifiableType createIdentifiableType() { return new IdentifiableType(); }
private static void checkSlots(IdentifiableType obj, List<String> requiredSlotNames) throws XDSException { for (SlotType1 s : obj.getSlot()) { requiredSlotNames.remove(s.getName()); } if (requiredSlotNames.size() > 0) throw new XDSException(XDSException.XDS_ERR_REGISTRY_METADATA_ERROR, "Missing attributes in '"+obj.getId()+"'!:"+requiredSlotNames, null); }
public void removeFromRequest() { List<JAXBElement<? extends IdentifiableType>> list = pnrRequest.getRegistryObjectList().getIdentifiable(); for (int i = 0, len = list.size() ; i < len ; i++) { if (list.get(i).getValue().getId().equals(id)) { list.remove(i); } } pnrRequest.removeAssociation(assoc); }
private AdhocQueryResponse addHomeCommunityId(AdhocQueryResponse rsp) { String home = XdsDevice.getXCARespondingGW().getHomeCommunityID(); IdentifiableType obj; if (rsp.getRegistryObjectList() != null) { List<JAXBElement<? extends IdentifiableType>> objList = rsp.getRegistryObjectList().getIdentifiable(); for (int i = 0, len = objList.size() ; i < len ; i++ ) { obj = objList.get(i).getValue(); if (obj.getHome() == null && ((obj instanceof ExtrinsicObjectType) || (obj instanceof RegistryPackageType) || obj instanceof ObjectRefType)) { obj.setHome(home); } } } if (rsp.getRegistryErrorList() != null) { for ( RegistryError err : rsp.getRegistryErrorList().getRegistryError()) { if (err.getLocation() == null) err.setLocation(home); } } return rsp; }
public String getSlotValue(IdentifiableType idType, String slotName) { List<SlotType1> list = idType.getSlot(); if (list != null) { for (SlotType1 slotType : list) { if (slotName.equals(slotType.getName())) return slotType.getValueList().getValue().get(0); } } return null; }
private AdhocQueryResponse addHomeCommunityId(AdhocQueryResponse rsp) { String home = XdsDevice.getXCARespondingGW().getHomeCommunityID(); IdentifiableType obj; if (rsp.getRegistryObjectList() != null) { List<JAXBElement<? extends IdentifiableType>> objList = rsp.getRegistryObjectList().getIdentifiable(); for (int i = 0, len = objList.size() ; i < len ; i++ ) { obj = objList.get(i).getValue(); if ((obj instanceof ExtrinsicObjectType) || (obj instanceof RegistryPackageType) || obj instanceof ObjectRefType) { obj.setHome(home); } } } if (rsp.getRegistryErrorList() != null) { for ( RegistryError err : rsp.getRegistryErrorList().getRegistryError()) { err.setLocation(home); } } return rsp; }
private RegistryObject getCheckedRegistryObject(String id, String errMsg, IdentifiableType parent) throws XDSException { RegistryObject ro = null; try { ro = getRegistryObject(id); } catch (Exception ignore) {} if (ro == null) throw new XDSException(XDSException.XDS_ERR_REGISTRY_ERROR, errMsg+" id="+id+" parent="+parent.getId(), null); return ro; } private RegistryObject getRegistryObject(String id) {
public void removeFromRequest() { pnrRequest.getProvideAndRegisterDocumentSetRequest().getDocument().remove(doc); List<JAXBElement<? extends IdentifiableType>> list = pnrRequest.getRegistryObjectList().getIdentifiable(); for (int i = 0, len = list.size() ; i < len ; i++) { if (list.get(i).getValue().getId().equals(id)) { list.remove(i); } } pnrRequest.removeAssociation(assoc); }
wrapper.toClassificationNode((ClassificationNodeType)obj, null, objects); } else if (obj instanceof ObjectRefType) {//for initialization Identifiable tmp = getIdentifiableByUUID(obj.getId()); log.info("#### found RegistryObject for ObjectRef:"+tmp); if (tmp == null) { log.info("#### add ObjectRef:"+obj.getId()); objects.add(wrapper.toObjectRef((ObjectRefType)obj));
} else if (!patIDtmp.equals(patID)) { throw new XDSException(XDSException.XDS_ERR_PATID_DOESNOT_MATCH, "PatientID of object"+obj.getId()+" does not match:"+patIDtmp+" vs. "+patID, null); } catch (Exception ignore) { throw new XDSException(XDSException.XDS_ERR_PATID_DOESNOT_MATCH, "PatientID referenced in Association "+obj.getId()+" does not match! SubmissionSet patID not valid!:"+patID, null);