Tabnine Logo
BaseRuntimeChildDefinition$IAccessor
Code IndexAdd Tabnine to your IDE (free)

How to use
BaseRuntimeChildDefinition$IAccessor
in
ca.uhn.fhir.context

Best Java code snippets using ca.uhn.fhir.context.BaseRuntimeChildDefinition$IAccessor (Showing top 20 results out of 315)

origin: jamesagnew/hapi-fhir

List<? extends IBase> values = nextDef.getAccessor().getValues(theCurrentObj);
origin: ca.uhn.hapi.fhir/hapi-fhir-base

private void extractDeclaredExtensions(IBase theResource, BaseRuntimeElementDefinition<?> resDef, List<HeldExtension> extensions, List<HeldExtension> modifierExtensions,
                          CompositeChildElement theChildElem) {
  for (RuntimeChildDeclaredExtensionDefinition nextDef : resDef.getExtensionsNonModifier()) {
    for (IBase nextValue : nextDef.getAccessor().getValues(theResource)) {
      if (nextValue != null) {
        if (nextValue.isEmpty()) {
          continue;
        }
        extensions.add(new HeldExtension(nextDef, nextValue, theChildElem));
      }
    }
  }
  for (RuntimeChildDeclaredExtensionDefinition nextDef : resDef.getExtensionsModifier()) {
    for (IBase nextValue : nextDef.getAccessor().getValues(theResource)) {
      if (nextValue != null) {
        if (nextValue.isEmpty()) {
          continue;
        }
        modifierExtensions.add(new HeldExtension(nextDef, nextValue, theChildElem));
      }
    }
  }
}
origin: ca.uhn.hapi.fhir/hapi-fhir-base

/**
 * Extract all of the resources of a given type from a given bundle 
 */
@SuppressWarnings("unchecked")
public static <T extends IBaseResource> List<T> toListOfResourcesOfType(FhirContext theContext, IBaseBundle theBundle, Class<T> theTypeToInclude) {
  List<T> retVal = new ArrayList<>();
  RuntimeResourceDefinition def = theContext.getResourceDefinition(theBundle);
  BaseRuntimeChildDefinition entryChild = def.getChildByName("entry");
  List<IBase> entries = entryChild.getAccessor().getValues(theBundle);
  BaseRuntimeElementCompositeDefinition<?> entryChildElem = (BaseRuntimeElementCompositeDefinition<?>) entryChild.getChildByName("entry");
  BaseRuntimeChildDefinition resourceChild = entryChildElem.getChildByName("resource");
  for (IBase nextEntry : entries) {
    for (IBase next : resourceChild.getAccessor().getValues(nextEntry)) {
      if (theTypeToInclude != null && !theTypeToInclude.isAssignableFrom(next.getClass())) {
        continue;
      }
      retVal.add((T) next);
    }
  }
  return retVal;
}
origin: ca.uhn.hapi.fhir/hapi-fhir-base

private static String getFirstIssueStringPart(FhirContext theCtx, IBaseOperationOutcome theOutcome, String name) {
  if (theOutcome == null) {
    return null;
  }
  RuntimeResourceDefinition ooDef = theCtx.getResourceDefinition(theOutcome);
  BaseRuntimeChildDefinition issueChild = ooDef.getChildByName("issue");
  List<IBase> issues = issueChild.getAccessor().getValues(theOutcome);
  if (issues.isEmpty()) {
    return null;
  }
  IBase issue = issues.get(0);
  BaseRuntimeElementCompositeDefinition<?> issueElement = (BaseRuntimeElementCompositeDefinition<?>) theCtx.getElementDefinition(issue.getClass());
  BaseRuntimeChildDefinition detailsChild = issueElement.getChildByName(name);
  List<IBase> details = detailsChild.getAccessor().getValues(issue);
  if (details.isEmpty()) {
    return null;
  }
  return ((IPrimitiveType<?>) details.get(0)).getValueAsString();
}
origin: ca.uhn.hapi.fhir/hapi-fhir-base

private static void populatePrimitiveValue(FhirContext theContext, IBaseResource theSubscription, String theChildName, String theValue) {
  RuntimeResourceDefinition def = theContext.getResourceDefinition(theSubscription);
  Validate.isTrue(def.getName().equals("Subscription"), "theResource is not a subscription");
  BaseRuntimeChildDefinition statusChild = def.getChildByName(theChildName);
  List<IBase> entries = statusChild.getAccessor().getValues(theSubscription);
  IPrimitiveType<?> instance;
  if (entries.size() == 0) {
    BaseRuntimeElementDefinition<?> statusElement = statusChild.getChildByName(theChildName);
    instance = (IPrimitiveType<?>) statusElement.newInstance(statusChild.getInstanceConstructorArguments());
    statusChild.getMutator().addValue(theSubscription, instance);
  } else {
    instance = (IPrimitiveType<?>) entries.get(0);
  }
  instance.setValueAsString(theValue);
}
origin: ca.uhn.hapi.fhir/hapi-fhir-base

public static List<String> getBaseAsStrings(FhirContext theContext, IBaseResource theResource) {
  Validate.notNull(theContext, "theContext must not be null");
  Validate.notNull(theResource, "theResource must not be null");
  RuntimeResourceDefinition def = theContext.getResourceDefinition(theResource);
  BaseRuntimeChildDefinition base = def.getChildByName("base");
  List<IBase> baseValues = base.getAccessor().getValues(theResource);
  List<String> retVal = new ArrayList<>();
  for (IBase next : baseValues) {
    IPrimitiveType<?> nextPrimitive = (IPrimitiveType<?>) next;
    retVal.add(nextPrimitive.getValueAsString());
  }
  return retVal;
}
origin: ca.uhn.hapi.fhir/hapi-fhir-base

public static Integer getTotal(FhirContext theContext, IBaseBundle theBundle) {
  RuntimeResourceDefinition def = theContext.getResourceDefinition(theBundle);
  BaseRuntimeChildDefinition entryChild = def.getChildByName("total");
  List<IBase> entries = entryChild.getAccessor().getValues(theBundle);
  if (entries.size() > 0) {
    IPrimitiveType<Number> typeElement = (IPrimitiveType<Number>) entries.get(0);
    if (typeElement != null && typeElement.getValue() != null) {
      return typeElement.getValue().intValue();
    }
  }
  return null;
}
origin: ca.uhn.hapi.fhir/hapi-fhir-base

public static String getBundleType(FhirContext theContext, IBaseBundle theBundle) {
  RuntimeResourceDefinition def = theContext.getResourceDefinition(theBundle);
  BaseRuntimeChildDefinition entryChild = def.getChildByName("type");
  List<IBase> entries = entryChild.getAccessor().getValues(theBundle);
  if (entries.size() > 0) {
    IPrimitiveType<?> typeElement = (IPrimitiveType<?>) entries.get(0);
    return typeElement.getValueAsString();
  }
  return null;
}
origin: ca.uhn.hapi.fhir/hapi-fhir-base

/**
 * Returns true if the given OperationOutcome has 1 or more Operation.issue repetitions
 */
public static boolean hasIssues(FhirContext theCtx, IBaseOperationOutcome theOutcome) {
  if (theOutcome == null) {
    return false;
  }
  RuntimeResourceDefinition ooDef = theCtx.getResourceDefinition(theOutcome);
  BaseRuntimeChildDefinition issueChild = ooDef.getChildByName("issue");
  return issueChild.getAccessor().getValues(theOutcome).size() > 0;
}
origin: ca.uhn.hapi.fhir/hapi-fhir-base

public static IBaseReference getSecurityContext(FhirContext theCtx, IBaseBinary theBinary) {
  RuntimeResourceDefinition def = theCtx.getResourceDefinition("Binary");
  BaseRuntimeChildDefinition child = def.getChildByName("securityContext");
  IBaseReference retVal = null;
  if (child != null) {
    List<IBase> values = child.getAccessor().getValues(theBinary);
    if (values.size() > 0) {
      retVal = (IBaseReference) values.get(0);
    }
  }
  return retVal;
}
origin: jamesagnew/hapi-fhir

List<IBase> entries = entryChild.getAccessor().getValues(retVal);
if (entries != null) {
  for (IBase nextEntry : entries) {
      continue; // TODO: remove this once the data model in tinder plugin catches up to 1.2
    List<IBase> fullUrl = fullUrlChild.getAccessor().getValues(nextEntry);
    if (fullUrl != null && !fullUrl.isEmpty()) {
      IPrimitiveType<?> value = (IPrimitiveType<?>) fullUrl.get(0);
      if (value.isEmpty() == false) {
        List<IBase> entryResources = entryDef.getChildByName("resource").getAccessor().getValues(nextEntry);
        if (entryResources != null && entryResources.size() > 0) {
          IBaseResource res = (IBaseResource) entryResources.get(0);
origin: jamesagnew/hapi-fhir

List<? extends IBase> values = nextChild.getAccessor().getValues(theElement);
values = super.preProcessValues(nextChild, theResource, values, nextChildElem);
origin: jamesagnew/hapi-fhir

BaseRuntimeElementCompositeDefinition<?> childDef = (BaseRuntimeElementCompositeDefinition<?>) theDefinition;
for (BaseRuntimeChildDefinition nextChild : childDef.getChildrenAndExtension()) {
  List<? extends IBase> values = nextChild.getAccessor().getValues(theElement);
  if (values != null) {
    for (IBase nextValue : values) {
origin: jamesagnew/hapi-fhir

for (BaseRuntimeChildDefinition nextChild : childDef.getChildrenAndExtension()) {
  List<?> values = nextChild.getAccessor().getValues(theElement);
  if (values != null) {
    for (Object nextValueObject : values) {
origin: jamesagnew/hapi-fhir

BaseRuntimeElementCompositeDefinition<?> entryDef = (BaseRuntimeElementCompositeDefinition<?>) entryChildDef.getChildByName("entry");
for (IBase nextEntry1 : entryChildDef.getAccessor().getValues(parsed)) {
  List<IBase> resources = entryDef.getChildByName("resource").getAccessor().getValues(nextEntry1);
  if (resources == null) {
    continue;
origin: jamesagnew/hapi-fhir

BaseRuntimeElementCompositeDefinition<?> entryDef = (BaseRuntimeElementCompositeDefinition<?>) entryChildDef.getChildByName("entry");
for (IBase nextEntry1 : entryChildDef.getAccessor().getValues(parsed)) {
  List<IBase> resources = entryDef.getChildByName("resource").getAccessor().getValues(nextEntry1);
  if (resources == null) {
    continue;
origin: jamesagnew/hapi-fhir

} else {
  List<? extends IBase> values = nextChild.getAccessor().getValues(theElement);
  values = super.preProcessValues(nextChild, theResource, values, nextChildElem);
origin: jamesagnew/hapi-fhir

BaseRuntimeElementCompositeDefinition<?> entryDef = (BaseRuntimeElementCompositeDefinition<?>) entryChildDef.getChildByName("entry");
for (IBase nextEntry1 : entryChildDef.getAccessor().getValues(parsed)) {
  List<IBase> resources = entryDef.getChildByName("resource").getAccessor().getValues(nextEntry1);
  if (resources == null) {
    continue;
origin: jamesagnew/hapi-fhir

List<IBase> entries = entryChild.getAccessor().getValues(retVal);
if (entries != null) {
  for (IBase nextEntry : entries) {
      List<IBase> fullUrl = fullUrlChild.getAccessor().getValues(nextEntry);
      if (fullUrl != null && !fullUrl.isEmpty()) {
        IPrimitiveType<?> value = (IPrimitiveType<?>) fullUrl.get(0);
        if (value.isEmpty() == false) {
          List<IBase> entryResources = entryDef.getChildByName("resource").getAccessor().getValues(nextEntry);
          if (entryResources != null && entryResources.size() > 0) {
            IBaseResource res = (IBaseResource) entryResources.get(0);
origin: jamesagnew/hapi-fhir

for (BaseRuntimeChildDefinition nextChildDef : cdef.getChildren()) {
  List<IBase> values = nextChildDef.getAccessor().getValues(theElement);
  if (values == null || values.isEmpty()) {
    continue;
ca.uhn.fhir.contextBaseRuntimeChildDefinition$IAccessor

Most used methods

  • getValues

Popular in Java

  • Making http requests using okhttp
  • addToBackStack (FragmentTransaction)
  • getResourceAsStream (ClassLoader)
  • notifyDataSetChanged (ArrayAdapter)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • JPanel (javax.swing)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • 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