Examples

Basic example

julia> using FHIRClient
julia> using FHIRClient.R4Types
julia> fhir_version = FHIRClient.R4()FHIRClient.R4()
julia> base_url = FHIRClient.BaseURL("https://hapi.fhir.org/baseR4")FHIRClient.BaseURL(URI("https://hapi.fhir.org/baseR4"))
julia> auth = FHIRClient.AnonymousAuth()FHIRClient.AnonymousAuth()
julia> client = FHIRClient.Client(fhir_version, base_url, auth)FHIRClient.Client{FHIRClient.R4, FHIRClient.AnonymousAuth}(FHIRClient.R4(), FHIRClient.BaseURL(URI("https://hapi.fhir.org/baseR4")), FHIRClient.AnonymousAuth())
julia> request_path = "/Patient/1476056""/Patient/1476056"
julia> p = FHIRClient.request(Patient, client, "GET", request_path)ERROR: HTTP.Exceptions.StatusError(504, "GET", "/baseR4/Patient/1476056", HTTP.Messages.Response: """ HTTP/1.1 504 Gateway Time-out Server: nginx/1.18.0 (Ubuntu) Date: Tue, 02 Apr 2024 08:41:42 GMT Content-Type: text/html Content-Length: 176 Connection: keep-alive <html> <head><title>504 Gateway Time-out</title></head> <body> <center><h1>504 Gateway Time-out</h1></center> <hr><center>nginx/1.18.0 (Ubuntu)</center> </body> </html> """)
julia> typeof(p)ERROR: UndefVarError: `p` not defined
julia> fieldnames(Patient)(:_active, :_birthDate, :_deceasedBoolean, :_deceasedDateTime, :_gender, :_implicitRules, :_language, :_multipleBirthBoolean, :_multipleBirthInteger, :active, :address, :birthDate, :communication, :contact, :contained, :deceasedBoolean, :deceasedDateTime, :extension, :gender, :generalPractitioner, :id, :identifier, :implicitRules, :language, :link, :managingOrganization, :maritalStatus, :meta, :modifierExtension, :multipleBirthBoolean, :multipleBirthInteger, :name, :photo, :resourceType, :telecom, :text)
julia> p.nameERROR: UndefVarError: `p` not defined