Package org.hl7.fhir.r4.utils
Class DefinitionNavigator
- java.lang.Object
-
- org.hl7.fhir.r4.utils.DefinitionNavigator
-
public class DefinitionNavigator extends Object
-
-
Constructor Summary
Constructors Constructor Description DefinitionNavigator(IWorkerContext context, StructureDefinition structure)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<DefinitionNavigator>children()List<DefinitionNavigator>childrenFromType(ElementDefinition.TypeRefComponent type)ElementDefinitioncurrent()List<String>getNames()When you walk a tree, and you walk into a typed structure, an element can simultaineously be covered by multiple types at once.booleanhasTypeChildren(ElementDefinition.TypeRefComponent type)if you have a typed element, the tree might end at that point.StringnameTail()Stringpath()List<DefinitionNavigator>slices()
-
-
-
Constructor Detail
-
DefinitionNavigator
public DefinitionNavigator(IWorkerContext context, StructureDefinition structure) throws org.hl7.fhir.exceptions.DefinitionException
- Throws:
org.hl7.fhir.exceptions.DefinitionException
-
-
Method Detail
-
getNames
public List<String> getNames()
When you walk a tree, and you walk into a typed structure, an element can simultaineously be covered by multiple types at once. Take, for example, the string label for an identifer value. It has the following paths: Patient.identifier.value.value Identifier.value.value String.value value If you started in a bundle, the list might be even longer and deeper Any of these names might be relevant. This function returns the names in an ordered list in the order above- Returns:
-
current
public ElementDefinition current()
-
slices
public List<DefinitionNavigator> slices() throws org.hl7.fhir.exceptions.DefinitionException
- Throws:
org.hl7.fhir.exceptions.DefinitionException
-
children
public List<DefinitionNavigator> children() throws org.hl7.fhir.exceptions.DefinitionException
- Throws:
org.hl7.fhir.exceptions.DefinitionException
-
hasTypeChildren
public boolean hasTypeChildren(ElementDefinition.TypeRefComponent type) throws org.hl7.fhir.exceptions.DefinitionException
if you have a typed element, the tree might end at that point. And you may or may not want to walk into the tree of that type It depends what you are doing. So this is a choice. You can ask for the children, and then, if you get no children, you can see if there are children defined for the type, and then get them you have to provide a type if there's more than one type for current() since this library doesn't know how to choose- Throws:
org.hl7.fhir.exceptions.DefinitionException
-
childrenFromType
public List<DefinitionNavigator> childrenFromType(ElementDefinition.TypeRefComponent type) throws org.hl7.fhir.exceptions.DefinitionException
- Returns:
- Throws:
org.hl7.fhir.exceptions.DefinitionException
-
-