Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions .github/distributed-test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ services:
DB_CASSANDRA_REQUEST_TIMEOUT: "60000"
DB_CASSANDRA_MAX_CONCURRENT_REQUESTS: "128"
DB_BLOCK_CACHE_SIZE: "128"
DB_RESOURCE_CACHE_SIZE: "100000"
DB_RESOURCE_INDEXER_THREADS: "8"
ALLOW_MULTIPLE_DELETE: "true"
ENABLE_INTERACTION_DELETE_HISTORY: "true"
Expand Down Expand Up @@ -156,7 +155,6 @@ services:
DB_CASSANDRA_REQUEST_TIMEOUT: "60000"
DB_CASSANDRA_MAX_CONCURRENT_REQUESTS: "128"
DB_BLOCK_CACHE_SIZE: "128"
DB_RESOURCE_CACHE_SIZE: "100000"
DB_RESOURCE_INDEXER_THREADS: "8"
ALLOW_MULTIPLE_DELETE: "true"
ENABLE_INTERACTION_DELETE_HISTORY: "true"
Expand Down
57 changes: 57 additions & 0 deletions .github/scripts/age-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash -e

#
# This script test that the complex data type Age works as expected
#

script_dir="$(dirname "$(readlink -f "$0")")"
. "$script_dir/util.sh"

base="http://localhost:8080/fhir"

echo "ℹ️ Age as polymorph data element in Condition"

condition() {
cat <<END
{
"resourceType": "Condition",
"onsetAge": {
"value": 42,
"unit": "year",
"system": "http://unitsofmeasure.org",
"code": "a"
}
}
END
}

response="$(condition | create "$base/Condition")"

test "age value" "$(echo "$response" | jq -r .onsetAge.value)" "42"
test "age unit" "$(echo "$response" | jq -r .onsetAge.unit)" "year"

echo "ℹ️ Age as extension value"

patient() {
cat <<END
{
"resourceType": "Patient",
"extension": [
{
"url": "foo",
"valueAge": {
"value": 42,
"unit": "year",
"system": "http://unitsofmeasure.org",
"code": "a"
}
}
]
}
END
}

response="$(patient | create "$base/Patient")"

test "age value" "$(echo "$response" | jq -r .extension[0].valueAge.value)" "42"
test "age unit" "$(echo "$response" | jq -r .extension[0].valueAge.unit)" "year"
15 changes: 14 additions & 1 deletion .github/scripts/check-capability-statement.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ script_dir="$(dirname "$(readlink -f "$0")")"
. "$script_dir/util.sh"

base="${1:-http://localhost:8080/fhir}"
capability_statement=$(curl -sH 'Accept: application/fhir+json' "$base/metadata")

echo "ℹ️ JSON Format"

capability_statement=$(curl -sfH 'Accept: application/fhir+json' "$base/metadata")

test "status" "$(echo "$capability_statement" | jq -r .status)" "active"
test "kind" "$(echo "$capability_statement" | jq -r .kind)" "instance"
Expand All @@ -20,3 +23,13 @@ test "Operation Patient \$everything Definition" "$(echo "$capability_statement"
test "Operation Patient \$everything Documentation" "$(echo "$capability_statement" | jq -r '.rest[0].resource[] | select(.type == "Patient") .operation[] | select(.name == "everything") | .documentation')" "Returns all resources from the patient compartment of one concrete patient including the patient. Has a fix limit of 10,000 resources if paging isn't used. Paging is supported when the _count parameter is used. No other params are supported."

test "Operation \$totals Documentation" "$(echo "$capability_statement" | jq -r '.rest[0].operation[] | select(.name == "totals") | .documentation')" "Retrieves the total counts of resources available by resource type."

echo "ℹ️ XML Format"

capability_statement=$(curl -sfH 'Accept: application/fhir+xml' "$base/metadata")

test "status" "$(echo "$capability_statement" | xq -x //status/@value)" "active"
test "kind" "$(echo "$capability_statement" | xq -x //kind/@value)" "instance"
test "software name" "$(echo "$capability_statement" | xq -x //software/name/@value)" "Blaze"
test "URL" "$(echo "$capability_statement" | xq -x //implementation/url/@value)" "http://localhost:8080/fhir"
test "FHIR version" "$(echo "$capability_statement" | xq -x //fhirVersion/@value)" "4.0.1"
35 changes: 35 additions & 0 deletions .github/scripts/count-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash -e

#
# This script test that the complex data type Count works as expected
#

script_dir="$(dirname "$(readlink -f "$0")")"
. "$script_dir/util.sh"

base="http://localhost:8080/fhir"

echo "ℹ️ Count as extension value"

patient() {
cat <<END
{
"resourceType": "Patient",
"extension": [
{
"url": "foo",
"valueCount": {
"value": 23,
"system": "http://unitsofmeasure.org",
"code": "1"
}
}
]
}
END
}

response="$(patient | create "$base/Patient")"

test "count value" "$(echo "$response" | jq -r .extension[0].valueCount.value)" "23"
test "count code" "$(echo "$response" | jq -r .extension[0].valueCount.code)" "1"
36 changes: 36 additions & 0 deletions .github/scripts/distance-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash -e

#
# This script test that the complex data type Distance works as expected
#

script_dir="$(dirname "$(readlink -f "$0")")"
. "$script_dir/util.sh"

base="http://localhost:8080/fhir"

echo "ℹ️ Distance as extension value"

patient() {
cat <<END
{
"resourceType": "Patient",
"extension": [
{
"url": "foo",
"valueDistance": {
"value": 23,
"unit": "km",
"system": "http://unitsofmeasure.org",
"code": "km"
}
}
]
}
END
}

response="$(patient | create "$base/Patient")"

test "distance value" "$(echo "$response" | jq -r .extension[0].valueDistance.value)" "23"
test "distance unit" "$(echo "$response" | jq -r .extension[0].valueDistance.unit)" "km"
57 changes: 57 additions & 0 deletions .github/scripts/duration-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash -e

#
# This script test that the complex data type Duration works as expected
#

script_dir="$(dirname "$(readlink -f "$0")")"
. "$script_dir/util.sh"

base="http://localhost:8080/fhir"

echo "ℹ️ Duration as polymorph data element in ActivityDefinition"

activity_definition() {
cat <<END
{
"resourceType": "ActivityDefinition",
"timingDuration": {
"value": 23,
"unit": "second",
"system": "http://unitsofmeasure.org",
"code": "s"
}
}
END
}

response="$(activity_definition | create "$base/ActivityDefinition")"

test "duration value" "$(echo "$response" | jq -r .timingDuration.value)" "23"
test "duration unit" "$(echo "$response" | jq -r .timingDuration.unit)" "second"

echo "ℹ️ Duration as extension value"

patient() {
cat <<END
{
"resourceType": "Patient",
"extension": [
{
"url": "foo",
"valueDuration": {
"value": 23,
"unit": "second",
"system": "http://unitsofmeasure.org",
"code": "s"
}
}
]
}
END
}

response="$(patient | create "$base/Patient")"

test "duration value" "$(echo "$response" | jq -r .extension[0].valueDuration.value)" "23"
test "duration unit" "$(echo "$response" | jq -r .extension[0].valueDuration.unit)" "second"
Loading