Skip to content

Commit

Permalink
Merge branch 'release/0.7.0'
Browse files Browse the repository at this point in the history
# Conflicts:
#	Dockerfile
#	README.md
#	docker-compose.yml
#	docs/index.adoc
#	project.clj
  • Loading branch information
alexanderkiel committed Jan 20, 2020
2 parents db1e013 + f6f946f commit 7b61950
Show file tree
Hide file tree
Showing 244 changed files with 11,604 additions and 5,054 deletions.
26 changes: 26 additions & 0 deletions .clj-kondo/config.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{:lint-as
{blaze.elm.compiler/defunop clojure.core/defn
blaze.elm.compiler/defbinop clojure.core/defn
blaze.elm.compiler/defternop clojure.core/defn
blaze.elm.compiler/defnaryop clojure.core/defn
blaze.elm.compiler/defaggop clojure.core/defn
blaze.elm.compiler/defbinopp clojure.core/defn
blaze.elm.compiler/defunopp clojure.core/defn
clojure.test.check.properties/for-all clojure.core/let
datomic-tools.schema/defunc clojure.core/defn
manifold.deferred/loop clojure.core/loop
manifold.deferred/let-flow clojure.core/let
manifold.deferred/let-flow' clojure.core/let
prometheus.alpha/defcounter clojure.core/def
prometheus.alpha/defhistogram clojure.core/def}

:linters
{:unused-private-var
{:exclude
[blaze.datomic.value/string-short-len-code
blaze.datomic.value/string-int-len-code
blaze.datomic.value/boolean-code]}

;; because of macros in modules/cql/src/blaze/elm/compiler.clj
:redefined-var
{:level :off}}}
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*
!modules
!resources
!src
!Dockerfile
!project.clj
!deps.edn
!pom.xml
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/target
/.lein-*
/.nrepl-port
.nrepl-port
/queries
/generate-docs.sh
/fill-store.sh
/load-test.sh
/start-db.sh
/cql-test
/kube*
/nginx.conf
.cpcache
.cache
22 changes: 16 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
dist: trusty
language: clojure
sudo: true
language: java
jdk:
- openjdk8
lein: 2.8.1
- openjdk11
cache:
directories:
- $HOME/.m2
- $HOME/.cljs
- $HOME/.gitlibs
- .cpcache
install:
- curl -O https://download.clojure.org/install/linux-install-1.10.1.469.sh
- chmod +x linux-install-1.10.1.469.sh
- sudo ./linux-install-1.10.1.469.sh
script:
- ./fetch-cql-tests.sh
- lein check
- lein test
- make check
- make lint
- make test
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM clojure:lein-2.9.1 as build
FROM clojure:openjdk-11-tools-deps as build

COPY . /build/

WORKDIR /build
RUN lein uberjar
RUN clojure -A:depstar -m hf.depstar.uberjar target/blaze-standalone.jar

FROM openjdk:8u222-jre
FROM openjdk:11.0.4-jre

COPY --from=build /build/target/blaze-0.6.4-standalone.jar /app/
COPY --from=build /build/target/blaze-standalone.jar /app/

WORKDIR /app

CMD ["/bin/bash", "-c", "java $JVM_OPTS -jar blaze-0.6.4-standalone.jar"]
CMD ["/bin/bash", "-c", "java $JVM_OPTS -jar blaze-standalone.jar -m blaze.core"]
414 changes: 201 additions & 213 deletions LICENSE

Large diffs are not rendered by default.

54 changes: 54 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
VERSION = "0.7.0"

check:
clojure -A:check

lint:
clojure -A:clj-kondo --lint modules
clojure -A:clj-kondo --lint src

modules/cql/cql-test:
wget -P modules/cql/cql-test -q https://raw.githubusercontent.com/HL7/cql/v1.4-ballot/tests/cql/CqlAggregateFunctionsTest.xml
wget -P modules/cql/cql-test -q https://raw.githubusercontent.com/HL7/cql/v1.4-ballot/tests/cql/CqlArithmeticFunctionsTest.xml
wget -P modules/cql/cql-test -q https://raw.githubusercontent.com/HL7/cql/v1.4-ballot/tests/cql/CqlComparisonOperatorsTest.xml
wget -P modules/cql/cql-test -q https://raw.githubusercontent.com/HL7/cql/v1.4-ballot/tests/cql/CqlConditionalOperatorsTest.xml
wget -P modules/cql/cql-test -q https://raw.githubusercontent.com/HL7/cql/v1.4-ballot/tests/cql/CqlDateTimeOperatorsTest.xml
wget -P modules/cql/cql-test -q https://raw.githubusercontent.com/HL7/cql/v1.4-ballot/tests/cql/CqlErrorsAndMessagingOperatorsTest.xml
wget -P modules/cql/cql-test -q https://raw.githubusercontent.com/HL7/cql/v1.4-ballot/tests/cql/CqlIntervalOperatorsTest.xml
wget -P modules/cql/cql-test -q https://raw.githubusercontent.com/HL7/cql/v1.4-ballot/tests/cql/CqlListOperatorsTest.xml
wget -P modules/cql/cql-test -q https://raw.githubusercontent.com/HL7/cql/v1.4-ballot/tests/cql/CqlLogicalOperatorsTest.xml
wget -P modules/cql/cql-test -q https://raw.githubusercontent.com/HL7/cql/v1.4-ballot/tests/cql/CqlNullologicalOperatorsTest.xml
wget -P modules/cql/cql-test -q https://raw.githubusercontent.com/HL7/cql/v1.4-ballot/tests/cql/CqlStringOperatorsTest.xml
wget -P modules/cql/cql-test -q https://raw.githubusercontent.com/HL7/cql/v1.4-ballot/tests/cql/CqlTypeOperatorsTest.xml
wget -P modules/cql/cql-test -q https://raw.githubusercontent.com/HL7/cql/v1.4-ballot/tests/cql/CqlTypesTest.xml
wget -P modules/cql/cql-test -q https://raw.githubusercontent.com/HL7/cql/v1.4-ballot/tests/cql/ValueLiteralsAndSelectors.xml

test-cql: modules/cql/cql-test
cd modules/cql; clojure -A:test --profile :ci

test-datomic:
cd modules/datomic; clojure -A:test --profile :ci

test-interaction:
cd modules/interaction; clojure -A:test --profile :ci

test-openid-auth:
cd modules/openid-auth; clojure -A:test --profile :ci

test-operations-measure-evaluate-measure:
cd modules/operations/measure-evaluate-measure; clojure -A:test --profile :ci

test-rest-api:
cd modules/rest-api; clojure -A:test --profile :ci

test-rest-util:
cd modules/rest-util; clojure -A:test --profile :ci

test: test-cql test-datomic test-interaction test-openid-auth test-operations-measure-evaluate-measure test-rest-api test-rest-util
clojure -A:test --profile :ci

uberjar:
clojure -A:depstar -m hf.depstar.uberjar target/blaze-${VERSION}-standalone.jar


.PHONY: check test-cql test-datomic test-interaction test-openid-auth test-operations-measure-evaluate-measure test-rest-api test-rest-util test uberjar
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The goal of this project is to provide a FHIR® Store with an internal CQL Evalu

The project is currently under active development. Essentially all official [CQL Tests][3] pass. Please report any issues you encounter during evaluation.

Latest release: [v0.6.4][5]
Latest release: [v0.7.0][5]

## Quick Start

Expand All @@ -23,14 +23,14 @@ In order to run Blaze with an in-memory, volatile database, just execute the fol
### Docker

```bash
docker run -p 8080:8080 liferesearch/blaze:0.6.4
docker run -p 8080:8080 liferesearch/blaze:0.7.0
```

### Java

```bash
wget https://github.com/life-research/blaze/releases/download/v0.6.4/blaze-0.6.4-standalone.jar
java -jar blaze-0.6.4-standalone.jar
wget https://github.com/samply/blaze/releases/download/v0.7.0/blaze-0.7.0-standalone.jar
java -jar blaze-0.7.0-standalone.jar
```

Logging output should appear which prints the most important settings and system parameters like Java version and available memory.
Expand All @@ -47,13 +47,16 @@ In-deep deployment options of Blaze are described in the [Deployment Section][4]

## License

Copyright © 2019 LIFE Research Center (Alexander Kiel)
Copyright 2019 The Samply Development Community

Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

[1]: <https://github.com/life-research/life-fhir-gen>
[2]: <http://cql-runner.dataphoria.org/>
[3]: <https://cql.hl7.org/tests.html>
[4]: <https://alexanderkiel.gitbook.io/blaze/deployment>
[5]: <https://github.com/life-research/blaze/releases/tag/v0.6.4>
[5]: <https://github.com/samply/blaze/releases/tag/v0.7.0>
123 changes: 123 additions & 0 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{:paths ["src" "resources"]

:deps
{blaze/datomic
{:local/root "modules/datomic"}

blaze/extern-terminology-service
{:local/root "modules/extern-terminology-service"}

blaze/interaction
{:local/root "modules/interaction"}

blaze.operation/measure-evaluate-measure
{:local/root "modules/operations/measure-evaluate-measure"}

blaze/openid-auth
{:local/root "modules/openid-auth"}

blaze/rest-api
{:local/root "modules/rest-api"}

blaze/structure-definition
{:local/root "modules/structure-definition"}

blaze/thread-pool-executor-collector
{:local/root "modules/thread-pool-executor-collector"}

com.cognitect/anomalies
{:mvn/version "0.1.12"}

com.datomic/datomic-free
{:mvn/version "0.9.5697"
:exclusions
[io.netty/netty-all]}

com.h2database/h2
{:mvn/version "1.4.199"}

com.taoensso/timbre
{:mvn/version "4.10.0"}

integrant
{:git/url "https://github.com/alexanderkiel/integrant.git"
:sha "c673b85130e553feec6d4c5d2d1ec773a49c929c"}

io.netty/netty-codec-http
{:mvn/version "4.1.39.Final"}

io.netty/netty-handler-proxy
{:mvn/version "4.1.39.Final"}

io.netty/netty-resolver-dns
{:mvn/version "4.1.39.Final"}

io.netty/netty-transport-native-epoll$linux-x86_64
{:mvn/version "4.1.39.Final"}

io.prometheus/simpleclient_hotspot
{:mvn/version "0.6.0"}

org.clojars.akiel/datomic-spec
{:mvn/version "0.5.2"}

org.clojars.akiel/datomic-tools
{:mvn/version "0.4"}

org.clojars.akiel/spec-coerce
{:mvn/version "0.4.0"}

org.clojure/clojure
{:mvn/version "1.10.1"}

org.clojure/tools.reader
{:mvn/version "1.3.2"}

prom-metrics
{:mvn/version "0.5-alpha2"}}

:aliases
{:depstar
{:extra-deps
{seancorfield/depstar
{:mvn/version "0.3.3"}}}

:check
{:extra-deps
{athos/clj-check
{:git/url "https://github.com/athos/clj-check.git"
:sha "b48d4e7000586529f81c1e29069b503b57259514"}}
:main-opts
["-m" "clj-check.check"]}

:test
{:extra-paths ["dev" "test"]

:extra-deps
{criterium
{:mvn/version "0.4.5"}

lambdaisland/kaocha
{:mvn/version "0.0-554"}

org.clojars.akiel/iota
{:mvn/version "0.1"}

org.clojure/data.xml
{:mvn/version "0.0.8"}

org.clojure/test.check
{:mvn/version "0.10.0"}

org.clojure/tools.namespace
{:mvn/version "0.3.1"}}

:main-opts
["-m" "kaocha.runner"]}

:clj-kondo
{:extra-deps
{clj-kondo
{:mvn/version "2019.11.03"}}

:main-opts ["-m" "clj-kondo.main"]}}}
40 changes: 40 additions & 0 deletions dev/blaze/dev.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
(ns blaze.dev
(:require
[blaze.spec]
[blaze.system :as system]
[clojure.repl :refer [pst]]
[clojure.spec.test.alpha :as st]
[clojure.tools.namespace.repl :refer [refresh]]
[datomic-spec.test :as dst]))


;; Spec Instrumentation
(st/instrument)
(dst/instrument)


(defonce system nil)


(defn init []
(alter-var-root #'system (constantly (system/init! (System/getenv))))
nil)


(defn reset []
(some-> system system/shutdown!)
(refresh :after `init))


;; Init Development
(comment
(init)
(pst)
)


;; Reset after making changes
(comment
(reset)
(st/unstrument)
)
29 changes: 29 additions & 0 deletions dev/blaze/dev/datomic.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
(ns blaze.dev.datomic
(:require
[blaze.datomic.util :as datomic-util]
[blaze.dev :refer [system]]
[datomic.api :as d]))


(defn count-resources [db type]
(d/q '[:find (count ?e) . :in $ ?id :where [?e ?id]] db (datomic-util/resource-id-attr type)))


(comment
(def conn (::conn system))
(def db (d/db conn))
(def hdb (d/history db))

(count-resources (d/db conn) "Coding")
(count-resources (d/db conn) "Organization")
(count-resources (d/db conn) "Patient")
(count-resources (d/db conn) "Specimen")
(count-resources (d/db conn) "Observation")

(d/pull (d/db conn) '[*] 1262239348687945)
(d/entity (d/db conn) [:Patient/id "0"])
(d/q '[:find (pull ?e [*]) :where [?e :code/id]] (d/db conn))

(d/pull (d/db conn) '[*] (d/t->tx 1197))
)

Loading

0 comments on commit 7b61950

Please sign in to comment.