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

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

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

origin: jamesagnew/hapi-fhir

@Override
public List<Bundle.BundleEntryComponent> getEntries(Bundle theRequest) {
  return theRequest.getEntry();
}
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

private StructureDefinition getProfileForType(String type) {
 if (logical != null)
  for (BundleEntryComponent be : logical.getEntry()) {
   if (be.hasResource() && be.getResource() instanceof StructureDefinition) {
    StructureDefinition sd = (StructureDefinition) be.getResource();
    if (sd.getId().equals(type))
     return sd;
   }
  }
 long t = System.nanoTime();
 try {
  return context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/" + type);
 } finally {
  sdTime = sdTime + (System.nanoTime() - t);
 }
}
origin: jamesagnew/hapi-fhir

private void filterBundle(org.hl7.fhir.dstu3.model.Bundle theBundle) {
  for (Iterator<BundleEntryComponent> iter = theBundle.getEntry().iterator(); iter.hasNext(); ) {
    IBaseResource next = iter.next().getResource();
    for (IIdType nextExclude : myExcludes) {
      if (nextExclude.hasResourceType() && nextExclude.toUnqualifiedVersionless().getValue().equals(next.getIdElement().toUnqualifiedVersionless().getValue())) {
        iter.remove();
        continue;
      } else if (nextExclude.getIdPart().equals(next.getIdElement().getIdPart())) {
        iter.remove();
        continue;
      }
    }
  }
}
origin: jamesagnew/hapi-fhir

private void loadStructureDefinitions(FhirContext theContext, Map<String, StructureDefinition> theCodeSystems, String theClasspath) {
  ourLog.info("Loading structure definitions from classpath: {}", theClasspath);
  InputStream valuesetText = DefaultProfileValidationSupport.class.getResourceAsStream(theClasspath);
  if (valuesetText != null) {
    InputStreamReader reader = new InputStreamReader(valuesetText, Charsets.UTF_8);
    Bundle bundle = theContext.newXmlParser().parseResource(Bundle.class, reader);
    for (BundleEntryComponent next : bundle.getEntry()) {
      if (next.getResource() instanceof StructureDefinition) {
        StructureDefinition nextSd = (StructureDefinition) next.getResource();
        nextSd.getText().setDivAsString("");
        String system = nextSd.getUrl();
        if (isNotBlank(system)) {
          theCodeSystems.put(system, nextSd);
        }
      }
    }
  } else {
    ourLog.warn("Unable to load resource: {}", theClasspath);
  }
}
origin: jamesagnew/hapi-fhir

private ElementDefinition resolveType(String type)  {
 if (logical != null)
  for (BundleEntryComponent be : logical.getEntry()) {
   if (be.hasResource() && be.getResource() instanceof StructureDefinition) {
    StructureDefinition sd = (StructureDefinition) be.getResource();
    if (sd.getId().equals(type))
     return sd.getSnapshot().getElement().get(0);
   }
  }
 String url = "http://hl7.org/fhir/StructureDefinition/" + type;
 long t = System.nanoTime();
 StructureDefinition sd = context.fetchResource(StructureDefinition.class, url);
 sdTime = sdTime + (System.nanoTime() - t);
 if (sd == null || !sd.hasSnapshot())
  return null;
 else
  return sd.getSnapshot().getElement().get(0);
}
origin: jamesagnew/hapi-fhir

for (BundleEntryComponent next : bundle.getEntry()) {
  if (next.getResource() instanceof CodeSystem) {
    CodeSystem nextValueSet = (CodeSystem) next.getResource();
origin: jamesagnew/hapi-fhir

total = bundle.getEntry().size();
count = 1;
Collections.sort(bundle.getEntry(), new Comparator<BundleEntryComponent>() {
  @Override
  public int compare(BundleEntryComponent theO1, BundleEntryComponent theO2) {
for (BundleEntryComponent i : bundle.getEntry()) {
  org.hl7.fhir.dstu3.model.Resource next = i.getResource();
  next.setId(next.getIdElement().toUnqualifiedVersionless());
origin: jamesagnew/hapi-fhir

Set<String> fullIds = new HashSet<String>();
for (Iterator<BundleEntryComponent> iterator = bundle.getEntry().iterator(); iterator.hasNext(); ) {
  BundleEntryComponent next = iterator.next();
for (Iterator<BundleEntryComponent> iterator = bundle.getEntry().iterator(); iterator.hasNext(); ) {
  BundleEntryComponent next = iterator.next();
  if (next.getResource().getIdElement().getIdPart() != null) {
for (BundleEntryComponent next : bundle.getEntry()) {
  List<ResourceReferenceInfo> refs = ctx.newTerser().getAllResourceReferences(next.getResource());
  for (ResourceReferenceInfo nextRef : refs) {
System.gc();
ourLog.info("Final bundle: {} entries", bundle.getEntry().size());
origin: jamesagnew/hapi-fhir

filterBundle(bundle);
total = bundle.getEntry().size();
count = 1;
for (BundleEntryComponent i : bundle.getEntry()) {
  org.hl7.fhir.dstu3.model.Resource next = i.getResource();
  next.setId(next.getIdElement().toUnqualifiedVersionless());
filterBundle(bundle);
total = bundle.getEntry().size();
count = 1;
for (BundleEntryComponent i : bundle.getEntry()) {
  org.hl7.fhir.dstu3.model.Resource next = i.getResource();
  next.setId(next.getIdElement().toUnqualifiedVersionless());
total = bundle.getEntry().size();
count = 1;
for (BundleEntryComponent i : bundle.getEntry()) {
  org.hl7.fhir.dstu3.model.Resource next = i.getResource();
  if (next.getIdElement().isIdPartValidLong()) {
origin: jamesagnew/hapi-fhir

private static void copy(FhirContext theCtx, IGenericClient theTarget, String theResType, List<IBaseResource> theQueued, Set<String> theSent, Bundle theReceived) {
  for (Bundle.BundleEntryComponent nextEntry : theReceived.getEntry()) {
    Resource nextResource = nextEntry.getResource();
    nextResource.setId(theResType + "/" + "CR-" + nextResource.getIdElement().getIdPart());
    boolean haveUnsentReference = false;
    for (ResourceReferenceInfo nextRefInfo : theCtx.newTerser().getAllResourceReferences(nextResource)) {
      IIdType nextRef = nextRefInfo.getResourceReference().getReferenceElement();
      if (nextRef.hasIdPart()) {
        String newRef = nextRef.getResourceType() + "/" + "CR-" + nextRef.getIdPart();
        ourLog.info("Changing reference {} to {}", nextRef.getValue(), newRef);
        nextRefInfo.getResourceReference().setReference(newRef);
        if (!theSent.contains(newRef)) {
          haveUnsentReference = true;
        }
      }
    }
    if (haveUnsentReference) {
      ourLog.info("Queueing {} for delivery after", nextResource.getId());
      theQueued.add(nextResource);
      continue;
    }
    IIdType newId = theTarget
      .update()
      .resource(nextResource)
      .execute()
      .getId();
    ourLog.info("Copied resource {} and got ID {}", nextResource.getId(), newId);
    theSent.add(nextResource.getIdElement().toUnqualifiedVersionless().getValue());
  }
}
origin: jamesagnew/hapi-fhir

protected String addReference(DomainResource r, String title, String id) throws Exception {
  if (r.getText() == null)
    r.setText(new Narrative());
  if (r.getText().getDiv() == null) {
    r.getText().setStatus(NarrativeStatus.GENERATED);
    new NarrativeGenerator("", "", context).generate(r);
  }
  r.setMeta(new Meta().setLastUpdatedElement(InstantType.now()));
  r.setId(id);
  feed.getEntry().add(new BundleEntryComponent().setResource(r));
  return id;
}
origin: jamesagnew/hapi-fhir

MyPatient pat0 = (MyPatient) bundle.getEntry().get(0).getResource();
MyPatient historyPatient0 = (MyPatient) bundle.getEntry().get(0).getResource();
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

public static org.hl7.fhir.dstu2016may.model.Bundle convertBundle(org.hl7.fhir.dstu3.model.Bundle src) throws FHIRException {
 if (src == null || src.isEmpty())
  return null;
 org.hl7.fhir.dstu2016may.model.Bundle tgt = new org.hl7.fhir.dstu2016may.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));
 tgt.setSignature(convertSignature(src.getSignature()));
 return tgt;
}
origin: org.openehealth.ipf.commons/ipf-commons-ihe-fhir-stu3-core

private Set<NamingSystem> setOfNamingSystems(Bundle bundle) {
  return bundle.getEntry().stream()
      .map(bec -> (NamingSystem) bec.getResource())
      .collect(Collectors.toSet());
}
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: ca.uhn.hapi.fhir/hapi-fhir-converter

protected String addReference(DomainResource r, String title, String id) throws Exception {
  if (r.getText() == null)
    r.setText(new Narrative());
  if (r.getText().getDiv() == null) {
    r.getText().setStatus(NarrativeStatus.GENERATED);
    new NarrativeGenerator("", "", context).generate(r);
  }
  r.setMeta(new Meta().setLastUpdatedElement(InstantType.now()));
  r.setId(id);
  feed.getEntry().add(new BundleEntryComponent().setResource(r));
  return id;
}
origin: org.openehealth.ipf.platform-camel/ipf-platform-camel-ihe-fhir-stu3-mhd

@Test
public void testSendIti66WithPatientReference() {
  Bundle result = sendManually(manifestPatientReferenceParameter());
  assertEquals(Bundle.BundleType.SEARCHSET, result.getType());
  assertEquals(ResourceType.Bundle, result.getResourceType());
  assertEquals(1, result.getTotal());
  DocumentManifest p = (DocumentManifest) result.getEntry().get(0).getResource();
  assertEquals("9bc72458-49b0-11e6-8a1c-3c1620524153", p.getIdElement().getIdPart());
}
origin: org.openehealth.ipf.platform-camel/ipf-platform-camel-ihe-fhir-stu3-mhd

@Test
public void testSendIti67WithPatientReference() {
  Bundle result = sendManually(referencePatientReferenceParameter());
  assertEquals(Bundle.BundleType.SEARCHSET, result.getType());
  assertEquals(ResourceType.Bundle, result.getResourceType());
  assertEquals(1, result.getTotal());
  DocumentReference p = (DocumentReference) result.getEntry().get(0).getResource();
  assertEquals("63ab1c29-4225-11e6-9b33-0050569b0094", p.getIdElement().getIdPart());
}
org.hl7.fhir.dstu3.modelBundlegetEntry

Popular methods of Bundle

  • <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
  • getSignature
  • getResourceType,
  • getSignature,
  • getTypeElement,
  • hasEntry,
  • setTotal,
  • castToCode,
  • castToIdentifier,
  • castToSignature,
  • castToUnsignedInt

Popular in Java

  • Running tasks concurrently on multiple threads
  • requestLocationUpdates (LocationManager)
  • onRequestPermissionsResult (Fragment)
  • findViewById (Activity)
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top plugins for Android Studio
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