Takes a dataframe with string representations of FHIR bundles in the given column and outputs a dataframe of encoded resources.

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

Arguments

pc

A Pathling context object.

df

A Spark DataFrame containing the bundles with the resources to encode.

resource_name

The name of the FHIR resource to extract (Condition, Observation, etc.).

input_type

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

column

The column in which the resources to encode are stored. If 'NULL', then 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()

Examples

pc <- pathling_connect()
#> Warning: problem writing to connection
#> Error in writeBin(as.integer(value), con, endian = "big"): ignoring SIGPIPE signal
json_resources_df <- pathling_spark(pc) %>% 
     sparklyr::spark_read_text(path=system.file('extdata','bundle-xml', package='pathling'), 
         whole = TRUE)
#> Error in sparklyr::spark_connection(pc): object 'pc' not found
pc %>% pathling_encode_bundle(json_resources_df, 'Condition',
     input_type = MimeType$FHIR_XML, column = 'contents')
#> Error in spark_connection(jobj): object 'pc' not found
pathling_disconnect(pc)
#> Error in sparklyr::spark_connection(pc): object 'pc' not found