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

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

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

origin: jamesagnew/hapi-fhir

@Override
public String getBundleType(Bundle theRequest) {
  if (theRequest.getType() == null) {
    return null;
  }
  return theRequest.getTypeElement().getValue().toCode();
}
origin: jamesagnew/hapi-fhir

@Override
protected void preProcessResourceForStorage(Bundle theResource) {
  super.preProcessResourceForStorage(theResource);
  Set<String> allowedBundleTypes = getConfig().getBundleTypesAllowedForStorage();
  if (theResource.getType() == null || !allowedBundleTypes.contains(defaultString(theResource.getType().toCode()))) {
    String message = "Unable to store a Bundle resource on this server with a Bundle.type value of: " + (theResource.getType() != null ? theResource.getType().toCode() : "(missing)");
    throw new UnprocessableEntityException(message);
  }
}
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: ca.uhn.hapi.fhir/hapi-fhir-jpaserver-base

@Override
public String getBundleType(Bundle theRequest) {
  if (theRequest.getType() == null) {
    return null;
  }
  return theRequest.getTypeElement().getValue().toCode();
}
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-jpaserver-base

@Override
protected void preProcessResourceForStorage(Bundle theResource) {
  super.preProcessResourceForStorage(theResource);
  Set<String> allowedBundleTypes = getConfig().getBundleTypesAllowedForStorage();
  if (theResource.getType() == null || !allowedBundleTypes.contains(defaultString(theResource.getType().toCode()))) {
    String message = "Unable to store a Bundle resource on this server with a Bundle.type value of: " + (theResource.getType() != null ? theResource.getType().toCode() : "(missing)");
    throw new UnprocessableEntityException(message);
  }
}
origin: org.openehealth.ipf.commons/ipf-commons-ihe-fhir-stu3-mhd

/**
 * Validates bundle type, meta data and consistency of contained resources
 *
 * @param bundle transaction bundle
 */
protected void validateTransactionBundle(Bundle bundle) {
  if (!Bundle.BundleType.TRANSACTION.equals(bundle.getType())) {
    throw FhirUtils.unprocessableEntity(
        OperationOutcome.IssueSeverity.ERROR,
        OperationOutcome.IssueType.INVALID,
        null, null,
        "Bundle type must be %s, but was %s",
        Bundle.BundleType.TRANSACTION.toCode(), bundle.getType().toCode());
  }
  List<UriType> profiles = bundle.getMeta().getProfile();
  if (profiles.isEmpty() || !Iti65Constants.ITI65_PROFILE.equals(profiles.get(0).getValue())) {
    throw FhirUtils.unprocessableEntity(
        OperationOutcome.IssueSeverity.ERROR,
        OperationOutcome.IssueType.INVALID,
        null, null,
        "Request bundle must have profile",
        Iti65Constants.ITI65_PROFILE);
  }
}
origin: ca.uhn.hapi.fhir/hapi-fhir-converter

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

@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());
}
origin: ca.uhn.hapi.fhir/hapi-fhir-converter

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: org.openehealth.ipf.platform-camel/ipf-platform-camel-ihe-fhir-stu3-pixpdq

assertEquals(Bundle.BundleType.SEARCHSET, result.getType());
assertEquals(ResourceType.Bundle, result.getResourceType());
assertTrue(result.hasEntry());
origin: org.openehealth.ipf.platform-camel/ipf-platform-camel-ihe-fhir-stu3-mhd

Bundle result = sendManually(manifestPatientIdentifierParameter());
assertEquals(Bundle.BundleType.SEARCHSET, result.getType());
assertEquals(ResourceType.Bundle, result.getResourceType());
assertEquals(1, result.getTotal());
origin: org.openehealth.ipf.platform-camel/ipf-platform-camel-ihe-fhir-stu3-mhd

assertEquals(Bundle.BundleType.SEARCHSET, result.getType());
assertEquals(ResourceType.Bundle, result.getResourceType());
assertEquals(1, result.getTotal());
org.hl7.fhir.dstu3.modelBundlegetType

Popular methods of Bundle

  • getEntry
  • <init>
    Constructor
  • addEntry
  • getMeta
  • 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

  • Finding current android device location
  • runOnUiThread (Activity)
  • addToBackStack (FragmentTransaction)
  • getContentResolver (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Github Copilot alternatives
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