Skip to content

Commit

Permalink
Rename some variables (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
DilumAluthge authored Aug 3, 2020
1 parent b06aedc commit 34e85aa
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "FHIRClient"
uuid = "b44d2ca2-8176-4fa9-8684-826e17b2a2da"
authors = ["Dilum Aluthge", "Brown Center for Biomedical Informatics", "JuliaHealth", "contributors"]
version = "0.1.2"
version = "0.2.0"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
4 changes: 2 additions & 2 deletions docs/src/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ julia> using DataFrames, PrettyPrint, StructArrays, Tables
julia> base_url = FHIRClient.BaseURL("https://hapi.fhir.org/baseR4")
FHIRClient.BaseURL(HTTP.URI("https://hapi.fhir.org/baseR4"))

julia> fhir_version = FHIRClient.R4()
julia> fhir_release = FHIRClient.R4()
FHIRClient.R4()

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

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

julia> patient1 = FHIRClient.request(FHIRClient.FHIRPatient, client, "GET", "/Patient/22692")
Expand Down
5 changes: 0 additions & 5 deletions src/authentication.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,3 @@ function Base.shred!(password_auth::UsernamePassAuth)::Nothing
Base.shred!(password_auth.password_cred)
return nothing
end

function Base.shred!(client::Client)::Nothing
Base.shred!(client.auth)
return nothing
end
7 changes: 6 additions & 1 deletion src/client.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
get_auth(client::Client) = client.auth
get_base_url(client::Client) = client.base_url
get_fhir_version(client::Client) = client.fhir_version
get_fhir_release(client::Client) = client.fhir_release

function Base.shred!(client::Client)::Nothing
Base.shred!(client.auth)
return nothing
end
8 changes: 4 additions & 4 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ A `FHIRType` is a Julia type representation of a FHIR object.
abstract type FHIRType end

"""
A struct corresponding to a version of the FHIR specification.
A struct corresponding to a release of the FHIR specification.
"""
abstract type FHIRVersion end
abstract type FHIRRelease end

"""
The base URL for a FHIR server.
Expand All @@ -25,8 +25,8 @@ end
"""
A FHIR client.
"""
struct Client{V <: FHIRVersion, A <: Authentication} <: HealthBase.AbstractFHIRClient
fhir_version::V
struct Client{R <: FHIRRelease, A <: Authentication} <: HealthBase.AbstractFHIRClient
fhir_release::R
base_url::BaseURL
auth::A
end
Expand Down
2 changes: 1 addition & 1 deletion src/version.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
struct R4 <: FHIRVersion end
struct R4 <: FHIRRelease end

const FHIR_VERSION_R4 = v"4.0.1"
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ using Test
]
for auth in all_auths
base_url = FHIRClient.BaseURL("https://hapi.fhir.org/baseR4")
fhir_version = FHIRClient.R4()
client = FHIRClient.Client(fhir_version, base_url, auth)
@test FHIRClient.get_fhir_version(client) == fhir_version
fhir_release = FHIRClient.R4()
client = FHIRClient.Client(fhir_release, base_url, auth)
@test FHIRClient.get_fhir_release(client) == fhir_release
@test FHIRClient.get_base_url(client) == base_url
request_path = "/Patient/22692"
json_response = FHIRClient.request_json(client, "GET", request_path)
Expand Down

2 comments on commit 34e85aa

@DilumAluthge
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register branch=master

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/18888

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.0 -m "<description of version>" 34e85aa890746475c3e775c1347dbda1dfa312b8
git push origin v0.2.0

Please sign in to comment.