public class FhirTerser extends Object
| Constructor and Description |
|---|
FhirTerser(FhirContext theContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
cloneInto(IBase theSource,
IBase theTarget,
boolean theIgnoreMissingFields)
Clones all values from a source object into the equivalent fields in a target object
|
<T extends IBase> |
getAllPopulatedChildElementsOfType(IBaseResource theResource,
Class<T> theType)
Returns a list containing all child elements (including the resource itself) which are non-empty and are either of the exact type specified, or are a subclass of that type.
|
List<ResourceReferenceInfo> |
getAllResourceReferences(IBaseResource theResource) |
BaseRuntimeChildDefinition |
getDefinition(Class<? extends IBaseResource> theResourceType,
String thePath) |
Object |
getSingleValueOrNull(IBase theTarget,
String thePath) |
<T> T |
getSingleValueOrNull(IBase theTarget,
String thePath,
Class<T> theWantedType) |
List<Object> |
getValues(IBaseResource theResource,
String thePath) |
<T> List<T> |
getValues(IBaseResource theResource,
String thePath,
Class<T> theWantedClass) |
void |
visit(IBaseResource theResource,
IModelVisitor theVisitor)
Visit all elements in a given resource
|
public FhirTerser(FhirContext theContext)
public <T extends IBase> List<T> getAllPopulatedChildElementsOfType(IBaseResource theResource, Class<T> theType)
For example, specifying a type of StringDt would return all non-empty string instances within the message. Specifying a type of IResource would return the resource itself, as
well as any contained resources.
Note on scope: This method will descend into any contained resources (IResource.getContained()) as well, but will not descend into linked resources (e.g.
BaseResourceReferenceDt.getResource()) or embedded resources (e.g. Bundle.entry.resource)
theResource - The resource instance to search. Must not be null.theType - The type to search for. Must not be null.public List<ResourceReferenceInfo> getAllResourceReferences(IBaseResource theResource)
public BaseRuntimeChildDefinition getDefinition(Class<? extends IBaseResource> theResourceType, String thePath)
public List<Object> getValues(IBaseResource theResource, String thePath)
public <T> List<T> getValues(IBaseResource theResource, String thePath, Class<T> theWantedClass)
public void visit(IBaseResource theResource, IModelVisitor theVisitor)
Note on scope: This method will descend into any contained resources (IResource.getContained()) as well, but will not descend into linked resources (e.g.
BaseResourceReferenceDt.getResource()) or embedded resources (e.g. Bundle.entry.resource)
theResource - The resource to visittheVisitor - The visitorpublic Object getSingleValueOrNull(IBase theTarget, String thePath)
public <T> T getSingleValueOrNull(IBase theTarget, String thePath, Class<T> theWantedType)
public void cloneInto(IBase theSource, IBase theTarget, boolean theIgnoreMissingFields)
theSource - The source object (must not be null)theTarget - The target object to copy values into (must not be null)theIgnoreMissingFields - The ignore fields in the target which do not exist (if false, an exception will be thrown if the target is unable to accept a value from the source)Copyright © 2014–2016 University Health Network. All rights reserved.