Examples

Basic example

julia> using FHIRClientXML

julia> base_url = FHIRClientXML.BaseURL("https://hapi.fhir.org/baseR4")
FHIRClientXML.BaseURL(URI("https://hapi.fhir.org/baseR4"))

julia> auth = FHIRClientXML.AnonymousAuth()
FHIRClientXML.AnonymousAuth()

julia> client = FHIRClientXML.Client(base_url, auth)
FHIRClientXML.Client{FHIRClientXML.AnonymousAuth}(FHIRClientXML.BaseURL(URI("https://hapi.fhir.org/baseR4")), FHIRClientXML.AnonymousAuth())

julia> bundle = FHIRClientXML.request_xml(client, "GET", "/Patient?given=Jason&family=Argonaut")
OrderedCollections.OrderedDict{Any,Any} with 2 entries:
  :version => "1.0"
  "Bundle" => OrderedCollections.OrderedDict{Any,Any}("id"=>OrderedCollections.…

julia> patients = bundle["Bundle"]["entry"];

julia> patient_id = patients[1]["resource"]["Patient"]["id"][:value]
"1924864"

julia> patient = FHIRClientXML.request_xml(client, "GET", "/Patient/$(patient_id)")
OrderedCollections.OrderedDict{Any,Any} with 2 entries:
  :version  => "1.0"
  "Patient" => OrderedCollections.OrderedDict{Any,Any}("id"=>OrderedCollections…

julia> patient["Patient"]["name"]
OrderedCollections.OrderedDict{Any,Any} with 4 entries:
  "use"    => OrderedCollections.OrderedDict{Any,Any}(:value=>"usual")
  "text"   => OrderedCollections.OrderedDict{Any,Any}(:value=>"Jason Argonaut")
  "family" => OrderedCollections.OrderedDict{Any,Any}(:value=>"Argonaut")
  "given"  => OrderedCollections.OrderedDict{Any,Any}(:value=>"Jason")

julia> patient["Patient"]["birthDate"][:value]
"1985-08-01"

julia> patient["Patient"]["address"]
2-element Array{Any,1}:
 OrderedCollections.OrderedDict{Any,Any}("use" => OrderedCollections.OrderedDict{Any,Any}(:value => "home"),"line" => OrderedCollections.OrderedDict{Any,Any}(:value => "1979 Milky Way Dr."),"city" => OrderedCollections.OrderedDict{Any,Any}(:value => "Verona"),"state" => OrderedCollections.OrderedDict{Any,Any}(:value => "WI"),"postalCode" => OrderedCollections.OrderedDict{Any,Any}(:value => "53593"),"country" => OrderedCollections.OrderedDict{Any,Any}(:value => "US"))
 OrderedCollections.OrderedDict{Any,Any}("use" => OrderedCollections.OrderedDict{Any,Any}(:value => "temp"),"line" => OrderedCollections.OrderedDict{Any,Any}(:value => "5301 Tokay Blvd"),"city" => OrderedCollections.OrderedDict{Any,Any}(:value => "MADISON"),"state" => OrderedCollections.OrderedDict{Any,Any}(:value => "WI"),"postalCode" => OrderedCollections.OrderedDict{Any,Any}(:value => "53711"),"country" => OrderedCollections.OrderedDict{Any,Any}(:value => "US"),"period" => OrderedCollections.OrderedDict{Any,Any}("start" => OrderedCollections.OrderedDict{Any,Any}(:value => "2011-08-04T00:00:00Z"),"end" => OrderedCollections.OrderedDict{Any,Any}(:value => "2014-08-04T00:00:00Z")))