Tabnine Logo
Bundle.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.hl7.fhir.dstu3.model.Bundle
constructor

Best Java code snippets using org.hl7.fhir.dstu3.model.Bundle.<init> (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: jamesagnew/hapi-fhir

/**
 * This method is a Patient search, but HAPI can not automatically
 * determine the resource type so it must be explicitly stated.
 */
@Search(type=Patient.class)
public Bundle searchForPatients(@RequiredParam(name=Patient.SP_NAME) StringDt theName) {
 Bundle retVal = new Bundle();
 // perform search
 return retVal;
}    
 
origin: jamesagnew/hapi-fhir

@Override
public Bundle createBundle(String theBundleType) {
  Bundle resp = new Bundle();
  try {
    resp.setType(Bundle.BundleType.fromCode(theBundleType));
  } catch (FHIRException theE) {
    throw new InternalErrorException("Unknown bundle type: " + theBundleType);
  }
  return resp;
}
origin: jamesagnew/hapi-fhir

@Transaction
public Bundle transaction(@TransactionParam Bundle theInput) {
  for (BundleEntryComponent nextEntry : theInput.getEntry()) {
   // Process entry
  }

  Bundle retVal = new Bundle();
  // Populate return bundle
  return retVal;
}
//END SNIPPET: transaction
origin: jamesagnew/hapi-fhir

@SuppressWarnings("unchecked")
private org.hl7.fhir.dstu3.model.Bundle getBundleFromFileDstu3(Integer limit, File inputFile, FhirContext ctx) throws IOException, UnsupportedEncodingException {
  org.hl7.fhir.dstu3.model.Bundle bundle = new org.hl7.fhir.dstu3.model.Bundle();
  bundle.setType(BundleType.TRANSACTION);
origin: jamesagnew/hapi-fhir

@SuppressWarnings("unused")
public void processMessage() {
 // START SNIPPET: processMessage
 FhirContext ctx = FhirContext.forDstu3();
 // Create the client
 IGenericClient client = ctx.newRestfulGenericClient("http://localhost:9999/fhir");
 
 Bundle bundle = new Bundle();
 // ..populate the bundle..
 
 Bundle response = client
    .operation()
    .processMessage() // New operation for sending messages
    .setMessageBundle(bundle)
    .asynchronous(Bundle.class)
    .execute();
 // END SNIPPET: processMessage
}
origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu3

private void ensureBundle() {
 if (myBundle == null) {
  myBundle = new Bundle();
 }
}
origin: jamesagnew/hapi-fhir

@SuppressWarnings("unused")
public void cacheControl() {
  FhirContext ctx = FhirContext.forDstu3();
  // Create the client
  IGenericClient client = ctx.newRestfulGenericClient("http://localhost:9999/fhir");
  Bundle bundle = new Bundle();
  // ..populate the bundle..
  // START SNIPPET: cacheControl
  Bundle response = client
    .search()
    .forResource(Patient.class)
    .returnBundle(Bundle.class)
    .cacheControl(new CacheControlDirective().setNoCache(true)) // <-- add a directive
    .execute();
  // END SNIPPET: cacheControl
}
origin: jamesagnew/hapi-fhir

public Bundle convert(InputStream stream) throws Exception {
  cda = new CDAUtilities(stream);
  doc = cda.getElement();
  cda.checkTemplateId(doc, "2.16.840.1.113883.10.20.22.1.1");
  convert = new Convert(cda, ucumSvc, "Z");
  // check it's a CDA/CCD
  feed = new Bundle();
  feed.setMeta(new Meta().setLastUpdatedElement(InstantType.now()));
  feed.setId(makeUUIDReference());
  feed.getMeta().getTag().add(new Coding()); // todo-bundle  ("http://hl7.org/fhir/tag", "http://hl7.org/fhir/tag/document", "Document"));
  // process the header
  makeDocument();
  composition.setSubject(Factory.makeReference(makeSubject()));
  for (Element e : cda.getChildren(doc, "author"))
    composition.getAuthor().add(Factory.makeReference(makeAuthor(e)));
  // todo: data enterer & informant goes in provenance
  composition.setCustodian(Factory.makeReference(makeOrganization(
      cda.getDescendent(doc, "custodian/assignedCustodian/representedCustodianOrganization"), "Custodian")));
  // todo: informationRecipient
  for (Element e : cda.getChildren(doc, "legalAuthenticator"))
    composition.getAttester().add(makeAttester(e, CompositionAttestationMode.LEGAL, "Legal Authenticator"));
  for (Element e : cda.getChildren(doc, "authenticator"))
    composition.getAttester().add(makeAttester(e, CompositionAttestationMode.PROFESSIONAL, "Authenticator"));
  // process the contents
  // we do this by section - keep the original section order
  Element body =  cda.getDescendent(doc, "component/structuredBody");
  processComponentSections(composition.getSection(), body);
  return feed;
}
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: jamesagnew/hapi-fhir

Bundle bundle = new Bundle().setType(Bundle.BundleType.DOCUMENT);
for (IBaseResource resource : resourceList) {
  bundle.addEntry(new Bundle.BundleEntryComponent().setResource((Resource) resource));
origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu3

/**
 * @return {@link #evaluatedResources} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to a Bundle containing the Resources that were used in the evaluation of this report.)
 */
public Bundle getEvaluatedResourcesTarget() { 
 if (this.evaluatedResourcesTarget == null)
  if (Configuration.errorOnAutoCreate())
   throw new Error("Attempt to auto-create MeasureReport.evaluatedResources");
  else if (Configuration.doAutoCreate())
   this.evaluatedResourcesTarget = new Bundle(); // aa
 return this.evaluatedResourcesTarget;
}
origin: apache/ctakes

/**
* {@inheritDoc}
*/
@Override
public Bundle createResource( final JCas jCas, final TOP nullified, final FhirPractitioner practitioner,
               final FhirNoteSpecs noteSpecs ) {
 final Bundle bundle = new Bundle();
 final String noteTime = DATE_FORMAT.format( new Date() );
 bundle.setId( FhirElementFactory.createId( jCas, CTAKES_BUNDLE_ID, noteTime ) );
 // The bundle is a collection; created for ease of distribution.
 bundle.setType( Bundle.BundleType.COLLECTION );
 return bundle;
}
origin: ca.uhn.hapi.fhir/hapi-fhir-jpaserver-base

@Override
public Bundle createBundle(String theBundleType) {
  Bundle resp = new Bundle();
  try {
    resp.setType(Bundle.BundleType.fromCode(theBundleType));
  } catch (FHIRException theE) {
    throw new InternalErrorException("Unknown bundle type: " + theBundleType);
  }
  return resp;
}
origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu3

public Bundle copy() {
 Bundle dst = new Bundle();
 copyValues(dst);
 dst.identifier = identifier == null ? null : identifier.copy();
 dst.type = type == null ? null : type.copy();
 dst.total = total == null ? null : total.copy();
 if (link != null) {
  dst.link = new ArrayList<BundleLinkComponent>();
  for (BundleLinkComponent i : link)
   dst.link.add(i.copy());
 };
 if (entry != null) {
  dst.entry = new ArrayList<BundleEntryComponent>();
  for (BundleEntryComponent i : entry)
   dst.entry.add(i.copy());
 };
 dst.signature = signature == null ? null : signature.copy();
 return dst;
}
origin: cerner/bunsen

/**
 * Returns a bundle containing all resources in the dataset. This should be used
 * with caution for large datasets, since the returned bundle will include all data.
 *
 * @param dataset a dataset of FHIR resoruces
 * @return a bundle containing those resources.
 */
public static Bundle toBundle(Dataset<? extends Resource> dataset) {
 List<Resource> resources = (List<Resource>) dataset.collectAsList();
 Bundle bundle = new Bundle();
 for (Resource resource : resources) {
  bundle.addEntry().setResource(resource);
 }
 return bundle;
}
origin: org.openehealth.ipf.platform-camel/ipf-platform-camel-ihe-fhir-stu3-mhd

protected Bundle thisSucks() {
  Bundle bundle = new Bundle().setType(Bundle.BundleType.TRANSACTION);
  bundle.getMeta().addProfile("http://thissucks.com");
  return bundle;
}
origin: org.openehealth.ipf.platform-camel/ipf-platform-camel-ihe-fhir-stu3-mhd

@Override
public Object evaluate(Exchange exchange) {
  if (returnError) throw new InternalErrorException("Something went wrong");
  Bundle requestBundle = exchange.getIn().getBody(Bundle.class);
  Bundle responseBundle = new Bundle()
      .setType(Bundle.BundleType.TRANSACTIONRESPONSE)
      .setTotal(requestBundle.getTotal());
  for (Bundle.BundleEntryComponent requestEntry : requestBundle.getEntry()) {
    Bundle.BundleEntryResponseComponent response = new Bundle.BundleEntryResponseComponent()
        .setStatus("201 Created")
        .setLastModified(new Date())
        .setLocation(requestEntry.getResource().getClass().getSimpleName() + "/" + 4711);
    responseBundle.addEntry()
        .setResponse(response)
        .setResource(responseResource(requestEntry.getResource()));
  }
  return responseBundle;
}
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;
}
org.hl7.fhir.dstu3.modelBundle<init>

Javadoc

Constructor

Popular methods of Bundle

  • getEntry
  • addEntry
  • getMeta
  • getType
  • setType
  • getTotal
  • getLink
    Returns the #getLink() which matches a given BundleLinkComponent#getRelation(). If no link is found
  • setId
  • addLink
  • getEntryFirstRep
  • getResourceType
  • getSignature
  • getResourceType,
  • getSignature,
  • getTypeElement,
  • hasEntry,
  • setTotal,
  • castToCode,
  • castToIdentifier,
  • castToSignature,
  • castToUnsignedInt

Popular in Java

  • Creating JSON documents from java classes using gson
  • getApplicationContext (Context)
  • getContentResolver (Context)
  • addToBackStack (FragmentTransaction)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • 14 Best Plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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