Tabnine Logo
ResourceMetadataKeyEnum.put
Code IndexAdd Tabnine to your IDE (free)

How to use
put
method
in
ca.uhn.fhir.model.api.ResourceMetadataKeyEnum

Best Java code snippets using ca.uhn.fhir.model.api.ResourceMetadataKeyEnum.put (Showing top 20 results out of 315)

origin: jamesagnew/hapi-fhir

tags.addTag(Tag.HL7_ORG_FHIR_TAG, "http://foo/tag1.html", "Some tag");
tags.addTag(Tag.HL7_ORG_FHIR_TAG, "http://foo/tag2.html", "Another tag");
ResourceMetadataKeyEnum.TAG_LIST.put(patient, tags);
ResourceMetadataKeyEnum.LINK_ALTERNATE.put(patient, linkAlternate);
String linkSearch = "Patient?name=smith&name=john";
ResourceMetadataKeyEnum.LINK_SEARCH.put(patient, linkSearch);
ResourceMetadataKeyEnum.PUBLISHED.put(patient, pubDate);
InstantDt updatedDate = new InstantDt("2014-07-12T11:22:27Z");
ResourceMetadataKeyEnum.UPDATED.put(patient, updatedDate);
ResourceMetadataKeyEnum.TITLE.put(patient, title);
origin: jamesagnew/hapi-fhir

  ResourceMetadataKeyEnum.VERSION.put((IResource) theResource, versionIdPart);
} else {
  BaseRuntimeChildDefinition metaChild = myFhirContext.getResourceDefinition(myResourceType).getChildByName("meta");
origin: jamesagnew/hapi-fhir

@Search
public List<Patient> getAllPatients() {
 ArrayList<Patient> retVal = new ArrayList<Patient>();
 
 // Create a patient to return
 Patient patient = new Patient();
 patient.setId("Patient/123");
 patient.addName().addFamily("Smith").addGiven("John");
 
 // Create a tag list and add it to the resource
 TagList tags = new TagList();
 ResourceMetadataKeyEnum.TAG_LIST.put(patient, tags);
 // Add some tags to the list
 tags.addTag(Tag.HL7_ORG_FHIR_TAG, "http://foo/tag1.html", "Some tag");
 tags.addTag(Tag.HL7_ORG_FHIR_TAG, "http://foo/tag2.html", "Another tag");
 
 return retVal;
}
// END SNIPPET: serverMethod
origin: jamesagnew/hapi-fhir

ResourceMetadataKeyEnum.VERSION.put(res, Long.toString(theEntity.getVersion()));
ResourceMetadataKeyEnum.PUBLISHED.put(res, theEntity.getPublished());
ResourceMetadataKeyEnum.UPDATED.put(res, theEntity.getUpdated());
IDao.RESOURCE_PID.put(res, theEntity.getId());
    ResourceMetadataKeyEnum.TAG_LIST.put(res, tagList);
    ResourceMetadataKeyEnum.SECURITY_LABELS.put(res, toBaseCodingList(securityLabels));
    ResourceMetadataKeyEnum.PROFILES.put(res, profiles);
origin: jamesagnew/hapi-fhir

@Override
public void addRootPropertiesToBundle(String theId, String theServerBase, String theLinkSelf, String theLinkPrev, String theLinkNext, Integer theTotalResults, BundleTypeEnum theBundleType,
                         IPrimitiveType<Date> theLastUpdated) {
  myBase = theServerBase;
  if (myBundle.getIdElement().isEmpty()) {
    myBundle.setId(theId);
  }
  if (myBundle.getId().isEmpty()) {
    myBundle.setId(UUID.randomUUID().toString());
  }
  if (ResourceMetadataKeyEnum.UPDATED.get(myBundle) == null) {
    ResourceMetadataKeyEnum.UPDATED.put(myBundle, (InstantDt) theLastUpdated);
  }
  if (!hasLink(Constants.LINK_SELF, myBundle) && isNotBlank(theLinkSelf)) {
    myBundle.addLink().setRelation(Constants.LINK_SELF).setUrl(theLinkSelf);
  }
  if (!hasLink(Constants.LINK_NEXT, myBundle) && isNotBlank(theLinkNext)) {
    myBundle.addLink().setRelation(Constants.LINK_NEXT).setUrl(theLinkNext);
  }
  if (!hasLink(Constants.LINK_PREVIOUS, myBundle) && isNotBlank(theLinkPrev)) {
    myBundle.addLink().setRelation(Constants.LINK_PREVIOUS).setUrl(theLinkPrev);
  }
  if (myBundle.getTypeElement().isEmpty() && theBundleType != null) {
    myBundle.getTypeElement().setValueAsString(theBundleType.getCode());
  }
  if (myBundle.getTotalElement().isEmpty() && theTotalResults != null) {
    myBundle.getTotalElement().setValue(theTotalResults);
  }
}
origin: jamesagnew/hapi-fhir

protected void updateResourceMetadata(IBaseResourceEntity theEntity, IBaseResource theResource) {
  IIdType id = theEntity.getIdDt();
  if (getContext().getVersion().getVersion().isRi()) {
    id = getContext().getVersion().newIdType().setValue(id.getValue());
  }
  if (id.hasResourceType() == false) {
    id = id.withResourceType(theEntity.getResourceType());
  }
  theResource.setId(id);
  if (theResource instanceof IResource) {
    ResourceMetadataKeyEnum.VERSION.put((IResource) theResource, id.getVersionIdPart());
    ResourceMetadataKeyEnum.UPDATED.put((IResource) theResource, theEntity.getUpdated());
  } else {
    IBaseMetaType meta = theResource.getMeta();
    meta.setVersionId(id.getVersionIdPart());
    meta.setLastUpdated(theEntity.getUpdatedDate());
  }
}
origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu

@Override
public IBaseMetaType setLastUpdated(Date theHeaderDateValue) {
  ResourceMetadataKeyEnum.UPDATED.put(BaseResource.this, new InstantDt(theHeaderDateValue));
  return this;
}

origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu2

@Override
public IBaseMetaType addProfile(String theProfile) {
  ArrayList<IdDt> newTagList = new ArrayList<IdDt>();
  List<IdDt> existingTagList = ResourceMetadataKeyEnum.PROFILES.get(BaseResource.this);
  if (existingTagList != null) {
    newTagList.addAll(existingTagList);
  }
  ResourceMetadataKeyEnum.PROFILES.put(BaseResource.this, newTagList);
  
  IdDt tag = new IdDt(theProfile);
  newTagList.add(tag);
  return this;
}

origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu

@Override
public IBaseMetaType addProfile(String theProfile) {
  ArrayList<IdDt> newTagList = new ArrayList<IdDt>();
  List<IdDt> existingTagList = ResourceMetadataKeyEnum.PROFILES.get(BaseResource.this);
  if (existingTagList != null) {
    newTagList.addAll(existingTagList);
  }
  ResourceMetadataKeyEnum.PROFILES.put(BaseResource.this, newTagList);
  
  IdDt tag = new IdDt(theProfile);
  newTagList.add(tag);
  return this;
}

origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu2

@Override
public IBaseCoding addSecurity() {
  List<BaseCodingDt> tagList = ResourceMetadataKeyEnum.SECURITY_LABELS.get(BaseResource.this);
  if (tagList == null) {
    tagList = new ArrayList<BaseCodingDt>();
    ResourceMetadataKeyEnum.SECURITY_LABELS.put(BaseResource.this, tagList);
  }
  CodingDt tag = new CodingDt();
  tagList.add(tag);
  return tag;
}

origin: jamesagnew/hapi-fhir

ResourceMetadataKeyEnum.PUBLISHED.put(myBundle, InstantDt.withCurrentTime());
origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu

@Override
public IBaseCoding addSecurity() {
  List<BaseCodingDt> tagList = ResourceMetadataKeyEnum.SECURITY_LABELS.get(BaseResource.this);
  if (tagList == null) {
    tagList = new ArrayList<BaseCodingDt>();
    ResourceMetadataKeyEnum.SECURITY_LABELS.put(BaseResource.this, tagList);
  }
  CodingDt tag = new CodingDt();
  tagList.add(tag);
  return asBaseCoding(tag);
}

origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu2

@Override
public IBaseMetaType setLastUpdated(Date theHeaderDateValue) {
  if (theHeaderDateValue == null) {
    getResourceMetadata().remove(ResourceMetadataKeyEnum.UPDATED);
  } else {
    ResourceMetadataKeyEnum.UPDATED.put(BaseResource.this, new InstantDt(theHeaderDateValue));
  }
  return this;
}

origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu2

@Override
public IBaseCoding addTag() {
  TagList tagList = ResourceMetadataKeyEnum.TAG_LIST.get(BaseResource.this);
  if (tagList == null) {
    tagList = new TagList();
    ResourceMetadataKeyEnum.TAG_LIST.put(BaseResource.this, tagList);
  }
  Tag tag = new Tag();
  tagList.add(tag);
  return tag;
}

origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu

@Override
public IBaseCoding addTag() {
  TagList tagList = ResourceMetadataKeyEnum.TAG_LIST.get(BaseResource.this);
  if (tagList == null) {
    tagList = new TagList();
    ResourceMetadataKeyEnum.TAG_LIST.put(BaseResource.this, tagList);
  }
  Tag tag = new Tag();
  tagList.add(tag);
  return tag;
}

origin: ca.uhn.hapi.fhir/hapi-fhir-server

  ResourceMetadataKeyEnum.VERSION.put((IResource) theResource, versionIdPart);
} else {
  BaseRuntimeChildDefinition metaChild = myFhirContext.getResourceDefinition(myResourceType).getChildByName("meta");
origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu

private void addProfileIfNeeded(IRestfulServer<?> theServer, String theServerBase, IBaseResource nextRes) {
  RuntimeResourceDefinition def = theServer.getFhirContext().getResourceDefinition(nextRes);
  if (theServer.getAddProfileTag() == AddProfileTagEnum.ALWAYS || !def.isStandardType()) {
    TagList tl = ResourceMetadataKeyEnum.TAG_LIST.get((IResource) nextRes);
    if (tl == null) {
      tl = new TagList();
      ResourceMetadataKeyEnum.TAG_LIST.put((IResource) nextRes, tl);
    }
    RuntimeResourceDefinition nextDef = myContext.getResourceDefinition(nextRes);
    String profile = nextDef.getResourceProfile(theServerBase);
    if (isNotBlank(profile)) {
      tl.add(new Tag(Tag.HL7_ORG_PROFILE_TAG, profile, null));
    }
  }
}
origin: ca.uhn.hapi.fhir/hapi-fhir-jpaserver-base

protected void updateResourceMetadata(IBaseResourceEntity theEntity, IBaseResource theResource) {
  IIdType id = theEntity.getIdDt();
  if (getContext().getVersion().getVersion().isRi()) {
    id = getContext().getVersion().newIdType().setValue(id.getValue());
  }
  if (id.hasResourceType() == false) {
    id = id.withResourceType(theEntity.getResourceType());
  }
  theResource.setId(id);
  if (theResource instanceof IResource) {
    ResourceMetadataKeyEnum.VERSION.put((IResource) theResource, id.getVersionIdPart());
    ResourceMetadataKeyEnum.UPDATED.put((IResource) theResource, theEntity.getUpdated());
  } else {
    IBaseMetaType meta = theResource.getMeta();
    meta.setVersionId(id.getVersionIdPart());
    meta.setLastUpdated(theEntity.getUpdatedDate());
  }
}
origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu2

@Override
public void addRootPropertiesToBundle(String theId, String theServerBase, String theLinkSelf, String theLinkPrev, String theLinkNext, Integer theTotalResults, BundleTypeEnum theBundleType,
                         IPrimitiveType<Date> theLastUpdated) {
  ensureBundle();
  myBase = theServerBase;
  if (myBundle.getIdElement().isEmpty()) {
    myBundle.setId(theId);
  }
  if (myBundle.getId().isEmpty()) {
    myBundle.setId(UUID.randomUUID().toString());
  }
  if (ResourceMetadataKeyEnum.UPDATED.get(myBundle) == null) {
    ResourceMetadataKeyEnum.UPDATED.put(myBundle, (InstantDt) theLastUpdated);
  }
  if (!hasLink(Constants.LINK_SELF, myBundle) && isNotBlank(theLinkSelf)) {
    myBundle.addLink().setRelation(Constants.LINK_SELF).setUrl(theLinkSelf);
  }
  if (!hasLink(Constants.LINK_NEXT, myBundle) && isNotBlank(theLinkNext)) {
    myBundle.addLink().setRelation(Constants.LINK_NEXT).setUrl(theLinkNext);
  }
  if (!hasLink(Constants.LINK_PREVIOUS, myBundle) && isNotBlank(theLinkPrev)) {
    myBundle.addLink().setRelation(Constants.LINK_PREVIOUS).setUrl(theLinkPrev);
  }
  if (myBundle.getTypeElement().isEmpty() && theBundleType != null) {
    myBundle.getTypeElement().setValueAsString(theBundleType.getCode());
  }
  if (myBundle.getTotalElement().isEmpty() && theTotalResults != null) {
    myBundle.getTotalElement().setValue(theTotalResults);
  }
}
origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu2

ResourceMetadataKeyEnum.PUBLISHED.put(myBundle, InstantDt.withCurrentTime());
ca.uhn.fhir.model.apiResourceMetadataKeyEnumput

Popular methods of ResourceMetadataKeyEnum

  • get
  • name
  • toId

Popular in Java

  • Updating database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • putExtra (Intent)
  • getResourceAsStream (ClassLoader)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JList (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now