package encoders
- Alphabetic
- By Inheritance
- encoders
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
AttachExtensions(targetObject: Expression, extensionMapObject: Expression) extends Expression with NonSQLExpression with Product with Serializable
Attaches the Extensions from the provided fid->Extension map to objects registered in the
_fid_mapping
with RegisterFid.Attaches the Extensions from the provided fid->Extension map to objects registered in the
_fid_mapping
with RegisterFid.- targetObject
the container object that should be the result of evaluation.
- extensionMapObject
the expression which evaluates to Map(Integer,Array(Extension)) which maps fid to the list of Extensions for the object with this fid.
- trait Deserializer extends AnyRef
-
class
DeserializerBuilder extends AnyRef
The builder of deserializer expressions for HAPI representation of FHIR resources.
-
case class
EncoderConfig(maxNestingLevel: Int, openTypes: Set[String], supportsExtensions: Boolean, generateFid: Boolean) extends EncoderSettings with Product with Serializable
Default implementation of EncoderSettings.
Default implementation of EncoderSettings.
- maxNestingLevel
- openTypes
- supportsExtensions
- generateFid
-
trait
EncoderContext extends EncoderSettings
Access to common objects required by schema processing operations.
-
trait
EncoderSettings extends AnyRef
Configuration setting for encoders.
- type ExpressionWithName = (String, Expression)
-
class
FhirEncoders extends AnyRef
Spark Encoders for FHIR Resources.
Spark Encoders for FHIR Resources. This object is thread safe.
-
case class
GetClassFromContained(targetObject: Expression, containedClass: Class[_]) extends Expression with NonSQLExpression with Product with Serializable
An Expression extracting an object having the given class definition from a List of FHIR Resources.
-
case class
GetHapiValue(value: Expression, dataType: DataType, hasMethod: String, getMethod: String) extends Expression with NonSQLExpression with Product with Serializable
Gets value of an element of a HAPI object.
Gets value of an element of a HAPI object. This is could be composed from
If
andInvoke
expression but having it as a dedicated expression makes the serializer expression more readable and also avoids the problems with 'If' optimisations.- value
the expression with the reference to the HAPI object
- dataType
the data type of the element to get
- hasMethod
the name of method to check if the element is present, e.g. hasNameElement()
- getMethod
the name of method to get the value of the element, e.g. getNameElement()
- returns
the value of the element or null if the element is not present or the object is null
-
case class
InstanceOf(value: Expression, checkedType: Class[_]) extends Expression with NonSQLExpression with Product with Serializable
Determines if the given value is an instanceof a given class
Determines if the given value is an instanceof a given class
- value
the value to check
- checkedType
the class to check the value against
-
case class
ObjectCast(value: Expression, resultType: DataType) extends Expression with NonSQLExpression with Product with Serializable
Casts the result of an expression to another type.
Casts the result of an expression to another type.
- value
The value to cast
- resultType
The type to which the value should be cast
-
case class
RegisterFid(targetObject: Expression, fidValue: Expression) extends Expression with NonSQLExpression with Product with Serializable
Registers the mapping of a deserialized object to its _fid value.
Registers the mapping of a deserialized object to its _fid value. The mapping is saved in '_fid_mapping' immutable state variable. Evaluates as identity.
- targetObject
the expression, which value should be registered.
- fidValue
the fid value to use.
-
class
SchemaConverter extends EncoderContext
The converter from FHIR schemas to SQL schemas.
-
trait
SchemaProcessor[DT, SF] extends SchemaVisitor[DT, SF] with EncoderSettings
A specialized SchemaVisitor for building schema encoders and converters.
A specialized SchemaVisitor for building schema encoders and converters.
- DT
the type which represents the final result of traversing a resource (or composite), e.g: for a schema converter this can be org.apache.spark.sql.types.DataType.
- SF
the type which represents the result of traversing an element of a composite, e.g: for a schema converter this can be org.apache.spark.sql.types.StructField.
-
abstract
class
SchemaProcessorWithTypeMappings[DT, SF] extends SchemaProcessor[DT, SF] with EncoderContext
Default implementation of SchemaProcessor delegating relevant functionality to DataTypeMappings
Default implementation of SchemaProcessor delegating relevant functionality to DataTypeMappings
- DT
the type which represents the final result of traversing a resource (or composite), e.g: for a schema converter this can be org.apache.spark.sql.types.DataType.
- SF
the type which represents the result of traversing an element of a composite, e.g: for a schema converter this can be org.apache.spark.sql.types.StructField.
- type Serializer = (Expression) ⇒ Expression
-
class
SerializerBuilder extends AnyRef
The builder of serializer expressions for HAPI representation of FHIR resources.
-
case class
StaticField(staticObject: Class[_], dataType: DataType, fieldName: String) extends Expression with NonSQLExpression with Product with Serializable
Invokes a static function, returning the result.
Invokes a static function, returning the result. By default, any of the arguments being null will result in returning null instead of calling the function.
- staticObject
The target of the static call. This can either be the object itself (methods defined on scala objects), or the class object (static methods defined in java).
- dataType
The expected type of the static field
- fieldName
The name of the field to retrieve
-
class
UnsupportedResourceError extends RuntimeException
Thrown when encoding is requested for an unsupported resource type.
Value Members
-
object
Catalyst
This class provides a compatibility layer for Spark Catalyst.
This class provides a compatibility layer for Spark Catalyst. It is used to createnew Expressions using constructors compatible with the runtime version of Spark Catalyst. This is necessary to address running Pathling in Databricks environments, which habitually use different (newer) version of Catalyst that one used by the corresponding Spark public release.
-
object
DeserializerBuilder
Companion object for DeserializerBuilder
-
object
EncoderBuilder
Spark Encoder for FHIR data models.
- object EncoderConfig extends Serializable
- object EncoderUtils
-
object
EncodingContext
Provides a context for tracking nesting depth of element definition for encoders.
Provides a context for tracking nesting depth of element definition for encoders. Usage:
EncodingContext.runWithContext { // anywhere in the call stack to increase the nesting level // of someDefinition EncodingContext.withDefinition(someDefinition) { // anywhere in the call stack to check the current nesting // level of someDefinition EncodingContext.currentNestingLevel(someDefinition) } }
-
object
ExtensionSupport
Helper class with constants related to FHIR extension support.
-
object
QuantitySupport
Helper class for serialization of Quantities.
Helper class for serialization of Quantities. In order to improve the performance of comparisons we store with each quantity canonicalized value (its value in the base unit of the quantity) and the base (canonicalized) unit code.
-
object
SerializerBuilder
Companion object for SerializerBuilder