Learn R Programming

fhircrackr (version 2.3.0)

fhir_body: Create fhir_body object

Description

Create fhir_body object

Usage

fhir_body(content, type)

# S4 method for list,missing fhir_body(content)

# S4 method for list,character fhir_body(content, type)

# S4 method for character,character fhir_body(content, type)

Value

An object of type fhir_body.

Arguments

content

A character vector of length one representing the body for the post in the format specified in type. If you provide a named list here, it will be taken as key value pairs of FHIR search parameters and will be concatenated appropriately. In this case the type will automatically be set to "application/x-www-form-urlencoded". See examples.

type

A string defining the type of the body e.g. "application/x-www-form-urlencoded" or "xml".

Examples

Run this code
#body that could be used in a FHIR search request POSTed to an URL like baseurl/Patient/_search
fhir_body(content = "gender=female&_summary=count", type="application/x-www-form-urlencoded")
fhir_body(content = list("gender" = "female", "_summary" = "count"))

Run the code above in your browser using DataLab