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) |
boolean |
isSourceInCompartmentForTarget(String theCompartmentName,
IBaseResource theSource,
IIdType theTarget)
Returns
true if theSource is in the compartment named theCompartmentName
belonging to resource theTarget |
void |
visit(IBaseResource theResource,
IModelVisitor theVisitor)
Visit all elements in a given resource
|
public FhirTerser(FhirContext theContext)
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)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 Object getSingleValueOrNull(IBase theTarget, String thePath)
public <T> T getSingleValueOrNull(IBase theTarget, String thePath, Class<T> theWantedType)
public List<Object> getValues(IBaseResource theResource, String thePath)
public <T> List<T> getValues(IBaseResource theResource, String thePath, Class<T> theWantedClass)
public boolean isSourceInCompartmentForTarget(String theCompartmentName, IBaseResource theSource, IIdType theTarget)
true if theSource is in the compartment named theCompartmentName
belonging to resource theTargettheCompartmentName - The name of the compartmenttheSource - The potential member of the compartmenttheTarget - The owner of the compartment. Note that both the resource type and ID must be filled in on this IIdType or the method will throw an IllegalArgumentExceptiontrue if theSource is in the compartmentIllegalArgumentException - If theTarget does not contain both a resource type and IDpublic 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 visitorCopyright © 2014–2017 University Health Network. All rights reserved.