The project is based on the Phoenix web framework. This framework is written in elixir, which is also used to do data pre-processing and import into the database. The front-end interactions are using Vue.js. Communication between Vue.js and the backend is done using Phoenix Channels (which runs on Websockets).
-
node.js
-
PostgreSQL database
Some configuration files contain secret credentials, therefore are not present in this public GitHub repository. Risteys developer can get them by requesting access to the GitLab repository "risteys/risteys_secrets".
Create a file dev.secret.exs
in the config/
directory, with the following content and replacing the <VAR>:
dev.secret.exs
use Mix.Config
# Configure your database
config :risteys, Risteys.Repo,
username: "<USER>",
password: "<PASSWORD>",
database: "<DBNAME>",
hostname: "<HOSTNAME>",
pool_size: 10
Tips to find needed information:
-
Open a psql console in a terminal by running
psql postgres
(\q
to quit). -
List existing users by
\du
. If you don’t have postrgesql user (other than superuser), create a user with the ability to create a database.-
create user:
CREATE USER <username> WITH PASSWORD <password>;
-
grant permission to create a database:
ALTER USER <username> CREATEDB;
-
-
get database name:
\conninfo
-
get hostname:
SELECT boot_val,reset_val
FROM pg_settings
WHERE name='listen_addresses';;
Create a file config.secret.exs
in the config/
directory, with the below content and replacing the <INSERT KEY HERE> with key with a random key given by Vincent. (For a working project, a random key can be made by using a command mix phx.gen.secret 64
).
config.secret.exs
use Mix.Config
# Configures the endpoint
config :risteys, RisteysWeb.Endpoint,
url: [host: "localhost"],
secret_key_base: "<INSERT KEY HERE>",
render_errors: [view: RisteysWeb.ErrorView, accepts: ~w(html json)],
pubsub: [name: Risteys.PubSub, adapter: Phoenix.PubSub.PG2]
From a terminal in the project root directory (i.e. risteys_elixir
), run:
-
mix deps.get
to get the Elixir dependencies -
mix ecto.setup
to create the DB and apply the migrations -
change directory to
assets/
and thennpm install
to install the Javascript dependencies listed in theassets\package.json
-
if the command directs to some other file than
assets\package.json
and is not installing dependencies listed in that file, but gives an error instead, removenode_modules
andpackage-lock.json
and run again.
-
change directory back to risteys_elixir
and connect to the server: mix phx.server
You can now access Risteys from http://localhost:4000
Import files are in risteys_elixir
and they should be run in that directory:
mix run import_icd9.exs <path-to-input-file>
.
Input files are listed at the beginning of import_
files.
Import scripts should be run in this order:
-
import_icd10.exs
-
import_icd9.exs
-
import_endpoint_csv.exs
-
import_ontology.exs
-
import_aggregated_stats.exs
-
import_coxhr.exs