Compose BioCompute Object - FHIR Extension (v1.4.2)

compose_fhir_v1.4.2(endpoint = NULL, version = NULL, resources = NULL)

compose_fhir(endpoint = NULL, version = NULL, resources = NULL)

Arguments

endpoint

Character string. The URL of the endpoint of the FHIR server containing the resource.

version

Character string. The FHIR version used.

resources

Data frame with two variables: id and resource. Each row is one item of resources to fetch from the endpoint.

Value

A list of class bco.domain

Examples

fhir_endpoint <- "https://fhirtest.uhn.ca/baseDstu3"
fhir_version <- "3"
fhir_resources <- data.frame(
  "id" = c("21376", "6288583", "25544", "92440", "4588936"),
  "resource" = c(
    "Sequence", "DiagnosticReport", "ProcedureRequest",
    "Observation", "FamilyMemberHistory"
  ),
  stringsAsFactors = FALSE
)

compose_fhir(fhir_endpoint, fhir_version, fhir_resources) %>% convert_json()
#> {
#>   "fhir_endpoint": "https://fhirtest.uhn.ca/baseDstu3",
#>   "fhir_version": "3",
#>   "fhir_resources": [
#>     [
#>       {
#>         "fhir_id": "21376",
#>         "fhir_resource": "Sequence"
#>       }
#>     ],
#>     [
#>       {
#>         "fhir_id": "6288583",
#>         "fhir_resource": "DiagnosticReport"
#>       }
#>     ],
#>     [
#>       {
#>         "fhir_id": "25544",
#>         "fhir_resource": "ProcedureRequest"
#>       }
#>     ],
#>     [
#>       {
#>         "fhir_id": "92440",
#>         "fhir_resource": "Observation"
#>       }
#>     ],
#>     [
#>       {
#>         "fhir_id": "4588936",
#>         "fhir_resource": "FamilyMemberHistory"
#>       }
#>     ]
#>   ]
#> }