Package ca.uhn.fhir.model.primitive

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


     * <b>Definition:</b>
     * An Internal id that is used to identify this mapping set when specific mappings are made
     * </p>
   */
  public Mapping setIdentity( String theId) {
    myIdentity = new IdDt(theId);
    return this;
  }
View Full Code Here


     * An internal reference to the definition of a mapping
     * </p>
   */
  public IdDt getIdentity() { 
    if (myIdentity == null) {
      myIdentity = new IdDt();
    }
    return myIdentity;
  }
View Full Code Here

     * <b>Definition:</b>
     * An internal reference to the definition of a mapping
     * </p>
   */
  public StructureElementDefinitionMapping setIdentity( String theId) {
    myIdentity = new IdDt(theId);
    return this;
  }
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());
        }
      }

      String qualifiedId = b.toString();
      entry.getLinkSelf().setValue(qualifiedId);

      // String resourceType = theContext.getResourceDefinition(theResource).getName();

      String linkSearch = ResourceMetadataKeyEnum.LINK_SEARCH.get(theResource);
      if (isNotBlank(linkSearch)) {
        if (!UrlUtil.isAbsolute(linkSearch)) {
          linkSearch = (theServerBase + "/" + linkSearch);
        }
        entry.getLinkSearch().setValue(linkSearch);
      }

      String linkAlternate = ResourceMetadataKeyEnum.LINK_ALTERNATE.get(theResource);
      if (isNotBlank(linkAlternate)) {
        if (!UrlUtil.isAbsolute(linkAlternate)) {
          linkSearch = (theServerBase + "/" + linkAlternate);
        }
        entry.getLinkAlternate().setValue(linkSearch);
      }

    }

    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

    public void attributeValue(String theName, String theValue) throws DataFormatException {
      if ("id".equals(theName)) {
        if (myInstance instanceof IIdentifiableElement) {
          ((IIdentifiableElement) myInstance).setElementSpecificId((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

    theState.setStack(myState);
    myState = theState;
  }

  private void putPlacerResourceInDeletedEntry(BundleEntry entry) {
    IdDt id = null;
    if (entry.getLinkSelf() != null && entry.getLinkSelf().isEmpty() == false) {
      id = new IdDt(entry.getLinkSelf().getValue());
    } else {
      id = entry.getId();
    }

    IResource resource = entry.getResource();
    if (resource == null && id != null && isNotBlank(id.getResourceType())) {
      String resourceType = id.getResourceType();
      RuntimeResourceDefinition def = myContext.getResourceDefinition(resourceType);
      if (def == null) {
        throw new DataFormatException("Entry references unknown resource type: " + resourceType);
      }
      resource = def.newInstance();
View Full Code Here

    }

    @Override
    public void attributeValue(String theName, String theValue) throws DataFormatException {
      if ("ref".equals(theName)) {
        getEntry().setId(new IdDt(theValue));
      } else if ("when".equals(theName)) {
        getEntry().setDeleted(new InstantDt(theValue));
      }
    }
View Full Code Here

    private void populateResourceMetadata() {
      if (myEntry.getResource() == null) {
        return;
      }

      IdDt id = myEntry.getId();
      if (id != null && id.isEmpty() == false) {
        myEntry.getResource().setId(id);
      }

      Map<ResourceMetadataKeyEnum<?>, Object> metadata = myEntry.getResource().getResourceMetadata();
      if (myEntry.getPublished().isEmpty() == false) {
        ResourceMetadataKeyEnum.PUBLISHED.put(myEntry.getResource(), myEntry.getPublished());
      }
      if (myEntry.getUpdated().isEmpty() == false) {
        ResourceMetadataKeyEnum.UPDATED.put(myEntry.getResource(), myEntry.getUpdated());
      }

      ResourceMetadataKeyEnum.TITLE.put(myEntry.getResource(), myEntry.getTitle().getValue());

      if (myEntry.getCategories().isEmpty() == false) {
        TagList tagList = new TagList();
        for (Tag next : myEntry.getCategories()) {
          tagList.add(next);
        }
        ResourceMetadataKeyEnum.TAG_LIST.put(myEntry.getResource(), tagList);
      }
      if (!myEntry.getLinkSelf().isEmpty()) {
        String linkSelfValue = myEntry.getLinkSelf().getValue();
        IdDt linkSelf = new IdDt(linkSelfValue);
        myEntry.getResource().setId(linkSelf);
        if (isNotBlank(linkSelf.getVersionIdPart())) {
          metadata.put(ResourceMetadataKeyEnum.VERSION_ID, linkSelf);
        }
      }
      if (!myEntry.getLinkAlternate().isEmpty()) {
        ResourceMetadataKeyEnum.LINK_ALTERNATE.put(myEntry.getResource(), myEntry.getLinkAlternate().getValue());
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.