Package ca.uhn.fhir.model.primitive

Examples of ca.uhn.fhir.model.primitive.IdDt


    }
  }

  @Override
  protected BaseHttpClientInvocation createClientInvocation(Object[] theArgs, IResource theResource) {
    IdDt idDt = (IdDt) theArgs[myIdParameterIndex];
    if (idDt == null) {
      throw new NullPointerException("ID can not be null");
    }

    IdDt versionIdDt = null;
    if (myVersionIdParameterIndex != null) {
      versionIdDt = (IdDt) theArgs[myVersionIdParameterIndex];
    }
    FhirContext context = getContext();
View Full Code Here


    @Override
    public void attributeValue(String theName, String theValue) throws DataFormatException {
      if ("id".equals(theName)) {
        if (myInstance instanceof IIdentifiableElement) {
          ((IIdentifiableElement) myInstance).setId(new IdDt(theValue));
        } else if (myInstance instanceof IResource) {
          ((IResource) myInstance).setId(new IdDt(theValue));
        }
      } else if ("url".equals(theName) && myInstance instanceof ExtensionDt) {
        ((ExtensionDt) myInstance).setUrl(theValue);
      }
    }
View Full Code Here

        myInstance.setValueAsString(theValue);
      } else if ("id".equals(theName)) {
        if (myInstance instanceof IIdentifiableElement) {
          ((IIdentifiableElement) myInstance).setElementSpecificId(theValue);
        } else if (myInstance instanceof IResource) {
          ((IResource) myInstance).setId(new IdDt(theValue));
        }
      }
    }
View Full Code Here

  @Override
  public BaseHttpClientInvocation invokeClient(Object[] theArgs) throws InternalErrorException {
    HttpPostClientInvocation retVal;

    IdDt id = (IdDt) theArgs[myIdParamIndex];
    if (id == null || id.isEmpty()) {
      throw new InvalidRequestException("ID must not be null or empty for this operation");
    }

    IdDt versionId = null;
    if (myVersionIdParamIndex != null) {
      versionId = (IdDt) theArgs[myVersionIdParamIndex];
    }

    TagList tagList = (TagList) theArgs[myTagListParamIndex];

    Class<? extends IResource> type = myType;
    assert type != null;

    if (isDelete()) {
      if (versionId != null) {
        retVal = new HttpPostClientInvocation(getContext(), tagList, getResourceName(), id.getValue(), Constants.PARAM_HISTORY, versionId.getValue(), Constants.PARAM_TAGS, Constants.PARAM_DELETE);
      } else {
        retVal = new HttpPostClientInvocation(getContext(), tagList, getResourceName(), id.getValue(), Constants.PARAM_TAGS, Constants.PARAM_DELETE);
      }
    } else {
      if (versionId != null) {
        retVal = new HttpPostClientInvocation(getContext(), tagList, getResourceName(), id.getValue(), Constants.PARAM_HISTORY, versionId.getValue(), Constants.PARAM_TAGS);
      } else {
        retVal = new HttpPostClientInvocation(getContext(), tagList, getResourceName(), id.getValue(), Constants.PARAM_TAGS);
      }
    }
    for (int idx = 0; idx < theArgs.length; idx++) {
View Full Code Here

  public IResource loadResource(IRestfulClient theClient) throws IOException {
    if (myResource != null) {
      return myResource;
    }

    IdDt resourceId = getReference();
    if (resourceId == null) {
      throw new IllegalStateException("Reference has no resource ID defined");
    }
   
    String resourceUrl = resourceId.getValue();
   
    ourLog.debug("Loading resource at URL: {}", resourceUrl);

    HttpClient httpClient = theClient.getHttpClient();
    FhirContext context = theClient.getFhirContext();
View Full Code Here

    return myContained;
  }

  public IdDt getId() {
    if (myId == null) {
      myId = new IdDt();
    }
    return myId;
  }
View Full Code Here

  public void setId(String theId) {
    if (theId == null) {
      myId = null;
    } else {
      myId = new IdDt(theId);
    }
  }
View Full Code Here

        b.append('/');
        b.append(Constants.PARAM_HISTORY);
        b.append('/');
        b.append(theResource.getId().getVersionIdPart());
      } else {
        IdDt versionId = (IdDt) ResourceMetadataKeyEnum.VERSION_ID.get(theResource);
        if (versionId != null) {
          b.append('/');
          b.append(Constants.PARAM_HISTORY);
          b.append('/');
          b.append(versionId.getValue());
        }
      }

      entry.getLinkSelf().setValue(b.toString());
    }

    InstantDt published = ResourceMetadataKeyEnum.PUBLISHED.get(theResource);
    if (published == null) {
      entry.getPublished().setToCurrentTimeInLocalTimeZone();
    } else {
      entry.setPublished(published);
    }

    InstantDt updated = ResourceMetadataKeyEnum.UPDATED.get(theResource);
    if (updated != null) {
      entry.setUpdated(updated);
    }

    InstantDt deleted = ResourceMetadataKeyEnum.DELETED_AT.get(theResource);
    if (deleted != null) {
      entry.setDeleted(deleted);
    }

    IdDt previous = ResourceMetadataKeyEnum.PREVIOUS_ID.get(theResource);
    if (previous != null) {
      entry.getLinkAlternate().setValue(previous.withServerBase(theServerBase, def.getName()));
    }

    TagList tagList = ResourceMetadataKeyEnum.TAG_LIST.get(theResource);
    if (tagList != null) {
      for (Tag nextTag : tagList) {
View Full Code Here

    return myResourceName;
  }

  @Override
  public BaseHttpClientInvocation invokeClient(Object[] theArgs) throws InternalErrorException {
    IdDt idDt = (IdDt) theArgs[myIdParameterIndex];
    if (idDt == null) {
      throw new NullPointerException("ID can not be null");
    }
    String resourceName = getResourceName();
   
View Full Code Here

    for (ResourceReferenceDt next : allElements) {
      IResource resource = next.getResource();
      if (resource != null) {
        if (resource.getId().isEmpty()) {
          resource.setId(new IdDt(myNextContainedId++));
//          resource.setId(new IdDt(UUID.randomUUID().toString()));
        }

        if (!allIds.contains(resource.getId().getValue())) {
          theTarget.getContained().getContainedResources().add(resource);
View Full Code Here

TOP

Related Classes of ca.uhn.fhir.model.primitive.IdDt

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.