Tabnine Logo
Bundle
Code IndexAdd Tabnine to your IDE (free)

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

Best Java code snippets using org.hl7.fhir.dstu3.model.Bundle (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

@Override
public List<Bundle.BundleEntryComponent> getEntries(Bundle theRequest) {
  return theRequest.getEntry();
}
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 org.hl7.fhir.instance.model.Bundle convertBundle(org.hl7.fhir.dstu3.model.Bundle src) throws FHIRException {
 if (src == null || src.isEmpty())
  return null;
 org.hl7.fhir.instance.model.Bundle tgt = new org.hl7.fhir.instance.model.Bundle();
 copyResource(src, tgt);
 tgt.setType(convertBundleType(src.getType()));
 if (src.hasTotal())
  tgt.setTotal(src.getTotal());
 for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink())
  tgt.addLink(convertBundleLinkComponent(t));
 for (org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent t : src.getEntry())
  tgt.addEntry(convertBundleEntryComponent(t));
 if (src.hasSignature())
  tgt.setSignature(convertSignature(src.getSignature()));
 return tgt;
}
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

@Override
public String getBundleType(Bundle theRequest) {
  if (theRequest.getType() == null) {
    return null;
  }
  return theRequest.getTypeElement().getValue().toCode();
}
origin: org.openehealth.ipf.platform-camel/ipf-platform-camel-ihe-fhir-stu3-pixpdq

  @Test
  public void testSendManualPdqmWithCount() {

    Bundle page1 = sendManuallyWithCount(familyParameters(), 2);

    assertEquals(Bundle.BundleType.SEARCHSET, page1.getType());
    assertEquals(ResourceType.Bundle, page1.getResourceType());
    assertTrue(page1.hasEntry());
    assertEquals(3, page1.getTotal());
    assertEquals(2, page1.getEntry().size());

    Bundle page2 = nextPage(page1);
    assertEquals(Bundle.BundleType.SEARCHSET, page2.getType());
    assertEquals(ResourceType.Bundle, page2.getResourceType());
    assertTrue(page2.hasEntry());
    assertEquals(3, page2.getTotal());
    assertEquals(1, page2.getEntry().size());

  }
}
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: 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);
            BundleEntryComponent entry = bundle.addEntry();
            entry.getRequest().setMethod(HTTPVerb.POST);
            entry.setResource((Resource) nextResource);
        continue;
      BundleEntryComponent entry = bundle.addEntry();
      entry.getRequest().setMethod(HTTPVerb.POST);
      entry.setResource((Resource) parsed);
origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu3

@Override
public Base setProperty(int hash, String name, Base value) throws FHIRException {
 switch (hash) {
 case -1618432855: // identifier
  this.identifier = castToIdentifier(value); // Identifier
  return value;
 case 3575610: // type
  value = new BundleTypeEnumFactory().fromType(castToCode(value));
  this.type = (Enumeration) value; // Enumeration<BundleType>
  return value;
 case 110549828: // total
  this.total = castToUnsignedInt(value); // UnsignedIntType
  return value;
 case 3321850: // link
  this.getLink().add((BundleLinkComponent) value); // BundleLinkComponent
  return value;
 case 96667762: // entry
  this.getEntry().add((BundleEntryComponent) value); // BundleEntryComponent
  return value;
 case 1073584312: // signature
  this.signature = castToSignature(value); // Signature
  return value;
 default: return super.setProperty(hash, name, value);
 }
}
origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu3

@Override
public void initializeBundleFromResourceList(String theAuthor, List<? extends IBaseResource> theResources, String theServerBase, String theCompleteUrl, int theTotalResults,
                       BundleTypeEnum theBundleType) {
 myBundle = new Bundle();
 myBundle.setId(UUID.randomUUID().toString());
 myBundle.getMeta().setLastUpdated(new Date());
 myBundle.addLink().setRelation(Constants.LINK_FHIR_BASE).setUrl(theServerBase);
 myBundle.addLink().setRelation(Constants.LINK_SELF).setUrl(theCompleteUrl);
 myBundle.getTypeElement().setValueAsString(theBundleType.getCode());
   BundleEntryComponent nextEntry = myBundle.addEntry();
 myBundle.getTotalElement().setValue(theTotalResults);
origin: org.openehealth.ipf.platform-camel/ipf-platform-camel-ihe-fhir-stu3-mhd

protected Bundle provideAndRegister() throws Exception {
  Bundle bundle = new Bundle().setType(Bundle.BundleType.TRANSACTION);
  bundle.getMeta().addProfile(Iti65Constants.ITI65_PROFILE);
  manifest.addContent()
      .setP(new Reference(REFERENCE_FULL_URL));
  bundle.addEntry()
      .setFullUrl(MANIFEST_FULL_URL)
      .setRequest(
              .setUrl(BINARY_FULL_URL))
      .setFormat(new Coding("urn:oid:1.3.6.1.4.1.19376.1.2.3", "urn:ihe:pcc:handp:2008", null));
  bundle.addEntry()
      .setFullUrl(REFERENCE_FULL_URL)
      .setRequest(
  binary.getMeta().setLastUpdated(timestamp);
  bundle.addEntry()
      .setFullUrl(BINARY_FULL_URL)
      .setRequest(new Bundle.BundleEntryRequestComponent()
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: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu3

/**
 * @return The first repetition of repeating field {@link #entry}, creating it if it does not already exist
 */
public BundleEntryComponent getEntryFirstRep() { 
 if (getEntry().isEmpty()) {
  addEntry();
 }
 return getEntry().get(0);
}
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: FirelyTeam/fhirstarters

  public static void main(String[] theArgs) {
   FhirContext ctx = FhirContext.forDstu3();
   IGenericClient client = ctx.newRestfulGenericClient("http://fhirtest.uhn.ca/baseDstu3");

   // Build a search and execute it
   Bundle response = client.search()
     .forResource(Patient.class)
     .where(Patient.NAME.matches().value("Test"))
     .and(Patient.BIRTHDATE.before().day("2014-01-01"))
     .count(100)
     .returnBundle(Bundle.class)
     .execute();

   // How many resources did we find?
   System.out.println("Responses: " + response.getTotal());

   // Print the ID of the first one
   System.out.println("First response ID: " + response.getEntry().get(0).getResource().getId());
  }
}
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: jamesagnew/hapi-fhir

@Override
public void addEntry(Bundle theBundle, Bundle.BundleEntryComponent theEntry) {
  theBundle.addEntry(theEntry);
}
origin: org.hspconsortium.carewebframework/cwf-fhir-client

@Test
public void testClient() {
  FhirContext ctx = new FhirContext(FhirVersionEnum.DSTU3);
  GenericClient client = (GenericClient) ctx.newRestfulGenericClient(FHIR_EP);
  //client.registerInterceptor(new BasicAuthInterceptor("user123", "user321$"));
  client.setDontValidateConformance(true);
  Bundle bundle = client.search().forResource(Patient.class).count(1).returnBundle(Bundle.class).execute();
  assertTrue("No patient resources returned.", bundle.getEntry().size() > 0);
  Patient patient = (Patient) bundle.getEntryFirstRep().getResource();
  String patient_id = patient.getIdElement().getIdPart();
  Patient patient1 = client.read(Patient.class, "Patient/" + patient_id);
  assertEquals(patient_id, patient1.getIdElement().getIdPart());
  bundle = client.search().byUrl("Patient?_id=" + patient_id).returnBundle(Bundle.class).execute();
  assertEquals(1, bundle.getEntry().size());
  Patient patient2 = (Patient) bundle.getEntry().get(0).getResource();
  assertEquals(patient_id, patient2.getIdElement().getIdPart());
}

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;
}
org.hl7.fhir.dstu3.modelBundle

Javadoc

A container for a collection of resources.

Most used methods

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

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getContentResolver (Context)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Collectors (java.util.stream)
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Top plugins for WebStorm
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