if (FALSE) {
### 1. POST transaction bundle
#unserialize example bundles
bundle <- fhir_unserialize(transaction_bundle_example)
#have a look at the bundle
cat(toString(bundle))
#post
fhir_post(url = "http://hapi.fhir.org/baseR4", body = bundle)
### 2. POST single resouce
#unserialize example resource
resource <- fhir_unserialize(example_resource1)
#have a look at the resource
resource
#post
url <- fhir_url(url = "http://hapi.fhir.org/baseR4", resource = "Patient")
fhir_post(url = url, body = resource)
### 3. POST arbitrary body
#define body
body <- fhir_body(content = " ", type = "xml")
#post
url <- fhir_url(url = "http://hapi.fhir.org/baseR4", resource = "Patient")
fhir_post(url = url, body = body)
}
Run the code above in your browser using DataLab