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

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

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

origin: jamesagnew/hapi-fhir

  @Override
  public int compare(BundleEntryComponent theO1, BundleEntryComponent theO2) {
    if (theO1.getResource() == null && theO2.getResource() == null) {
      return 0;
    }
    if (theO1.getResource() == null) {
      return 1;
    }
    if (theO2.getResource() == null) {
      return -1;
    }
    // StructureDefinition, then OperationDefinition, then CompartmentDefinition
    return theO2.getResource().getClass().getName().compareTo(theO1.getResource().getClass().getName());
  }
});
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: ca.uhn.hapi.fhir/hapi-fhir-jpaserver-base

@Override
public IBaseResource getResource(Bundle.BundleEntryComponent theBundleEntry) {
  return theBundleEntry.getResource();
}
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: 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: 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());
}
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: jamesagnew/hapi-fhir

count = 1;
for (BundleEntryComponent i : bundle.getEntry()) {
  org.hl7.fhir.dstu3.model.Resource next = i.getResource();
  next.setId(next.getIdElement().toUnqualifiedVersionless());
count = 1;
for (BundleEntryComponent i : bundle.getEntry()) {
  org.hl7.fhir.dstu3.model.Resource next = i.getResource();
  next.setId(next.getIdElement().toUnqualifiedVersionless());
count = 1;
for (BundleEntryComponent i : bundle.getEntry()) {
  org.hl7.fhir.dstu3.model.Resource next = i.getResource();
  if (next.getIdElement().isIdPartValidLong()) {
    next.setIdElement(new IdType("v2-" + next.getIdElement().getIdPart()));
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: jamesagnew/hapi-fhir

org.hl7.fhir.dstu3.model.Resource next = i.getResource();
next.setId(next.getIdElement().toUnqualifiedVersionless());
if (next instanceof CapabilityStatement) {
origin: jamesagnew/hapi-fhir

MyPatient pat0 = (MyPatient) bundle.getEntry().get(0).getResource();
MyPatient historyPatient0 = (MyPatient) bundle.getEntry().get(0).getResource();
origin: jamesagnew/hapi-fhir

  org.hl7.fhir.dstu3.model.ConceptMap conceptMap = (org.hl7.fhir.dstu3.model.ConceptMap) response.getEntryFirstRep().getResource();
  convertConceptMapToCsv(conceptMap);
} else {
origin: jamesagnew/hapi-fhir

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: 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

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;
}
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

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

public static org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent convertBundleEntryComponent(org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent src) throws FHIRException {
 if (src == null || src.isEmpty())
  return null;
 org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent tgt = new org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent();
 copyElement(src, tgt);
 for (org.hl7.fhir.dstu3.model.Bundle.BundleLinkComponent t : src.getLink())
  tgt.addLink(convertBundleLinkComponent(t));
 if (src.hasFullUrl())
  tgt.setFullUrl(src.getFullUrl());
 tgt.setResource(convertResource(src.getResource()));
 tgt.setSearch(convertBundleEntrySearchComponent(src.getSearch()));
 tgt.setRequest(convertBundleEntryRequestComponent(src.getRequest()));
 tgt.setResponse(convertBundleEntryResponseComponent(src.getResponse()));
 return tgt;
}
origin: jamesagnew/hapi-fhir

@Override
public IBaseResource getResource(Bundle.BundleEntryComponent theBundleEntry) {
  return theBundleEntry.getResource();
}
org.hl7.fhir.dstu3.modelBundle$BundleEntryComponentgetResource

Popular methods of Bundle$BundleEntryComponent

  • 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
  • setResponse
  • setRequest,
  • setResponse,
  • castToResource,
  • castToUri,
  • compareDeep,
  • compareValues,
  • copy,
  • copyValues,
  • getFullUrlElement

Popular in Java

  • Finding current android device location
  • getSystemService (Context)
  • getApplicationContext (Context)
  • onCreateOptionsMenu (Activity)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top Sublime Text plugins
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