diff --git a/.github/scripts/admin-api/create-invalid-jobs.sh b/.github/scripts/admin-api/create-invalid-jobs.sh new file mode 100755 index 000000000..e5ac9b071 --- /dev/null +++ b/.github/scripts/admin-api/create-invalid-jobs.sh @@ -0,0 +1,25 @@ +#!/bin/bash -e + +SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" +. "$SCRIPT_DIR/../util.sh" + +BASE="http://localhost:8080/fhir" + +ERROR_MESSAGE="$(curl -s -H 'Content-Type: application/fhir+json' -H 'Accept: application/fhir+json' -d "{\"resourceType\": \"Task\"}" "$BASE/__admin/Task" | jq -r '.issue[].details.text')" +test "error message" "$ERROR_MESSAGE" "No allowed profile found." + +re-index-job() { +cat <` is created. You can use that image after the pipeline ended successfully. +The most reliable way to build Blaze is to use GitHub CI. If you create a PR, a Docker image with the label `pr-` is created. You can use that image after the pipeline ended successfully. ### Using a Local Build Environment @@ -32,7 +32,14 @@ The best way to use a REPL, is to use it from your IDE. If you use Intellij, the Inside the REPL you should be able to discover and play with the functions and execute unit tests. Developing a new feature will always include writing unit tests. Code coverage is measured in CI and should only increase. The unit tests should already ensure that the feature is implemented correctly on a module level. In addition to that, integration tests can be added to the GitHub CI pipeline available in the file `.github/workflows/build.yml`. -In addition to the REPL development inside a single module, it's possible to run a REPL were Blaze can be started as a system. Such a REPL should be started with the namespace `blaze.dev` loaded available in the file `dev/blaze/dev.clj`. In that namespace Blaze can be started by invoking the `init` function. The configuration of the development system is done with the same environment variables used in the production system. That variables are documented [here](docs/deployment/environment-variables.md). +In addition to the REPL development inside a single module, it is also possible to run a REPL were Blaze can be started as a system. This procedure is automated via a Makefile alias. + +```make repl``` + +See the files `Makefile` and `dev/blaze/dev.clj` for more details. + +The configuration of the development system is done with the same environment variables used in the production system. +Documentation: [Environment Variables](docs/deployment/environment-variables.md). ## Release Checklist @@ -49,11 +56,7 @@ In addition to the REPL development inside a single module, it's possible to run ## Style Guide -The Clojure code in this project follows the [Clojure Style Guide][2]. - -### Exceptions: - -* we use two empty lines between top-level forms +The Clojure code in this project mainly follows the [Clojure Style Guide][2], enforced by `cljfmt`. For more details, please check `cljfmt.edn`." ## Pure Functions @@ -69,7 +72,7 @@ Such components reside in a namespace. There exists a constructor function calle ```clojure (ns blaze.db.node - (:require + (:require [clojure.spec.alpha :as s] [integrant.core :as ig]) (:import @@ -81,7 +84,7 @@ Such components reside in a namespace. There exists a constructor function calle [dep-a dep-b]) -(defmethod ig/pre-init-spec :blaze.db/node [_] +(defmethod m/pre-init-spec :blaze.db/node [_] (s/keys :req-un [dep-a dep-b])) @@ -99,7 +102,7 @@ Such components reside in a namespace. There exists a constructor function calle In this example, you can see the `new-node` function which gets two dependencies `dep-a` and `dep-b` which could be config values or other components. The function returns the database node itself. In our case the database node holds resources which should be freed when it is no longer needed. A common idiom is to implement `java.lang.AutoCloseable` and call the `.close` method at the end of usage. -While the pair of the function `new-node` and the method `.close` can be used in tests, integrant is used in production. In the example, you can see the multi-method instances `ig/pre-init-spec`, `ig/init-key` and `ig/halt-key!`. First `ig/pre-init-spec` is used to provide a spec for the dependency map `ig/init-key` receives. The spec is created using the `s/keys` form in order to validate a map. Second the `ig/init-key` method will be called by integrant when the component with the :blaze.db/node key is initialized. In this method we simply call our `new-node` function, passing all dependencies from the map as arguments. In addition to that we log a meaningful message at info level in order to make the startup of Blaze transparent. It's also a good idea to log out any config values here. Last the method `ig/halt-key!` is used to free any resources our component might hold. Here we call our `.close` on the component instance passed. +While the pair of the function `new-node` and the method `.close` can be used in tests, integrant is used in production. In the example, you can see the multi-method instances `m/pre-init-spec`, `ig/init-key` and `ig/halt-key!`. First `m/pre-init-spec` is used to provide a spec for the dependency map `ig/init-key` receives. The spec is created using the `s/keys` form in order to validate a map. Second the `ig/init-key` method will be called by integrant when the component with the :blaze.db/node key is initialized. In this method we simply call our `new-node` function, passing all dependencies from the map as arguments. In addition to that we log a meaningful message at info level in order to make the startup of Blaze transparent. It's also a good idea to log out any config values here. Last the method `ig/halt-key!` is used to free any resources our component might hold. Here we call our `.close` on the component instance passed. ## Function Specs @@ -107,7 +110,7 @@ Every public function should have a spec. Function specs are declared in a names ## Java Interop -It is important that we don't use reflection. In order to see reflection warnings ```(set! *warn-on-reflection* true)``` should be used in every namespace which does Java interop. +It is important to avoid using reflection. In order to see reflection warnings, make sure to use ```(set! *warn-on-reflection* true)``` in every namespace which does Java interop. ## REPL @@ -116,7 +119,7 @@ It is important that we don't use reflection. In order to see reflection warning * add `-Dclojure.server.repl='{:address,\"0.0.0.0\",:port,5555,:accept,clojure.core.server/repl}'` to the `JAVA_TOOL_OPTIONS` env var * bind port 5555 * create remote REPL in Cursive -* +* [1]: [2]: diff --git a/Dockerfile b/Dockerfile index e2c3c9c46..898c9368b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:6.0@sha256:5c0d4c483ce2781fa522c96a6069d12f719f1313635cba76f9e061dd17740077 as fhir-packages - -RUN dotnet tool install -g firely.terminal -RUN /root/.dotnet/tools/fhir install hl7.fhir.r4.core 4.0.1 -RUN /root/.dotnet/tools/fhir install hl7.fhir.xver-extensions 0.1.0 - -FROM eclipse-temurin:17-jre-jammy@sha256:ed5ea3ef6b4db2a39d241ba8f040394c11450f5373329824390c227da7f229be +FROM eclipse-temurin:17.0.11_9-jre-jammy@sha256:d7d18c361578b6d2395054bc89b7a4790f696120d91a1955ac52ecf4e12d77c8 RUN apt-get update && apt-get upgrade -y && \ apt-get install libjemalloc2 -y && \ @@ -12,13 +6,8 @@ RUN apt-get update && apt-get upgrade -y && \ apt-get autoremove -y && apt-get clean && \ rm -rf /var/lib/apt/lists/ -RUN groupadd -g 1001 blaze -RUN useradd -u 1001 -g 1001 --create-home blaze - RUN mkdir -p /app/data && chown 1001:1001 /app/data -COPY target/blaze-0.26.1-standalone.jar /app/ -COPY --from=fhir-packages /root/.fhir/packages /home/blaze/.fhir/packages/ -RUN chown -R 1001:1001 /home/blaze/.fhir +COPY target/blaze-0.26.2-standalone.jar /app/ WORKDIR /app USER 1001 @@ -31,4 +20,4 @@ ENV RESOURCE_DB_DIR="/app/data/resource" ENV ADMIN_INDEX_DB_DIR="/app/data/admin-index" ENV ADMIN_TRANSACTION_DB_DIR="/app/data/admin-transaction" -CMD ["java", "-jar", "blaze-0.26.1-standalone.jar"] +CMD ["java", "-jar", "blaze-0.26.2-standalone.jar"] diff --git a/Makefile b/Makefile index bae5da707..cb44a3c2c 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,9 @@ deps-tree: deps-list: clojure -X:deps list +repl: + clj -M:test -e "(require 'blaze.dev) (in-ns 'blaze.dev)" --repl + cloc-prod-root: cloc src diff --git a/README.md b/README.md index 0052600b3..39c65c982 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ A demo installation can be found [here](https://blaze.life.uni-leipzig.de/fhir) Blaze is widely used in the [Medical Informatics Initiative](https://www.medizininformatik-initiative.de) in Germany and in [Biobanks](https://www.bbmri-eric.eu) across Europe. A 1.0 version is expected in the next months. -Latest release: [v0.26.1][5] +Latest release: [v0.26.2][5] ## Quick Start @@ -75,7 +75,7 @@ Unless required by applicable law or agreed to in writing, software distributed [3]: [4]: -[5]: +[5]: [6]: [7]: [8]: diff --git a/build.clj b/build.clj index 28d9693cc..e03d0a498 100644 --- a/build.clj +++ b/build.clj @@ -2,7 +2,7 @@ (:require [clojure.tools.build.api :as b])) (def lib 'samply/blaze) -(def version "0.26.1") +(def version "0.26.2") (def class-dir "target/classes") (def basis (b/create-basis {:project "deps.edn"})) (def uber-file (format "target/%s-%s-standalone.jar" (name lib) version)) diff --git a/deps.edn b/deps.edn index 1446d0ad4..8227dd989 100644 --- a/deps.edn +++ b/deps.edn @@ -78,7 +78,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 55dcc76c8..8e8c94040 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -27,7 +27,7 @@ export default defineConfig({ nav: [ {text: 'Home', link: '/'}, { - text: "v0.26.1", + text: "v0.26.2", items: [ { text: 'Changelog', diff --git a/docs/deployment/manual-deployment.md b/docs/deployment/manual-deployment.md index 385c33e95..3c6e86f3a 100644 --- a/docs/deployment/manual-deployment.md +++ b/docs/deployment/manual-deployment.md @@ -2,12 +2,12 @@ The installation works under Windows, Linux and macOS. The only dependency is an installed OpenJDK 11 or 17 with 17 recommended. Blaze is tested with [Eclipse Temurin][1]. -Blaze runs on the JVM and comes as single JAR file. Download the most recent version [here](https://github.com/samply/blaze/releases/tag/v0.26.1). Look for `blaze-0.26.1-standalone.jar`. +Blaze runs on the JVM and comes as single JAR file. Download the most recent version [here](https://github.com/samply/blaze/releases/tag/v0.26.2). Look for `blaze-0.26.2-standalone.jar`. After the download, you can start blaze with the following command (Linux, macOS): ```sh -java -jar blaze-0.26.1-standalone.jar +java -jar blaze-0.26.2-standalone.jar ``` Blaze will run with an in-memory, volatile database for testing and demo purposes. @@ -17,14 +17,14 @@ Blaze can be run with durable storage by setting the environment variables `STOR Under Linux/macOS: ```sh -STORAGE=standalone java -jar blaze-0.26.1-standalone.jar +STORAGE=standalone java -jar blaze-0.26.2-standalone.jar ``` Under Windows, you need to set the Environment variables in the PowerShell before starting Blaze: ```powershell $Env:STORAGE="standalone" -java -jar blaze-0.26.1-standalone.jar +java -jar blaze-0.26.2-standalone.jar ``` This will create three directories called `index`, `transaction` and `resource` inside the current working directory, one for each database part used. @@ -42,7 +42,7 @@ The output should look like this: 2021-06-27T11:02:37.834Z ee086ef908c1 main INFO [blaze.core:64] - JVM version: 16.0.2 2021-06-27T11:02:37.834Z ee086ef908c1 main INFO [blaze.core:65] - Maximum available memory: 1738 MiB 2021-06-27T11:02:37.835Z ee086ef908c1 main INFO [blaze.core:66] - Number of available processors: 8 -2021-06-27T11:02:37.836Z ee086ef908c1 main INFO [blaze.core:67] - Successfully started Blaze version 0.26.1 in 8.2 seconds +2021-06-27T11:02:37.836Z ee086ef908c1 main INFO [blaze.core:67] - Successfully started Blaze version 0.26.2 in 8.2 seconds ``` In order to test connectivity, query the health endpoint: @@ -62,7 +62,7 @@ that should return: ```json { "name": "Blaze", - "version": "0.26.1" + "version": "0.26.2" } ``` diff --git a/docs/deployment/standalone-backend.md b/docs/deployment/standalone-backend.md index 326bc067d..bafcc4eac 100644 --- a/docs/deployment/standalone-backend.md +++ b/docs/deployment/standalone-backend.md @@ -27,7 +27,7 @@ Blaze should log something like this: 2023-06-09T08:30:30.126Z b45689460ff3 main INFO [blaze.core:67] - JVM version: 17.0.7 2023-06-09T08:30:30.126Z b45689460ff3 main INFO [blaze.core:68] - Maximum available memory: 1738 MiB 2023-06-09T08:30:30.126Z b45689460ff3 main INFO [blaze.core:69] - Number of available processors: 2 -2023-06-09T08:30:30.126Z b45689460ff3 main INFO [blaze.core:70] - Successfully started 🔥 Blaze version 0.26.1 in 9.0 seconds +2023-06-09T08:30:30.126Z b45689460ff3 main INFO [blaze.core:70] - Successfully started 🔥 Blaze version 0.26.2 in 9.0 seconds ``` In order to test connectivity, query the health endpoint: @@ -47,7 +47,7 @@ that should return: ```json { "name": "Blaze", - "version": "0.26.1" + "version": "0.26.2" } ``` diff --git a/job-ig/Makefile b/job-ig/Makefile index 24f069a9e..8e98bedc7 100644 --- a/job-ig/Makefile +++ b/job-ig/Makefile @@ -6,5 +6,6 @@ build: cp fsh-generated/resources/CodeSystem-ReIndexJobOutput.json ../modules/job-re-index/resources/blaze/job/re_index/CodeSystem-ReIndexJobOutput.json cp fsh-generated/resources/CodeSystem-ReIndexJobParameter.json ../modules/job-re-index/resources/blaze/job/re_index/CodeSystem-ReIndexJobParameter.json cp fsh-generated/resources/StructureDefinition-ReIndexJob.json ../modules/job-re-index/resources/blaze/job/re_index/StructureDefinition-ReIndexJob.json + cp fsh-generated/resources/StructureDefinition-CompactJob.json ../modules/admin-api/resources/blaze/admin_api/StructureDefinition-CompactJob.json .PHONY: build diff --git a/modules/admin-api/deps.edn b/modules/admin-api/deps.edn index ac071d028..97e4235c3 100644 --- a/modules/admin-api/deps.edn +++ b/modules/admin-api/deps.edn @@ -1,4 +1,6 @@ -{:deps +{:paths ["src" "resources"] + + :deps {blaze/async {:local/root "../async"} @@ -27,31 +29,37 @@ {:local/root "../spec"} fi.metosin/reitit-openapi - {:mvn/version "0.7.0-alpha7"} + {:mvn/version "0.7.0" + :exclusions [javax.xml.bind/jaxb-api]} - ca.uhn.hapi.fhir/org.hl7.fhir.validation - {:mvn/version "6.3.6" + ca.uhn.hapi.fhir/hapi-fhir-validation + {:mvn/version "7.0.2" :exclusions - [ca.uhn.hapi.fhir/org.hl7.fhir.dstu2 - ca.uhn.hapi.fhir/org.hl7.fhir.dstu2016may - org.apache.httpcomponents/httpclient + [net.sf.saxon/Saxon-HE + org.ogce/xpp3 + ognl/ognl + org.attoparser/attoparser + org.unbescape/unbescape org.xerial/sqlite-jdbc - net.sf.saxon/Saxon-HE - info.cqframework/cql - info.cqframework/model - info.cqframework/elm - info.cqframework/cql-to-elm - info.cqframework/quick - info.cqframework/qdm - org.thymeleaf/thymeleaf - com.nimbusds/nimbus-jose-jwt - net.sourceforge.plantuml/plantuml-mit - junit/junit - jakarta-regexp/jakarta-regexp]} + commons-beanutils/commons-beanutils + org.apache.httpcomponents/httpclient]} + + ca.uhn.hapi.fhir/hapi-fhir-structures-r4 + {:mvn/version "7.0.2" + :exclusions [com.google.code.findbugs/jsr305]} + + ca.uhn.hapi.fhir/hapi-fhir-validation-resources-r4 + {:mvn/version "7.0.2"} + + ca.uhn.hapi.fhir/hapi-fhir-caching-caffeine + {:mvn/version "7.0.2"} org.fhir/ucum {:mvn/version "1.0.8" - :exclusions [xpp3/xpp3 xpp3/xpp3_xpath]}} + :exclusions [xpp3/xpp3 xpp3/xpp3_xpath]} + + com.fasterxml.jackson.datatype/jackson-datatype-jsr310 + {:mvn/version "2.17.1"}} :aliases {:test @@ -64,7 +72,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/admin-api/resources/blaze/admin_api/StructureDefinition-CompactJob.json b/modules/admin-api/resources/blaze/admin_api/StructureDefinition-CompactJob.json new file mode 100644 index 000000000..4ce7a48d6 --- /dev/null +++ b/modules/admin-api/resources/blaze/admin_api/StructureDefinition-CompactJob.json @@ -0,0 +1,4005 @@ +{ + "resourceType": "StructureDefinition", + "id": "CompactJob", + "url": "https://samply.github.io/blaze/fhir/StructureDefinition/CompactJob", + "name": "CompactJob", + "status": "draft", + "fhirVersion": "4.0.1", + "mapping": [ + { + "identity": "workflow", + "uri": "http://hl7.org/fhir/workflow", + "name": "Workflow Pattern" + }, + { + "identity": "rim", + "uri": "http://hl7.org/v3", + "name": "RIM Mapping" + }, + { + "identity": "w5", + "uri": "http://hl7.org/fhir/fivews", + "name": "FiveWs Pattern Mapping" + }, + { + "identity": "v2", + "uri": "http://hl7.org/v2", + "name": "HL7 v2 Mapping" + } + ], + "kind": "resource", + "abstract": false, + "type": "Task", + "baseDefinition": "https://samply.github.io/blaze/fhir/StructureDefinition/Job", + "derivation": "constraint", + "snapshot": { + "element": [ + { + "id": "Task", + "path": "Task", + "short": "A task to be performed", + "definition": "A task to be performed.", + "min": 0, + "max": "*", + "base": { + "path": "Task", + "min": 0, + "max": "*" + }, + "constraint": [ + { + "key": "dom-2", + "severity": "error", + "human": "If the resource is contained in another resource, it SHALL NOT contain nested Resources", + "expression": "contained.contained.empty()", + "xpath": "not(parent::f:contained and f:contained)", + "source": "http://hl7.org/fhir/StructureDefinition/DomainResource" + }, + { + "key": "dom-3", + "severity": "error", + "human": "If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource", + "expression": "contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()", + "xpath": "not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))", + "source": "http://hl7.org/fhir/StructureDefinition/DomainResource" + }, + { + "key": "dom-4", + "severity": "error", + "human": "If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated", + "expression": "contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()", + "xpath": "not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))", + "source": "http://hl7.org/fhir/StructureDefinition/DomainResource" + }, + { + "key": "dom-5", + "severity": "error", + "human": "If a resource is contained in another resource, it SHALL NOT have a security label", + "expression": "contained.meta.security.empty()", + "xpath": "not(exists(f:contained/*/f:meta/f:security))", + "source": "http://hl7.org/fhir/StructureDefinition/DomainResource" + }, + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice", + "valueBoolean": true + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation", + "valueMarkdown": "When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time." + } + ], + "key": "dom-6", + "severity": "warning", + "human": "A resource should have narrative for robust management", + "expression": "text.`div`.exists()", + "xpath": "exists(f:text/h:div)", + "source": "http://hl7.org/fhir/StructureDefinition/DomainResource" + }, + { + "key": "inv-1", + "severity": "error", + "human": "Last modified date must be greater than or equal to authored-on date.", + "expression": "lastModified.exists().not() or authoredOn.exists().not() or lastModified >= authoredOn", + "xpath": "not(exists(f:lastModified/@value)) or not(exists(f:authoredOn/@value)) or f:lastModified/@value >= f:authoredOn/@value" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "Entity. Role, or Act" + }, + { + "identity": "workflow", + "map": "Request, Event" + }, + { + "identity": "rim", + "map": "ControlAct[moodCode=INT]" + } + ] + }, + { + "id": "Task.id", + "path": "Task.id", + "short": "Logical id of this artifact", + "definition": "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.", + "comment": "The only time that a resource does not have an id is when it is being submitted to the server using a create operation.", + "min": 0, + "max": "1", + "base": { + "path": "Resource.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "http://hl7.org/fhirpath/System.String", + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "string" + } + ] + } + ], + "isModifier": false, + "isSummary": true + }, + { + "id": "Task.meta", + "path": "Task.meta", + "short": "Metadata about the resource", + "definition": "The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.", + "min": 0, + "max": "1", + "base": { + "path": "Resource.meta", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Meta" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true + }, + { + "id": "Task.implicitRules", + "path": "Task.implicitRules", + "short": "A set of rules under which this content was created", + "definition": "A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.", + "comment": "Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.", + "min": 0, + "max": "1", + "base": { + "path": "Resource.implicitRules", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "uri" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": true, + "isModifierReason": "This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation", + "isSummary": true + }, + { + "id": "Task.language", + "path": "Task.language", + "short": "Language of the resource content", + "definition": "The base language in which the resource is written.", + "comment": "Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).", + "min": 0, + "max": "1", + "base": { + "path": "Resource.language", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "code" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet", + "valueCanonical": "http://hl7.org/fhir/ValueSet/all-languages" + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "Language" + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding", + "valueBoolean": true + } + ], + "strength": "preferred", + "description": "A human language.", + "valueSet": "http://hl7.org/fhir/ValueSet/languages" + } + }, + { + "id": "Task.text", + "path": "Task.text", + "short": "Text summary of the resource, for human interpretation", + "definition": "A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.", + "comment": "Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.", + "alias": [ + "narrative", + "html", + "xhtml", + "display" + ], + "min": 0, + "max": "1", + "base": { + "path": "DomainResource.text", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Narrative" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "Act.text?" + } + ] + }, + { + "id": "Task.contained", + "path": "Task.contained", + "short": "Contained, inline Resources", + "definition": "These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.", + "comment": "This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.", + "alias": [ + "inline resources", + "anonymous resources", + "contained resources" + ], + "min": 0, + "max": "*", + "base": { + "path": "DomainResource.contained", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Resource" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "Task.extension", + "path": "Task.extension", + "short": "Additional content defined by implementations", + "definition": "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "DomainResource.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "Task.modifierExtension", + "path": "Task.modifierExtension", + "short": "Extensions that cannot be ignored", + "definition": "May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](extensibility.html#modifierExtension).", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "DomainResource.modifierExtension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": true, + "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them", + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "Task.identifier", + "path": "Task.identifier", + "slicing": { + "discriminator": [ + { + "type": "pattern", + "path": "system" + } + ], + "rules": "closed" + }, + "short": "Task Instance Identifier", + "definition": "The business identifier for this task.", + "min": 0, + "max": "*", + "base": { + "path": "Task.identifier", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Identifier" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "workflow", + "map": "Request.identifier, Event.identifier" + }, + { + "identity": "w5", + "map": "FiveWs.identifier" + }, + { + "identity": "rim", + "map": ".id" + } + ] + }, + { + "id": "Task.identifier:jobNumber", + "path": "Task.identifier", + "sliceName": "jobNumber", + "short": "Job Number", + "definition": "The business identifier for this task.", + "min": 0, + "max": "1", + "base": { + "path": "Task.identifier", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Identifier" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "workflow", + "map": "Request.identifier, Event.identifier" + }, + { + "identity": "w5", + "map": "FiveWs.identifier" + }, + { + "identity": "rim", + "map": ".id" + } + ] + }, + { + "id": "Task.identifier:jobNumber.id", + "path": "Task.identifier.id", + "representation": [ + "xmlAttr" + ], + "short": "Unique id for inter-element referencing", + "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.", + "min": 0, + "max": "1", + "base": { + "path": "Element.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "http://hl7.org/fhirpath/System.String", + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "string" + } + ] + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Task.identifier:jobNumber.extension", + "path": "Task.identifier.extension", + "slicing": { + "discriminator": [ + { + "type": "value", + "path": "url" + } + ], + "description": "Extensions are always sliced by (at least) url", + "rules": "open" + }, + "short": "Additional content defined by implementations", + "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "Element.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Task.identifier:jobNumber.use", + "path": "Task.identifier.use", + "short": "usual | official | temp | secondary | old (If known)", + "definition": "The purpose of this identifier.", + "comment": "Applications can assume that an identifier is permanent unless it explicitly says that it is temporary.", + "requirements": "Allows the appropriate identifier for a particular context of use to be selected from among a set of identifiers.", + "min": 0, + "max": "1", + "base": { + "path": "Identifier.use", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "code" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": true, + "isModifierReason": "This is labeled as \"Is Modifier\" because applications should not mistake a temporary id for a permanent one.", + "isSummary": true, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "IdentifierUse" + } + ], + "strength": "required", + "description": "Identifies the purpose for this identifier, if known .", + "valueSet": "http://hl7.org/fhir/ValueSet/identifier-use|4.0.1" + }, + "mapping": [ + { + "identity": "v2", + "map": "N/A" + }, + { + "identity": "rim", + "map": "Role.code or implied by context" + } + ] + }, + { + "id": "Task.identifier:jobNumber.type", + "path": "Task.identifier.type", + "short": "Description of identifier", + "definition": "A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.", + "comment": "This element deals only with general categories of identifiers. It SHOULD not be used for codes that correspond 1..1 with the Identifier.system. Some identifiers may fall into multiple categories due to common usage. Where the system is known, a type is unnecessary because the type is always part of the system definition. However systems often need to handle identifiers where the system is not known. There is not a 1:1 relationship between type and system, since many different systems have the same type.", + "requirements": "Allows users to make use of identifiers when the identifier system is not known.", + "min": 0, + "max": "1", + "base": { + "path": "Identifier.type", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "IdentifierType" + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding", + "valueBoolean": true + } + ], + "strength": "extensible", + "description": "A coded type for an identifier that can be used to determine which identifier to use for a specific purpose.", + "valueSet": "http://hl7.org/fhir/ValueSet/identifier-type" + }, + "mapping": [ + { + "identity": "v2", + "map": "CX.5" + }, + { + "identity": "rim", + "map": "Role.code or implied by context" + } + ] + }, + { + "id": "Task.identifier:jobNumber.system", + "path": "Task.identifier.system", + "short": "The namespace for the identifier value", + "definition": "Establishes the namespace for the value - that is, a URL that describes a set values that are unique.", + "comment": "Identifier.system is always case sensitive.", + "requirements": "There are many sets of identifiers. To perform matching of two identifiers, we need to know what set we're dealing with. The system identifies a particular set of unique identifiers.", + "min": 1, + "max": "1", + "base": { + "path": "Identifier.system", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "uri" + } + ], + "patternUri": "https://samply.github.io/blaze/fhir/sid/JobNumber", + "example": [ + { + "label": "General", + "valueUri": "http://www.acme.com/identifiers/patient" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "v2", + "map": "CX.4 / EI-2-4" + }, + { + "identity": "rim", + "map": "II.root or Role.id.root" + }, + { + "identity": "servd", + "map": "./IdentifierType" + } + ] + }, + { + "id": "Task.identifier:jobNumber.value", + "path": "Task.identifier.value", + "short": "The value that is unique", + "definition": "The portion of the identifier typically relevant to the user and which is unique within the context of the system.", + "comment": "If the value is a full URI, then the system SHALL be urn:ietf:rfc:3986. The value's primary purpose is computational mapping. As a result, it may be normalized for comparison purposes (e.g. removing non-significant whitespace, dashes, etc.) A value formatted for human display can be conveyed using the [Rendered Value extension](extension-rendered-value.html). Identifier.value is to be treated as case sensitive unless knowledge of the Identifier.system allows the processer to be confident that non-case-sensitive processing is safe.", + "min": 0, + "max": "1", + "base": { + "path": "Identifier.value", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "string" + } + ], + "example": [ + { + "label": "General", + "valueString": "123456" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "v2", + "map": "CX.1 / EI.1" + }, + { + "identity": "rim", + "map": "II.extension or II.root if system indicates OID or GUID (Or Role.id.extension or root)" + }, + { + "identity": "servd", + "map": "./Value" + } + ] + }, + { + "id": "Task.identifier:jobNumber.period", + "path": "Task.identifier.period", + "short": "Time period when id is/was valid for use", + "definition": "Time period during which identifier is/was valid for use.", + "min": 0, + "max": "1", + "base": { + "path": "Identifier.period", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Period" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "v2", + "map": "CX.7 + CX.8" + }, + { + "identity": "rim", + "map": "Role.effectiveTime or implied by context" + }, + { + "identity": "servd", + "map": "./StartDate and ./EndDate" + } + ] + }, + { + "id": "Task.identifier:jobNumber.assigner", + "path": "Task.identifier.assigner", + "short": "Organization that issued id (may be just text)", + "definition": "Organization that issued/manages the identifier.", + "comment": "The Identifier.assigner may omit the .reference element and only contain a .display element reflecting the name or other textual information about the assigning organization.", + "min": 0, + "max": "1", + "base": { + "path": "Identifier.assigner", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Reference", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/Organization" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "v2", + "map": "CX.4 / (CX.4,CX.9,CX.10)" + }, + { + "identity": "rim", + "map": "II.assigningAuthorityName but note that this is an improper use by the definition of the field. Also Role.scoper" + }, + { + "identity": "servd", + "map": "./IdentifierIssuingAuthority" + } + ] + }, + { + "id": "Task.instantiatesCanonical", + "path": "Task.instantiatesCanonical", + "short": "Formal definition of task", + "definition": "The URL pointing to a *FHIR*-defined protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.", + "requirements": "Enables a formal definition of how he task is to be performed, enabling automation.", + "min": 0, + "max": "1", + "base": { + "path": "Task.instantiatesCanonical", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "canonical", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/ActivityDefinition" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "workflow", + "map": "Request.instantiatesCanonical, Event.instantiatesCanonical" + }, + { + "identity": "rim", + "map": ".outboundRelationship[typeCode=DEFN].target" + } + ] + }, + { + "id": "Task.instantiatesUri", + "path": "Task.instantiatesUri", + "short": "Formal definition of task", + "definition": "The URL pointing to an *externally* maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this Task.", + "requirements": "Enables a formal definition of how he task is to be performed (e.g. using BPMN, BPEL, XPDL or other formal notation to be associated with a task), enabling automation.", + "min": 0, + "max": "1", + "base": { + "path": "Task.instantiatesUri", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "uri" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "workflow", + "map": "Event.instantiatesUrl" + }, + { + "identity": "rim", + "map": ".outboundRelationship[typeCode=DEFN].target" + } + ] + }, + { + "id": "Task.basedOn", + "path": "Task.basedOn", + "short": "Request fulfilled by this task", + "definition": "BasedOn refers to a higher-level authorization that triggered the creation of the task. It references a \"request\" resource such as a ServiceRequest, MedicationRequest, ServiceRequest, CarePlan, etc. which is distinct from the \"request\" resource the task is seeking to fulfill. This latter resource is referenced by FocusOn. For example, based on a ServiceRequest (= BasedOn), a task is created to fulfill a procedureRequest ( = FocusOn ) to collect a specimen from a patient.", + "min": 0, + "max": "*", + "base": { + "path": "Task.basedOn", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Reference", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/Resource" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "workflow", + "map": "Request.basedOn, Event.basedOn" + }, + { + "identity": "rim", + "map": ".outboundRelationship[typeCode=FLFS].target[moodCode=INT]" + } + ] + }, + { + "id": "Task.groupIdentifier", + "path": "Task.groupIdentifier", + "short": "Requisition or grouper id", + "definition": "An identifier that links together multiple tasks and other requests that were created in the same context.", + "requirements": "Billing and/or reporting can be linked to whether multiple requests were created as a single unit.", + "min": 0, + "max": "1", + "base": { + "path": "Task.groupIdentifier", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Identifier" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "workflow", + "map": "Request.groupIdentifier" + }, + { + "identity": "rim", + "map": ".inboundRelationship[typeCode=COMP].source[moodCode=INT].id" + } + ] + }, + { + "id": "Task.partOf", + "path": "Task.partOf", + "short": "Composite task", + "definition": "Task that this particular task is part of.", + "comment": "This should usually be 0..1.", + "requirements": "Allows tasks to be broken down into sub-steps (and this division can occur independent of the original task).", + "min": 0, + "max": "*", + "base": { + "path": "Task.partOf", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Reference", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/Task" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "workflow", + "map": "Event.partOf" + }, + { + "identity": "rim", + "map": ".inboundRelationship[typeCode=COMP].source[moodCode=INT]" + } + ] + }, + { + "id": "Task.status", + "path": "Task.status", + "short": "draft | requested | received | accepted | +", + "definition": "The current status of the task.", + "requirements": "These states enable coordination of task status with off-the-shelf workflow solutions that support automation of tasks.", + "min": 1, + "max": "1", + "base": { + "path": "Task.status", + "min": 1, + "max": "1" + }, + "type": [ + { + "code": "code" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": true, + "isModifierReason": "This element is labeled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid", + "isSummary": true, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "TaskStatus" + } + ], + "strength": "required", + "description": "The current status of the task.", + "valueSet": "http://hl7.org/fhir/ValueSet/task-status|4.0.1" + }, + "mapping": [ + { + "identity": "workflow", + "map": "Request.status, Event.status" + }, + { + "identity": "w5", + "map": "FiveWs.status" + }, + { + "identity": "rim", + "map": ".statusCode" + } + ] + }, + { + "id": "Task.statusReason", + "path": "Task.statusReason", + "short": "Reason for current status", + "definition": "An explanation as to why this task is held, failed, was refused, etc.", + "comment": "This applies to the current status. Look at the history of the task to see reasons for past statuses.", + "min": 0, + "max": "1", + "base": { + "path": "Task.statusReason", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "TaskStatusReason" + } + ], + "strength": "example", + "description": "Codes to identify the reason for current status. These will typically be specific to a particular workflow." + }, + "mapping": [ + { + "identity": "rim", + "map": ".inboundRelationship[typeCode=SUBJ].source[classCode=CACT, moodCode=EVN, code=\"status change\"].reasonCode" + } + ] + }, + { + "id": "Task.businessStatus", + "path": "Task.businessStatus", + "short": "E.g. \"Specimen collected\", \"IV prepped\"", + "definition": "Contains business-specific nuances of the business state.", + "requirements": "There's often a need to track substates of a task - this is often variable by specific workflow implementation.", + "min": 0, + "max": "1", + "base": { + "path": "Task.businessStatus", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "TaskBusinessStatus" + } + ], + "strength": "example", + "description": "The domain-specific business-contextual sub-state of the task. For example: \"Blood drawn\", \"IV inserted\", \"Awaiting physician signature\", etc." + }, + "mapping": [ + { + "identity": "rim", + "map": ".inboundRelationship[typeCode=SUBJ].source[classCode=OBS, moodCode=EVN, code=\"business status\"]" + } + ] + }, + { + "id": "Task.intent", + "path": "Task.intent", + "short": "unknown | proposal | plan | order | original-order | reflex-order | filler-order | instance-order | option", + "definition": "Indicates the \"level\" of actionability associated with the Task, i.e. i+R[9]Cs this a proposed task, a planned task, an actionable task, etc.", + "comment": "This element is immutable. Proposed tasks, planned tasks, etc. must be distinct instances.\n\nIn most cases, Tasks will have an intent of \"order\".", + "min": 1, + "max": "1", + "base": { + "path": "Task.intent", + "min": 1, + "max": "1" + }, + "type": [ + { + "code": "code" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "TaskIntent" + } + ], + "strength": "required", + "description": "Distinguishes whether the task is a proposal, plan or full order.", + "valueSet": "http://hl7.org/fhir/ValueSet/task-intent|4.0.1" + }, + "mapping": [ + { + "identity": "workflow", + "map": "Request.intent" + }, + { + "identity": "w5", + "map": "FiveWs.class" + }, + { + "identity": "rim", + "map": ".moodCode" + } + ] + }, + { + "id": "Task.priority", + "path": "Task.priority", + "short": "routine | urgent | asap | stat", + "definition": "Indicates how quickly the Task should be addressed with respect to other requests.", + "requirements": "Used to identify the service level expected while performing a task.", + "min": 0, + "max": "1", + "base": { + "path": "Task.priority", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "code" + } + ], + "meaningWhenMissing": "If missing, this task should be performed with normal priority", + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "TaskPriority" + } + ], + "strength": "required", + "description": "The task's priority.", + "valueSet": "http://hl7.org/fhir/ValueSet/request-priority|4.0.1" + }, + "mapping": [ + { + "identity": "workflow", + "map": "Request.priority" + }, + { + "identity": "w5", + "map": "FiveWs.grade" + }, + { + "identity": "rim", + "map": ".priorityCode" + } + ] + }, + { + "id": "Task.code", + "path": "Task.code", + "short": "Task Type", + "definition": "A name or code (or both) briefly describing what the task involves.", + "comment": "The title (eg \"My Tasks\", \"Outstanding Tasks for Patient X\") should go into the code.", + "min": 1, + "max": "1", + "base": { + "path": "Task.code", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "patternCodeableConcept": { + "coding": [ + { + "code": "compact", + "system": "https://samply.github.io/blaze/fhir/CodeSystem/JobType", + "display": "Compact Database Column Families" + } + ] + }, + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "TaskCode" + } + ], + "strength": "example", + "description": "Codes to identify what the task involves. These will typically be specific to a particular workflow.", + "valueSet": "http://hl7.org/fhir/ValueSet/task-code" + }, + "mapping": [ + { + "identity": "workflow", + "map": "Request.code, Event.code" + }, + { + "identity": "w5", + "map": "FiveWs.what[x]" + }, + { + "identity": "rim", + "map": ".code" + } + ] + }, + { + "id": "Task.description", + "path": "Task.description", + "short": "Human-readable explanation of task", + "definition": "A free-text description of what is to be performed.", + "min": 0, + "max": "1", + "base": { + "path": "Task.description", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "string" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "rim", + "map": ".text" + } + ] + }, + { + "id": "Task.focus", + "path": "Task.focus", + "short": "What task is acting on", + "definition": "The request being actioned or the resource being manipulated by this task.", + "comment": "If multiple resources need to be manipulated, use sub-tasks. (This ensures that status can be tracked independently for each referenced resource.).", + "requirements": "Used to identify the thing to be done.", + "min": 0, + "max": "1", + "base": { + "path": "Task.focus", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Reference", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/Resource" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "w5", + "map": "FiveWs.what[x]" + }, + { + "identity": "rim", + "map": ".outboundRelationship[typeCode=SUBJ].target" + } + ] + }, + { + "id": "Task.for", + "path": "Task.for", + "short": "Beneficiary of the Task", + "definition": "The entity who benefits from the performance of the service specified in the task (e.g., the patient).", + "requirements": "Used to track tasks outstanding for a beneficiary. Do not use to track the task owner or creator (see owner and creator respectively). This can also affect access control.", + "alias": [ + "Patient" + ], + "min": 0, + "max": "1", + "base": { + "path": "Task.for", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Reference", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/Resource" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "workflow", + "map": "Request.subject, Event.subject" + }, + { + "identity": "w5", + "map": "FiveWs.subject[x]" + }, + { + "identity": "rim", + "map": ".participation[typeCode=RCT].role" + }, + { + "identity": "w5", + "map": "FiveWs.subject" + } + ] + }, + { + "id": "Task.encounter", + "path": "Task.encounter", + "short": "Healthcare event during which this task originated", + "definition": "The healthcare event (e.g. a patient and healthcare provider interaction) during which this task was created.", + "requirements": "For some tasks it may be important to know the link between the encounter the task originated within.", + "min": 0, + "max": "1", + "base": { + "path": "Task.encounter", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Reference", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/Encounter" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "workflow", + "map": "Request.context, Event.context" + }, + { + "identity": "w5", + "map": "FiveWs.context" + }, + { + "identity": "rim", + "map": ".inboundRelationship[typeCode=COMP].source[classCode=PCPR, moodCode=EVN]" + } + ] + }, + { + "id": "Task.executionPeriod", + "path": "Task.executionPeriod", + "short": "Start and end time of execution", + "definition": "Identifies the time action was first taken against the task (start) and/or the time final action was taken against the task prior to marking it as completed (end).", + "min": 0, + "max": "1", + "base": { + "path": "Task.executionPeriod", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Period" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "workflow", + "map": "Event.occurrence[x]" + }, + { + "identity": "w5", + "map": "FiveWs.done[x]" + }, + { + "identity": "rim", + "map": ".effectiveTime" + } + ] + }, + { + "id": "Task.authoredOn", + "path": "Task.authoredOn", + "short": "Task Creation Date", + "definition": "The date and time this task was created.", + "requirements": "Most often used along with lastUpdated to track duration of task to supporting monitoring and management.", + "alias": [ + "Created Date" + ], + "min": 1, + "max": "1", + "base": { + "path": "Task.authoredOn", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "dateTime" + } + ], + "condition": [ + "inv-1" + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "workflow", + "map": "Request.authoredOn" + }, + { + "identity": "w5", + "map": "FiveWs.recorded" + }, + { + "identity": "rim", + "map": ".participation[typeCode=AUT].time" + } + ] + }, + { + "id": "Task.lastModified", + "path": "Task.lastModified", + "short": "Task Last Modified Date", + "definition": "The date and time of last modification to this task.", + "requirements": "Used along with history to track task activity and time in a particular task state. This enables monitoring and management.", + "alias": [ + "Update Date" + ], + "min": 0, + "max": "1", + "base": { + "path": "Task.lastModified", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "dateTime" + } + ], + "condition": [ + "inv-1" + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "rim", + "map": ".inboundRelationship[typeCode=SUBJ, ].source[classCode=CACT, moodCode=EVN].effectiveTime" + } + ] + }, + { + "id": "Task.requester", + "path": "Task.requester", + "short": "Who is asking for task to be done", + "definition": "The creator of the task.", + "requirements": "Identifies who created this task. May be used by access control mechanisms (e.g., to ensure that only the creator can cancel a task).", + "min": 0, + "max": "1", + "base": { + "path": "Task.requester", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Reference", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/Device", + "http://hl7.org/fhir/StructureDefinition/Organization", + "http://hl7.org/fhir/StructureDefinition/Patient", + "http://hl7.org/fhir/StructureDefinition/Practitioner", + "http://hl7.org/fhir/StructureDefinition/PractitionerRole", + "http://hl7.org/fhir/StructureDefinition/RelatedPerson" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "workflow", + "map": "Request.requester" + }, + { + "identity": "w5", + "map": "FiveWs.author" + }, + { + "identity": "rim", + "map": ".participation[typeCode=AUT].role" + } + ] + }, + { + "id": "Task.performerType", + "path": "Task.performerType", + "short": "Requested performer", + "definition": "The kind of participant that should perform the task.", + "requirements": "Use to distinguish tasks on different activity queues.", + "min": 0, + "max": "*", + "base": { + "path": "Task.performerType", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "TaskPerformerType" + } + ], + "strength": "preferred", + "description": "The type(s) of task performers allowed.", + "valueSet": "http://hl7.org/fhir/ValueSet/performer-role" + }, + "mapping": [ + { + "identity": "workflow", + "map": "Event.performer.role, Request.performerType" + }, + { + "identity": "w5", + "map": "FiveWs.actor" + }, + { + "identity": "rim", + "map": ".participation[typeCode=PRF].role.code" + } + ] + }, + { + "id": "Task.owner", + "path": "Task.owner", + "short": "Responsible individual", + "definition": "Individual organization or Device currently responsible for task execution.", + "comment": "Tasks may be created with an owner not yet identified.", + "requirements": "Identifies who is expected to perform this task.", + "alias": [ + "Performer", + "Executer" + ], + "min": 0, + "max": "1", + "base": { + "path": "Task.owner", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Reference", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/Practitioner", + "http://hl7.org/fhir/StructureDefinition/PractitionerRole", + "http://hl7.org/fhir/StructureDefinition/Organization", + "http://hl7.org/fhir/StructureDefinition/CareTeam", + "http://hl7.org/fhir/StructureDefinition/HealthcareService", + "http://hl7.org/fhir/StructureDefinition/Patient", + "http://hl7.org/fhir/StructureDefinition/Device", + "http://hl7.org/fhir/StructureDefinition/RelatedPerson" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "workflow", + "map": "Event.performer.actor, Request.performer" + }, + { + "identity": "w5", + "map": "FiveWs.actor" + }, + { + "identity": "rim", + "map": ".participation[typeCode=PRF].role" + } + ] + }, + { + "id": "Task.location", + "path": "Task.location", + "short": "Where task occurs", + "definition": "Principal physical location where the this task is performed.", + "requirements": "Ties the event to where the records are likely kept and provides context around the event occurrence (e.g. if it occurred inside or outside a dedicated healthcare setting).", + "min": 0, + "max": "1", + "base": { + "path": "Task.location", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Reference", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/Location" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": true, + "mapping": [ + { + "identity": "workflow", + "map": "Request.reasonCode, Event.reasonCode" + }, + { + "identity": "w5", + "map": "FiveWs.where[x]" + }, + { + "identity": "rim", + "map": ".participation[typeCode=LOC].role" + } + ] + }, + { + "id": "Task.reasonCode", + "path": "Task.reasonCode", + "short": "Why task is needed", + "definition": "A description or code indicating why this task needs to be performed.", + "comment": "This should only be included if there is no focus or if it differs from the reason indicated on the focus.", + "min": 0, + "max": "1", + "base": { + "path": "Task.reasonCode", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "TaskReason" + } + ], + "strength": "example", + "description": "Indicates why the task is needed. E.g. Suspended because patient admitted to hospital." + }, + "mapping": [ + { + "identity": "workflow", + "map": "Event.location" + }, + { + "identity": "w5", + "map": "FiveWs.why[x]" + }, + { + "identity": "v2", + "map": "EVN.7" + }, + { + "identity": "rim", + "map": ".reasonCode" + } + ] + }, + { + "id": "Task.reasonReference", + "path": "Task.reasonReference", + "short": "Why task is needed", + "definition": "A resource reference indicating why this task needs to be performed.", + "comment": "Tasks might be justified based on an Observation, a Condition, a past or planned procedure, etc. This should only be included if there is no focus or if it differs from the reason indicated on the focus. Use the CodeableConcept text element in `Task.reasonCode` if the data is free (uncoded) text.", + "min": 0, + "max": "1", + "base": { + "path": "Task.reasonReference", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Reference", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/Resource" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "workflow", + "map": "Request.reasonReference, Event.reasonReference" + }, + { + "identity": "w5", + "map": "FiveWs.why[x]" + }, + { + "identity": "rim", + "map": ".outboundRelationship[typeCode=RSON].target" + } + ] + }, + { + "id": "Task.insurance", + "path": "Task.insurance", + "short": "Associated insurance coverage", + "definition": "Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be relevant to the Task.", + "min": 0, + "max": "*", + "base": { + "path": "Task.insurance", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Reference", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/Coverage", + "http://hl7.org/fhir/StructureDefinition/ClaimResponse" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "workflow", + "map": "Request.insurance" + }, + { + "identity": "v2", + "map": "IN1/IN2" + }, + { + "identity": "rim", + "map": ".outboundRelationship[typeCode=COVBY].target" + } + ] + }, + { + "id": "Task.note", + "path": "Task.note", + "short": "Comments made about the task", + "definition": "Free-text information captured about the task as it progresses.", + "min": 0, + "max": "*", + "base": { + "path": "Task.note", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Annotation" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "workflow", + "map": "Request.note, Event.note" + }, + { + "identity": "rim", + "map": ".inboundRelationship[typeCode=SUBJ, ].source[classCode=OBS, moodCode=EVN, code=\"annotation\"].value(string)" + } + ] + }, + { + "id": "Task.relevantHistory", + "path": "Task.relevantHistory", + "short": "Key events in history of the Task", + "definition": "Links to Provenance records for past versions of this Task that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the task.", + "comment": "This element does not point to the Provenance associated with the *current* version of the resource - as it would be created after this version existed. The Provenance for the current version can be retrieved with a _revinclude.", + "alias": [ + "Status History" + ], + "min": 0, + "max": "*", + "base": { + "path": "Task.relevantHistory", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Reference", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/Provenance" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "workflow", + "map": "Request.relevantHistory" + }, + { + "identity": "rim", + "map": ".inboundRelationship(typeCode=SUBJ].source[classCode=CACT, moodCode=EVN]" + } + ] + }, + { + "id": "Task.restriction", + "path": "Task.restriction", + "short": "Constraints on fulfillment tasks", + "definition": "If the Task.focus is a request resource and the task is seeking fulfillment (i.e. is asking for the request to be actioned), this element identifies any limitations on what parts of the referenced request should be actioned.", + "requirements": "Sometimes when fulfillment is sought, you don't want full fulfillment.", + "min": 0, + "max": "1", + "base": { + "path": "Task.restriction", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "BackboneElement" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "Instead of pointing to request, would point to component of request, having these characteristics" + } + ] + }, + { + "id": "Task.restriction.id", + "path": "Task.restriction.id", + "representation": [ + "xmlAttr" + ], + "short": "Unique id for inter-element referencing", + "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.", + "min": 0, + "max": "1", + "base": { + "path": "Element.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "http://hl7.org/fhirpath/System.String", + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "string" + } + ] + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Task.restriction.extension", + "path": "Task.restriction.extension", + "short": "Additional content defined by implementations", + "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "Element.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Task.restriction.modifierExtension", + "path": "Task.restriction.modifierExtension", + "short": "Extensions that cannot be ignored even if unrecognized", + "definition": "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](extensibility.html#modifierExtension).", + "alias": [ + "extensions", + "user content", + "modifiers" + ], + "min": 0, + "max": "*", + "base": { + "path": "BackboneElement.modifierExtension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": true, + "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the element that contains them", + "isSummary": true, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "Task.restriction.repetitions", + "path": "Task.restriction.repetitions", + "short": "How many times to repeat", + "definition": "Indicates the number of times the requested action should occur.", + "requirements": "E.g. order that requests monthly lab tests, fulfillment is sought for 1.", + "min": 0, + "max": "1", + "base": { + "path": "Task.restriction.repetitions", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "positiveInt" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": ".repeatNumber" + } + ] + }, + { + "id": "Task.restriction.period", + "path": "Task.restriction.period", + "short": "When fulfillment sought", + "definition": "Over what time-period is fulfillment sought.", + "comment": "Note that period.high is the due date representing the time by which the task should be completed.", + "requirements": "E.g. order that authorizes 1 year's services. Fulfillment is sought for next 3 months.", + "min": 0, + "max": "1", + "base": { + "path": "Task.restriction.period", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "Period" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": ".effectiveTime(IVL)" + } + ] + }, + { + "id": "Task.restriction.recipient", + "path": "Task.restriction.recipient", + "short": "For whom is fulfillment sought?", + "definition": "For requests that are targeted to more than on potential recipient/target, for whom is fulfillment sought?", + "min": 0, + "max": "*", + "base": { + "path": "Task.restriction.recipient", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Reference", + "targetProfile": [ + "http://hl7.org/fhir/StructureDefinition/Patient", + "http://hl7.org/fhir/StructureDefinition/Practitioner", + "http://hl7.org/fhir/StructureDefinition/PractitionerRole", + "http://hl7.org/fhir/StructureDefinition/RelatedPerson", + "http://hl7.org/fhir/StructureDefinition/Group", + "http://hl7.org/fhir/StructureDefinition/Organization" + ] + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": ".participation[typeCode=SBJ].role" + } + ] + }, + { + "id": "Task.input", + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name", + "valueString": "Parameter" + } + ], + "path": "Task.input", + "slicing": { + "discriminator": [ + { + "type": "pattern", + "path": "type" + } + ], + "rules": "closed" + }, + "short": "Information used to perform task", + "definition": "Additional information that may be needed in the execution of the task.", + "requirements": "Resources and data used to perform the task. This data is used in the business logic of task execution, and is stored separately because it varies between workflows.", + "alias": [ + "Supporting Information" + ], + "min": 1, + "max": "*", + "base": { + "path": "Task.input", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "BackboneElement" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "???" + } + ] + }, + { + "id": "Task.input.id", + "path": "Task.input.id", + "representation": [ + "xmlAttr" + ], + "short": "Unique id for inter-element referencing", + "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.", + "min": 0, + "max": "1", + "base": { + "path": "Element.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "http://hl7.org/fhirpath/System.String", + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "string" + } + ] + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Task.input.extension", + "path": "Task.input.extension", + "short": "Additional content defined by implementations", + "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "Element.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Task.input.modifierExtension", + "path": "Task.input.modifierExtension", + "short": "Extensions that cannot be ignored even if unrecognized", + "definition": "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](extensibility.html#modifierExtension).", + "alias": [ + "extensions", + "user content", + "modifiers" + ], + "min": 0, + "max": "*", + "base": { + "path": "BackboneElement.modifierExtension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": true, + "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the element that contains them", + "isSummary": true, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "Task.input.type", + "path": "Task.input.type", + "short": "Label for the input", + "definition": "A code or description indicating how the input is intended to be used as part of the task execution.", + "comment": "If referencing a BPMN workflow or Protocol, the \"system\" is the URL for the workflow definition and the code is the \"name\" of the required input.", + "requirements": "Inputs are named to enable task automation to bind data and pass it from one task to the next.", + "alias": [ + "Name" + ], + "min": 1, + "max": "1", + "base": { + "path": "Task.input.type", + "min": 1, + "max": "1" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "TaskInputParameterType" + } + ], + "strength": "example", + "description": "Codes to identify types of input parameters. These will typically be specific to a particular workflow. E.g. \"Comparison source\", \"Applicable consent\", \"Concomitent Medications\", etc." + }, + "mapping": [ + { + "identity": "rim", + "map": "???" + } + ] + }, + { + "id": "Task.input.value[x]", + "path": "Task.input.value[x]", + "short": "Content to use in performing the task", + "definition": "The value of the input parameter as a basic type.", + "min": 1, + "max": "1", + "base": { + "path": "Task.input.value[x]", + "min": 1, + "max": "1" + }, + "type": [ + { + "code": "base64Binary" + }, + { + "code": "boolean" + }, + { + "code": "canonical" + }, + { + "code": "code" + }, + { + "code": "date" + }, + { + "code": "dateTime" + }, + { + "code": "decimal" + }, + { + "code": "id" + }, + { + "code": "instant" + }, + { + "code": "integer" + }, + { + "code": "markdown" + }, + { + "code": "oid" + }, + { + "code": "positiveInt" + }, + { + "code": "string" + }, + { + "code": "time" + }, + { + "code": "unsignedInt" + }, + { + "code": "uri" + }, + { + "code": "url" + }, + { + "code": "uuid" + }, + { + "code": "Address" + }, + { + "code": "Age" + }, + { + "code": "Annotation" + }, + { + "code": "Attachment" + }, + { + "code": "CodeableConcept" + }, + { + "code": "Coding" + }, + { + "code": "ContactPoint" + }, + { + "code": "Count" + }, + { + "code": "Distance" + }, + { + "code": "Duration" + }, + { + "code": "HumanName" + }, + { + "code": "Identifier" + }, + { + "code": "Money" + }, + { + "code": "Period" + }, + { + "code": "Quantity" + }, + { + "code": "Range" + }, + { + "code": "Ratio" + }, + { + "code": "Reference" + }, + { + "code": "SampledData" + }, + { + "code": "Signature" + }, + { + "code": "Timing" + }, + { + "code": "ContactDetail" + }, + { + "code": "Contributor" + }, + { + "code": "DataRequirement" + }, + { + "code": "Expression" + }, + { + "code": "ParameterDefinition" + }, + { + "code": "RelatedArtifact" + }, + { + "code": "TriggerDefinition" + }, + { + "code": "UsageContext" + }, + { + "code": "Dosage" + }, + { + "code": "Meta" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "???" + } + ] + }, + { + "id": "Task.input:columnFamilyName", + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name", + "valueString": "Parameter" + } + ], + "path": "Task.input", + "sliceName": "columnFamilyName", + "short": "Column Family Name", + "definition": "The name of the column family to compact.", + "requirements": "Resources and data used to perform the task. This data is used in the business logic of task execution, and is stored separately because it varies between workflows.", + "alias": [ + "Supporting Information" + ], + "min": 1, + "max": "1", + "base": { + "path": "Task.input", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "BackboneElement" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "???" + } + ] + }, + { + "id": "Task.input:columnFamilyName.id", + "path": "Task.input.id", + "representation": [ + "xmlAttr" + ], + "short": "Unique id for inter-element referencing", + "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.", + "min": 0, + "max": "1", + "base": { + "path": "Element.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "http://hl7.org/fhirpath/System.String", + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "string" + } + ] + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Task.input:columnFamilyName.extension", + "path": "Task.input.extension", + "short": "Additional content defined by implementations", + "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "Element.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Task.input:columnFamilyName.modifierExtension", + "path": "Task.input.modifierExtension", + "short": "Extensions that cannot be ignored even if unrecognized", + "definition": "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](extensibility.html#modifierExtension).", + "alias": [ + "extensions", + "user content", + "modifiers" + ], + "min": 0, + "max": "*", + "base": { + "path": "BackboneElement.modifierExtension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": true, + "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the element that contains them", + "isSummary": true, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "Task.input:columnFamilyName.type", + "path": "Task.input.type", + "short": "Label for the input", + "definition": "A code or description indicating how the input is intended to be used as part of the task execution.", + "comment": "If referencing a BPMN workflow or Protocol, the \"system\" is the URL for the workflow definition and the code is the \"name\" of the required input.", + "requirements": "Inputs are named to enable task automation to bind data and pass it from one task to the next.", + "alias": [ + "Name" + ], + "min": 1, + "max": "1", + "base": { + "path": "Task.input.type", + "min": 1, + "max": "1" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "patternCodeableConcept": { + "coding": [ + { + "code": "column-family-name", + "system": "https://samply.github.io/blaze/fhir/CodeSystem/CompactJobParameter" + } + ] + }, + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "TaskInputParameterType" + } + ], + "strength": "example", + "description": "Codes to identify types of input parameters. These will typically be specific to a particular workflow. E.g. \"Comparison source\", \"Applicable consent\", \"Concomitent Medications\", etc." + }, + "mapping": [ + { + "identity": "rim", + "map": "???" + } + ] + }, + { + "id": "Task.input:columnFamilyName.value[x]", + "path": "Task.input.value[x]", + "short": "Content to use in performing the task", + "definition": "The value of the input parameter as a basic type.", + "min": 1, + "max": "1", + "base": { + "path": "Task.input.value[x]", + "min": 1, + "max": "1" + }, + "type": [ + { + "code": "string" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "???" + } + ] + }, + { + "id": "Task.output", + "path": "Task.output", + "slicing": { + "discriminator": [ + { + "type": "pattern", + "path": "type" + } + ], + "rules": "closed" + }, + "short": "Information produced as part of task", + "definition": "Outputs produced by the Task.", + "requirements": "Resources and data produced during the execution the task. This data is generated by the business logic of task execution, and is stored separately because it varies between workflows.", + "min": 0, + "max": "*", + "base": { + "path": "Task.output", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "BackboneElement" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "???" + } + ] + }, + { + "id": "Task.output.id", + "path": "Task.output.id", + "representation": [ + "xmlAttr" + ], + "short": "Unique id for inter-element referencing", + "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.", + "min": 0, + "max": "1", + "base": { + "path": "Element.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "http://hl7.org/fhirpath/System.String", + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "string" + } + ] + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Task.output.extension", + "path": "Task.output.extension", + "short": "Additional content defined by implementations", + "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "Element.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Task.output.modifierExtension", + "path": "Task.output.modifierExtension", + "short": "Extensions that cannot be ignored even if unrecognized", + "definition": "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](extensibility.html#modifierExtension).", + "alias": [ + "extensions", + "user content", + "modifiers" + ], + "min": 0, + "max": "*", + "base": { + "path": "BackboneElement.modifierExtension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": true, + "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the element that contains them", + "isSummary": true, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "Task.output.type", + "path": "Task.output.type", + "short": "Label for output", + "definition": "The name of the Output parameter.", + "requirements": "Outputs are named to enable task automation to bind data and pass it from one task to the next.", + "alias": [ + "Name" + ], + "min": 1, + "max": "1", + "base": { + "path": "Task.output.type", + "min": 1, + "max": "1" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "TaskOutputParameterType" + } + ], + "strength": "example", + "description": "Codes to identify types of input parameters. These will typically be specific to a particular workflow. E.g. \"Identified issues\", \"Preliminary results\", \"Filler order\", \"Final results\", etc." + }, + "mapping": [ + { + "identity": "rim", + "map": "???" + } + ] + }, + { + "id": "Task.output.value[x]", + "path": "Task.output.value[x]", + "short": "Result of output", + "definition": "The value of the Output parameter as a basic type.", + "requirements": "Task outputs can take any form.", + "min": 1, + "max": "1", + "base": { + "path": "Task.output.value[x]", + "min": 1, + "max": "1" + }, + "type": [ + { + "code": "base64Binary" + }, + { + "code": "boolean" + }, + { + "code": "canonical" + }, + { + "code": "code" + }, + { + "code": "date" + }, + { + "code": "dateTime" + }, + { + "code": "decimal" + }, + { + "code": "id" + }, + { + "code": "instant" + }, + { + "code": "integer" + }, + { + "code": "markdown" + }, + { + "code": "oid" + }, + { + "code": "positiveInt" + }, + { + "code": "string" + }, + { + "code": "time" + }, + { + "code": "unsignedInt" + }, + { + "code": "uri" + }, + { + "code": "url" + }, + { + "code": "uuid" + }, + { + "code": "Address" + }, + { + "code": "Age" + }, + { + "code": "Annotation" + }, + { + "code": "Attachment" + }, + { + "code": "CodeableConcept" + }, + { + "code": "Coding" + }, + { + "code": "ContactPoint" + }, + { + "code": "Count" + }, + { + "code": "Distance" + }, + { + "code": "Duration" + }, + { + "code": "HumanName" + }, + { + "code": "Identifier" + }, + { + "code": "Money" + }, + { + "code": "Period" + }, + { + "code": "Quantity" + }, + { + "code": "Range" + }, + { + "code": "Ratio" + }, + { + "code": "Reference" + }, + { + "code": "SampledData" + }, + { + "code": "Signature" + }, + { + "code": "Timing" + }, + { + "code": "ContactDetail" + }, + { + "code": "Contributor" + }, + { + "code": "DataRequirement" + }, + { + "code": "Expression" + }, + { + "code": "ParameterDefinition" + }, + { + "code": "RelatedArtifact" + }, + { + "code": "TriggerDefinition" + }, + { + "code": "UsageContext" + }, + { + "code": "Dosage" + }, + { + "code": "Meta" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "???" + } + ] + }, + { + "id": "Task.output:error", + "path": "Task.output", + "sliceName": "error", + "short": "Error", + "definition": "Error message.", + "requirements": "Resources and data produced during the execution the task. This data is generated by the business logic of task execution, and is stored separately because it varies between workflows.", + "min": 0, + "max": "1", + "base": { + "path": "Task.output", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "BackboneElement" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "???" + } + ] + }, + { + "id": "Task.output:error.id", + "path": "Task.output.id", + "representation": [ + "xmlAttr" + ], + "short": "Unique id for inter-element referencing", + "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.", + "min": 0, + "max": "1", + "base": { + "path": "Element.id", + "min": 0, + "max": "1" + }, + "type": [ + { + "code": "http://hl7.org/fhirpath/System.String", + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type", + "valueUrl": "string" + } + ] + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Task.output:error.extension", + "path": "Task.output.extension", + "short": "Additional content defined by implementations", + "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "alias": [ + "extensions", + "user content" + ], + "min": 0, + "max": "*", + "base": { + "path": "Element.extension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "n/a" + } + ] + }, + { + "id": "Task.output:error.modifierExtension", + "path": "Task.output.modifierExtension", + "short": "Extensions that cannot be ignored even if unrecognized", + "definition": "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).", + "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.", + "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](extensibility.html#modifierExtension).", + "alias": [ + "extensions", + "user content", + "modifiers" + ], + "min": 0, + "max": "*", + "base": { + "path": "BackboneElement.modifierExtension", + "min": 0, + "max": "*" + }, + "type": [ + { + "code": "Extension" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + }, + { + "key": "ext-1", + "severity": "error", + "human": "Must have either extensions or value[x], not both", + "expression": "extension.exists() != value.exists()", + "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])", + "source": "http://hl7.org/fhir/StructureDefinition/Extension" + } + ], + "isModifier": true, + "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the element that contains them", + "isSummary": true, + "mapping": [ + { + "identity": "rim", + "map": "N/A" + } + ] + }, + { + "id": "Task.output:error.type", + "path": "Task.output.type", + "short": "Label for output", + "definition": "The name of the Output parameter.", + "requirements": "Outputs are named to enable task automation to bind data and pass it from one task to the next.", + "alias": [ + "Name" + ], + "min": 1, + "max": "1", + "base": { + "path": "Task.output.type", + "min": 1, + "max": "1" + }, + "type": [ + { + "code": "CodeableConcept" + } + ], + "patternCodeableConcept": { + "coding": [ + { + "code": "error", + "system": "https://samply.github.io/blaze/fhir/CodeSystem/JobOutput" + } + ] + }, + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "binding": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName", + "valueString": "TaskOutputParameterType" + } + ], + "strength": "example", + "description": "Codes to identify types of input parameters. These will typically be specific to a particular workflow. E.g. \"Identified issues\", \"Preliminary results\", \"Filler order\", \"Final results\", etc." + }, + "mapping": [ + { + "identity": "rim", + "map": "???" + } + ] + }, + { + "id": "Task.output:error.value[x]", + "path": "Task.output.value[x]", + "short": "Result of output", + "definition": "The value of the Output parameter as a basic type.", + "requirements": "Task outputs can take any form.", + "min": 1, + "max": "1", + "base": { + "path": "Task.output.value[x]", + "min": 1, + "max": "1" + }, + "type": [ + { + "code": "string" + } + ], + "constraint": [ + { + "key": "ele-1", + "severity": "error", + "human": "All FHIR elements must have a @value or children", + "expression": "hasValue() or (children().count() > id.count())", + "xpath": "@value|f:*|h:div", + "source": "http://hl7.org/fhir/StructureDefinition/Element" + } + ], + "isModifier": false, + "isSummary": false, + "mapping": [ + { + "identity": "rim", + "map": "???" + } + ] + } + ] + }, + "differential": { + "element": [ + { + "id": "Task.code", + "path": "Task.code", + "patternCodeableConcept": { + "coding": [ + { + "code": "compact", + "system": "https://samply.github.io/blaze/fhir/CodeSystem/JobType", + "display": "Compact Database Column Families" + } + ] + } + }, + { + "id": "Task.input", + "path": "Task.input", + "slicing": { + "discriminator": [ + { + "type": "pattern", + "path": "type" + } + ], + "rules": "closed" + }, + "min": 1 + }, + { + "id": "Task.input:columnFamilyName", + "path": "Task.input", + "sliceName": "columnFamilyName", + "short": "Column Family Name", + "definition": "The name of the column family to compact.", + "min": 1, + "max": "1" + }, + { + "id": "Task.input:columnFamilyName.type", + "path": "Task.input.type", + "patternCodeableConcept": { + "coding": [ + { + "code": "column-family-name", + "system": "https://samply.github.io/blaze/fhir/CodeSystem/CompactJobParameter" + } + ] + } + }, + { + "id": "Task.input:columnFamilyName.value[x]", + "path": "Task.input.value[x]", + "type": [ + { + "code": "string" + } + ] + } + ] + } +} diff --git a/modules/admin-api/src/blaze/admin_api.clj b/modules/admin-api/src/blaze/admin_api.clj index 92101fe59..09e41e3e8 100644 --- a/modules/admin-api/src/blaze/admin_api.clj +++ b/modules/admin-api/src/blaze/admin_api.clj @@ -18,6 +18,7 @@ [blaze.middleware.fhir.output :as fhir-output] [blaze.middleware.fhir.resource :as resource] [blaze.middleware.output :as output] + [blaze.module :as m] [blaze.spec] [clojure.datafy :as datafy] [clojure.spec.alpha :as s] @@ -29,13 +30,18 @@ [ring.util.response :as ring] [taoensso.timbre :as log]) (:import + [ca.uhn.fhir.context FhirContext] + [ca.uhn.fhir.context.support DefaultProfileValidationSupport] + [ca.uhn.fhir.validation FhirValidator] [com.google.common.base CaseFormat] [java.io File] + [java.nio.charset StandardCharsets] [java.nio.file Files] - [java.util ArrayList] - [org.hl7.fhir.r5.elementmodel Manager$FhirFormat] - [org.hl7.fhir.r5.formats FormatUtilities] - [org.hl7.fhir.validation ValidationEngine ValidationEngine$ValidationEngineBuilder])) + [org.hl7.fhir.common.hapi.validation.support + CommonCodeSystemsTerminologyService + InMemoryTerminologyServerValidationSupport PrePopulatedValidationSupport + ValidationSupportChain] + [org.hl7.fhir.common.hapi.validation.validator FhirInstanceValidator])) (set! *warn-on-reflection* true) @@ -172,12 +178,12 @@ :details #fhir/CodeableConcept {:text "No allowed profile found."}}]}))) -(defn- validate [validator resource] - (-> (.validate ^ValidationEngine validator - ^bytes (fhir-spec/unform-json resource) - Manager$FhirFormat/JSON - (ArrayList.) - (ArrayList.)) +(defn- unform-json [resource] + (String. ^bytes (fhir-spec/unform-json resource) StandardCharsets/UTF_8)) + +(defn- validate [^FhirValidator validator resource] + (-> (.validateWithResult validator ^String (unform-json resource)) + (.toOperationOutcome) (datafy/datafy))) (defn- error-issues [outcome] @@ -379,23 +385,38 @@ {:path (str context-path "/__admin") :syntax :bracket})) -(defn- load-profile [name] +(defn- load-profile [context name] (log/debug "Load profile" name) - (let [parser (FormatUtilities/makeParser Manager$FhirFormat/JSON) + (let [parser (.newJsonParser ^FhirContext context) classloader (.getContextClassLoader (Thread/currentThread)) - source (.readAllBytes (.getResourceAsStream classloader name))] - (.parse parser source))) + source (.getResourceAsStream classloader name)] + (.parseResource parser source))) + +(defn- profile-validation-support [context] + (let [s (PrePopulatedValidationSupport. context)] + (run! + #(.addResource s (load-profile context %)) + ["blaze/job_scheduler/CodeSystem-JobType.json" + "blaze/job_scheduler/CodeSystem-JobOutput.json" + "blaze/job_scheduler/StructureDefinition-Job.json" + "blaze/job/re_index/CodeSystem-ReIndexJobParameter.json" + "blaze/job/re_index/CodeSystem-ReIndexJobOutput.json" + "blaze/job/re_index/StructureDefinition-ReIndexJob.json" + "blaze/admin_api/StructureDefinition-CompactJob.json"]) + s)) (defn- create-validator* [] - (doto (-> (ValidationEngine$ValidationEngineBuilder.) - (.withNoTerminologyServer) - (.fromSource "hl7.fhir.r4.core#4.0.1")) - (.seeResource (load-profile "blaze/job_scheduler/CodeSystem-JobType.json")) - (.seeResource (load-profile "blaze/job_scheduler/CodeSystem-JobOutput.json")) - (.seeResource (load-profile "blaze/job_scheduler/StructureDefinition-Job.json")) - (.seeResource (load-profile "blaze/job/re_index/CodeSystem-ReIndexJobParameter.json")) - (.seeResource (load-profile "blaze/job/re_index/CodeSystem-ReIndexJobOutput.json")) - (.seeResource (load-profile "blaze/job/re_index/StructureDefinition-ReIndexJob.json")))) + (let [context (FhirContext/forR4) + _ (.newJsonParser context) + validator (.newValidator context) + chain (doto (ValidationSupportChain.) + (.addValidationSupport (DefaultProfileValidationSupport. context)) + (.addValidationSupport (InMemoryTerminologyServerValidationSupport. context)) + (.addValidationSupport (CommonCodeSystemsTerminologyService. context)) + (.addValidationSupport (profile-validation-support context))) + instanceValidator (FhirInstanceValidator. chain)] + (.registerValidatorModule validator instanceValidator) + validator)) (defn- create-validator [] (try @@ -431,7 +452,7 @@ (ring/header "Last-Modified" (fhir-util/last-modified tx)) (ring/header "ETag" (fhir-util/etag tx))))))) -(defmethod ig/pre-init-spec :blaze/admin-api [_] +(defmethod m/pre-init-spec :blaze/admin-api [_] (s/keys :req-un [:blaze/context-path ::admin-node :blaze/job-scheduler ::read-job-handler ::search-type-job-handler ::settings ::features] diff --git a/modules/admin-api/src/blaze/admin_api/validation.clj b/modules/admin-api/src/blaze/admin_api/validation.clj index 00f2533ba..a24da0bee 100644 --- a/modules/admin-api/src/blaze/admin_api/validation.clj +++ b/modules/admin-api/src/blaze/admin_api/validation.clj @@ -4,11 +4,11 @@ [clojure.core.protocols :as p] [clojure.datafy :as datafy]) (:import - [org.hl7.fhir.r5.model + [org.hl7.fhir.r4.model CodeableConcept OperationOutcome OperationOutcome$OperationOutcomeIssueComponent])) -(set! *warn-on-reflection* true) +(set! *warn-on-reflection* true) (extend-protocol p/Datafiable OperationOutcome @@ -24,7 +24,9 @@ (.hasCode issue) (assoc :code (type/code (.toCode (.getCode issue)))) (.hasDetails issue) - (assoc :details (datafy/datafy (.getDetails issue))))) + (assoc :details (datafy/datafy (.getDetails issue))) + (.hasDiagnostics issue) + (assoc :diagnostics (.getDiagnostics issue)))) CodeableConcept (datafy [concept] diff --git a/modules/admin-api/test/blaze/admin_api_test.clj b/modules/admin-api/test/blaze/admin_api_test.clj index d577a0ada..a301e55e1 100644 --- a/modules/admin-api/test/blaze/admin_api_test.clj +++ b/modules/admin-api/test/blaze/admin_api_test.clj @@ -210,75 +210,75 @@ (given-thrown (ig/init {:blaze/admin-api nil}) :key := :blaze/admin-api :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze/admin-api {}}) :key := :blaze/admin-api :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :context-path)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :admin-node)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :job-scheduler)) - [:explain ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :read-job-handler)) - [:explain ::s/problems 4 :pred] := `(fn ~'[%] (contains? ~'% :search-type-job-handler)) - [:explain ::s/problems 5 :pred] := `(fn ~'[%] (contains? ~'% :settings)) - [:explain ::s/problems 6 :pred] := `(fn ~'[%] (contains? ~'% :features)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :context-path)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :admin-node)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :job-scheduler)) + [:cause-data ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :read-job-handler)) + [:cause-data ::s/problems 4 :pred] := `(fn ~'[%] (contains? ~'% :search-type-job-handler)) + [:cause-data ::s/problems 5 :pred] := `(fn ~'[%] (contains? ~'% :settings)) + [:cause-data ::s/problems 6 :pred] := `(fn ~'[%] (contains? ~'% :features)))) (testing "invalid context path" (given-thrown (ig/init {:blaze/admin-api {:context-path ::invalid}}) :key := :blaze/admin-api :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :admin-node)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :job-scheduler)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :read-job-handler)) - [:explain ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :search-type-job-handler)) - [:explain ::s/problems 4 :pred] := `(fn ~'[%] (contains? ~'% :settings)) - [:explain ::s/problems 5 :pred] := `(fn ~'[%] (contains? ~'% :features)) - [:explain ::s/problems 6 :via] := [:blaze/context-path] - [:explain ::s/problems 6 :pred] := `string? - [:explain ::s/problems 6 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :admin-node)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :job-scheduler)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :read-job-handler)) + [:cause-data ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :search-type-job-handler)) + [:cause-data ::s/problems 4 :pred] := `(fn ~'[%] (contains? ~'% :settings)) + [:cause-data ::s/problems 5 :pred] := `(fn ~'[%] (contains? ~'% :features)) + [:cause-data ::s/problems 6 :via] := [:blaze/context-path] + [:cause-data ::s/problems 6 :pred] := `string? + [:cause-data ::s/problems 6 :val] := ::invalid)) (testing "invalid admin node" (given-thrown (ig/init {:blaze/admin-api {:admin-node ::invalid}}) :key := :blaze/admin-api :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :context-path)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :job-scheduler)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :read-job-handler)) - [:explain ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :search-type-job-handler)) - [:explain ::s/problems 4 :pred] := `(fn ~'[%] (contains? ~'% :settings)) - [:explain ::s/problems 5 :pred] := `(fn ~'[%] (contains? ~'% :features)) - [:explain ::s/problems 6 :via] := [:blaze.db/node] - [:explain ::s/problems 6 :pred] := `node? - [:explain ::s/problems 6 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :context-path)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :job-scheduler)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :read-job-handler)) + [:cause-data ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :search-type-job-handler)) + [:cause-data ::s/problems 4 :pred] := `(fn ~'[%] (contains? ~'% :settings)) + [:cause-data ::s/problems 5 :pred] := `(fn ~'[%] (contains? ~'% :features)) + [:cause-data ::s/problems 6 :via] := [:blaze.db/node] + [:cause-data ::s/problems 6 :pred] := `node? + [:cause-data ::s/problems 6 :val] := ::invalid)) (testing "invalid settings" (given-thrown (ig/init {:blaze/admin-api {:settings ::invalid}}) :key := :blaze/admin-api :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :context-path)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :admin-node)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :job-scheduler)) - [:explain ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :read-job-handler)) - [:explain ::s/problems 4 :pred] := `(fn ~'[%] (contains? ~'% :search-type-job-handler)) - [:explain ::s/problems 5 :pred] := `(fn ~'[%] (contains? ~'% :features)) - [:explain ::s/problems 6 :via] := [::admin-api/settings] - [:explain ::s/problems 6 :pred] := `coll? - [:explain ::s/problems 6 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :context-path)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :admin-node)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :job-scheduler)) + [:cause-data ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :read-job-handler)) + [:cause-data ::s/problems 4 :pred] := `(fn ~'[%] (contains? ~'% :search-type-job-handler)) + [:cause-data ::s/problems 5 :pred] := `(fn ~'[%] (contains? ~'% :features)) + [:cause-data ::s/problems 6 :via] := [::admin-api/settings] + [:cause-data ::s/problems 6 :pred] := `coll? + [:cause-data ::s/problems 6 :val] := ::invalid)) (testing "invalid features" (given-thrown (ig/init {:blaze/admin-api {:features ::invalid}}) :key := :blaze/admin-api :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :context-path)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :admin-node)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :job-scheduler)) - [:explain ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :read-job-handler)) - [:explain ::s/problems 4 :pred] := `(fn ~'[%] (contains? ~'% :search-type-job-handler)) - [:explain ::s/problems 5 :pred] := `(fn ~'[%] (contains? ~'% :settings)) - [:explain ::s/problems 6 :via] := [::admin-api/features] - [:explain ::s/problems 6 :pred] := `coll? - [:explain ::s/problems 6 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :context-path)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :admin-node)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :job-scheduler)) + [:cause-data ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :read-job-handler)) + [:cause-data ::s/problems 4 :pred] := `(fn ~'[%] (contains? ~'% :search-type-job-handler)) + [:cause-data ::s/problems 5 :pred] := `(fn ~'[%] (contains? ~'% :settings)) + [:cause-data ::s/problems 6 :via] := [::admin-api/features] + [:cause-data ::s/problems 6 :pred] := `coll? + [:cause-data ::s/problems 6 :val] := ::invalid)) (testing "with minimal config" (with-system [{handler :blaze/admin-api} (config (new-temp-dir!))] @@ -640,6 +640,7 @@ {:system #fhir/uri"https://samply.github.io/blaze/fhir/CodeSystem/JobType" :code #fhir/code"compact" :display "Compact Database Column Families"}]} + :authoredOn #fhir/dateTime"2024-04-13T10:05:20.927Z" :input [{:fhir/type :fhir.Task/input :type #fhir/CodeableConcept @@ -705,8 +706,8 @@ (given body "resourceType" := "OperationOutcome" ["issue" 0 "severity"] := "error" - ["issue" 0 "code"] := "structure" - ["issue" 0 "details" "text"] := "Task.code: minimum required = 1, but only found 0 (from https://samply.github.io/blaze/fhir/StructureDefinition/ReIndexJob)")))) + ["issue" 0 "code"] := "processing" + ["issue" 0 "diagnostics"] := "Task.code: minimum required = 1, but only found 0 (from https://samply.github.io/blaze/fhir/StructureDefinition/ReIndexJob)")))) (testing "missing authoredOn" (with-handler [handler] (config (new-temp-dir!)) [] @@ -722,8 +723,8 @@ (given body "resourceType" := "OperationOutcome" ["issue" 0 "severity"] := "error" - ["issue" 0 "code"] := "structure" - ["issue" 0 "details" "text"] := "Task.authoredOn: minimum required = 1, but only found 0 (from https://samply.github.io/blaze/fhir/StructureDefinition/ReIndexJob)")))) + ["issue" 0 "code"] := "processing" + ["issue" 0 "diagnostics"] := "Task.authoredOn: minimum required = 1, but only found 0 (from https://samply.github.io/blaze/fhir/StructureDefinition/ReIndexJob)")))) (testing "wrong code" (with-handler [handler] (config (new-temp-dir!)) [] @@ -739,8 +740,8 @@ (given body "resourceType" := "OperationOutcome" ["issue" 0 "severity"] := "error" - ["issue" 0 "code"] := "value" - ["issue" 0 "details" "text"] := "The pattern [system https://samply.github.io/blaze/fhir/CodeSystem/JobType, code re-index, and display '(Re)Index a Search Parameter'] defined in the profile https://samply.github.io/blaze/fhir/StructureDefinition/ReIndexJob not found. Issues: [ValidationMessage[level=ERROR,type=VALUE,location=Task.code.coding.code,message=Value is 'compact' but must be 're-index'], ValidationMessage[level=ERROR,type=VALUE,location=Task.code.coding.display,message=Value is 'Compact Database Column Families' but must be '(Re)Index a Search Parameter']]")))) + ["issue" 0 "code"] := "processing" + ["issue" 0 "diagnostics"] := "The pattern [system https://samply.github.io/blaze/fhir/CodeSystem/JobType, code re-index, and display '(Re)Index a Search Parameter'] defined in the profile https://samply.github.io/blaze/fhir/StructureDefinition/ReIndexJob not found. Issues: [ValidationMessage[level=ERROR,type=VALUE,location=Task.code.coding.code,message=Value is 'compact' but must be 're-index'], ValidationMessage[level=ERROR,type=VALUE,location=Task.code.coding.display,message=Value is 'Compact Database Column Families' but must be '(Re)Index a Search Parameter']]")))) (testing "re-index job" (with-handler [handler] (config (new-temp-dir!)) [] diff --git a/modules/anomaly/deps.edn b/modules/anomaly/deps.edn index 80db7172e..7e09def1d 100644 --- a/modules/anomaly/deps.edn +++ b/modules/anomaly/deps.edn @@ -21,7 +21,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/async/deps.edn b/modules/async/deps.edn index cc3902c5d..69a03c52b 100644 --- a/modules/async/deps.edn +++ b/modules/async/deps.edn @@ -8,7 +8,7 @@ {:local/root "../executor"} com.taoensso/timbre - {:mvn/version "5.2.1"}} + {:mvn/version "6.5.0"}} :aliases {:test @@ -21,7 +21,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/byte-buffer/deps.edn b/modules/byte-buffer/deps.edn index e20fb2a1f..8798898ba 100644 --- a/modules/byte-buffer/deps.edn +++ b/modules/byte-buffer/deps.edn @@ -13,7 +13,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/byte-string/deps.edn b/modules/byte-string/deps.edn index 02d29cd5b..1b18245c1 100644 --- a/modules/byte-string/deps.edn +++ b/modules/byte-string/deps.edn @@ -5,7 +5,7 @@ {:local/root "../byte-buffer"} com.google.guava/guava - {:mvn/version "33.1.0-jre" + {:mvn/version "33.2.0-jre" :exclusions [com.google.code.findbugs/jsr305 org.checkerframework/checker-qual @@ -13,7 +13,7 @@ com.google.j2objc/j2objc-annotations]} com.fasterxml.jackson.core/jackson-databind - {:mvn/version "2.17.0"}} + {:mvn/version "2.17.1"}} :aliases {:test @@ -26,7 +26,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/cassandra/deps.edn b/modules/cassandra/deps.edn index 92eb3e601..a183c1a1d 100644 --- a/modules/cassandra/deps.edn +++ b/modules/cassandra/deps.edn @@ -8,7 +8,7 @@ ;; current version of transitive dependency of com.datastax.oss/java-driver-core com.fasterxml.jackson.core/jackson-databind - {:mvn/version "2.17.0"} + {:mvn/version "2.17.1"} ;; current version of transitive dependency of com.datastax.oss/java-driver-core io.netty/netty-handler @@ -28,7 +28,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/coll/deps.edn b/modules/coll/deps.edn index 1d0a2392a..afebc6ab6 100644 --- a/modules/coll/deps.edn +++ b/modules/coll/deps.edn @@ -9,7 +9,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/cql/deps.edn b/modules/cql/deps.edn index 8437325c1..313b6f629 100644 --- a/modules/cql/deps.edn +++ b/modules/cql/deps.edn @@ -5,10 +5,10 @@ {:local/root "../db"} com.fasterxml.jackson.module/jackson-module-jaxb-annotations - {:mvn/version "2.17.0"} + {:mvn/version "2.17.1"} com.fasterxml.jackson.dataformat/jackson-dataformat-xml - {:mvn/version "2.17.0"} + {:mvn/version "2.17.1"} info.cqframework/cql-to-elm {:mvn/version "2.11.0" @@ -54,7 +54,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/db-resource-store-cassandra/deps.edn b/modules/db-resource-store-cassandra/deps.edn index 5fccef904..a0b1c9648 100644 --- a/modules/db-resource-store-cassandra/deps.edn +++ b/modules/db-resource-store-cassandra/deps.edn @@ -25,7 +25,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/db-resource-store-cassandra/src/blaze/db/resource_store/cassandra.clj b/modules/db-resource-store-cassandra/src/blaze/db/resource_store/cassandra.clj index adf034658..297ef9424 100644 --- a/modules/db-resource-store-cassandra/src/blaze/db/resource_store/cassandra.clj +++ b/modules/db-resource-store-cassandra/src/blaze/db/resource_store/cassandra.clj @@ -8,7 +8,7 @@ [blaze.db.resource-store :as rs] [blaze.db.resource-store.cassandra.statement :as statement] [blaze.fhir.spec :as fhir-spec] - [blaze.module :refer [reg-collector]] + [blaze.module :as m :refer [reg-collector]] [clojure.spec.alpha :as s] [cognitect.anomalies :as anom] [integrant.core :as ig] @@ -133,7 +133,7 @@ (close [_] (cass/close session))) -(defmethod ig/pre-init-spec ::rs/cassandra [_] +(defmethod m/pre-init-spec ::rs/cassandra [_] (s/keys :opt-un [::cass/contact-points ::cass/key-space ::cass/username ::cass/password ::cass/put-consistency-level diff --git a/modules/db-resource-store-cassandra/test/blaze/db/resource_store/cassandra_test.clj b/modules/db-resource-store-cassandra/test/blaze/db/resource_store/cassandra_test.clj index 769839d59..4f44e956c 100644 --- a/modules/db-resource-store-cassandra/test/blaze/db/resource_store/cassandra_test.clj +++ b/modules/db-resource-store-cassandra/test/blaze/db/resource_store/cassandra_test.clj @@ -75,15 +75,15 @@ (given-thrown (ig/init {::rs/cassandra nil}) :key := ::rs/cassandra :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "invalid contact-points" (given-thrown (ig/init {::rs/cassandra {:contact-points ::invalid}}) :key := ::rs/cassandra :reason := ::ig/build-failed-spec [:value :contact-points] := ::invalid - [:explain ::s/problems 0 :path] := [:contact-points] - [:explain ::s/problems 0 :val] := ::invalid))) + [:cause-data ::s/problems 0 :path] := [:contact-points] + [:cause-data ::s/problems 0 :val] := ::invalid))) (def cbor-object-mapper (j/object-mapper diff --git a/modules/db-resource-store/deps.edn b/modules/db-resource-store/deps.edn index 550383410..2c5f57c1a 100644 --- a/modules/db-resource-store/deps.edn +++ b/modules/db-resource-store/deps.edn @@ -34,7 +34,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/db-resource-store/src/blaze/db/resource_store/kv.clj b/modules/db-resource-store/src/blaze/db/resource_store/kv.clj index c9185200c..404f4844c 100644 --- a/modules/db-resource-store/src/blaze/db/resource_store/kv.clj +++ b/modules/db-resource-store/src/blaze/db/resource_store/kv.clj @@ -11,7 +11,7 @@ [blaze.executors :as ex] [blaze.fhir.hash :as hash] [blaze.fhir.spec :as fhir-spec] - [blaze.module :refer [reg-collector]] + [blaze.module :as m :refer [reg-collector]] [clojure.spec.alpha :as s] [cognitect.anomalies :as anom] [integrant.core :as ig] @@ -111,7 +111,7 @@ (kv/put! kv-store (coll/eduction entry-freezer entries))) executor))) -(defmethod ig/pre-init-spec ::rs/kv [_] +(defmethod m/pre-init-spec ::rs/kv [_] (s/keys :req-un [:blaze.db/kv-store ::executor])) (defmethod ig/init-key ::rs/kv @@ -121,7 +121,7 @@ (derive ::rs/kv :blaze.db/resource-store) -(defmethod ig/pre-init-spec ::executor [_] +(defmethod m/pre-init-spec ::executor [_] (s/keys :opt-un [::num-threads])) (defn- executor-init-msg [num-threads] diff --git a/modules/db-resource-store/test/blaze/db/resource_store/kv_test.clj b/modules/db-resource-store/test/blaze/db/resource_store/kv_test.clj index 524428f3d..50579f488 100644 --- a/modules/db-resource-store/test/blaze/db/resource_store/kv_test.clj +++ b/modules/db-resource-store/test/blaze/db/resource_store/kv_test.clj @@ -52,44 +52,44 @@ (given-thrown (ig/init {::rs/kv nil}) :key := ::rs/kv :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {::rs/kv {}}) :key := ::rs/kv :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :kv-store)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :executor)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :kv-store)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :executor)))) (testing "invalid kv-store" (given-thrown (ig/init {::rs/kv {:kv-store ::invalid}}) :key := ::rs/kv :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :executor)) - [:explain ::s/problems 1 :pred] := `kv/store? - [:explain ::s/problems 1 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :executor)) + [:cause-data ::s/problems 1 :pred] := `kv/store? + [:cause-data ::s/problems 1 :val] := ::invalid)) (testing "invalid executor" (given-thrown (ig/init {::rs/kv {:executor ::invalid}}) :key := ::rs/kv :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :kv-store)) - [:explain ::s/problems 1 :pred] := `ex/executor? - [:explain ::s/problems 1 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :kv-store)) + [:cause-data ::s/problems 1 :pred] := `ex/executor? + [:cause-data ::s/problems 1 :val] := ::invalid))) (deftest executor-init-test (testing "nil config" (given-thrown (ig/init {::rs-kv/executor nil}) :key := ::rs-kv/executor :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "invalid num-threads" (given-thrown (ig/init {::rs-kv/executor {:num-threads ::invalid}}) :key := ::rs-kv/executor :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `nat-int? - [:explain ::s/problems 0 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `nat-int? + [:cause-data ::s/problems 0 :val] := ::invalid))) (deftest resource-bytes-collector-init-test (with-system [{collector ::rs-kv/resource-bytes} {::rs-kv/resource-bytes {}}] diff --git a/modules/db-tx-log-kafka/deps.edn b/modules/db-tx-log-kafka/deps.edn index 5343dd604..f1260b398 100644 --- a/modules/db-tx-log-kafka/deps.edn +++ b/modules/db-tx-log-kafka/deps.edn @@ -28,7 +28,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/db-tx-log-kafka/src/blaze/db/tx_log/kafka.clj b/modules/db-tx-log-kafka/src/blaze/db/tx_log/kafka.clj index d6f46565b..34460b1a0 100644 --- a/modules/db-tx-log-kafka/src/blaze/db/tx_log/kafka.clj +++ b/modules/db-tx-log-kafka/src/blaze/db/tx_log/kafka.clj @@ -9,7 +9,7 @@ [blaze.db.tx-log.kafka.spec] [blaze.db.tx-log.kafka.util :as u] [blaze.executors :as ex] - [blaze.module :refer [reg-collector]] + [blaze.module :as m :refer [reg-collector]] [clojure.spec.alpha :as s] [integrant.core :as ig] [prometheus.alpha :as prom :refer [defhistogram]] @@ -106,7 +106,7 @@ (def create-last-t-consumer create-consumer) -(defmethod ig/pre-init-spec :blaze.db.tx-log/kafka [_] +(defmethod m/pre-init-spec :blaze.db.tx-log/kafka [_] (s/keys :req-un [::bootstrap-servers ::topic ::last-t-executor] diff --git a/modules/db-tx-log-kafka/test/blaze/db/tx_log/kafka_test.clj b/modules/db-tx-log-kafka/test/blaze/db/tx_log/kafka_test.clj index 18146f2d4..d3ed98bc7 100644 --- a/modules/db-tx-log-kafka/test/blaze/db/tx_log/kafka_test.clj +++ b/modules/db-tx-log-kafka/test/blaze/db/tx_log/kafka_test.clj @@ -72,24 +72,24 @@ (given-thrown (ig/init {::tx-log/kafka nil}) :key := ::tx-log/kafka :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {::tx-log/kafka {}}) :key := ::tx-log/kafka :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :bootstrap-servers)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :topic)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :last-t-executor)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :bootstrap-servers)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :topic)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :last-t-executor)))) (testing "invalid bootstrap servers" (given-thrown (ig/init {::tx-log/kafka {:bootstrap-servers ::invalid}}) :key := ::tx-log/kafka :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :topic)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :last-t-executor)) - [:explain ::s/problems 2 :pred] := `string? - [:explain ::s/problems 2 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :topic)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :last-t-executor)) + [:cause-data ::s/problems 2 :pred] := `string? + [:cause-data ::s/problems 2 :val] := ::invalid)) (testing "non default key" (with-redefs diff --git a/modules/db-tx-log/deps.edn b/modules/db-tx-log/deps.edn index 805864164..a61abadf1 100644 --- a/modules/db-tx-log/deps.edn +++ b/modules/db-tx-log/deps.edn @@ -22,7 +22,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/db/deps.edn b/modules/db/deps.edn index c907c1e4a..cb165271d 100644 --- a/modules/db/deps.edn +++ b/modules/db/deps.edn @@ -51,7 +51,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/db/src/blaze/db/cache_collector.clj b/modules/db/src/blaze/db/cache_collector.clj index 7e9e15402..4db50791f 100644 --- a/modules/db/src/blaze/db/cache_collector.clj +++ b/modules/db/src/blaze/db/cache_collector.clj @@ -3,6 +3,7 @@ [blaze.db.cache-collector.protocols :as p] [blaze.db.cache-collector.spec] [blaze.metrics.core :as metrics] + [blaze.module :as m] [clojure.spec.alpha :as s] [integrant.core :as ig]) (:import @@ -35,7 +36,7 @@ (when cache [name (p/-stats cache) (p/-estimated-size cache)])))) -(defmethod ig/pre-init-spec :blaze.db/cache-collector [_] +(defmethod m/pre-init-spec :blaze.db/cache-collector [_] (s/keys :req-un [::caches])) (defmethod ig/init-key :blaze.db/cache-collector diff --git a/modules/db/src/blaze/db/node.clj b/modules/db/src/blaze/db/node.clj index 2d3733045..4aff66530 100644 --- a/modules/db/src/blaze/db/node.clj +++ b/modules/db/src/blaze/db/node.clj @@ -32,7 +32,7 @@ [blaze.executors :as ex] [blaze.fhir.spec :as fhir-spec] [blaze.fhir.spec.type :as type] - [blaze.module :refer [reg-collector]] + [blaze.module :as m :refer [reg-collector]] [blaze.spec] [blaze.util :refer [conj-vec]] [clojure.spec.alpha :as s] @@ -400,7 +400,7 @@ :or {enforce-referential-integrity true}}] {:blaze.db/enforce-referential-integrity enforce-referential-integrity}) -(defmethod ig/pre-init-spec :blaze.db/node [_] +(defmethod m/pre-init-spec :blaze.db/node [_] (s/keys :req-un [:blaze.db/tx-log diff --git a/modules/db/src/blaze/db/node/resource_indexer.clj b/modules/db/src/blaze/db/node/resource_indexer.clj index 144d3b44a..5cb53991f 100644 --- a/modules/db/src/blaze/db/node/resource_indexer.clj +++ b/modules/db/src/blaze/db/node/resource_indexer.clj @@ -16,7 +16,7 @@ [blaze.db.search-param-registry :as sr] [blaze.executors :as ex] [blaze.fhir.spec :as fhir-spec] - [blaze.module :refer [reg-collector]] + [blaze.module :as m :refer [reg-collector]] [clojure.spec.alpha :as s] [cognitect.anomalies :as anom] [integrant.core :as ig] @@ -169,7 +169,7 @@ {:num-resources (count to-index) :next next}))) -(defmethod ig/pre-init-spec :blaze.db.node/resource-indexer [_] +(defmethod m/pre-init-spec :blaze.db.node/resource-indexer [_] (s/keys :req-un [:blaze.db/kv-store :blaze.db/resource-store :blaze.db/search-param-registry @@ -180,7 +180,7 @@ (log/info "Init" (node-util/component-name key "resource indexer")) resource-indexer) -(defmethod ig/pre-init-spec ::executor [_] +(defmethod m/pre-init-spec ::executor [_] (s/keys :opt-un [::num-threads])) (defmethod ig/init-key ::executor diff --git a/modules/db/src/blaze/db/resource_cache.clj b/modules/db/src/blaze/db/resource_cache.clj index ff8da4020..9453e7c30 100644 --- a/modules/db/src/blaze/db/resource_cache.clj +++ b/modules/db/src/blaze/db/resource_cache.clj @@ -8,6 +8,7 @@ [blaze.db.resource-cache.spec] [blaze.db.resource-store :as rs] [blaze.db.resource-store.spec] + [blaze.module :as m] [clojure.spec.alpha :as s] [integrant.core :as ig] [taoensso.timbre :as log]) @@ -39,7 +40,7 @@ (-> (.synchronous ^AsyncLoadingCache (.cache ^ResourceCache resource-cache)) (.invalidateAll))) -(defmethod ig/pre-init-spec :blaze.db/resource-cache [_] +(defmethod m/pre-init-spec :blaze.db/resource-cache [_] (s/keys :req-un [:blaze.db/resource-store] :opt-un [::max-size])) (defmethod ig/init-key :blaze.db/resource-cache diff --git a/modules/db/src/blaze/db/search_param_registry.clj b/modules/db/src/blaze/db/search_param_registry.clj index 9cee4d765..94fa8e168 100644 --- a/modules/db/src/blaze/db/search_param_registry.clj +++ b/modules/db/src/blaze/db/search_param_registry.clj @@ -8,6 +8,7 @@ [blaze.db.impl.search-param.core :as sc] [blaze.db.search-param-registry.spec] [blaze.fhir.spec :as fhir-spec] + [blaze.module :as m] [blaze.util :refer [conj-vec]] [clojure.java.io :as io] [clojure.spec.alpha :as s] @@ -230,7 +231,7 @@ {} entries)) -(defmethod ig/pre-init-spec :blaze.db/search-param-registry [_] +(defmethod m/pre-init-spec :blaze.db/search-param-registry [_] (s/keys :req-un [:blaze.fhir/structure-definition-repo] :opt-un [::extra-bundle-file])) diff --git a/modules/db/src/blaze/db/tx_cache.clj b/modules/db/src/blaze/db/tx_cache.clj index 23065420e..09a69244e 100644 --- a/modules/db/src/blaze/db/tx_cache.clj +++ b/modules/db/src/blaze/db/tx_cache.clj @@ -7,6 +7,7 @@ [blaze.db.impl.index.tx-success :as tx-success] [blaze.db.kv.spec] [blaze.db.tx-cache.spec] + [blaze.module :as m] [clojure.spec.alpha :as s] [integrant.core :as ig] [taoensso.timbre :as log]) @@ -15,7 +16,7 @@ (set! *warn-on-reflection* true) -(defmethod ig/pre-init-spec :blaze.db/tx-cache [_] +(defmethod m/pre-init-spec :blaze.db/tx-cache [_] (s/keys :req-un [:blaze.db/kv-store] :opt-un [::max-size])) (defmethod ig/init-key :blaze.db/tx-cache diff --git a/modules/db/src/blaze/db/tx_log/local.clj b/modules/db/src/blaze/db/tx_log/local.clj index 40a348ec1..a16f7cc85 100644 --- a/modules/db/src/blaze/db/tx_log/local.clj +++ b/modules/db/src/blaze/db/tx_log/local.clj @@ -17,7 +17,7 @@ [blaze.db.node.util :as node-util] [blaze.db.tx-log :as tx-log] [blaze.db.tx-log.local.codec :as codec] - [blaze.module :refer [reg-collector]] + [blaze.module :as m :refer [reg-collector]] [clojure.spec.alpha :as s] [integrant.core :as ig] [java-time.api :as time] @@ -131,7 +131,7 @@ (when (kv/valid? iter) (Longs/fromByteArray (kv/key iter))))) -(defmethod ig/pre-init-spec :blaze.db.tx-log/local [_] +(defmethod m/pre-init-spec :blaze.db.tx-log/local [_] (s/keys :req-un [:blaze.db/kv-store :blaze/clock])) (defmethod ig/init-key :blaze.db.tx-log/local diff --git a/modules/db/test/blaze/db/cache_collector_test.clj b/modules/db/test/blaze/db/cache_collector_test.clj index aa632564c..3f1adde1f 100644 --- a/modules/db/test/blaze/db/cache_collector_test.clj +++ b/modules/db/test/blaze/db/cache_collector_test.clj @@ -29,20 +29,20 @@ (given-thrown (ig/init {:blaze.db/cache-collector nil}) :key := :blaze.db/cache-collector :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.db/cache-collector {}}) :key := :blaze.db/cache-collector :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :caches)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :caches)))) (testing "invalid caches" (given-thrown (ig/init {:blaze.db/cache-collector {:caches ::invalid}}) :key := :blaze.db/cache-collector :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map? - [:explain ::s/problems 0 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `map? + [:cause-data ::s/problems 0 :val] := ::invalid))) (deftest cache-collector-test (with-system [{collector :blaze.db/cache-collector} config] diff --git a/modules/db/test/blaze/db/node/resource_indexer_test.clj b/modules/db/test/blaze/db/node/resource_indexer_test.clj index b490e757e..97ad644c3 100644 --- a/modules/db/test/blaze/db/node/resource_indexer_test.clj +++ b/modules/db/test/blaze/db/node/resource_indexer_test.clj @@ -92,56 +92,56 @@ (given-thrown (ig/init {::node/resource-indexer nil}) :key := ::node/resource-indexer :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {::node/resource-indexer {}}) :key := ::node/resource-indexer :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :kv-store)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :resource-store)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :search-param-registry)) - [:explain ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :executor)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :kv-store)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :resource-store)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :search-param-registry)) + [:cause-data ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :executor)))) (testing "invalid kv-store" (given-thrown (ig/init {::node/resource-indexer {:kv-store ::invalid}}) :key := ::node/resource-indexer :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :resource-store)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :search-param-registry)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :executor)) - [:explain ::s/problems 3 :pred] := `kv/store? - [:explain ::s/problems 3 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :resource-store)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :search-param-registry)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :executor)) + [:cause-data ::s/problems 3 :pred] := `kv/store? + [:cause-data ::s/problems 3 :val] := ::invalid)) (testing "invalid resource-store" (given-thrown (ig/init {::node/resource-indexer {:resource-store ::invalid}}) :key := ::node/resource-indexer :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :kv-store)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :search-param-registry)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :executor)) - [:explain ::s/problems 3 :pred] := `resource-store? - [:explain ::s/problems 3 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :kv-store)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :search-param-registry)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :executor)) + [:cause-data ::s/problems 3 :pred] := `resource-store? + [:cause-data ::s/problems 3 :val] := ::invalid)) (testing "invalid search-param-registry" (given-thrown (ig/init {::node/resource-indexer {:search-param-registry ::invalid}}) :key := ::node/resource-indexer :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :kv-store)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :resource-store)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :executor)) - [:explain ::s/problems 3 :pred] := `search-param-registry? - [:explain ::s/problems 3 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :kv-store)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :resource-store)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :executor)) + [:cause-data ::s/problems 3 :pred] := `search-param-registry? + [:cause-data ::s/problems 3 :val] := ::invalid)) (testing "invalid executor" (given-thrown (ig/init {::node/resource-indexer {:executor ::invalid}}) :key := ::node/resource-indexer :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :kv-store)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :resource-store)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :search-param-registry)) - [:explain ::s/problems 3 :pred] := `ex/executor? - [:explain ::s/problems 3 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :kv-store)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :resource-store)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :search-param-registry)) + [:cause-data ::s/problems 3 :pred] := `ex/executor? + [:cause-data ::s/problems 3 :val] := ::invalid)) (testing "with custom name" (let [system (ig/init main-config) @@ -153,14 +153,14 @@ (given-thrown (ig/init {::resource-indexer/executor nil}) :key := ::resource-indexer/executor :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "invalid num-threads" (given-thrown (ig/init {::resource-indexer/executor {:num-threads ::invalid}}) :key := ::resource-indexer/executor :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `pos-int? - [:explain ::s/problems 0 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `pos-int? + [:cause-data ::s/problems 0 :val] := ::invalid))) (deftest duration-seconds-collector-init-test (with-system [{collector ::resource-indexer/duration-seconds} {::resource-indexer/duration-seconds {}}] diff --git a/modules/db/test/blaze/db/node_test.clj b/modules/db/test/blaze/db/node_test.clj index cd0b8f4fc..a11da85ff 100644 --- a/modules/db/test/blaze/db/node_test.clj +++ b/modules/db/test/blaze/db/node_test.clj @@ -102,75 +102,75 @@ (given-thrown (ig/init {:blaze.db/node nil}) :key := :blaze.db/node :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.db/node {}}) :key := :blaze.db/node :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :tx-log)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :tx-cache)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :indexer-executor)) - [:explain ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :kv-store)) - [:explain ::s/problems 4 :pred] := `(fn ~'[%] (contains? ~'% :resource-indexer)) - [:explain ::s/problems 5 :pred] := `(fn ~'[%] (contains? ~'% :resource-store)) - [:explain ::s/problems 6 :pred] := `(fn ~'[%] (contains? ~'% :search-param-registry)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :tx-log)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :tx-cache)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :indexer-executor)) + [:cause-data ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :kv-store)) + [:cause-data ::s/problems 4 :pred] := `(fn ~'[%] (contains? ~'% :resource-indexer)) + [:cause-data ::s/problems 5 :pred] := `(fn ~'[%] (contains? ~'% :resource-store)) + [:cause-data ::s/problems 6 :pred] := `(fn ~'[%] (contains? ~'% :search-param-registry)))) (testing "invalid tx-log" (given-thrown (ig/init (assoc-in config [:blaze.db/node :tx-log] ::invalid)) :key := :blaze.db/node :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `tx-log? - [:explain ::s/problems 0 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `tx-log? + [:cause-data ::s/problems 0 :val] := ::invalid)) (testing "invalid tx-cache" (given-thrown (ig/init (assoc-in config [:blaze.db/node :tx-cache] ::invalid)) :key := :blaze.db/node :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `loading-cache? - [:explain ::s/problems 0 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `loading-cache? + [:cause-data ::s/problems 0 :val] := ::invalid)) (testing "invalid indexer-executor" (given-thrown (ig/init (assoc-in config [:blaze.db/node :indexer-executor] ::invalid)) :key := :blaze.db/node :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `ex/executor? - [:explain ::s/problems 0 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `ex/executor? + [:cause-data ::s/problems 0 :val] := ::invalid)) (testing "invalid kv-store" (given-thrown (ig/init (assoc-in config [:blaze.db/node :kv-store] ::invalid)) :key := :blaze.db/node :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `kv/store? - [:explain ::s/problems 0 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `kv/store? + [:cause-data ::s/problems 0 :val] := ::invalid)) (testing "invalid resource-indexer" (given-thrown (ig/init (assoc-in config [:blaze.db/node :resource-indexer] ::invalid)) :key := :blaze.db/node :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map? - [:explain ::s/problems 0 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `map? + [:cause-data ::s/problems 0 :val] := ::invalid)) (testing "invalid resource-store" (given-thrown (ig/init (assoc-in config [:blaze.db/node :resource-store] ::invalid)) :key := :blaze.db/node :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `resource-store? - [:explain ::s/problems 0 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `resource-store? + [:cause-data ::s/problems 0 :val] := ::invalid)) (testing "invalid search-param-registry" (given-thrown (ig/init (assoc-in config [:blaze.db/node :search-param-registry] ::invalid)) :key := :blaze.db/node :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `search-param-registry? - [:explain ::s/problems 0 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `search-param-registry? + [:cause-data ::s/problems 0 :val] := ::invalid)) (testing "invalid enforce-referential-integrity" (given-thrown (ig/init (assoc-in config [:blaze.db/node :enforce-referential-integrity] ::invalid)) :key := :blaze.db/node :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `boolean? - [:explain ::s/problems 0 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `boolean? + [:cause-data ::s/problems 0 :val] := ::invalid)) (testing "incompatible version" (given-thrown (ig/init (with-index-store-version config -1)) diff --git a/modules/db/test/blaze/db/resource_cache_test.clj b/modules/db/test/blaze/db/resource_cache_test.clj index ff6ca635b..598b4e040 100644 --- a/modules/db/test/blaze/db/resource_cache_test.clj +++ b/modules/db/test/blaze/db/resource_cache_test.clj @@ -48,27 +48,27 @@ (given-thrown (ig/init {:blaze.db/resource-cache nil}) :key := :blaze.db/resource-cache :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing store" (given-thrown (ig/init {:blaze.db/resource-cache {}}) :key := :blaze.db/resource-cache :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :resource-store)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :resource-store)))) (testing "invalid store" (given-thrown (ig/init {:blaze.db/resource-cache {:resource-store ::invalid}}) :key := :blaze.db/resource-cache :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `resource-store? - [:explain ::s/problems 0 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `resource-store? + [:cause-data ::s/problems 0 :val] := ::invalid)) (testing "invalid max-size" (given-thrown (ig/init (assoc-in config [:blaze.db/resource-cache :max-size] ::invalid)) :key := :blaze.db/resource-cache :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `nat-int? - [:explain ::s/problems 0 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `nat-int? + [:cause-data ::s/problems 0 :val] := ::invalid))) (deftest get-test (testing "success" diff --git a/modules/db/test/blaze/db/search_param_registry_test.clj b/modules/db/test/blaze/db/search_param_registry_test.clj index 96435fbb2..eb5c6b1c5 100644 --- a/modules/db/test/blaze/db/search_param_registry_test.clj +++ b/modules/db/test/blaze/db/search_param_registry_test.clj @@ -35,20 +35,20 @@ (given-thrown (ig/init {:blaze.db/search-param-registry nil}) :key := :blaze.db/search-param-registry :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.db/search-param-registry {}}) :key := :blaze.db/search-param-registry :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :structure-definition-repo)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :structure-definition-repo)))) (testing "invalid structure-definition-repo" (given-thrown (ig/init {:blaze.db/search-param-registry {:structure-definition-repo ::invalid}}) :key := :blaze.db/search-param-registry :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `structure-definition-repo? - [:explain ::s/problems 0 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `structure-definition-repo? + [:cause-data ::s/problems 0 :val] := ::invalid)) (testing "invalid extra-bundle-file" (given-thrown (ig/init {:blaze.db/search-param-registry @@ -56,8 +56,8 @@ :extra-bundle-file ::invalid}}) :key := :blaze.db/search-param-registry :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `string? - [:explain ::s/problems 0 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `string? + [:cause-data ::s/problems 0 :val] := ::invalid)) (testing "not-found extra-bundle-file" (given-thrown (ig/init {:blaze.db/search-param-registry diff --git a/modules/db/test/blaze/db/tx_cache_test.clj b/modules/db/test/blaze/db/tx_cache_test.clj index 6f0fcc22c..f8ba930eb 100644 --- a/modules/db/test/blaze/db/tx_cache_test.clj +++ b/modules/db/test/blaze/db/tx_cache_test.clj @@ -29,19 +29,19 @@ (given-thrown (ig/init {:blaze.db/tx-cache nil}) :key := :blaze.db/tx-cache :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing store" (given-thrown (ig/init {:blaze.db/tx-cache {}}) :key := :blaze.db/tx-cache :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn [~'%] (contains? ~'% :kv-store)))) + [:cause-data ::s/problems 0 :pred] := `(fn [~'%] (contains? ~'% :kv-store)))) (testing "invalid store" (given-thrown (ig/init {:blaze.db/tx-cache {:kv-store nil}}) :key := :blaze.db/tx-cache :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `kv/store?)) + [:cause-data ::s/problems 0 :pred] := `kv/store?)) (testing "invalid max-size" (given-thrown (ig/init {:blaze.db/tx-cache @@ -50,7 +50,7 @@ ::kv/mem {:column-families {}}}) :key := :blaze.db/tx-cache :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `nat-int?))) + [:cause-data ::s/problems 0 :pred] := `nat-int?))) (deftest empty-store-test (with-system [{cache :blaze.db/tx-cache} config] diff --git a/modules/db/test/blaze/db/tx_log/local_test.clj b/modules/db/test/blaze/db/tx_log/local_test.clj index 318b83a70..d1665e43c 100644 --- a/modules/db/test/blaze/db/tx_log/local_test.clj +++ b/modules/db/test/blaze/db/tx_log/local_test.clj @@ -92,14 +92,14 @@ (given-thrown (ig/init {::tx-log/local nil}) :key := ::tx-log/local :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {::tx-log/local {}}) :key := ::tx-log/local :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :kv-store)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :clock))))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :kv-store)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :clock))))) (defn- write-cbor [x] (j/write-value-as-bytes x cbor-object-mapper)) diff --git a/modules/executor/deps.edn b/modules/executor/deps.edn index 0de11ee6e..cea318b75 100644 --- a/modules/executor/deps.edn +++ b/modules/executor/deps.edn @@ -9,7 +9,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/extern-terminology-service/deps.edn b/modules/extern-terminology-service/deps.edn index 7dc994377..13db2d2cc 100644 --- a/modules/extern-terminology-service/deps.edn +++ b/modules/extern-terminology-service/deps.edn @@ -22,7 +22,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/extern-terminology-service/src/blaze/terminology_service/extern.clj b/modules/extern-terminology-service/src/blaze/terminology_service/extern.clj index fed3bd5ae..ea0dc276a 100644 --- a/modules/extern-terminology-service/src/blaze/terminology_service/extern.clj +++ b/modules/extern-terminology-service/src/blaze/terminology_service/extern.clj @@ -3,7 +3,7 @@ [blaze.async.comp :as ac] [blaze.fhir-client :as fhir-client] [blaze.http-client.spec] - [blaze.module :refer [reg-collector]] + [blaze.module :as m :refer [reg-collector]] [blaze.terminology-service :as ts] [blaze.terminology-service.extern.spec] [clojure.spec.alpha :as s] @@ -46,7 +46,7 @@ (-expand-value-set [_ params] (.get cache params))) -(defmethod ig/pre-init-spec :blaze.terminology-service/extern [_] +(defmethod m/pre-init-spec :blaze.terminology-service/extern [_] (s/keys :req-un [::base-uri :blaze/http-client])) (defmethod ig/init-key :blaze.terminology-service/extern diff --git a/modules/extern-terminology-service/test/blaze/terminology_service/extern_test.clj b/modules/extern-terminology-service/test/blaze/terminology_service/extern_test.clj index ea1dbf8df..17e502f3c 100644 --- a/modules/extern-terminology-service/test/blaze/terminology_service/extern_test.clj +++ b/modules/extern-terminology-service/test/blaze/terminology_service/extern_test.clj @@ -35,22 +35,22 @@ (given-thrown (ig/init {::ts/extern nil}) :key := ::ts/extern :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {::ts/extern {}}) :key := ::ts/extern :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :base-uri)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :http-client)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :base-uri)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :http-client)))) (testing "invalid base-uri" (given-thrown (ig/init {::ts/extern {:base-uri ::invalid}}) :key := ::ts/extern :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :http-client)) - [:explain ::s/problems 1 :pred] := `string? - [:explain ::s/problems 1 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :http-client)) + [:cause-data ::s/problems 1 :pred] := `string? + [:cause-data ::s/problems 1 :val] := ::invalid))) (deftest terminology-service-test (with-system [{ts ::ts/extern ::keys [http-client]} config] diff --git a/modules/fhir-client/deps.edn b/modules/fhir-client/deps.edn index 946e67194..2c4a1d42b 100644 --- a/modules/fhir-client/deps.edn +++ b/modules/fhir-client/deps.edn @@ -12,7 +12,7 @@ {:local/root "../fhir-structure"} com.taoensso/timbre - {:mvn/version "5.2.1"} + {:mvn/version "6.5.0"} hato/hato {:mvn/version "0.9.0"}} @@ -31,7 +31,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/fhir-path/deps.edn b/modules/fhir-path/deps.edn index 72a938b3a..895d8cc82 100644 --- a/modules/fhir-path/deps.edn +++ b/modules/fhir-path/deps.edn @@ -17,7 +17,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/fhir-structure/deps.edn b/modules/fhir-structure/deps.edn index f8ed7240f..2052ca03f 100644 --- a/modules/fhir-structure/deps.edn +++ b/modules/fhir-structure/deps.edn @@ -1,13 +1,7 @@ {:paths ["src" "resources" "target/classes"] :deps - {blaze/anomaly - {:local/root "../anomaly"} - - blaze/byte-string - {:local/root "../byte-string"} - - blaze/coll + {blaze/coll {:local/root "../coll"} blaze/module-base @@ -17,13 +11,10 @@ {:mvn/version "3.1.8"} com.fasterxml.jackson.dataformat/jackson-dataformat-cbor - {:mvn/version "2.17.0"} + {:mvn/version "2.17.1"} com.fasterxml.jackson.dataformat/jackson-dataformat-xml - {:mvn/version "2.17.0"} - - com.taoensso/timbre - {:mvn/version "5.2.1"} + {:mvn/version "2.17.1"} metosin/jsonista {:mvn/version "0.3.8"} @@ -57,7 +48,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/frontend/package-lock.json b/modules/frontend/package-lock.json index 7caad0f68..28dc8b565 100644 --- a/modules/frontend/package-lock.json +++ b/modules/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "blaze-frontend", - "version": "0.26.1", + "version": "0.26.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "blaze-frontend", - "version": "0.26.1", + "version": "0.26.2", "dependencies": { "@auth/sveltekit": "^1.0.0", "@fontsource-variable/inter": "^5.0.8", @@ -40,7 +40,7 @@ "tslib": "^2.4.1", "typescript": "^5.0.0", "vite": "^5.0.0", - "vitest": "1.5.2" + "vitest": "1.5.3" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -1405,13 +1405,13 @@ "dev": true }, "node_modules/@vitest/expect": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.5.2.tgz", - "integrity": "sha512-rf7MTD1WCoDlN3FfYJ9Llfp0PbdtOMZ3FIF0AVkDnKbp3oiMW1c8AmvRZBcqbAhDUAvF52e9zx4WQM1r3oraVA==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.5.3.tgz", + "integrity": "sha512-y+waPz31pOFr3rD7vWTbwiLe5+MgsMm40jTZbQE8p8/qXyBX3CQsIXRx9XK12IbY7q/t5a5aM/ckt33b4PxK2g==", "dev": true, "dependencies": { - "@vitest/spy": "1.5.2", - "@vitest/utils": "1.5.2", + "@vitest/spy": "1.5.3", + "@vitest/utils": "1.5.3", "chai": "^4.3.10" }, "funding": { @@ -1419,12 +1419,12 @@ } }, "node_modules/@vitest/runner": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.5.2.tgz", - "integrity": "sha512-7IJ7sJhMZrqx7HIEpv3WrMYcq8ZNz9L6alo81Y6f8hV5mIE6yVZsFoivLZmr0D777klm1ReqonE9LyChdcmw6g==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.5.3.tgz", + "integrity": "sha512-7PlfuReN8692IKQIdCxwir1AOaP5THfNkp0Uc4BKr2na+9lALNit7ub9l3/R7MP8aV61+mHKRGiqEKRIwu6iiQ==", "dev": true, "dependencies": { - "@vitest/utils": "1.5.2", + "@vitest/utils": "1.5.3", "p-limit": "^5.0.0", "pathe": "^1.1.1" }, @@ -1460,9 +1460,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.5.2.tgz", - "integrity": "sha512-CTEp/lTYos8fuCc9+Z55Ga5NVPKUgExritjF5VY7heRFUfheoAqBneUlvXSUJHUZPjnPmyZA96yLRJDP1QATFQ==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.5.3.tgz", + "integrity": "sha512-K3mvIsjyKYBhNIDujMD2gfQEzddLe51nNOAf45yKRt/QFJcUIeTQd2trRvv6M6oCBHNVnZwFWbQ4yj96ibiDsA==", "dev": true, "dependencies": { "magic-string": "^0.30.5", @@ -1474,9 +1474,9 @@ } }, "node_modules/@vitest/spy": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.5.2.tgz", - "integrity": "sha512-xCcPvI8JpCtgikT9nLpHPL1/81AYqZy1GCy4+MCHBE7xi8jgsYkULpW5hrx5PGLgOQjUpb6fd15lqcriJ40tfQ==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.5.3.tgz", + "integrity": "sha512-Llj7Jgs6lbnL55WoshJUUacdJfjU2honvGcAJBxhra5TPEzTJH8ZuhI3p/JwqqfnTr4PmP7nDmOXP53MS7GJlg==", "dev": true, "dependencies": { "tinyspy": "^2.2.0" @@ -1486,9 +1486,9 @@ } }, "node_modules/@vitest/utils": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.5.2.tgz", - "integrity": "sha512-sWOmyofuXLJ85VvXNsroZur7mOJGiQeM0JN3/0D1uU8U9bGFM69X1iqHaRXl6R8BwaLY6yPCogP257zxTzkUdA==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.5.3.tgz", + "integrity": "sha512-rE9DTN1BRhzkzqNQO+kw8ZgfeEBCLXiHJwetk668shmNBpSagQxneT5eSqEBLP+cqSiAeecvQmbpFfdMyLcIQA==", "dev": true, "dependencies": { "diff-sequences": "^29.6.3", @@ -4648,9 +4648,9 @@ } }, "node_modules/vite-node": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.5.2.tgz", - "integrity": "sha512-Y8p91kz9zU+bWtF7HGt6DVw2JbhyuB2RlZix3FPYAYmUyZ3n7iTp8eSyLyY6sxtPegvxQtmlTMhfPhUfCUF93A==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.5.3.tgz", + "integrity": "sha512-axFo00qiCpU/JLd8N1gu9iEYL3xTbMbMrbe5nDp9GL0nb6gurIdZLkkFogZXWnE8Oyy5kfSLwNVIcVsnhE7lgQ==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -4683,16 +4683,16 @@ } }, "node_modules/vitest": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.5.2.tgz", - "integrity": "sha512-l9gwIkq16ug3xY7BxHwcBQovLZG75zZL0PlsiYQbf76Rz6QGs54416UWMtC0jXeihvHvcHrf2ROEjkQRVpoZYw==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.5.3.tgz", + "integrity": "sha512-2oM7nLXylw3mQlW6GXnRriw+7YvZFk/YNV8AxIC3Z3MfFbuziLGWP9GPxxu/7nRlXhqyxBikpamr+lEEj1sUEw==", "dev": true, "dependencies": { - "@vitest/expect": "1.5.2", - "@vitest/runner": "1.5.2", - "@vitest/snapshot": "1.5.2", - "@vitest/spy": "1.5.2", - "@vitest/utils": "1.5.2", + "@vitest/expect": "1.5.3", + "@vitest/runner": "1.5.3", + "@vitest/snapshot": "1.5.3", + "@vitest/spy": "1.5.3", + "@vitest/utils": "1.5.3", "acorn-walk": "^8.3.2", "chai": "^4.3.10", "debug": "^4.3.4", @@ -4706,7 +4706,7 @@ "tinybench": "^2.5.1", "tinypool": "^0.8.3", "vite": "^5.0.0", - "vite-node": "1.5.2", + "vite-node": "1.5.3", "why-is-node-running": "^2.2.2" }, "bin": { @@ -4721,8 +4721,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.5.2", - "@vitest/ui": "1.5.2", + "@vitest/browser": "1.5.3", + "@vitest/ui": "1.5.3", "happy-dom": "*", "jsdom": "*" }, diff --git a/modules/frontend/package.json b/modules/frontend/package.json index 779cce9b7..f05e1112f 100644 --- a/modules/frontend/package.json +++ b/modules/frontend/package.json @@ -1,6 +1,6 @@ { "name": "blaze-frontend", - "version": "0.26.1", + "version": "0.26.2", "private": true, "scripts": { "dev": "vite dev", @@ -41,7 +41,7 @@ "tslib": "^2.4.1", "typescript": "^5.0.0", "vite": "^5.0.0", - "vitest": "1.5.2" + "vitest": "1.5.3" }, "type": "module", "dependencies": { diff --git a/modules/http-client/deps.edn b/modules/http-client/deps.edn index 20378923a..86e0f4500 100644 --- a/modules/http-client/deps.edn +++ b/modules/http-client/deps.edn @@ -16,7 +16,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/http-client/src/blaze/http_client.clj b/modules/http-client/src/blaze/http_client.clj index 5967e0323..bb5cbca65 100644 --- a/modules/http-client/src/blaze/http_client.clj +++ b/modules/http-client/src/blaze/http_client.clj @@ -1,12 +1,13 @@ (ns blaze.http-client (:require [blaze.http-client.spec] + [blaze.module :as m] [clojure.spec.alpha :as s] [hato.client :as hc] [integrant.core :as ig] [taoensso.timbre :as log])) -(defmethod ig/pre-init-spec :blaze/http-client [_] +(defmethod m/pre-init-spec :blaze/http-client [_] (s/keys :opt-un [::connect-timeout ::trust-store ::trust-store-pass])) (defn init-msg [connect-timeout trust-store] diff --git a/modules/http-client/test/blaze/http_client_test.clj b/modules/http-client/test/blaze/http_client_test.clj index 489729481..415a6e200 100644 --- a/modules/http-client/test/blaze/http_client_test.clj +++ b/modules/http-client/test/blaze/http_client_test.clj @@ -38,28 +38,28 @@ (given-thrown (ig/init {:blaze/http-client nil}) :key := :blaze/http-client :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "invalid connect timeout" (given-thrown (ig/init {:blaze/http-client {:connect-timeout ::invalid}}) :key := :blaze/http-client :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `pos-int? - [:explain ::s/problems 0 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `pos-int? + [:cause-data ::s/problems 0 :val] := ::invalid)) (testing "invalid trust store" (given-thrown (ig/init {:blaze/http-client {:trust-store ::invalid}}) :key := :blaze/http-client :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `string? - [:explain ::s/problems 0 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `string? + [:cause-data ::s/problems 0 :val] := ::invalid)) (testing "invalid trust store password" (given-thrown (ig/init {:blaze/http-client {:trust-store-pass ::invalid}}) :key := :blaze/http-client :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `string? - [:explain ::s/problems 0 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `string? + [:cause-data ::s/problems 0 :val] := ::invalid)) (testing "default config" (with-system [{:blaze/keys [http-client]} {:blaze/http-client {}}] diff --git a/modules/interaction/deps.edn b/modules/interaction/deps.edn index ab0dbfc07..2b905c8c2 100644 --- a/modules/interaction/deps.edn +++ b/modules/interaction/deps.edn @@ -28,7 +28,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/interaction/src/blaze/interaction/create.clj b/modules/interaction/src/blaze/interaction/create.clj index cf3228f5b..c4b77eb36 100644 --- a/modules/interaction/src/blaze/interaction/create.clj +++ b/modules/interaction/src/blaze/interaction/create.clj @@ -12,6 +12,7 @@ [blaze.fhir.spec.type :as type] [blaze.handler.util :as handler-util] [blaze.interaction.util :as iu] + [blaze.module :as m] [clojure.spec.alpha :as s] [clojure.string :as str] [cognitect.anomalies :as anom] @@ -90,7 +91,7 @@ (handler request) ac/completed-future))) -(defmethod ig/pre-init-spec :blaze.interaction/create [_] +(defmethod m/pre-init-spec :blaze.interaction/create [_] (s/keys :req-un [:blaze.db/node :blaze/clock :blaze/rng-fn])) (defmethod ig/init-key :blaze.interaction/create [_ context] diff --git a/modules/interaction/src/blaze/interaction/delete.clj b/modules/interaction/src/blaze/interaction/delete.clj index 3e30f4b8c..477030c5d 100644 --- a/modules/interaction/src/blaze/interaction/delete.clj +++ b/modules/interaction/src/blaze/interaction/delete.clj @@ -7,6 +7,7 @@ [blaze.db.api :as d] [blaze.db.spec] [blaze.handler.fhir.util :as fhir-util] + [blaze.module :as m] [clojure.spec.alpha :as s] [integrant.core :as ig] [reitit.core :as reitit] @@ -20,7 +21,7 @@ (ring/header "Last-Modified" (fhir-util/last-modified tx)) (ring/header "ETag" (fhir-util/etag tx))))) -(defmethod ig/pre-init-spec :blaze.interaction/delete [_] +(defmethod m/pre-init-spec :blaze.interaction/delete [_] (s/keys :req-un [:blaze.db/node])) (defmethod ig/init-key :blaze.interaction/delete [_ {:keys [node]}] diff --git a/modules/interaction/src/blaze/interaction/history/instance.clj b/modules/interaction/src/blaze/interaction/history/instance.clj index 733224dc3..b6d087784 100644 --- a/modules/interaction/src/blaze/interaction/history/instance.clj +++ b/modules/interaction/src/blaze/interaction/history/instance.clj @@ -11,6 +11,7 @@ [blaze.handler.fhir.util :as fhir-util] [blaze.interaction.history.util :as history-util] [blaze.interaction.util :as iu] + [blaze.module :as m] [blaze.spec] [clojure.spec.alpha :as s] [cognitect.anomalies :as anom] @@ -54,7 +55,7 @@ (< page-size (count paged-version-handles)) (update :link conj (next-link (peek paged-version-handles)))))))))) -(defmethod ig/pre-init-spec :blaze.interaction.history/instance [_] +(defmethod m/pre-init-spec :blaze.interaction.history/instance [_] (s/keys :req-un [:blaze/clock :blaze/rng-fn])) (defmethod ig/init-key :blaze.interaction.history/instance [_ context] diff --git a/modules/interaction/src/blaze/interaction/history/system.clj b/modules/interaction/src/blaze/interaction/history/system.clj index f8245000c..c6c573c86 100644 --- a/modules/interaction/src/blaze/interaction/history/system.clj +++ b/modules/interaction/src/blaze/interaction/history/system.clj @@ -11,6 +11,7 @@ [blaze.handler.fhir.util :as fhir-util] [blaze.interaction.history.util :as history-util] [blaze.interaction.util :as iu] + [blaze.module :as m] [blaze.spec] [blaze.util :refer [conj-vec]] [clojure.spec.alpha :as s] @@ -59,7 +60,7 @@ (< page-size (count paged-version-handles)) (update :link conj-vec (next-link (peek paged-version-handles)))))))))) -(defmethod ig/pre-init-spec :blaze.interaction.history/system [_] +(defmethod m/pre-init-spec :blaze.interaction.history/system [_] (s/keys :req-un [:blaze/clock :blaze/rng-fn])) (defmethod ig/init-key :blaze.interaction.history/system [_ context] diff --git a/modules/interaction/src/blaze/interaction/history/type.clj b/modules/interaction/src/blaze/interaction/history/type.clj index 14f6dd95e..c2fd89fcd 100644 --- a/modules/interaction/src/blaze/interaction/history/type.clj +++ b/modules/interaction/src/blaze/interaction/history/type.clj @@ -10,6 +10,7 @@ [blaze.handler.fhir.util :as fhir-util] [blaze.interaction.history.util :as history-util] [blaze.interaction.util :as iu] + [blaze.module :as m] [blaze.spec] [blaze.util :refer [conj-vec]] [clojure.spec.alpha :as s] @@ -56,7 +57,7 @@ (< page-size (count paged-version-handles)) (update :link conj-vec (next-link (peek paged-version-handles)))))))))) -(defmethod ig/pre-init-spec :blaze.interaction.history/type [_] +(defmethod m/pre-init-spec :blaze.interaction.history/type [_] (s/keys :req-un [:blaze/clock :blaze/rng-fn])) (defmethod ig/init-key :blaze.interaction.history/type [_ context] diff --git a/modules/interaction/src/blaze/interaction/search_compartment.clj b/modules/interaction/src/blaze/interaction/search_compartment.clj index bd6778787..bd9747104 100644 --- a/modules/interaction/src/blaze/interaction/search_compartment.clj +++ b/modules/interaction/src/blaze/interaction/search_compartment.clj @@ -10,6 +10,7 @@ [blaze.interaction.search.params :as params] [blaze.interaction.search.util :as search-util] [blaze.interaction.util :as iu] + [blaze.module :as m] [blaze.page-store.spec] [blaze.spec] [clojure.spec.alpha :as s] @@ -136,7 +137,7 @@ handling (assoc :blaze.preference/handling handling)))))) -(defmethod ig/pre-init-spec :blaze.interaction/search-compartment [_] +(defmethod m/pre-init-spec :blaze.interaction/search-compartment [_] (s/keys :req-un [:blaze/clock :blaze/rng-fn :blaze/page-store])) (defmethod ig/init-key :blaze.interaction/search-compartment [_ context] diff --git a/modules/interaction/src/blaze/interaction/search_system.clj b/modules/interaction/src/blaze/interaction/search_system.clj index ea432168e..9316176ac 100644 --- a/modules/interaction/src/blaze/interaction/search_system.clj +++ b/modules/interaction/src/blaze/interaction/search_system.clj @@ -12,6 +12,7 @@ [blaze.interaction.search.params :as params] [blaze.interaction.search.util :as search-util] [blaze.interaction.util :as iu] + [blaze.module :as m] [blaze.page-store.spec] [blaze.util :refer [conj-vec]] [clojure.spec.alpha :as s] @@ -109,7 +110,7 @@ :page-match (reitit/match-by-name router :page) :params params)))) -(defmethod ig/pre-init-spec :blaze.interaction/search-system [_] +(defmethod m/pre-init-spec :blaze.interaction/search-system [_] (s/keys :req-un [:blaze/clock :blaze/rng-fn :blaze/page-store])) (defmethod ig/init-key :blaze.interaction/search-system [_ context] diff --git a/modules/interaction/src/blaze/interaction/search_type.clj b/modules/interaction/src/blaze/interaction/search_type.clj index 161abf524..0f25e401a 100644 --- a/modules/interaction/src/blaze/interaction/search_type.clj +++ b/modules/interaction/src/blaze/interaction/search_type.clj @@ -14,6 +14,7 @@ [blaze.interaction.search.params :as params] [blaze.interaction.search.util :as search-util] [blaze.interaction.util :as iu] + [blaze.module :as m] [blaze.page-store :as page-store] [blaze.page-store.spec] [blaze.spec] @@ -291,7 +292,7 @@ handling (assoc :blaze.preference/handling handling))))) -(defmethod ig/pre-init-spec :blaze.interaction/search-type [_] +(defmethod m/pre-init-spec :blaze.interaction/search-type [_] (s/keys :req-un [:blaze/clock :blaze/rng-fn :blaze/page-store])) (defmethod ig/init-key :blaze.interaction/search-type [_ context] diff --git a/modules/interaction/src/blaze/interaction/transaction.clj b/modules/interaction/src/blaze/interaction/transaction.clj index 0c6e1c99b..3ff91d57f 100644 --- a/modules/interaction/src/blaze/interaction/transaction.clj +++ b/modules/interaction/src/blaze/interaction/transaction.clj @@ -4,7 +4,7 @@ https://www.hl7.org/fhir/http.html#transaction" (:require [blaze.anomaly :as ba :refer [if-ok when-ok]] - [blaze.async.comp :as ac :refer [do-sync do-async]] + [blaze.async.comp :as ac :refer [do-async do-sync]] [blaze.coll.core :as coll] [blaze.db.api :as d] [blaze.fhir.spec :as fhir-spec] @@ -14,6 +14,7 @@ [blaze.interaction.transaction.bundle :as bundle] [blaze.interaction.transaction.bundle.url :as url] [blaze.interaction.util :as iu] + [blaze.module :as m] [blaze.spec] [clojure.spec.alpha :as s] [clojure.string :as str] @@ -501,7 +502,7 @@ :type (type/code (str (type/value type) "-response")) :entry entries}) -(defmethod ig/pre-init-spec :blaze.interaction/transaction [_] +(defmethod m/pre-init-spec :blaze.interaction/transaction [_] (s/keys :req-un [:blaze.db/node :blaze/clock :blaze/rng-fn])) (defmethod ig/init-key :blaze.interaction/transaction [_ context] diff --git a/modules/interaction/src/blaze/interaction/update.clj b/modules/interaction/src/blaze/interaction/update.clj index 554839ec4..75648d207 100644 --- a/modules/interaction/src/blaze/interaction/update.clj +++ b/modules/interaction/src/blaze/interaction/update.clj @@ -10,6 +10,7 @@ [blaze.fhir.spec.type :as type] [blaze.handler.util :as handler-util] [blaze.interaction.util :as iu] + [blaze.module :as m] [clojure.spec.alpha :as s] [cognitect.anomalies :as anom] [integrant.core :as ig] @@ -81,7 +82,7 @@ new-handle))))) ac/completed-future)) -(defmethod ig/pre-init-spec :blaze.interaction/update [_] +(defmethod m/pre-init-spec :blaze.interaction/update [_] (s/keys :req-un [:blaze.db/node])) (defmethod ig/init-key :blaze.interaction/update [_ context] diff --git a/modules/interaction/test/blaze/interaction/create_test.clj b/modules/interaction/test/blaze/interaction/create_test.clj index fcd37daac..88b19b830 100644 --- a/modules/interaction/test/blaze/interaction/create_test.clj +++ b/modules/interaction/test/blaze/interaction/create_test.clj @@ -50,24 +50,24 @@ (given-thrown (ig/init {:blaze.interaction/create nil}) :key := :blaze.interaction/create :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.interaction/create {}}) :key := :blaze.interaction/create :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :node)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :clock)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :node)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :clock)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)))) (testing "invalid node" (given-thrown (ig/init {:blaze.interaction/create {:node ::invalid}}) :key := :blaze.interaction/create :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :clock)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) - [:explain ::s/problems 2 :pred] := `node? - [:explain ::s/problems 2 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :clock)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) + [:cause-data ::s/problems 2 :pred] := `node? + [:cause-data ::s/problems 2 :val] := ::invalid))) (def config (assoc diff --git a/modules/interaction/test/blaze/interaction/delete_test.clj b/modules/interaction/test/blaze/interaction/delete_test.clj index cda88aaa2..1bcfb064f 100644 --- a/modules/interaction/test/blaze/interaction/delete_test.clj +++ b/modules/interaction/test/blaze/interaction/delete_test.clj @@ -25,20 +25,20 @@ (given-thrown (ig/init {:blaze.interaction/delete nil}) :key := :blaze.interaction/delete :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.interaction/delete {}}) :key := :blaze.interaction/delete :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :node)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :node)))) (testing "invalid executor" (given-thrown (ig/init {:blaze.interaction/delete {:node ::invalid}}) :key := :blaze.interaction/delete :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `node? - [:explain ::s/problems 0 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `node? + [:cause-data ::s/problems 0 :val] := ::invalid))) (def config (assoc api-stub/mem-node-config diff --git a/modules/interaction/test/blaze/interaction/history/instance_test.clj b/modules/interaction/test/blaze/interaction/history/instance_test.clj index 60c52333a..4dfe1cada 100644 --- a/modules/interaction/test/blaze/interaction/history/instance_test.clj +++ b/modules/interaction/test/blaze/interaction/history/instance_test.clj @@ -73,22 +73,22 @@ (given-thrown (ig/init {:blaze.interaction.history/instance nil}) :key := :blaze.interaction.history/instance :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.interaction.history/instance {}}) :key := :blaze.interaction.history/instance :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :clock)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :clock)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)))) (testing "invalid clock" (given-thrown (ig/init {:blaze.interaction.history/instance {:clock ::invalid}}) :key := :blaze.interaction.history/instance :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) - [:explain ::s/problems 1 :pred] := `time/clock? - [:explain ::s/problems 1 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) + [:cause-data ::s/problems 1 :pred] := `time/clock? + [:cause-data ::s/problems 1 :val] := ::invalid))) (def config (assoc api-stub/mem-node-config diff --git a/modules/interaction/test/blaze/interaction/history/system_test.clj b/modules/interaction/test/blaze/interaction/history/system_test.clj index 9399c0bab..dcb0b1cdf 100644 --- a/modules/interaction/test/blaze/interaction/history/system_test.clj +++ b/modules/interaction/test/blaze/interaction/history/system_test.clj @@ -64,22 +64,22 @@ (given-thrown (ig/init {:blaze.interaction.history/system nil}) :key := :blaze.interaction.history/system :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.interaction.history/system {}}) :key := :blaze.interaction.history/system :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :clock)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :clock)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)))) (testing "invalid clock" (given-thrown (ig/init {:blaze.interaction.history/system {:clock ::invalid}}) :key := :blaze.interaction.history/system :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) - [:explain ::s/problems 1 :pred] := `time/clock? - [:explain ::s/problems 1 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) + [:cause-data ::s/problems 1 :pred] := `time/clock? + [:cause-data ::s/problems 1 :val] := ::invalid))) (def config (assoc api-stub/mem-node-config diff --git a/modules/interaction/test/blaze/interaction/history/type_test.clj b/modules/interaction/test/blaze/interaction/history/type_test.clj index d98a7f056..1e550468c 100644 --- a/modules/interaction/test/blaze/interaction/history/type_test.clj +++ b/modules/interaction/test/blaze/interaction/history/type_test.clj @@ -72,22 +72,22 @@ (given-thrown (ig/init {:blaze.interaction.history/type nil}) :key := :blaze.interaction.history/type :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.interaction.history/type {}}) :key := :blaze.interaction.history/type :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :clock)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :clock)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)))) (testing "invalid clock" (given-thrown (ig/init {:blaze.interaction.history/type {:clock ::invalid}}) :key := :blaze.interaction.history/type :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) - [:explain ::s/problems 1 :pred] := `time/clock? - [:explain ::s/problems 1 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) + [:cause-data ::s/problems 1 :pred] := `time/clock? + [:cause-data ::s/problems 1 :val] := ::invalid))) (def config (assoc api-stub/mem-node-config diff --git a/modules/interaction/test/blaze/interaction/search_compartment_test.clj b/modules/interaction/test/blaze/interaction/search_compartment_test.clj index ec3567f42..376fc2700 100644 --- a/modules/interaction/test/blaze/interaction/search_compartment_test.clj +++ b/modules/interaction/test/blaze/interaction/search_compartment_test.clj @@ -53,24 +53,24 @@ (given-thrown (ig/init {:blaze.interaction/search-compartment nil}) :key := :blaze.interaction/search-compartment :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.interaction/search-compartment {}}) :key := :blaze.interaction/search-compartment :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :clock)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :page-store)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :clock)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :page-store)))) (testing "invalid clock" (given-thrown (ig/init {:blaze.interaction/search-compartment {:clock ::invalid}}) :key := :blaze.interaction/search-compartment :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :page-store)) - [:explain ::s/problems 2 :pred] := `time/clock? - [:explain ::s/problems 2 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :page-store)) + [:cause-data ::s/problems 2 :pred] := `time/clock? + [:cause-data ::s/problems 2 :val] := ::invalid))) (def config (assoc api-stub/mem-node-config diff --git a/modules/interaction/test/blaze/interaction/search_system_test.clj b/modules/interaction/test/blaze/interaction/search_system_test.clj index 099878a4b..8bb86c350 100644 --- a/modules/interaction/test/blaze/interaction/search_system_test.clj +++ b/modules/interaction/test/blaze/interaction/search_system_test.clj @@ -60,24 +60,24 @@ (given-thrown (ig/init {:blaze.interaction/search-system nil}) :key := :blaze.interaction/search-system :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.interaction/search-system {}}) :key := :blaze.interaction/search-system :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :clock)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :page-store)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :clock)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :page-store)))) (testing "invalid clock" (given-thrown (ig/init {:blaze.interaction/search-system {:clock ::invalid}}) :key := :blaze.interaction/search-system :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :page-store)) - [:explain ::s/problems 2 :pred] := `time/clock? - [:explain ::s/problems 2 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :page-store)) + [:cause-data ::s/problems 2 :pred] := `time/clock? + [:cause-data ::s/problems 2 :val] := ::invalid))) (def config (assoc api-stub/mem-node-config diff --git a/modules/interaction/test/blaze/interaction/search_type_test.clj b/modules/interaction/test/blaze/interaction/search_type_test.clj index 75992a9e6..5eccaecc1 100644 --- a/modules/interaction/test/blaze/interaction/search_type_test.clj +++ b/modules/interaction/test/blaze/interaction/search_type_test.clj @@ -89,24 +89,24 @@ (given-thrown (ig/init {:blaze.interaction/search-type nil}) :key := :blaze.interaction/search-type :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.interaction/search-type {}}) :key := :blaze.interaction/search-type :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :clock)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :page-store)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :clock)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :page-store)))) (testing "invalid clock" (given-thrown (ig/init {:blaze.interaction/search-type {:clock ::invalid}}) :key := :blaze.interaction/search-type :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :page-store)) - [:explain ::s/problems 2 :pred] := `time/clock? - [:explain ::s/problems 2 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :page-store)) + [:cause-data ::s/problems 2 :pred] := `time/clock? + [:cause-data ::s/problems 2 :val] := ::invalid))) (def config (assoc api-stub/mem-node-config diff --git a/modules/interaction/test/blaze/interaction/transaction_test.clj b/modules/interaction/test/blaze/interaction/transaction_test.clj index 8181e80b3..c759bc560 100644 --- a/modules/interaction/test/blaze/interaction/transaction_test.clj +++ b/modules/interaction/test/blaze/interaction/transaction_test.clj @@ -104,24 +104,24 @@ (given-thrown (ig/init {:blaze.interaction/transaction nil}) :key := :blaze.interaction/transaction :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.interaction/transaction {}}) :key := :blaze.interaction/transaction :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :node)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :clock)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :node)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :clock)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)))) (testing "invalid node" (given-thrown (ig/init {:blaze.interaction/transaction {:node ::invalid}}) :key := :blaze.interaction/transaction :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :clock)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) - [:explain ::s/problems 2 :pred] := `node? - [:explain ::s/problems 2 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :clock)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) + [:cause-data ::s/problems 2 :pred] := `node? + [:cause-data ::s/problems 2 :val] := ::invalid))) (def config (assoc api-stub/mem-node-config diff --git a/modules/interaction/test/blaze/interaction/update_test.clj b/modules/interaction/test/blaze/interaction/update_test.clj index 62147d811..93604cf37 100644 --- a/modules/interaction/test/blaze/interaction/update_test.clj +++ b/modules/interaction/test/blaze/interaction/update_test.clj @@ -58,20 +58,20 @@ (given-thrown (ig/init {:blaze.interaction/update nil}) :key := :blaze.interaction/update :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.interaction/update {}}) :key := :blaze.interaction/update :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :node)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :node)))) (testing "invalid node" (given-thrown (ig/init {:blaze.interaction/update {:node ::invalid}}) :key := :blaze.interaction/update :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `node? - [:explain ::s/problems 0 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `node? + [:cause-data ::s/problems 0 :val] := ::invalid))) (def config (assoc api-stub/mem-node-config diff --git a/modules/jepsen/deps.edn b/modules/jepsen/deps.edn index b19e8a720..12ce79c8b 100644 --- a/modules/jepsen/deps.edn +++ b/modules/jepsen/deps.edn @@ -16,7 +16,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/job-re-index/deps.edn b/modules/job-re-index/deps.edn index 7ad05f30d..82bc40717 100644 --- a/modules/job-re-index/deps.edn +++ b/modules/job-re-index/deps.edn @@ -18,7 +18,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/job-scheduler/deps.edn b/modules/job-scheduler/deps.edn index 04d644198..8864536aa 100644 --- a/modules/job-scheduler/deps.edn +++ b/modules/job-scheduler/deps.edn @@ -21,7 +21,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/job-scheduler/src/blaze/job_scheduler.clj b/modules/job-scheduler/src/blaze/job_scheduler.clj index a60e4785f..9e50cef24 100644 --- a/modules/job-scheduler/src/blaze/job_scheduler.clj +++ b/modules/job-scheduler/src/blaze/job_scheduler.clj @@ -9,6 +9,7 @@ [blaze.fhir.spec.type :as type] [blaze.job-scheduler.job-util :as job-util] [blaze.luid :as luid] + [blaze.module :as m] [blaze.spec] [clojure.spec.alpha :as s] [cognitect.anomalies :as anom] @@ -225,7 +226,7 @@ (keys @running-jobs))) (some-> (vals @running-jobs) ac/all-of ac/join)) -(defmethod ig/pre-init-spec :blaze/job-scheduler [_] +(defmethod m/pre-init-spec :blaze/job-scheduler [_] (s/keys :req-un [::main-node ::admin-node :blaze/clock :blaze/rng-fn])) (defmethod ig/init-key :blaze/job-scheduler diff --git a/modules/job-scheduler/test/blaze/job_scheduler_test.clj b/modules/job-scheduler/test/blaze/job_scheduler_test.clj index 930765676..b60239897 100644 --- a/modules/job-scheduler/test/blaze/job_scheduler_test.clj +++ b/modules/job-scheduler/test/blaze/job_scheduler_test.clj @@ -172,56 +172,56 @@ (given-thrown (ig/init {:blaze/job-scheduler nil}) :key := :blaze/job-scheduler :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze/job-scheduler {}}) :key := :blaze/job-scheduler :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :main-node)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :admin-node)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :clock)) - [:explain ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :main-node)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :admin-node)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :clock)) + [:cause-data ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)))) (testing "invalid main node" (given-thrown (ig/init {:blaze/job-scheduler {:main-node ::invalid}}) :key := :blaze/job-scheduler :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :admin-node)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :clock)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) - [:explain ::s/problems 3 :pred] := `node? - [:explain ::s/problems 3 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :admin-node)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :clock)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) + [:cause-data ::s/problems 3 :pred] := `node? + [:cause-data ::s/problems 3 :val] := ::invalid)) (testing "invalid admin node" (given-thrown (ig/init {:blaze/job-scheduler {:admin-node ::invalid}}) :key := :blaze/job-scheduler :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :main-node)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :clock)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) - [:explain ::s/problems 3 :pred] := `node? - [:explain ::s/problems 3 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :main-node)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :clock)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) + [:cause-data ::s/problems 3 :pred] := `node? + [:cause-data ::s/problems 3 :val] := ::invalid)) (testing "invalid clock" (given-thrown (ig/init {:blaze/job-scheduler {:clock ::invalid}}) :key := :blaze/job-scheduler :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :main-node)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :admin-node)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) - [:explain ::s/problems 3 :pred] := `time/clock? - [:explain ::s/problems 3 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :main-node)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :admin-node)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) + [:cause-data ::s/problems 3 :pred] := `time/clock? + [:cause-data ::s/problems 3 :val] := ::invalid)) (testing "invalid rng-fn" (given-thrown (ig/init {:blaze/job-scheduler {:rng-fn ::invalid}}) :key := :blaze/job-scheduler :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :main-node)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :admin-node)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :clock)) - [:explain ::s/problems 3 :pred] := `fn? - [:explain ::s/problems 3 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :main-node)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :admin-node)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :clock)) + [:cause-data ::s/problems 3 :pred] := `fn? + [:cause-data ::s/problems 3 :val] := ::invalid)) (testing "success" (with-system [{:blaze/keys [job-scheduler]} config] diff --git a/modules/kv/deps.edn b/modules/kv/deps.edn index e0907b045..6472cf2ba 100644 --- a/modules/kv/deps.edn +++ b/modules/kv/deps.edn @@ -38,7 +38,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/kv/src/blaze/db/kv/mem.clj b/modules/kv/src/blaze/db/kv/mem.clj index 199fa1fed..bfab9fd71 100644 --- a/modules/kv/src/blaze/db/kv/mem.clj +++ b/modules/kv/src/blaze/db/kv/mem.clj @@ -8,6 +8,7 @@ [blaze.db.kv :as kv] [blaze.db.kv.protocols :as p] [blaze.db.kv.spec] + [blaze.module :as m] [clojure.spec.alpha :as s] [integrant.core :as ig] [taoensso.timbre :as log]) @@ -189,7 +190,7 @@ (defn- init-db [column-families] (into {} (map init-column-family) column-families)) -(defmethod ig/pre-init-spec ::kv/mem [_] +(defmethod m/pre-init-spec ::kv/mem [_] (s/keys :req-un [::kv/column-families])) (defmethod ig/init-key ::kv/mem diff --git a/modules/kv/test/blaze/db/kv/mem_test.clj b/modules/kv/test/blaze/db/kv/mem_test.clj index b535cfa6f..3887f5182 100644 --- a/modules/kv/test/blaze/db/kv/mem_test.clj +++ b/modules/kv/test/blaze/db/kv/mem_test.clj @@ -48,13 +48,13 @@ (given-thrown (ig/init {::kv/mem nil}) :key := ::kv/mem :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {::kv/mem {}}) :key := ::kv/mem :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :column-families))))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :column-families))))) (defn- iterator-invalid-anom? [anom] (and (ba/fault? anom) (= "The iterator is invalid." (::anom/message anom)))) diff --git a/modules/luid/deps.edn b/modules/luid/deps.edn index 4d65677b7..aa6c30761 100644 --- a/modules/luid/deps.edn +++ b/modules/luid/deps.edn @@ -16,7 +16,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/metrics/deps.edn b/modules/metrics/deps.edn index e3c5c26c5..3a702545e 100644 --- a/modules/metrics/deps.edn +++ b/modules/metrics/deps.edn @@ -29,7 +29,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/metrics/src/blaze/metrics/handler.clj b/modules/metrics/src/blaze/metrics/handler.clj index d42271aa8..c6929ab7e 100644 --- a/modules/metrics/src/blaze/metrics/handler.clj +++ b/modules/metrics/src/blaze/metrics/handler.clj @@ -1,12 +1,13 @@ (ns blaze.metrics.handler (:require [blaze.metrics.spec] + [blaze.module :as m] [clojure.spec.alpha :as s] [integrant.core :as ig] [prometheus.alpha :as prom] [taoensso.timbre :as log])) -(defmethod ig/pre-init-spec :blaze.metrics/handler [_] +(defmethod m/pre-init-spec :blaze.metrics/handler [_] (s/keys :req-un [:blaze.metrics/registry])) (defmethod ig/init-key :blaze.metrics/handler diff --git a/modules/metrics/src/blaze/metrics/registry.clj b/modules/metrics/src/blaze/metrics/registry.clj index 2e3b74a5e..27f8d1705 100644 --- a/modules/metrics/src/blaze/metrics/registry.clj +++ b/modules/metrics/src/blaze/metrics/registry.clj @@ -2,19 +2,20 @@ (:require [blaze.metrics.core :as metrics] [blaze.metrics.spec] + [blaze.module :as m] [clojure.spec.alpha :as s] [integrant.core :as ig] [taoensso.timbre :as log]) (:import [io.prometheus.client CollectorRegistry] [io.prometheus.client.hotspot - StandardExports MemoryPoolsExports - GarbageCollectorExports ThreadExports - ClassLoadingExports VersionInfoExports])) + ClassLoadingExports GarbageCollectorExports + MemoryPoolsExports StandardExports + ThreadExports VersionInfoExports])) (set! *warn-on-reflection* true) -(defmethod ig/pre-init-spec :blaze.metrics/registry [_] +(defmethod m/pre-init-spec :blaze.metrics/registry [_] (s/keys :opt-un [:blaze.metrics/collectors])) (defn- register-collectors! [registry collectors] diff --git a/modules/metrics/test/blaze/metrics/handler_test.clj b/modules/metrics/test/blaze/metrics/handler_test.clj index cabc26c3e..560c55c9b 100644 --- a/modules/metrics/test/blaze/metrics/handler_test.clj +++ b/modules/metrics/test/blaze/metrics/handler_test.clj @@ -23,20 +23,20 @@ (given-thrown (ig/init {:blaze.metrics/handler nil}) :key := :blaze.metrics/handler :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.metrics/handler {}}) :key := :blaze.metrics/handler :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :registry)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :registry)))) (testing "invalid registry" (given-thrown (ig/init {:blaze.metrics/handler {:registry ::invalid}}) :key := :blaze.metrics/handler :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `spec/registry? - [:explain ::s/problems 0 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `spec/registry? + [:cause-data ::s/problems 0 :val] := ::invalid))) (def config {:blaze.metrics/handler {:registry (ig/ref :blaze.metrics/registry)} diff --git a/modules/metrics/test/blaze/metrics/registry_test.clj b/modules/metrics/test/blaze/metrics/registry_test.clj index d5f3f20c1..41f94dc78 100644 --- a/modules/metrics/test/blaze/metrics/registry_test.clj +++ b/modules/metrics/test/blaze/metrics/registry_test.clj @@ -25,14 +25,14 @@ (given-thrown (ig/init {:blaze.metrics/registry nil}) :key := :blaze.metrics/registry :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "invalid collectors" (given-thrown (ig/init {:blaze.metrics/registry {:collectors ::invalid}}) :key := :blaze.metrics/registry :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `coll? - [:explain ::s/problems 0 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `coll? + [:cause-data ::s/problems 0 :val] := ::invalid))) (def collector (metrics/collector [(metrics/counter-metric "foo_total" "" [] [])])) diff --git a/modules/module-base/deps.edn b/modules/module-base/deps.edn index 0d73d6a01..3a6cff706 100644 --- a/modules/module-base/deps.edn +++ b/modules/module-base/deps.edn @@ -5,10 +5,10 @@ {:local/root "../anomaly"} com.taoensso/timbre - {:mvn/version "5.2.1"} + {:mvn/version "6.5.0"} com.google.guava/guava - {:mvn/version "33.1.0-jre" + {:mvn/version "33.2.0-jre" :exclusions [com.google.code.findbugs/jsr305 org.checkerframework/checker-qual @@ -16,7 +16,7 @@ com.google.j2objc/j2objc-annotations]} integrant/integrant - {:mvn/version "0.8.1"} + {:mvn/version "0.9.0"} prom-metrics/prom-metrics {:mvn/version "0.6-alpha.7"}} @@ -32,7 +32,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/module-base/src/blaze/module.clj b/modules/module-base/src/blaze/module.clj index f2b648849..98e1e304a 100644 --- a/modules/module-base/src/blaze/module.clj +++ b/modules/module-base/src/blaze/module.clj @@ -1,5 +1,6 @@ (ns blaze.module (:require + [clojure.spec.alpha :as s] [integrant.core :as ig])) (defmacro reg-collector @@ -9,3 +10,18 @@ (defmethod ig/init-key ~key ~'[_ _] ~collector) (derive ~key :blaze.metrics/collector))) + +(defmulti pre-init-spec + "Return a spec for the supplied key that is used to check the associated + value before the key is initiated. + + Backport of integrant up to v0.8 available multi-method." + {:arglists '([key])} + ig/normalize-key) + +(defmethod pre-init-spec :default [_]) + +(defmethod ig/assert-key :default [k v] + (when-let [spec (pre-init-spec k)] + (when-not (s/valid? spec v) + (throw (ex-info "" (s/explain-data spec v)))))) diff --git a/modules/module-base/test/blaze/module_test.clj b/modules/module-base/test/blaze/module_test.clj index d47de611b..18e320eb5 100644 --- a/modules/module-base/test/blaze/module_test.clj +++ b/modules/module-base/test/blaze/module_test.clj @@ -1,9 +1,10 @@ (ns blaze.module-test (:require - [blaze.module :refer [reg-collector]] - [blaze.test-util :as tu] + [blaze.module :as m :refer [reg-collector]] + [blaze.test-util :as tu :refer [given-thrown]] + [clojure.spec.alpha :as s] [clojure.spec.test.alpha :as st] - [clojure.test :as test :refer [deftest is]] + [clojure.test :as test :refer [deftest is testing]] [integrant.core :as ig] [prometheus.alpha :refer [defcounter]]) (:import @@ -21,3 +22,25 @@ collector) (is (instance? Collector (::collector (ig/init {::collector nil}))))) + +(defmethod m/pre-init-spec ::bar [_] int?) + +(deftest pre-init-spec-test + (testing "returns nil per default" + (is (nil? (m/pre-init-spec ::foo)))) + + (testing "returns the defined spec" + (is (= int? (m/pre-init-spec ::bar))))) + +(deftest assert-key-test + (testing "doesn't throw on default nil spec" + (ig/assert-key ::foo 0)) + + (testing "doesn't throw on valid value" + (ig/assert-key ::bar 0)) + + (testing "doesn't throw on valid value" + (given-thrown (ig/assert-key ::bar "a") + ::s/value := "a" + [::s/problems 0 :pred] := `int? + [::s/problems 0 :val] := "a"))) diff --git a/modules/module-test-util/deps.edn b/modules/module-test-util/deps.edn index 229bf887c..2aed9a9d7 100644 --- a/modules/module-test-util/deps.edn +++ b/modules/module-test-util/deps.edn @@ -8,4 +8,4 @@ {:local/root "../test-util"} integrant/integrant - {:mvn/version "0.8.1"}}} + {:mvn/version "0.9.0"}}} diff --git a/modules/openid-auth/deps.edn b/modules/openid-auth/deps.edn index bef0d2211..2e6ead6b5 100644 --- a/modules/openid-auth/deps.edn +++ b/modules/openid-auth/deps.edn @@ -33,7 +33,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/openid-auth/src/blaze/openid_auth.clj b/modules/openid-auth/src/blaze/openid_auth.clj index 60bf7da3b..0e97eef3e 100644 --- a/modules/openid-auth/src/blaze/openid_auth.clj +++ b/modules/openid-auth/src/blaze/openid_auth.clj @@ -1,5 +1,6 @@ (ns blaze.openid-auth (:require + [blaze.module :as m] [blaze.openid-auth.impl :as impl] [blaze.openid-auth.spec] [blaze.scheduler :as sched] @@ -29,7 +30,7 @@ (ex-message e) (pr-str (ex-data e))))) (time/seconds 1) (time/seconds 60))) -(defmethod ig/pre-init-spec :blaze.openid-auth/backend [_] +(defmethod m/pre-init-spec :blaze.openid-auth/backend [_] (s/keys :req-un [:blaze/http-client :blaze/scheduler ::provider-url])) (defmethod ig/init-key :blaze.openid-auth/backend diff --git a/modules/openid-auth/test/blaze/openid_auth_test.clj b/modules/openid-auth/test/blaze/openid_auth_test.clj index 305c7b194..b7497282c 100644 --- a/modules/openid-auth/test/blaze/openid_auth_test.clj +++ b/modules/openid-auth/test/blaze/openid_auth_test.clj @@ -25,15 +25,15 @@ (given-thrown (ig/init {::openid-auth/backend nil}) :key := ::openid-auth/backend :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {::openid-auth/backend {}}) :key := ::openid-auth/backend :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :http-client)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :scheduler)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :provider-url))))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :http-client)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :scheduler)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :provider-url))))) (defmethod ig/init-key ::http-client-not-found [_ _] (let [http-client (HttpClientMock.)] diff --git a/modules/operation-graphql/deps.edn b/modules/operation-graphql/deps.edn index 5da2e31ca..cc1ede56f 100644 --- a/modules/operation-graphql/deps.edn +++ b/modules/operation-graphql/deps.edn @@ -29,7 +29,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/operation-graphql/src/blaze/fhir/operation/graphql.clj b/modules/operation-graphql/src/blaze/fhir/operation/graphql.clj index f98e10e18..0e86d84e3 100644 --- a/modules/operation-graphql/src/blaze/fhir/operation/graphql.clj +++ b/modules/operation-graphql/src/blaze/fhir/operation/graphql.clj @@ -5,6 +5,7 @@ [blaze.db.api :as d] [blaze.executors :as ex] [blaze.fhir.operation.graphql.spec] + [blaze.module :as m] [clojure.spec.alpha :as s] [cognitect.anomalies :as anom] [com.walmartlabs.lacinia :as lacinia] @@ -76,7 +77,7 @@ (lacinia/execute schema query variables {:blaze/db db})) (lacinia/execute schema (get (:params request) "query") nil {:blaze/db db}))) -(defmethod ig/pre-init-spec ::handler [_] +(defmethod m/pre-init-spec ::handler [_] (s/keys :req-un [:blaze.db/node ::executor])) (defmethod ig/init-key ::handler [_ {:keys [executor] :as context}] @@ -87,7 +88,7 @@ #(ring/response (execute-query schema db request)) executor)))) -(defmethod ig/pre-init-spec ::executor [_] +(defmethod m/pre-init-spec ::executor [_] (s/keys :opt-un [::num-threads])) (defn- executor-init-msg [num-threads] diff --git a/modules/operation-graphql/test/blaze/fhir/operation/graphql_test.clj b/modules/operation-graphql/test/blaze/fhir/operation/graphql_test.clj index dfcb65918..00239a7e0 100644 --- a/modules/operation-graphql/test/blaze/fhir/operation/graphql_test.clj +++ b/modules/operation-graphql/test/blaze/fhir/operation/graphql_test.clj @@ -28,36 +28,36 @@ (given-thrown (ig/init {::graphql/handler nil}) :key := ::graphql/handler :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {::graphql/handler {}}) :key := ::graphql/handler :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :node)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :executor)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :node)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :executor)))) (testing "invalid executor" (given-thrown (ig/init {::graphql/handler {:executor ::invalid}}) :key := ::graphql/handler :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :node)) - [:explain ::s/problems 1 :pred] := `ex/executor? - [:explain ::s/problems 1 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :node)) + [:cause-data ::s/problems 1 :pred] := `ex/executor? + [:cause-data ::s/problems 1 :val] := ::invalid))) (deftest executor-init-test (testing "nil config" (given-thrown (ig/init {::graphql/executor nil}) :key := ::graphql/executor :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "invalid num-threads" (given-thrown (ig/init {::graphql/executor {:num-threads ::invalid}}) :key := ::graphql/executor :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `pos-int? - [:explain ::s/problems 0 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `pos-int? + [:cause-data ::s/problems 0 :val] := ::invalid)) (testing "with default num-threads" (with-system [{::graphql/keys [executor]} diff --git a/modules/operation-measure-evaluate-measure/deps.edn b/modules/operation-measure-evaluate-measure/deps.edn index a15a1bb50..1ba698dcb 100644 --- a/modules/operation-measure-evaluate-measure/deps.edn +++ b/modules/operation-measure-evaluate-measure/deps.edn @@ -34,7 +34,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/operation-measure-evaluate-measure/src/blaze/fhir/operation/evaluate_measure.clj b/modules/operation-measure-evaluate-measure/src/blaze/fhir/operation/evaluate_measure.clj index eb8cb479b..c25a759cc 100644 --- a/modules/operation-measure-evaluate-measure/src/blaze/fhir/operation/evaluate_measure.clj +++ b/modules/operation-measure-evaluate-measure/src/blaze/fhir/operation/evaluate_measure.clj @@ -14,7 +14,7 @@ [blaze.fhir.response.create :as response] [blaze.handler.util :as handler-util] [blaze.luid :as luid] - [blaze.module :refer [reg-collector]] + [blaze.module :as m :refer [reg-collector]] [blaze.spec] [clojure.spec.alpha :as s] [cognitect.anomalies :as anom] @@ -112,7 +112,7 @@ :fhir/issue "incomplete"))))) (ac/then-compose-async (partial handle (assoc context :db db) request))))) -(defmethod ig/pre-init-spec ::handler [_] +(defmethod m/pre-init-spec ::handler [_] (s/keys :req-un [:blaze.db/node ::executor :blaze/clock :blaze/rng-fn] :opt-un [::timeout])) @@ -120,7 +120,7 @@ (log/info "Init FHIR $evaluate-measure operation handler") (wrap-coerce-params (handler context))) -(defmethod ig/pre-init-spec ::timeout [_] +(defmethod m/pre-init-spec ::timeout [_] (s/keys :req-un [:blaze.fhir.operation.evaluate-measure.timeout/millis])) (defmethod ig/init-key ::timeout [_ {:keys [millis]}] diff --git a/modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure_test.clj b/modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure_test.clj index 9890d65ab..78abbb0a7 100644 --- a/modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure_test.clj +++ b/modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure_test.clj @@ -68,46 +68,46 @@ (given-thrown (ig/init {::evaluate-measure/handler nil}) :key := ::evaluate-measure/handler :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {::evaluate-measure/handler {}}) :key := ::evaluate-measure/handler :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :node)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :executor)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :clock)) - [:explain ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :node)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :executor)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :clock)) + [:cause-data ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)))) (testing "invalid executor" (given-thrown (ig/init {::evaluate-measure/handler {:executor ::invalid}}) :key := ::evaluate-measure/handler :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :node)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :clock)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) - [:explain ::s/problems 3 :pred] := `ex/executor? - [:explain ::s/problems 3 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :node)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :clock)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) + [:cause-data ::s/problems 3 :pred] := `ex/executor? + [:cause-data ::s/problems 3 :val] := ::invalid))) (deftest timeout-init-test (testing "nil config" (given-thrown (ig/init {::evaluate-measure/timeout nil}) :key := ::evaluate-measure/timeout :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {::evaluate-measure/timeout {}}) :key := ::evaluate-measure/timeout :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :millis)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :millis)))) (testing "invalid millis" (given-thrown (ig/init {::evaluate-measure/timeout {:millis ::invalid}}) :key := ::evaluate-measure/timeout :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `nat-int? - [:explain ::s/problems 0 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `nat-int? + [:cause-data ::s/problems 0 :val] := ::invalid)) (testing "init" (with-system [{::evaluate-measure/keys [timeout]} diff --git a/modules/operation-patient-everything/deps.edn b/modules/operation-patient-everything/deps.edn index ff56abf78..858642265 100644 --- a/modules/operation-patient-everything/deps.edn +++ b/modules/operation-patient-everything/deps.edn @@ -28,7 +28,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/operation-patient-everything/src/blaze/operation/patient/everything.clj b/modules/operation-patient-everything/src/blaze/operation/patient/everything.clj index c3dc9157b..5f1c8a626 100644 --- a/modules/operation-patient-everything/src/blaze/operation/patient/everything.clj +++ b/modules/operation-patient-everything/src/blaze/operation/patient/everything.clj @@ -8,6 +8,7 @@ [blaze.handler.fhir.util :as fhir-util] [blaze.interaction.search.util :as search-util] [blaze.luid :as luid] + [blaze.module :as m] [blaze.spec] [clojure.spec.alpha :as s] [integrant.core :as ig] @@ -79,7 +80,7 @@ (do-sync [resources (d/pull-many db handles)] (ring/response (bundle context request resources page-size next-offset))))))) -(defmethod ig/pre-init-spec :blaze.operation.patient/everything [_] +(defmethod m/pre-init-spec :blaze.operation.patient/everything [_] (s/keys :req-un [:blaze/clock :blaze/rng-fn])) (defmethod ig/init-key :blaze.operation.patient/everything [_ context] diff --git a/modules/operation-patient-everything/test/blaze/operation/patient/everything_test.clj b/modules/operation-patient-everything/test/blaze/operation/patient/everything_test.clj index de401c1d5..f31f256dc 100644 --- a/modules/operation-patient-everything/test/blaze/operation/patient/everything_test.clj +++ b/modules/operation-patient-everything/test/blaze/operation/patient/everything_test.clj @@ -30,22 +30,22 @@ (given-thrown (ig/init {:blaze.operation.patient/everything nil}) :key := :blaze.operation.patient/everything :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.operation.patient/everything {}}) :key := :blaze.operation.patient/everything :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :clock)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :clock)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)))) (testing "invalid clock" (given-thrown (ig/init {:blaze.operation.patient/everything {:clock ::invalid}}) :key := :blaze.operation.patient/everything :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) - [:explain ::s/problems 1 :pred] := `time/clock? - [:explain ::s/problems 1 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :rng-fn)) + [:cause-data ::s/problems 1 :pred] := `time/clock? + [:cause-data ::s/problems 1 :val] := ::invalid))) (def base-url "base-url-113047") (def context-path "/context-path-173858") diff --git a/modules/operation-totals/deps.edn b/modules/operation-totals/deps.edn index 193a7345b..d6aba6cd5 100644 --- a/modules/operation-totals/deps.edn +++ b/modules/operation-totals/deps.edn @@ -28,7 +28,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/operation-totals/src/blaze/fhir/operation/totals.clj b/modules/operation-totals/src/blaze/fhir/operation/totals.clj index ec50eb332..6344960e3 100644 --- a/modules/operation-totals/src/blaze/fhir/operation/totals.clj +++ b/modules/operation-totals/src/blaze/fhir/operation/totals.clj @@ -5,6 +5,7 @@ [blaze.db.api :as d] [blaze.fhir.spec.type :as type] [blaze.fhir.structure-definition-repo :as sdr] + [blaze.module :as m] [blaze.spec] [clojure.spec.alpha :as s] [integrant.core :as ig] @@ -27,7 +28,7 @@ (-> (ring/response (parameters db types)) (ac/completed-future)))) -(defmethod ig/pre-init-spec :blaze.fhir.operation/totals [_] +(defmethod m/pre-init-spec :blaze.fhir.operation/totals [_] (s/keys :req-un [:blaze.fhir/structure-definition-repo])) (defmethod ig/init-key :blaze.fhir.operation/totals diff --git a/modules/operation-totals/test/blaze/fhir/operation/totals_test.clj b/modules/operation-totals/test/blaze/fhir/operation/totals_test.clj index 96f372943..43af56ea6 100644 --- a/modules/operation-totals/test/blaze/fhir/operation/totals_test.clj +++ b/modules/operation-totals/test/blaze/fhir/operation/totals_test.clj @@ -25,20 +25,20 @@ (given-thrown (ig/init {:blaze.fhir.operation/totals nil}) :key := :blaze.fhir.operation/totals :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.fhir.operation/totals {}}) :key := :blaze.fhir.operation/totals :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :structure-definition-repo)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :structure-definition-repo)))) (testing "invalid structure definition repo" (given-thrown (ig/init {:blaze.fhir.operation/totals {:structure-definition-repo ::invalid}}) :key := :blaze.fhir.operation/totals :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `structure-definition-repo? - [:explain ::s/problems 0 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `structure-definition-repo? + [:cause-data ::s/problems 0 :val] := ::invalid))) (def config (assoc api-stub/mem-node-config diff --git a/modules/page-store-cassandra/deps.edn b/modules/page-store-cassandra/deps.edn index 9a8eca36b..48880db3e 100644 --- a/modules/page-store-cassandra/deps.edn +++ b/modules/page-store-cassandra/deps.edn @@ -25,7 +25,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/page-store-cassandra/src/blaze/page_store/cassandra.clj b/modules/page-store-cassandra/src/blaze/page_store/cassandra.clj index 4a1b83eca..7e0bf2574 100644 --- a/modules/page-store-cassandra/src/blaze/page_store/cassandra.clj +++ b/modules/page-store-cassandra/src/blaze/page_store/cassandra.clj @@ -5,7 +5,7 @@ [blaze.byte-buffer :as bb] [blaze.cassandra :as cass] [blaze.cassandra.spec] - [blaze.module :refer [reg-collector]] + [blaze.module :as m :refer [reg-collector]] [blaze.page-store :as-alias page-store] [blaze.page-store.cassandra.codec :as codec] [blaze.page-store.cassandra.statement :as statement] @@ -91,7 +91,7 @@ (close [_] (cass/close session))) -(defmethod ig/pre-init-spec ::page-store/cassandra [_] +(defmethod m/pre-init-spec ::page-store/cassandra [_] (s/keys :req-un [::page-store/secure-rng] :opt-un [::cass/contact-points ::cass/key-space ::cass/username ::cass/password diff --git a/modules/page-store-cassandra/test/blaze/page_store/cassandra_test.clj b/modules/page-store-cassandra/test/blaze/page_store/cassandra_test.clj index 4a3a200d9..7a47218ce 100644 --- a/modules/page-store-cassandra/test/blaze/page_store/cassandra_test.clj +++ b/modules/page-store-cassandra/test/blaze/page_store/cassandra_test.clj @@ -31,7 +31,7 @@ (given-thrown (ig/init {::page-store/cassandra nil}) :key := ::page-store/cassandra :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "invalid contact-points" (given-thrown (ig/init {::page-store/cassandra {:secure-rng (SecureRandom.) @@ -39,8 +39,8 @@ :key := ::page-store/cassandra :reason := ::ig/build-failed-spec [:value :contact-points] := ::invalid - [:explain ::s/problems 0 :path] := [:contact-points] - [:explain ::s/problems 0 :val] := ::invalid))) + [:cause-data ::s/problems 0 :path] := [:contact-points] + [:cause-data ::s/problems 0 :val] := ::invalid))) (defn- prepare [session statement] (assert (= ::session session)) diff --git a/modules/page-store/deps.edn b/modules/page-store/deps.edn index 04497fe4a..9979578f4 100644 --- a/modules/page-store/deps.edn +++ b/modules/page-store/deps.edn @@ -19,7 +19,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/page-store/src/blaze/page_store/local.clj b/modules/page-store/src/blaze/page_store/local.clj index e49f0133e..a643258a8 100644 --- a/modules/page-store/src/blaze/page_store/local.clj +++ b/modules/page-store/src/blaze/page_store/local.clj @@ -3,6 +3,7 @@ [blaze.anomaly :as ba] [blaze.async.comp :as ac] [blaze.metrics.core :as metrics] + [blaze.module :as m] [blaze.page-store :as-alias page-store] [blaze.page-store.local.spec] [blaze.page-store.local.token :as token] @@ -41,7 +42,7 @@ (weigh [_ _ clauses] (+ token-weigh (w/weigh clauses))))) -(defmethod ig/pre-init-spec ::page-store/local [_] +(defmethod m/pre-init-spec ::page-store/local [_] (s/keys :req-un [::page-store/secure-rng] :opt-un [::max-size-in-mb ::expire-duration])) @@ -49,7 +50,7 @@ [_ {:keys [secure-rng max-size-in-mb expire-duration] :or {max-size-in-mb 10 expire-duration (time/hours 24)}}] (log/info "Open local page store with a capacity of" max-size-in-mb - "MiB and an expire duration of" expire-duration) + "MiB and an expire duration of" (str expire-duration)) (->LocalPageStore secure-rng (-> (Caffeine/newBuilder) @@ -60,7 +61,7 @@ (derive ::page-store/local :blaze/page-store) -(defmethod ig/pre-init-spec :blaze.page-store.local/collector [_] +(defmethod m/pre-init-spec :blaze.page-store.local/collector [_] (s/keys :req-un [:blaze/page-store])) (defmethod ig/init-key :blaze.page-store.local/collector diff --git a/modules/page-store/test/blaze/page_store/local_test.clj b/modules/page-store/test/blaze/page_store/local_test.clj index 1e82e6472..deee8386b 100644 --- a/modules/page-store/test/blaze/page_store/local_test.clj +++ b/modules/page-store/test/blaze/page_store/local_test.clj @@ -37,37 +37,37 @@ (given-thrown (ig/init {:blaze.page-store/local nil}) :key := :blaze.page-store/local :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.page-store/local {}}) :key := :blaze.page-store/local :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :secure-rng)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :secure-rng)))) (testing "invalid secure random number generator" (given-thrown (ig/init {:blaze.page-store/local {:secure-rng ::invalid}}) :key := :blaze.page-store/local :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :val] := ::invalid)) + [:cause-data ::s/problems 0 :val] := ::invalid)) (testing "invalid max size" (given-thrown (ig/init {:blaze.page-store/local {:max-size-in-mb ::invalid}}) :key := :blaze.page-store/local :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :secure-rng)) - [:explain ::s/problems 1 :path 0] := :max-size-in-mb - [:explain ::s/problems 1 :pred] := `nat-int? - [:explain ::s/problems 1 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :secure-rng)) + [:cause-data ::s/problems 1 :path 0] := :max-size-in-mb + [:cause-data ::s/problems 1 :pred] := `nat-int? + [:cause-data ::s/problems 1 :val] := ::invalid)) (testing "invalid expire duration" (given-thrown (ig/init {:blaze.page-store/local {:expire-duration ::invalid}}) :key := :blaze.page-store/local :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :secure-rng)) - [:explain ::s/problems 1 :path 0] := :expire-duration - [:explain ::s/problems 1 :pred] := `time/duration? - [:explain ::s/problems 1 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :secure-rng)) + [:cause-data ::s/problems 1 :path 0] := :expire-duration + [:cause-data ::s/problems 1 :pred] := `time/duration? + [:cause-data ::s/problems 1 :val] := ::invalid)) (testing "is a page store" (with-system [{store :blaze.page-store/local} config] @@ -100,20 +100,20 @@ (given-thrown (ig/init {:blaze.page-store.local/collector nil}) :key := :blaze.page-store.local/collector :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.page-store.local/collector {}}) :key := :blaze.page-store.local/collector :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :page-store)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :page-store)))) (testing "invalid page store" (given-thrown (ig/init {:blaze.page-store.local/collector {:page-store ::invalid}}) :key := :blaze.page-store.local/collector :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `page-store? - [:explain ::s/problems 0 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `page-store? + [:cause-data ::s/problems 0 :val] := ::invalid)) (testing "is a collector" (with-system [{collector :blaze.page-store.local/collector} config] diff --git a/modules/rest-api/deps.edn b/modules/rest-api/deps.edn index 79a7b6e3e..686773211 100644 --- a/modules/rest-api/deps.edn +++ b/modules/rest-api/deps.edn @@ -26,7 +26,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/rest-api/src/blaze/rest_api.clj b/modules/rest-api/src/blaze/rest_api.clj index c15d917b2..d7ef26094 100644 --- a/modules/rest-api/src/blaze/rest_api.clj +++ b/modules/rest-api/src/blaze/rest_api.clj @@ -7,7 +7,7 @@ [blaze.handler.util :as handler-util] [blaze.middleware.fhir.output :as output] [blaze.middleware.fhir.resource :as resource] - [blaze.module :refer [reg-collector]] + [blaze.module :as m :refer [reg-collector]] [blaze.rest-api.capabilities :as capabilities] [blaze.rest-api.middleware.cors :as cors] [blaze.rest-api.middleware.log :refer [wrap-log]] @@ -86,7 +86,7 @@ (conj #(apply wrap-authentication % auth-backends)))}) wrap-log)) -(defmethod ig/pre-init-spec :blaze/rest-api [_] +(defmethod m/pre-init-spec :blaze/rest-api [_] (s/keys :req-un [:blaze/base-url diff --git a/modules/rest-api/src/blaze/rest_api/metadata_handler.clj b/modules/rest-api/src/blaze/rest_api/metadata_handler.clj index 2a9b6d2cc..27cea314f 100644 --- a/modules/rest-api/src/blaze/rest_api/metadata_handler.clj +++ b/modules/rest-api/src/blaze/rest_api/metadata_handler.clj @@ -3,6 +3,7 @@ [blaze.async.comp :as ac] [blaze.fhir.structure-definition-repo :as sdr] [blaze.fhir.structure-definition-repo.spec] + [blaze.module :as m] [clojure.spec.alpha :as s] [integrant.core :as ig] [ring.util.response :as ring] @@ -21,7 +22,7 @@ (ac/completed-future (ring/response structure-def)) (ac/completed-future (ring/not-found {})))))) -(defmethod ig/pre-init-spec :blaze.rest-api/metadata-handler [_] +(defmethod m/pre-init-spec :blaze.rest-api/metadata-handler [_] (s/keys :req-un [:blaze.fhir/structure-definition-repo])) (defmethod ig/init-key :blaze.rest-api/metadata-handler diff --git a/modules/rest-api/test/blaze/rest_api/metadata_handler_test.clj b/modules/rest-api/test/blaze/rest_api/metadata_handler_test.clj index 7396f0be4..51bf5242d 100644 --- a/modules/rest-api/test/blaze/rest_api/metadata_handler_test.clj +++ b/modules/rest-api/test/blaze/rest_api/metadata_handler_test.clj @@ -22,20 +22,20 @@ (given-thrown (ig/init {:blaze.rest-api/metadata-handler nil}) :key := :blaze.rest-api/metadata-handler :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.rest-api/metadata-handler {}}) :key := :blaze.rest-api/metadata-handler :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :structure-definition-repo)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :structure-definition-repo)))) (testing "invalid executor" (given-thrown (ig/init {:blaze.rest-api/metadata-handler {:structure-definition-repo ::invalid}}) :key := :blaze.rest-api/metadata-handler :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `structure-definition-repo? - [:explain ::s/problems 0 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `structure-definition-repo? + [:cause-data ::s/problems 0 :val] := ::invalid))) (def config {:blaze.rest-api/metadata-handler diff --git a/modules/rest-api/test/blaze/rest_api_test.clj b/modules/rest-api/test/blaze/rest_api_test.clj index 1ec8e34a1..84821b307 100644 --- a/modules/rest-api/test/blaze/rest_api_test.clj +++ b/modules/rest-api/test/blaze/rest_api_test.clj @@ -301,33 +301,33 @@ (given-thrown (ig/init {:blaze/rest-api nil}) :key := :blaze/rest-api :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze/rest-api {}}) :key := :blaze/rest-api :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :base-url)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :version)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :release-date)) - [:explain ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :structure-definition-repo)) - [:explain ::s/problems 4 :pred] := `(fn ~'[%] (contains? ~'% :node)) - [:explain ::s/problems 5 :pred] := `(fn ~'[%] (contains? ~'% :search-param-registry)) - [:explain ::s/problems 6 :pred] := `(fn ~'[%] (contains? ~'% :db-sync-timeout)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :base-url)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :version)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :release-date)) + [:cause-data ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :structure-definition-repo)) + [:cause-data ::s/problems 4 :pred] := `(fn ~'[%] (contains? ~'% :node)) + [:cause-data ::s/problems 5 :pred] := `(fn ~'[%] (contains? ~'% :search-param-registry)) + [:cause-data ::s/problems 6 :pred] := `(fn ~'[%] (contains? ~'% :db-sync-timeout)))) (testing "invalid enforce-referential-integrity" (given-thrown (ig/init {:blaze/rest-api {:enforce-referential-integrity ::invalid}}) :key := :blaze/rest-api :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :base-url)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :version)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :release-date)) - [:explain ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :structure-definition-repo)) - [:explain ::s/problems 4 :pred] := `(fn ~'[%] (contains? ~'% :node)) - [:explain ::s/problems 5 :pred] := `(fn ~'[%] (contains? ~'% :search-param-registry)) - [:explain ::s/problems 6 :pred] := `(fn ~'[%] (contains? ~'% :db-sync-timeout)) - [:explain ::s/problems 7 :pred] := `boolean? - [:explain ::s/problems 7 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :base-url)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :version)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :release-date)) + [:cause-data ::s/problems 3 :pred] := `(fn ~'[%] (contains? ~'% :structure-definition-repo)) + [:cause-data ::s/problems 4 :pred] := `(fn ~'[%] (contains? ~'% :node)) + [:cause-data ::s/problems 5 :pred] := `(fn ~'[%] (contains? ~'% :search-param-registry)) + [:cause-data ::s/problems 6 :pred] := `(fn ~'[%] (contains? ~'% :db-sync-timeout)) + [:cause-data ::s/problems 7 :pred] := `boolean? + [:cause-data ::s/problems 7 :val] := ::invalid))) (deftest requests-total-collector-init-test (with-system [{collector :blaze.rest-api/requests-total} {:blaze.rest-api/requests-total {}}] diff --git a/modules/rest-util/deps.edn b/modules/rest-util/deps.edn index 3e4b61574..43f23f928 100644 --- a/modules/rest-util/deps.edn +++ b/modules/rest-util/deps.edn @@ -12,7 +12,8 @@ {:mvn/version "5.2.4"} metosin/reitit-ring - {:mvn/version "0.6.0"} + {:mvn/version "0.7.0" + :exclusions [org.apache.commons/commons-fileupload2-core]} metosin/muuntaja {:mvn/version "0.6.10" @@ -36,7 +37,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/rocksdb/deps.edn b/modules/rocksdb/deps.edn index 08b5d8d66..7634b1927 100644 --- a/modules/rocksdb/deps.edn +++ b/modules/rocksdb/deps.edn @@ -28,7 +28,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/rocksdb/src/blaze/db/kv/rocksdb.clj b/modules/rocksdb/src/blaze/db/kv/rocksdb.clj index da2742071..26e0e05d1 100644 --- a/modules/rocksdb/src/blaze/db/kv/rocksdb.clj +++ b/modules/rocksdb/src/blaze/db/kv/rocksdb.clj @@ -8,6 +8,7 @@ [blaze.db.kv.rocksdb.metrics.spec] [blaze.db.kv.rocksdb.protocols :as p] [blaze.db.kv.rocksdb.spec] + [blaze.module :as m] [clojure.datafy :as datafy] [clojure.spec.alpha :as s] [integrant.core :as ig] @@ -304,7 +305,7 @@ (.setBackgroundThreads 2 Priority/HIGH) (.setBackgroundThreads 6 Priority/LOW))) -(defmethod ig/pre-init-spec ::kv/rocksdb [_] +(defmethod m/pre-init-spec ::kv/rocksdb [_] (s/keys :req-un [::dir] :opt-un [::block-cache ::stats ::opts ::column-families])) @@ -346,21 +347,21 @@ (log/info "Shutdown RocksDB statistics") (.close ^AutoCloseable stats)) -(defmethod ig/pre-init-spec ::stats-collector [_] +(defmethod m/pre-init-spec ::stats-collector [_] (s/keys :req-un [::metrics/stats])) (defmethod ig/init-key ::stats-collector [_ {:keys [stats]}] (metrics/stats-collector stats)) -(defmethod ig/pre-init-spec ::block-cache-collector [_] +(defmethod m/pre-init-spec ::block-cache-collector [_] (s/keys :req-un [::block-cache])) (defmethod ig/init-key ::block-cache-collector [_ {:keys [block-cache]}] (metrics/block-cache-collector block-cache)) -(defmethod ig/pre-init-spec ::table-reader-collector [_] +(defmethod m/pre-init-spec ::table-reader-collector [_] (s/keys :req-un [::metrics/stores])) (defmethod ig/init-key ::table-reader-collector diff --git a/modules/rocksdb/test/blaze/db/kv/rocksdb_test.clj b/modules/rocksdb/test/blaze/db/kv/rocksdb_test.clj index 1506fc83c..9ceb6a4ec 100644 --- a/modules/rocksdb/test/blaze/db/kv/rocksdb_test.clj +++ b/modules/rocksdb/test/blaze/db/kv/rocksdb_test.clj @@ -36,97 +36,97 @@ (given-thrown (ig/init {::kv/rocksdb nil}) :key := ::kv/rocksdb :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {::kv/rocksdb {}}) :key := ::kv/rocksdb :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :dir)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :dir)))) (testing "invalid dir" (given-thrown (ig/init {::kv/rocksdb {:dir ::invalid}}) :key := ::kv/rocksdb :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `string? - [:explain ::s/problems 0 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `string? + [:cause-data ::s/problems 0 :val] := ::invalid)) (testing "invalid block-cache" (given-thrown (ig/init {::kv/rocksdb {:block-cache ::invalid}}) :key := ::kv/rocksdb :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :dir)) - [:explain ::s/problems 1 :via] := [::rocksdb/block-cache] - [:explain ::s/problems 1 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :dir)) + [:cause-data ::s/problems 1 :via] := [::rocksdb/block-cache] + [:cause-data ::s/problems 1 :val] := ::invalid)) (testing "invalid stats" (given-thrown (ig/init {::kv/rocksdb {:stats ::invalid}}) :key := ::kv/rocksdb :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :dir)) - [:explain ::s/problems 1 :via] := [::rocksdb/stats] - [:explain ::s/problems 1 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :dir)) + [:cause-data ::s/problems 1 :via] := [::rocksdb/stats] + [:cause-data ::s/problems 1 :val] := ::invalid))) (deftest stats-collector-init-test (testing "nil config" (given-thrown (ig/init {::rocksdb/stats-collector nil}) :key := ::rocksdb/stats-collector :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {::rocksdb/stats-collector {}}) :key := ::rocksdb/stats-collector :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :stats)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :stats)))) (testing "invalid stats" (given-thrown (ig/init {::rocksdb/stats-collector {:stats ::invalid}}) :key := ::rocksdb/stats-collector :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :via] := [::metrics/stats] - [:explain ::s/problems 0 :val] := ::invalid))) + [:cause-data ::s/problems 0 :via] := [::metrics/stats] + [:cause-data ::s/problems 0 :val] := ::invalid))) (deftest block-cache-collector-init-test (testing "nil config" (given-thrown (ig/init {::rocksdb/block-cache-collector nil}) :key := ::rocksdb/block-cache-collector :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {::rocksdb/block-cache-collector {}}) :key := ::rocksdb/block-cache-collector :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :block-cache)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :block-cache)))) (testing "invalid stats" (given-thrown (ig/init {::rocksdb/block-cache-collector {:block-cache ::invalid}}) :key := ::rocksdb/block-cache-collector :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :via] := [::rocksdb/block-cache] - [:explain ::s/problems 0 :val] := ::invalid))) + [:cause-data ::s/problems 0 :via] := [::rocksdb/block-cache] + [:cause-data ::s/problems 0 :val] := ::invalid))) (deftest table-reader-collector-init-test (testing "nil config" (given-thrown (ig/init {::rocksdb/table-reader-collector nil}) :key := ::rocksdb/table-reader-collector :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {::rocksdb/table-reader-collector {}}) :key := ::rocksdb/table-reader-collector :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :stores)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :stores)))) (testing "invalid stores" (given-thrown (ig/init {::rocksdb/table-reader-collector {:stores ::invalid}}) :key := ::rocksdb/table-reader-collector :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :via] := [::metrics/stores] - [:explain ::s/problems 0 :pred] := `map? - [:explain ::s/problems 0 :val] := ::invalid))) + [:cause-data ::s/problems 0 :via] := [::metrics/stores] + [:cause-data ::s/problems 0 :pred] := `map? + [:cause-data ::s/problems 0 :val] := ::invalid))) (defn- new-temp-dir! [] (str (Files/createTempDirectory "blaze" (make-array FileAttribute 0)))) diff --git a/modules/scheduler/deps.edn b/modules/scheduler/deps.edn index 0fe73d7bd..f928109f9 100644 --- a/modules/scheduler/deps.edn +++ b/modules/scheduler/deps.edn @@ -16,7 +16,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/server/deps.edn b/modules/server/deps.edn index 5d30cdc63..da96aa9fd 100644 --- a/modules/server/deps.edn +++ b/modules/server/deps.edn @@ -29,7 +29,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/server/src/blaze/server.clj b/modules/server/src/blaze/server.clj index 87ba395f2..3899b6a2e 100644 --- a/modules/server/src/blaze/server.clj +++ b/modules/server/src/blaze/server.clj @@ -1,6 +1,7 @@ (ns blaze.server "HTTP Server." (:require + [blaze.module :as m] [blaze.server.spec] [clojure.spec.alpha :as s] [integrant.core :as ig] @@ -21,7 +22,7 @@ (-> (server-request request) (handler #(respond (ring/header % "Server" server)) raise))))) -(defmethod ig/pre-init-spec :blaze/server [_] +(defmethod m/pre-init-spec :blaze/server [_] (s/keys :req-un [::port ::handler ::version] :opt-un [::name ::async? ::min-threads ::max-threads])) @@ -33,7 +34,7 @@ (wrap-server handler (str "Blaze/" version)) {:port port :async? async? - ;; TODO: remove such a long timeout only here because of FHIR_OPERATION_EVALUATE_MEASURE_TIMEOUT + ;; TODO: remove such a long timeout only here because of FHIR_OPERATION_EVALUATE_MEASURE_TIMEOUT :async-timeout 3610000 ; 1 h and 10 s :join? false :send-server-version? false diff --git a/modules/server/test/blaze/server_test.clj b/modules/server/test/blaze/server_test.clj index 353d9eb3d..3616ea4f3 100644 --- a/modules/server/test/blaze/server_test.clj +++ b/modules/server/test/blaze/server_test.clj @@ -28,42 +28,42 @@ (given-thrown (ig/init {:blaze/server nil}) :key := :blaze/server :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze/server {}}) :key := :blaze/server :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :port)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :handler)) - [:explain ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :version)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :port)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :handler)) + [:cause-data ::s/problems 2 :pred] := `(fn ~'[%] (contains? ~'% :version)))) (testing "invalid port" (given-thrown (ig/init {:blaze/server {:port ::invalid}}) :key := :blaze/server :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :handler)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :version)) - [:explain ::s/problems 2 :pred] := `nat-int? - [:explain ::s/problems 2 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :handler)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :version)) + [:cause-data ::s/problems 2 :pred] := `nat-int? + [:cause-data ::s/problems 2 :val] := ::invalid)) (testing "invalid handler" (given-thrown (ig/init {:blaze/server {:handler ::invalid}}) :key := :blaze/server :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :port)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :version)) - [:explain ::s/problems 2 :pred] := `fn? - [:explain ::s/problems 2 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :port)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :version)) + [:cause-data ::s/problems 2 :pred] := `fn? + [:cause-data ::s/problems 2 :val] := ::invalid)) (testing "invalid version" (given-thrown (ig/init {:blaze/server {:version ::invalid}}) :key := :blaze/server :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :port)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :handler)) - [:explain ::s/problems 2 :pred] := `string? - [:explain ::s/problems 2 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :port)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :handler)) + [:cause-data ::s/problems 2 :pred] := `string? + [:cause-data ::s/problems 2 :val] := ::invalid))) (defn ok-handler [_] (ring/response "OK")) diff --git a/modules/thread-pool-executor-collector/deps.edn b/modules/thread-pool-executor-collector/deps.edn index 346efcd5a..82666d31d 100644 --- a/modules/thread-pool-executor-collector/deps.edn +++ b/modules/thread-pool-executor-collector/deps.edn @@ -19,7 +19,7 @@ :kaocha {:extra-deps {lambdaisland/kaocha - {:mvn/version "1.88.1376"}} + {:mvn/version "1.89.1380"}} :main-opts ["-m" "kaocha.runner"]} diff --git a/modules/thread-pool-executor-collector/src/blaze/thread_pool_executor_collector.clj b/modules/thread-pool-executor-collector/src/blaze/thread_pool_executor_collector.clj index dc91a8faf..07acb5c26 100644 --- a/modules/thread-pool-executor-collector/src/blaze/thread_pool_executor_collector.clj +++ b/modules/thread-pool-executor-collector/src/blaze/thread_pool_executor_collector.clj @@ -1,6 +1,7 @@ (ns blaze.thread-pool-executor-collector (:require [blaze.metrics.core :as metrics] + [blaze.module :as m] [blaze.thread-pool-executor-collector.spec] [clojure.spec.alpha :as s] [integrant.core :as ig] @@ -59,7 +60,7 @@ #(.size ^BlockingQueue (.getQueue ^ThreadPoolExecutor %)) executors)])) -(defmethod ig/pre-init-spec :blaze/thread-pool-executor-collector [_] +(defmethod m/pre-init-spec :blaze/thread-pool-executor-collector [_] (s/keys :req-un [::executors])) (defn- executor-name [key] diff --git a/modules/thread-pool-executor-collector/test/blaze/thread_pool_executor_collector_test.clj b/modules/thread-pool-executor-collector/test/blaze/thread_pool_executor_collector_test.clj index 2f4c64522..b3de602c8 100644 --- a/modules/thread-pool-executor-collector/test/blaze/thread_pool_executor_collector_test.clj +++ b/modules/thread-pool-executor-collector/test/blaze/thread_pool_executor_collector_test.clj @@ -26,27 +26,27 @@ (given-thrown (ig/init {:blaze/thread-pool-executor-collector nil}) :key := :blaze/thread-pool-executor-collector :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "nil executors" (given-thrown (ig/init {:blaze/thread-pool-executor-collector {:executors nil}}) :key := :blaze/thread-pool-executor-collector :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "invalid executor key" (given-thrown (ig/init {:blaze/thread-pool-executor-collector {:executors {"a" nil}}}) :key := :blaze/thread-pool-executor-collector :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `keyword? - [:explain ::s/problems 0 :val] := "a")) + [:cause-data ::s/problems 0 :pred] := `keyword? + [:cause-data ::s/problems 0 :val] := "a")) (testing "invalid executor" (given-thrown (ig/init {:blaze/thread-pool-executor-collector {:executors {:a nil}}}) :key := :blaze/thread-pool-executor-collector :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `spec/thread-pool-executor? - [:explain ::s/problems 0 :val] := nil))) + [:cause-data ::s/problems 0 :pred] := `spec/thread-pool-executor? + [:cause-data ::s/problems 0 :val] := nil))) (def config {:blaze/thread-pool-executor-collector diff --git a/src/blaze/handler/app.clj b/src/blaze/handler/app.clj index 9b75ebce6..ece8b10b8 100644 --- a/src/blaze/handler/app.clj +++ b/src/blaze/handler/app.clj @@ -1,6 +1,7 @@ (ns blaze.handler.app (:require [blaze.handler.health.spec] + [blaze.module :as m] [blaze.rest-api.spec] [blaze.spec] [clojure.spec.alpha :as s] @@ -29,7 +30,7 @@ (router health-handler) rest-api)) -(defmethod ig/pre-init-spec :blaze.handler/app [_] +(defmethod m/pre-init-spec :blaze.handler/app [_] (s/keys :req-un [:blaze/rest-api :blaze/health-handler])) (defmethod ig/init-key :blaze.handler/app diff --git a/src/blaze/system.clj b/src/blaze/system.clj index 012e93d06..10f1c0826 100644 --- a/src/blaze/system.clj +++ b/src/blaze/system.clj @@ -92,9 +92,9 @@ (into {} (map (fn [[k v]] [k (resolvef k v)])) (ig/find-derived config key)))) (def ^:private root-config - {:blaze/version "0.26.1" + {:blaze/version "0.26.2" - :blaze/release-date "2024-04-28" + :blaze/release-date "2024-05-08" :blaze/clock {} diff --git a/test/blaze/handler/app_test.clj b/test/blaze/handler/app_test.clj index e36fb75dc..d0104c3b1 100644 --- a/test/blaze/handler/app_test.clj +++ b/test/blaze/handler/app_test.clj @@ -22,30 +22,30 @@ (given-thrown (ig/init {:blaze.handler/app nil}) :key := :blaze.handler/app :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `map?)) + [:cause-data ::s/problems 0 :pred] := `map?)) (testing "missing config" (given-thrown (ig/init {:blaze.handler/app {}}) :key := :blaze.handler/app :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :rest-api)) - [:explain ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :health-handler)))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :rest-api)) + [:cause-data ::s/problems 1 :pred] := `(fn ~'[%] (contains? ~'% :health-handler)))) (testing "invalid rest-api" (given-thrown (ig/init {:blaze.handler/app {:rest-api ::invalid}}) :key := :blaze.handler/app :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :health-handler)) - [:explain ::s/problems 1 :pred] := `fn? - [:explain ::s/problems 1 :val] := ::invalid)) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :health-handler)) + [:cause-data ::s/problems 1 :pred] := `fn? + [:cause-data ::s/problems 1 :val] := ::invalid)) (testing "invalid health" (given-thrown (ig/init {:blaze.handler/app {:health-handler ::invalid}}) :key := :blaze.handler/app :reason := ::ig/build-failed-spec - [:explain ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :rest-api)) - [:explain ::s/problems 1 :pred] := `fn? - [:explain ::s/problems 1 :val] := ::invalid))) + [:cause-data ::s/problems 0 :pred] := `(fn ~'[%] (contains? ~'% :rest-api)) + [:cause-data ::s/problems 1 :pred] := `fn? + [:cause-data ::s/problems 1 :val] := ::invalid))) (defn- rest-api [_ respond _] (respond (ring/response ::rest-api)))