org.hl7.fhir.dstu3.model.Bundle.addLink()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中org.hl7.fhir.dstu3.model.Bundle.addLink()方法的一些代码示例,展示了Bundle.addLink()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bundle.addLink()方法的具体详情如下:
包路径:org.hl7.fhir.dstu3.model.Bundle
类名称:Bundle
方法名:addLink

Bundle.addLink介绍

暂无

代码示例

代码示例来源:origin: jamesagnew/hapi-fhir

public org.hl7.fhir.dstu3.model.Bundle convertBundle(org.hl7.fhir.instance.model.Bundle src) throws FHIRException {
 if (src == null || src.isEmpty())
  return null;
 org.hl7.fhir.dstu3.model.Bundle tgt = new org.hl7.fhir.dstu3.model.Bundle();
 copyResource(src, tgt);
 tgt.setType(convertBundleType(src.getType()));
 if (src.hasTotal())
  tgt.setTotal(src.getTotal());
 for (org.hl7.fhir.instance.model.Bundle.BundleLinkComponent t : src.getLink())
  tgt.addLink(convertBundleLinkComponent(t));
 for (org.hl7.fhir.instance.model.Bundle.BundleEntryComponent t : src.getEntry())
  tgt.addEntry(convertBundleEntryComponent(t));
 tgt.setSignature(convertSignature(src.getSignature()));
 return tgt;
}

代码示例来源:origin: jamesagnew/hapi-fhir

public static org.hl7.fhir.dstu3.model.Bundle convertBundle(org.hl7.fhir.dstu2016may.model.Bundle src) throws FHIRException {
 if (src == null || src.isEmpty())
  return null;
 org.hl7.fhir.dstu3.model.Bundle tgt = new org.hl7.fhir.dstu3.model.Bundle();
 copyResource(src, tgt);
 tgt.setType(convertBundleType(src.getType()));
 if (src.hasTotal())
  tgt.setTotal(src.getTotal());
 for (org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent t : src.getLink())
  tgt.addLink(convertBundleLinkComponent(t));
 for (org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent t : src.getEntry())
  tgt.addEntry(convertBundleEntryComponent(t));
 tgt.setSignature(convertSignature(src.getSignature()));
 return tgt;
}

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu3

/**
 * @return The first repetition of repeating field {@link #link}, creating it if it does not already exist
 */
public BundleLinkComponent getLinkFirstRep() { 
 if (getLink().isEmpty()) {
  addLink();
 }
 return getLink().get(0);
}

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu3

@Override
public Base addChild(String name) throws FHIRException {
 if (name.equals("identifier")) {
  this.identifier = new Identifier();
  return this.identifier;
 }
 else if (name.equals("type")) {
  throw new FHIRException("Cannot call addChild on a primitive type Bundle.type");
 }
 else if (name.equals("total")) {
  throw new FHIRException("Cannot call addChild on a primitive type Bundle.total");
 }
 else if (name.equals("link")) {
  return addLink();
 }
 else if (name.equals("entry")) {
  return addEntry();
 }
 else if (name.equals("signature")) {
  this.signature = new Signature();
  return this.signature;
 }
 else
  return super.addChild(name);
}

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu3

@Override
public Base makeProperty(int hash, String name) throws FHIRException {
 switch (hash) {
 case -1618432855:  return getIdentifier(); 
 case 3575610:  return getTypeElement();
 case 110549828:  return getTotalElement();
 case 3321850:  return addLink(); 
 case 96667762:  return addEntry(); 
 case 1073584312:  return getSignature(); 
 default: return super.makeProperty(hash, name);
 }
}

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu3

@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.getIdElement().isEmpty()) {
  myBundle.setId(UUID.randomUUID().toString());
 }
 if (myBundle.getMeta().getLastUpdated() == null && theLastUpdated != null) {
  myBundle.getMeta().getLastUpdatedElement().setValueAsString(theLastUpdated.getValueAsString());
 }
 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-dstu3

myBundle.addLink().setRelation(Constants.LINK_FHIR_BASE).setUrl(theServerBase);
myBundle.addLink().setRelation(Constants.LINK_SELF).setUrl(theCompleteUrl);
myBundle.getTypeElement().setValueAsString(theBundleType.getCode());

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-converter

public static org.hl7.fhir.dstu3.model.Bundle convertBundle(org.hl7.fhir.dstu2016may.model.Bundle src) throws FHIRException {
 if (src == null || src.isEmpty())
  return null;
 org.hl7.fhir.dstu3.model.Bundle tgt = new org.hl7.fhir.dstu3.model.Bundle();
 copyResource(src, tgt);
 tgt.setType(convertBundleType(src.getType()));
 if (src.hasTotal())
  tgt.setTotal(src.getTotal());
 for (org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent t : src.getLink())
  tgt.addLink(convertBundleLinkComponent(t));
 for (org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent t : src.getEntry())
  tgt.addEntry(convertBundleEntryComponent(t));
 tgt.setSignature(convertSignature(src.getSignature()));
 return tgt;
}

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-converter

public org.hl7.fhir.dstu3.model.Bundle convertBundle(org.hl7.fhir.instance.model.Bundle src) throws FHIRException {
 if (src == null || src.isEmpty())
  return null;
 org.hl7.fhir.dstu3.model.Bundle tgt = new org.hl7.fhir.dstu3.model.Bundle();
 copyResource(src, tgt);
 tgt.setType(convertBundleType(src.getType()));
 if (src.hasTotal())
  tgt.setTotal(src.getTotal());
 for (org.hl7.fhir.instance.model.Bundle.BundleLinkComponent t : src.getLink())
  tgt.addLink(convertBundleLinkComponent(t));
 for (org.hl7.fhir.instance.model.Bundle.BundleEntryComponent t : src.getEntry())
  tgt.addEntry(convertBundleEntryComponent(t));
 tgt.setSignature(convertSignature(src.getSignature()));
 return tgt;
}

相关文章