This repository contains the code of ZorgRank which is part of the project 'Gepast Verwijzen'. The project aims to help a general practitioner and patient to make joint decisions about the most suitable follow-up care by ranking care providers with an arithmetic selection model we call ZorgRank. See https://gepastverwijzen.nl/ for more information about the project.
This repository contains:
- a sample set of data
- the API by which the data can be accessed
- an example client that uses the API to show how ZorgRank works
- bin contains scripts to start the application and database (for example used in the Makefile)
- client an example website that uses the API to show how ZorgRank works
- docs specific documentation of subsections
- env environment specific settings for development and production
- resources resources like database migration scripts, queries on the database, configuration files and images
- src/nl/mediquest/zorgrank the code of the API structured using the Luminus web framework
- test/nl/mediquest/zorgrank unit, integration and load tests
- zorgrank.pgsql SQL-script to import data into PostgreSQL
To start the application you need to setup a local database and insert data and then start the API. You will need Leiningen 2.0 or above installed and Docker Compose for running a local PostgreSQL instance.
The project is written in Clojure and uses Leiningen as a build tool. To install Clojure and Leiningen see Purely Functional's installation instructions.
Docker Compose is necessary for running a local PostgreSQL instance.
To setup a database server for the application, run:
make
# enter password: mq_zorgrank_password
- This script imports the tables from
zorgrank.pgsql
in the root of the project. This is smaller example of the actual data available on the Mediquest network.
To connect with the local database run make psql
.
Running from Emacs start a REPL and evaluate (start)
:
M-x cider-jack-in-clj
user> (start)
Running from Leiningen, in the root of the project run:
lein run
To start from a Leiningen REPL use:
lein repl
user> (start)
When started navigate to localhost:3030 to see the Swagger API of the started application.
To investigate the API with the client run cd client && npm install && lein sass4clj once && npx shadow-cljs watch dev
. The client interface will run on localhost:3449 and uses the started API.
To clean up Docker artifacts, run:
make clean
Run unit tests:
lein test :unit
Run integration tests (the ZorgRank API is started in integration test):
make setup-development-db
lein test :integration
make setup-development-db
lein test
For load testing see the load folder or the Load Testing docs.
The data in this open sourced API is a subset of the data available in the production API as used by general practitioners. To see what data is limited see the description of available data.
See the client subfolder for an application that uses the ZorgRank API. This application is deployed at https://zorgrank-client-demo.mediquest.cloud and there uses the deployed version of this API.
Instances of this demo API and client are deployed in the Mediquest cluster at zorgrank-demo.mediquest.cloud and zorgrank-client-demo.mediquest.cloud.
See the docs folder.
- Overview
- Luminus
- Description of available data
- Database:
- Authentication
- Monitoring
- Testing:
- clojure.spec's instrumentation
See DISCLAIMER.md.
MIT © Mediquest