@Override public IdType toUnqualifiedVersionless() { if (isLocal() || isUrn()) { return new IdType(getValueAsString()); } return new IdType(getResourceType(), getIdPart()); }
/** * @return Reference to the id of the grouping this resource appears in. */ public String getGroupingId() { return this.groupingId == null ? null : this.groupingId.getValue(); }
@Override public IdType copy() { IdType ret = new IdType(getValue()); copyValues(ret); return ret; }
private IIdType bindSimple(WebSocketSession theSession, String theBindString) { IdType id = new IdType(theBindString); if (!id.hasIdPart() || !id.isIdPartValid()) { try { String message = "Invalid bind request - No ID included"; ourLog.warn(message); theSession.close(new CloseStatus(CloseStatus.PROTOCOL_ERROR.getCode(), message)); } catch (IOException e) { handleFailure(e); } return null; } if (id.hasResourceType() == false) { id = id.withResourceType("Subscription"); } try { ActiveSubscription activeSubscription = mySubscriptionRegistry.get(id.getIdPart()); myState = new BoundStaticSubscipriptionState( theSession, activeSubscription); } catch (ResourceNotFoundException e) { try { String message = "Invalid bind request - Unknown subscription: " + id.getValue(); ourLog.warn(message); theSession.close(new CloseStatus(CloseStatus.PROTOCOL_ERROR.getCode(), message)); } catch (IOException e1) { handleFailure(e); } return null; } return id; }
if (next.getIdElement().isEmpty()) { nextEntry.getRequest().setMethod(HTTPVerb.POST); } else { nextEntry.getRequest().setMethod(HTTPVerb.PUT); if (next.getIdElement().isAbsolute()) { nextEntry.getRequest().setUrl(next.getId()); } else { String resourceType = myContext.getResourceDefinition(next).getName(); nextEntry.getRequest().setUrl(new IdType(theServerBase, resourceType, next.getIdElement().getIdPart(), next.getIdElement().getVersionIdPart()).getValue());
for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent i : bundle.getEntry()) { org.hl7.fhir.r4.model.Resource next = i.getResource(); next.setId(next.getIdElement().toUnqualifiedVersionless()); ourLog.info("Uploading ValueSet {}/{} : {} ({} bytes}", new Object[] {count, total, next.getIdElement().getValue(), bytes}); try { IIdType id = client.update().resource(next).execute().getId(); for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent i : bundle.getEntry()) { org.hl7.fhir.r4.model.Resource next = i.getResource(); next.setId(next.getIdElement().toUnqualifiedVersionless()); ourLog.info("Uploading v3-codesystems ValueSet {}/{} : {}", new Object[] {count, total, next.getIdElement().getValue()}); client.update().resource(next).execute(); for (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent i : bundle.getEntry()) { org.hl7.fhir.r4.model.Resource next = i.getResource(); if (next.getIdElement().isIdPartValidLong()) { next.setIdElement(new org.hl7.fhir.r4.model.IdType("v2-" + next.getIdElement().getIdPart())); next.setId(next.getIdElement().toUnqualifiedVersionless()); ourLog.info("Uploading v2-tables ValueSet {}/{} : {}", new Object[] {count, total, next.getIdElement().getValue()}); client.update().resource(next).execute(); count++;
/** * @return {@link #actionId} (The element id of the action this is related to.). This is the underlying object with id, value and extensions. The accessor "getActionId" gives direct access to the value */ public IdType getActionIdElement() { if (this.actionId == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create RequestGroupActionRelatedActionComponent.actionId"); else if (Configuration.doAutoCreate()) this.actionId = new IdType(); // bb return this.actionId; }
IdType url = new IdType(theUrl); Base retVal = null; if (isNotBlank(url.getResourceType())) { retVal = myResourceTypeToStub.get(url.getResourceType()); if (retVal != null) { return retVal; ResourceType resourceType = ResourceType.fromCode(url.getResourceType()); if (resourceType != null) { retVal = new Resource(){ myResourceTypeToStub.put(url.getResourceType(), retVal);
@Override public boolean hasIdPart() { return isNotBlank(getIdPart()); }
@SuppressWarnings("unchecked") @Override public <T extends IBaseResource> T fetchResource(FhirContext theContext, Class<T> theClass, String theUri) { IdType id = new IdType(theUri); boolean localReference = false; if (id.hasBaseUrl() == false && id.hasIdPart() == true) { localReference = true; SearchParameterMap params = new SearchParameterMap(); params.setLoadSynchronousUpTo(1); params.add(IAnyResource.SP_RES_ID, new StringParam(id.getIdPart())); search = myQuestionnaireDao.search(params); } else if ("CodeSystem".equals(resourceName)) {
@Override @Transactional public void storeTermConceptMapAndChildren(ResourceTable theResourceTable, ConceptMap theConceptMap) { ourLog.info("Storing TermConceptMap {}", theConceptMap.getIdElement().getValue()); if ("StructureDefinition".equals(new IdType(source).getResourceType()) || "StructureDefinition".equals(new IdType(target).getResourceType())) { return;
/** * Returns true if this IdType matches the given IdType in terms of resource * type and ID, but ignores the URL base */ @SuppressWarnings("deprecation") public boolean equalsIgnoreBase(IdType theId) { if (theId == null) { return false; } if (theId.isEmpty()) { return isEmpty(); } return ObjectUtils.equals(getResourceType(), theId.getResourceType()) && ObjectUtils.equals(getIdPart(), theId.getIdPart()) && ObjectUtils.equals(getVersionIdPart(), theId.getVersionIdPart()); }
iterator.remove(); } else { IdDt resourceId = new IdDt(next.getResource().getResourceType() + "/EX" + next.getResource().getIdElement().getIdPart()); if (!fullIds.add(resourceId.toUnqualifiedVersionless().getValue())) { ourLog.info("Discarding duplicate resource: " + resourceId.getValue()); for (Iterator<org.hl7.fhir.r4.model.Bundle.BundleEntryComponent> iterator = bundle.getEntry().iterator(); iterator.hasNext(); ) { org.hl7.fhir.r4.model.Bundle.BundleEntryComponent next = iterator.next(); if (next.getResource().getIdElement().getIdPart() != null) { String nextId = next.getResource().getIdElement().getValue(); next.getRequest().setMethod(org.hl7.fhir.r4.model.Bundle.HTTPVerb.PUT); next.getRequest().setUrl(nextId);
if (next instanceof DomainResource) { for (Resource nextContained : ((DomainResource) next).getContained()) { if (nextContained.getIdElement().isEmpty() == false) { containedIds.add(nextContained.getIdElement().getValue()); if (next.getIdElement().hasBaseUrl()) { entry.setFullUrl(next.getId());
@Read(type = OperationDefinition.class) public OperationDefinition readOperationDefinition(@IdParam IdType theId) { if (theId == null || theId.hasIdPart() == false) { throw new ResourceNotFoundException(theId); } List<OperationMethodBinding> operationBindings = myOperationNameToBindings.get(theId.getIdPart()); if (operationBindings != null && !operationBindings.isEmpty()) { return readOperationDefinitionForOperation(operationBindings); } List<SearchMethodBinding> searchBindings = mySearchNameToBindings.get(theId.getIdPart()); if (searchBindings != null && !searchBindings.isEmpty()) { return readOperationDefinitionForNamedSearch(searchBindings); } throw new ResourceNotFoundException(theId); }
/** * Returns <code>true</code> if the unqualified ID is a valid {@link Long} * value (in other words, it consists only of digits) */ @Override public boolean isIdPartValidLong() { return isValidLong(getIdPart()); }
/** * Create a new ID, using a BigDecimal input. Uses * {@link BigDecimal#toPlainString()} to generate the string representation. */ public IdType(BigDecimal thePid) { if (thePid != null) { setValue(toPlainStringWithNpeThrowIfNeeded(thePid)); } else { setValue(null); } }