pathling_encode {pathling}R Documentation

Encode FHIR JSON or XML to a dataframe

Description

Takes a Spark DataFrame with string representations of FHIR resources in the given column and encodes the resources of the given types as Spark DataFrame.

Usage

pathling_encode(pc, df, resource_name, input_type = NULL, column = NULL)

Arguments

pc

The Pathling context object.

df

A Spark DataFrame containing the resources to encode.

resource_name

The name of the FHIR resource to extract (e.g., "Condition", "Observation").

input_type

The MIME type of input string encoding. Defaults to "application/fhir+json".

column

The column in which the resources to encode are stored. If set to NULL, the input DataFrame is assumed to have one column of type string.

Value

A Spark DataFrame containing the given type of resources encoded into Spark columns.

See Also

Other encoding functions: pathling_encode_bundle()

Examples


pc <- pathling_connect()
json_resources_df <- pathling_spark(pc) %>% 
     sparklyr::spark_read_text(path=system.file('extdata','ndjson', 'Condition.ndjson', 
             package='pathling'))
pc %>% pathling_encode(json_resources_df, 'Condition')
pathling_disconnect(pc)


[Package pathling version 6.4.2 Index]