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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/scripts/search-value-set-url-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
set -euo pipefail

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

base="http://localhost:8080/fhir"
vs_url="http://example.com/fhir/ValueSet/$(uuidgen | tr '[:upper:]' '[:lower:]')"

valueset() {
cat <<END
{
"resourceType": "ValueSet",
"url" : "$vs_url",
"version" : "$1",
"status" : "draft"
}
END
}

valueset "1.2.3" | create "$base/ValueSet"
valueset "1.3.4" | create "$base/ValueSet"
valueset "2.1.6" | create "$base/ValueSet"

search() {
curl -sfH 'Accept: application/fhir+json' "$base/ValueSet?url$1=$vs_url$2&_summary=count" | jq -r .total
}

test "ValueSet below v1 count" "$(search ":below" "|1")" "2"
test "ValueSet below v2 count" "$(search ":below" "|2")" "1"
test "ValueSet below all count" "$(search ":below" "")" "3"
test "ValueSet below v1.2.3 count" "$(search ":below" "|1.2.3")" "1"
test "ValueSet exact v1.2.3 count" "$(search "" "|1.2.3")" "1"
test "ValueSet exact unversioned count" "$(search "" "")" "3"
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,9 @@ jobs:
- name: Search Observation _profile Version
run: .github/scripts/search-observation-profile-version.sh

- name: Search ValueSet url Version
run: .github/scripts/search-value-set-url-version.sh

- name: Search Modifier
run: .github/scripts/search-modifier.sh

Expand Down
8 changes: 0 additions & 8 deletions .idea/misc.xml

This file was deleted.

2 changes: 1 addition & 1 deletion modules/db-protocols/src/blaze/db/impl/protocols.clj
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
(-matcher [_ batch-db modifier compiled-values])
(-single-version-id-matcher [_ batch-db tid modifier compiled-values])
(-postprocess-matches
[search-param batch-db values compiled-values]
[search-param batch-db modifier values compiled-values]
"Returns a transducer that will be applied on every matching resource-handle
at the end of the query execution. Can also be used to finally remove
unwanted matches.")
Expand Down
2 changes: 2 additions & 0 deletions modules/db/src/blaze/db/impl/codec.clj
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@
"series"
"status"
"subject"
"system:below"
"url"
"url:below"
"value-quantity"
"variant-start"
"version"]))
Expand Down
4 changes: 2 additions & 2 deletions modules/db/src/blaze/db/impl/index.clj
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@
(let [f #(ordered-index-handles* batch-db tid % start-id)]
(u/intersection-index-handles (map f conjunction))))))

(defn- postprocess-matches** [batch-db [search-param _ values compiled-values]]
(p/-postprocess-matches search-param batch-db values compiled-values))
(defn- postprocess-matches** [batch-db [search-param modifier values compiled-values]]
(p/-postprocess-matches search-param batch-db modifier values compiled-values))

(defn- postprocess-matches* [batch-db disjunction]
(transduce (keep (partial postprocess-matches** batch-db)) comp disjunction))
Expand Down
2 changes: 1 addition & 1 deletion modules/db/src/blaze/db/impl/search_param/chained.clj
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
nil
(single-version-id-targets batch-db tid single-version-id ref-c-hash ref-tid)))))

(-postprocess-matches [_ _ _ _]))
(-postprocess-matches [_ _ _ _ _]))

(defn- compile-ref-search-param-value
"Compiles the value of the reference of `resource-handle` via
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
(spq/single-version-id-matcher batch-db tid c-hash prefix-length
compiled-values))

(-postprocess-matches [_ _ _ _])
(-postprocess-matches [_ _ _ _ _])

(-index-values [_ resolver resource]
(when-ok [values (fhir-path/eval resolver main-expression resource)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
(r-sp-v/single-version-id-value-prefix-filter
(:snapshot batch-db) tid c-hash compiled-values))

(-postprocess-matches [_ _ _ _])
(-postprocess-matches [_ _ _ _ _])

(-index-values [_ resolver resource]
(when-ok [values (fhir-path/eval resolver main-expression resource)]
Expand Down
4 changes: 2 additions & 2 deletions modules/db/src/blaze/db/impl/search_param/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
This multi-method is used to convert search parameters before storing them
in the registry. Other namespaces can provide their own implementations here.

The `context` contains a :code-expression? function, a :canonical-expression?
function, a :terminology-service and an :index.
The `context` contains an :expression-type function, a :terminology-service
and an :index.

The conversion can return an anomaly."
{:arglists '([context definition])}
Expand Down
4 changes: 2 additions & 2 deletions modules/db/src/blaze/db/impl/search_param/date.clj
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@
(-single-version-id-matcher [_ batch-db tid _ compiled-values]
(single-version-id-matcher batch-db tid c-hash compiled-values))

(-postprocess-matches [_ _ _ _])
(-postprocess-matches [_ _ _ _ _])

(-index-values [search-param resolver resource]
(when-ok [values (fhir-path/eval resolver expression resource)]
Expand Down Expand Up @@ -676,7 +676,7 @@
(-single-version-id-matcher [search-param batch-db tid modifier compiled-values]
(u/single-version-id-matcher search-param batch-db tid modifier compiled-values))

(-postprocess-matches [_ batch-db _ compiled-values]
(-postprocess-matches [_ batch-db _ _ compiled-values]
(last-updated-matcher batch-db compiled-values))

;; The _lastUpdated search parameter is queried over the TypeAsOf index, so
Expand Down
2 changes: 1 addition & 1 deletion modules/db/src/blaze/db/impl/search_param/has.clj
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
(-single-version-id-matcher [search-param batch-db tid modifier compiled-values]
(u/single-version-id-matcher search-param batch-db tid modifier compiled-values))

(-postprocess-matches [_ _ _ _])
(-postprocess-matches [_ _ _ _ _])

(-index-values [_ _ _]
[]))
Expand Down
2 changes: 1 addition & 1 deletion modules/db/src/blaze/db/impl/search_param/list.clj
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
(-ordered-compartment-index-handles [_ _ _ _ _ _ _]
(ba/unsupported))

(-postprocess-matches [_ _ _ _])
(-postprocess-matches [_ _ _ _ _])

(-index-values [_ _ _]
[]))
Expand Down
2 changes: 1 addition & 1 deletion modules/db/src/blaze/db/impl/search_param/near.clj
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
(-single-version-id-matcher [search-param batch-db tid modifier compiled-values]
(u/single-version-id-matcher search-param batch-db tid modifier compiled-values))

(-postprocess-matches [_ batch-db _ compiled-values]
(-postprocess-matches [_ batch-db _ _ compiled-values]
(postprocess-matches-xf batch-db compiled-values))

(-index-values [_ _ _]
Expand Down
2 changes: 1 addition & 1 deletion modules/db/src/blaze/db/impl/search_param/number.clj
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
(-single-version-id-matcher [_ batch-db tid _ compiled-values]
(spq/single-version-id-matcher batch-db tid c-hash 0 compiled-values))

(-postprocess-matches [_ _ _ _])
(-postprocess-matches [_ _ _ _ _])

(-index-values [search-param resolver resource]
(when-ok [values (fhir-path/eval resolver expression resource)]
Expand Down
2 changes: 1 addition & 1 deletion modules/db/src/blaze/db/impl/search_param/quantity.clj
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
(single-version-id-matcher batch-db tid c-hash codec/v-hash-size
compiled-values))

(-postprocess-matches [_ _ _ _])
(-postprocess-matches [_ _ _ _ _])

(-index-values [search-param resolver resource]
(when-ok [values (fhir-path/eval resolver expression resource)]
Expand Down
2 changes: 1 addition & 1 deletion modules/db/src/blaze/db/impl/search_param/string.clj
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
(r-sp-v/single-version-id-value-prefix-filter
(:snapshot batch-db) tid c-hash compiled-values))

(-postprocess-matches [_ _ _ _])
(-postprocess-matches [_ _ _ _ _])

(-index-values [search-param resolver resource]
(when-ok [values (fhir-path/eval resolver expression resource)]
Expand Down
Loading
Loading