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

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

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

origin: org.hspconsortium.client/hspc-java-client

private <T extends IBaseResource> Collection<T> asCollection(Bundle results) {
  List<T> list = new ArrayList<>();
  for (Bundle.BundleEntryComponent entry : results.getEntry()) {
    list.add((T) entry.getResource());
  }
  return list;
}
origin: apache/ctakes

/**
* Add all of the given resources to the given bundle.
*
* @param bundle    -
* @param resources -
*/
static private void addBundleResources( final Bundle bundle, final Collection<? extends Resource> resources ) {
 resources.stream()
    .map( r -> new Bundle.BundleEntryComponent().setResource( r ) )
    .forEach( bundle::addEntry );
}
origin: jamesagnew/hapi-fhir

  if ("Subscription".equals(next.getResource().getResourceType()) || "DataElement".equals(next.getResource().getResourceType())
    || "OperationOutcome".equals(next.getResource().getResourceType()) || "OperationDefinition".equals(next.getResource().getResourceType())) {
    ourLog.info("Skipping " + next.getResource().getResourceType() + " example");
    iterator.remove();
  } else {
    IdDt resourceId = new IdDt(next.getResource().getResourceType() + "/EX" + next.getResource().getIdElement().getIdPart());
    if (!fullIds.add(resourceId.toUnqualifiedVersionless().getValue())) {
      ourLog.info("Discarding duplicate resource: " + resourceId.getValue());
      next.getResource().setId(resourceId);
    } else {
      ourLog.info("Discarding resource with not explicit ID");
for (Iterator<BundleEntryComponent> iterator = bundle.getEntry().iterator(); iterator.hasNext(); ) {
  BundleEntryComponent next = iterator.next();
  if (next.getResource().getIdElement().getIdPart() != null) {
    String nextId = next.getResource().getIdElement().getValue();
    next.getRequest().setMethod(HTTPVerb.PUT);
    next.getRequest().setUrl(nextId);
  List<ResourceReferenceInfo> refs = ctx.newTerser().getAllResourceReferences(next.getResource());
  for (ResourceReferenceInfo nextRef : refs) {
origin: org.openehealth.ipf.commons/ipf-commons-ihe-fhir-stu3-mhd

.flatMap(Collection::stream)
.forEach(entry -> {
  if (ResourceType.DocumentReference == entry.getResource().getResourceType()) {
    if (!expectedReferenceFullUrls.remove(entry.getFullUrl())) {
      throw FhirUtils.unprocessableEntity(
          OperationOutcome.IssueSeverity.ERROR,
          null, null,
          "DocumentReference with URL %s is not referenced by any DocumentManifest",
          entry.getFullUrl()
      );
  } else if (ResourceType.Binary == entry.getResource().getResourceType()) {
    if (!expectedBinaryFullUrls.remove(entry.getFullUrl())) {
      throw FhirUtils.unprocessableEntity(
          OperationOutcome.IssueSeverity.ERROR,
          null, null,
          "Binary with URL %s is not referenced by any DocumentReference",
          entry.getFullUrl()
      );
origin: apache/ctakes

bundle.addEntry( new Bundle.BundleEntryComponent().setResource( composition ) );
bundle.addEntry( new Bundle.BundleEntryComponent().setResource( practitioner.getPractitioner() ) );
addBundleResources( bundle, noteSpecs.getSubjects() );
addBundleResources( bundle, sections );
origin: synthetichealth/synthea

ValidationResult eresult = validator.validateWithResult(entry.getResource());
if (!eresult.isSuccessful()) {
 for (SingleValidationMessage emessage : eresult.getMessages()) {
   valid = validateObs7((Observation) entry.getResource());
  } else if (emessage.getMessage().contains("@ Condition con-4")) {
   valid = validateCon4((Condition) entry.getResource());
  } else if (emessage.getMessage().contains("@ MedicationRequest mps-1")) {
   System.out.println(parser.encodeResourceToString(entry.getResource()));
   System.out.println("ERROR: " + emessage.getMessage());
   validationErrors.add(emessage.getMessage());
if (entry.getResource().fhirType().equals("ExplanationOfBenefit")) {
 ValidationResult bbResult = validationResources.validate(entry.getResource());
origin: org.openehealth.ipf.platform-camel/ipf-platform-camel-ihe-fhir-stu3-mhd

    .setP(new Reference(REFERENCE_FULL_URL));
bundle.addEntry()
    .setFullUrl(MANIFEST_FULL_URL)
    .setRequest(
        new Bundle.BundleEntryRequestComponent()
            .setMethod(Bundle.HTTPVerb.POST)
            .setUrl("DocumentManifest"))
    .setResource(manifest);
    .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(
        new Bundle.BundleEntryRequestComponent()
            .setMethod(Bundle.HTTPVerb.POST)
            .setUrl("DocumentReference"))
    .setResource(reference);
    .setFullUrl(BINARY_FULL_URL)
    .setRequest(new Bundle.BundleEntryRequestComponent()
        .setMethod(Bundle.HTTPVerb.POST)
        .setUrl("Binary"))
    .setResource(binary);
origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu3

BundleEntryComponent entry = myBundle.addEntry().setResource((Resource) next);
Resource nextAsResource = (Resource) next;
IIdType id = populateBundleEntryFullUrl(next, entry);
String httpVerb = ResourceMetadataKeyEnum.ENTRY_TRANSACTION_METHOD.get(nextAsResource);
if (httpVerb != null) {
 entry.getRequest().getMethodElement().setValueAsString(httpVerb);
 if (id != null) {
  entry.getRequest().setUrl(id.getValue());
 entry.getSearch().getModeElement().setValueAsString(searchMode);
entry.setResource((Resource) next).getSearch().setMode(SearchEntryMode.INCLUDE);
populateBundleEntryFullUrl(next, entry);
origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu3

BundleEntryComponent entry = myBundle.addEntry().setResource(next);
if (next.getIdElement().hasBaseUrl()) {
 entry.setFullUrl(next.getId());
 entry.getRequest().getMethodElement().setValueAsString(httpVerb);
 entry.getRequest().getUrlElement().setValue(next.getId());
entry.setResource((Resource) next).getSearch().setMode(SearchEntryMode.INCLUDE);
if (next.getIdElement().hasBaseUrl()) {
 entry.setFullUrl(next.getIdElement().getValue());
origin: apache/ctakes

final Map<IBaseResource, Annotation> resourceAnnotations = new HashMap<>( entries.size() );
for ( BundleEntryComponent entry : entries ) {
  final IBaseResource resource = entry.getResource();
  final Annotation annotation = parseResource( jCas, resource,
     compositionParser, sectionParser, paragraphParser, sentenceParser, baseTokenParser,
origin: org.openehealth.ipf.platform-camel/ipf-platform-camel-ihe-fhir-stu3-mhd

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

assertEquals(1, result.getTotal());
DocumentReference p = (DocumentReference) result.getEntry().get(0).getResource();
assertEquals("63ab1c29-4225-11e6-9b33-0050569b0094", p.getIdElement().getIdPart());
origin: apache/ctakes

final Map<IBaseResource, Annotation> resourceAnnotations = new HashMap<>( entries.size() );
for ( BundleEntryComponent entry : entries ) {
  final IBaseResource resource = entry.getResource();
  final Annotation annotation = parseResource( jCas, resource, sectionParser, annotationParser, iaParser );
  if ( annotation != null ) {
origin: org.openehealth.ipf.platform-camel/ipf-platform-camel-ihe-fhir-stu3-pixpdq

PdqPatient p = (PdqPatient)result.getEntry().get(0).getResource();
assertEquals("Test", p.getName().get(0).getFamily());
assertEquals("http://localhost:8999/Patient/4711", p.getId());
origin: ca.uhn.hapi.fhir/hapi-fhir-validation

if (next.getResource() instanceof CodeSystem) {
  CodeSystem nextValueSet = (CodeSystem) next.getResource();
  nextValueSet.getText().setDivAsString("");
  String system = nextValueSet.getUrl();
    theCodeSystems.put(system, nextValueSet);
} else if (next.getResource() instanceof ValueSet) {
  ValueSet nextValueSet = (ValueSet) next.getResource();
  nextValueSet.getText().setDivAsString("");
  String system = nextValueSet.getUrl();
origin: ca.uhn.hapi.fhir/hapi-fhir-jpaserver-base

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

BundleEntryComponent nextEntry = myBundle.addEntry();
nextEntry.setResource(next);
if (next.getIdElement().isEmpty()) {
 nextEntry.getRequest().setMethod(HTTPVerb.POST);
} else {
 nextEntry.getRequest().setMethod(HTTPVerb.PUT);
 if (next.getIdElement().isAbsolute()) {
  nextEntry.getRequest().setUrl(next.getId());
 } else {
  String resourceType = myContext.getResourceDefinition(next).getName();
  nextEntry.getRequest().setUrl(new IdType(theServerBase, resourceType, next.getIdElement().getIdPart(), next.getIdElement().getVersionIdPart()).getValue());
origin: org.openehealth.ipf.commons/ipf-commons-ihe-fhir-stu3-core

/**
 * Converts a {@link Bundle} into a map grouped by the entry resources types
 *
 * @param bundle Bundle
 * @return map of entries grouped by their resource type
 */
public static Map<ResourceType, List<Bundle.BundleEntryComponent>> getBundleEntries(Bundle bundle) {
  return bundle.getEntry().stream()
      .collect(Collectors.groupingBy(entry -> {
            Bundle.BundleEntryRequestComponent request = entry.getRequest();
            if (request == null || request.getUrl() == null) {
              throw unprocessableEntity(
                  OperationOutcome.IssueSeverity.ERROR,
                  OperationOutcome.IssueType.INVALID,
                  null, null,
                  "Invalid bundle entry request element %s",
                  entry);
            }
            return entry.getResource().getResourceType();
          }
      , LinkedHashMap::new, Collectors.toList()));
}
origin: ca.uhn.hapi.fhir/hapi-fhir-validation

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: ca.uhn.hapi.fhir/hapi-fhir-converter

public org.hl7.fhir.instance.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent src) throws FHIRException {
 if (src == null || src.isEmpty())
  return null;
 if (advisor.ignoreEntry(src))
  return null;
 org.hl7.fhir.instance.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.instance.model.Bundle.BundleEntryComponent();
 copyElement(src, tgt);
 for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink())
  tgt.addLink(convertBundleLinkComponent(t));
 tgt.setFullUrl(src.getFullUrl());
 org.hl7.fhir.instance.model.Resource res = advisor.convert(src.getResource());
 if (res == null)
  res = convertResource(src.getResource());
 tgt.setResource(res);
 if (src.hasSearch())
  tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch()));
 if (src.hasRequest())
  tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest()));
 if (src.hasResponse())
  tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse()));
 return tgt;
}
org.hl7.fhir.dstu3.modelBundle$BundleEntryComponent

Most used methods

  • getResource
  • setResource
  • getRequest
  • <init>
    Constructor
  • getFullUrl
  • getResponse
  • setFullUrl
  • addLink
  • getLink
    Returns the #getLink() which matches a given BundleLinkComponent#getRelation(). If no link is found
  • getSearch
  • isEmpty
  • setRequest
  • isEmpty,
  • setRequest,
  • setResponse,
  • castToResource,
  • castToUri,
  • compareDeep,
  • compareValues,
  • copy,
  • copyValues,
  • getFullUrlElement

Popular in Java

  • Making http requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • requestLocationUpdates (LocationManager)
  • getApplicationContext (Context)
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Reference (javax.naming)
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Best plugins for Eclipse
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