Skip to content

Commit

Permalink
Split into Modules
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderkiel committed Nov 5, 2019
1 parent 9967b83 commit f12e410
Show file tree
Hide file tree
Showing 217 changed files with 4,678 additions and 2,667 deletions.
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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/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
21 changes: 15 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
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 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.7.0-alpha3-standalone.jar /app/
COPY --from=build /build/target/blaze-standalone.jar /app/

WORKDIR /app

CMD ["/bin/bash", "-c", "java $JVM_OPTS -jar blaze-0.7.0-alpha3-standalone.jar"]
CMD ["/bin/bash", "-c", "java $JVM_OPTS -jar blaze-standalone.jar -m blaze.core"]
50 changes: 50 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
VERSION = "0.7.0-alpha5"

check:
clojure -A:check

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
10 changes: 5 additions & 5 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.7.0-alpha2][5]
Latest release: [v0.7.0-alpha5][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.7.0-alpha3
docker run -p 8080:8080 liferesearch/blaze:0.7.0-alpha5
```

### Java

```bash
wget https://github.com/life-research/blaze/releases/download/v0.7.0-alpha2/blaze-0.7.0-alpha3-standalone.jar
java -jar blaze-0.7.0-alpha3-standalone.jar
wget https://github.com/life-research/blaze/releases/download/v0.7.0-alpha5/blaze-0.7.0-alpha5-standalone.jar
java -jar blaze-0.7.0-alpha5-standalone.jar
```

Logging output should appear which prints the most important settings and system parameters like Java version and available memory.
Expand All @@ -56,4 +56,4 @@ your option) any later version.
[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.7.0-alpha2>
[5]: <https://github.com/life-research/blaze/releases/tag/v0.7.0-alpha5>
119 changes: 119 additions & 0 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{: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"}

phrase
{:mvn/version "0.3-alpha3"}

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"]}}}
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 f12e410

Please sign in to comment.