Skip to content

Commit

Permalink
Add some convenience types (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
DilumAluthge authored Feb 17, 2021
1 parent 52d9385 commit a9fa40d
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 63 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", "Rhode Island Quality Institute", "contributors"]
version = "0.7.4"
version = "0.7.5"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand Down
1 change: 1 addition & 0 deletions src/FHIRClient.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ include("r4.jl")
include("credentials.jl")
include("fhir-to-julia.jl")
include("headers.jl")
include("other-fhir-versions.jl")
include("requests.jl")

end # end module FHIRClient
11 changes: 11 additions & 0 deletions src/other-fhir-versions.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
struct DSTU2 <: FHIRVersion
end

struct STU3 <: FHIRVersion
end

struct UnknownFHIRVersion <: FHIRVersion
end

struct OtherFHIRVersion{V} <: FHIRVersion
end
7 changes: 0 additions & 7 deletions test/integration-tests.jl

This file was deleted.

4 changes: 4 additions & 0 deletions test/integration.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@testset "Integration tests" begin
include("integration/json.jl")
include("integration/basic-read.jl")
end
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
using FHIRClient
using Test

import Dates
import .JSON3

@testset "Basic reading" begin
anonymous_auth = FHIRClient.AnonymousAuth()
oauth2_auth = FHIRClient.OAuth2()
Expand Down
6 changes: 0 additions & 6 deletions test/integration-tests/json.jl → test/integration/json.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
using FHIRClient
using Test

import Dates
import .JSON3

@testset "Raw JSON" begin
fhir_version = FHIRClient.R4()
base_url = FHIRClient.BaseURL("https://hapi.fhir.org/baseR4")
Expand Down
7 changes: 5 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import Test

const JSON3 = FHIRClient.JSON3

import Dates
import .JSON3

@testset "FHIRClient.jl" begin
include("unit-tests.jl")
include("integration-tests.jl")
include("unit.jl")
include("integration.jl")
end
File renamed without changes.
41 changes: 0 additions & 41 deletions test/unit-tests.jl

This file was deleted.

6 changes: 6 additions & 0 deletions test/unit.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@testset "Unit tests" begin
include("unit/auto-generated-source-files.jl")
include("unit/fhir-to-julia.jl")
include("unit/other-fhir-versions.jl")
include("unit/requests.jl")
end
9 changes: 9 additions & 0 deletions test/unit/auto-generated-source-files.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@testset "Auto-generated source files" begin
@testset "R4" begin
@testset "Patient" begin
p = FHIRClient.R4Types.Patient()
@test p.resourceType isa String
@test p.resourceType == "Patient"
end
end
end
19 changes: 19 additions & 0 deletions test/unit/fhir-to-julia.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@testset "fhir-to-julia.jl" begin
@testset "fhir_to_julia" begin
@test FHIRClient.fhir_to_julia(:end) == :end_fhir
@test FHIRClient.fhir_to_julia(:function) == :function_fhir
@test FHIRClient.fhir_to_julia(:global) == :global_fhir
@test FHIRClient.fhir_to_julia(:import) == :import_fhir
@test FHIRClient.fhir_to_julia(:for) == :for_fhir
@test FHIRClient.fhir_to_julia(:birthDate) == :birthDate
end

@testset "julia_to_fhir" begin
@test FHIRClient.julia_to_fhir(:end_fhir) == :end
@test FHIRClient.julia_to_fhir(:function_fhir) == :function
@test FHIRClient.julia_to_fhir(:global_fhir) == :global
@test FHIRClient.julia_to_fhir(:import_fhir) == :import
@test FHIRClient.julia_to_fhir(:for_fhir) == :for
@test FHIRClient.julia_to_fhir(:birthDate) == :birthDate
end
end
7 changes: 7 additions & 0 deletions test/unit/other-fhir-versions.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@testset "other-fhir-versions.jl" begin
@test FHIRClient.DSTU2() isa FHIRClient.DSTU2
@test FHIRClient.STU3() isa FHIRClient.STU3
@test FHIRClient.UnknownFHIRVersion() isa FHIRClient.UnknownFHIRVersion
@test FHIRClient.OtherFHIRVersion{:DSTU2}() isa FHIRClient.OtherFHIRVersion
@test FHIRClient.OtherFHIRVersion{:DSTU2}() isa FHIRClient.OtherFHIRVersion{:DSTU2}
end
4 changes: 4 additions & 0 deletions test/unit/requests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@testset "requests.jl" begin
@test FHIRClient._add_trailing_slash(HTTP.URI("https://example.com")) == HTTP.URI("https://example.com/")
@test FHIRClient._add_trailing_slash(HTTP.URI("https://example.com/")) == HTTP.URI("https://example.com/")
end

2 comments on commit a9fa40d

@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
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/30236

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.7.5 -m "<description of version>" a9fa40d48cdc0410d2a5f0402e9999e057abf401
git push origin v0.7.5

Please sign in to comment.