With the Mainzelliste UI your can easily manage your patient list, creating new ID, editing patient fields or deleting patient.
Most of the configuration can be set using docker environment variables
the docker image of the ui uses several environment variables :
Environment Variable | Description | Required ? | Default Value |
---|---|---|---|
MAINZELLISTE_URL | the mainzelliste backend url | Yes | - |
ML_UI_MAIN_ID_TYPE | default selected ID in create new patient page | no | the backend default id type (is the first id type in the mainzelliste idgenerators configutation) |
ML_UI_SHOW_ALL_IDS | show all id in patient list view | no | false |
ML_UI_DEBUG_MODE | activate debug mode will initialize the patient list view with dummy data | no | false |
KEYCLOAK_URL | Keycloak base url | Yes | - |
KEYCLOAK_REALM | Realm ID | Yes | - |
KEYCLOAK_CLIENT_ID | Client ID | Yes | - |
Choosing the right version of the Mainzelliste backend.
Mainzelliste-UI | Mainzelliste (backend) |
---|---|
0.0.4 (Beta) | 12.x |
0.0.5 (development) | 13.x (development) |
- copy the file
.env.default
to.env
and set the environment variableHOST
to the server name or ip address. - set your server name or ip address (
{HOST}
) in keyclok configuration
chmod u+x prepare-keycloak-import-file.sh
./prepare-keycloak-import-file.sh {HOST}
- run
docker-compose up -d
Adjust your docker compose file, depending on the configuration of the reverse proxy:
- in
keycloak
service:- change the
command
tocommand: ["start"]
- replace the environment variable
KC_HOSTNAME_URL
with :
- change the
KC_PROXY: edge
KC_HOSTNAME: ${HOST}
KC_HTTP_RELATIVE_PATH: /keycloak
- in
mainzelliste
service:- adjust both env. variables
ML_ALLOWED_ORIGINS
andML_OIDC_ISS
- adjust both env. variables
- in
mainzelliste-gui
service:- adjust both env. variables
KEYCLOAK_URL
andMAINZELLISTE_URL
- adjust both env. variables
For more configuration your can override the default configuration file using the docker secret mainzelliste-gui.docker.conf
services:
mainzelliste-gui:
secrets:
- mainzelliste-gui.docker.conf
secrets:
mainzelliste-gui.docker.conf:
file: ./configs/mainzelliste-gui.docker.conf
- Run
npm install -g @angular/cli
andnpm install
in the terminal in your project directory. - copy the file
.env.default
to.env
and set the environment variableHOST
tolocalhost
. - (optional) populate the mainzelliste database with 100k patients
./init-demodata.sh
Note:./rousource/demodata.sql
contains identifying demographic data set compiled from a lists of first and last names provided by Eli Finer in Gist, randomly generated birthdate and german city and zip codes. docker-compose up mainzelliste mainzelliste-db keycloak keycloak-db -d
- create a configuration file
src/assets/config/config.json
and fill the content with the following code:
{
"patientLists": [
{
"url": "http://localhost:8080",
"oAuthConfig": {
"url": "http://localhost:8082",
"realm": "mainzelliste",
"clientId": "mainzelliste-ui"
},
"mainIdType": "pid",
"showAllIds": false,
"fields": [
{ "i18n": "first_name_text", "name": "Vorname", "mainzellisteField": "vorname"},
{ "i18n": "last_name_text", "name": "Nachname", "mainzellisteField": "nachname"},
{ "i18n": "birth_name_text", "name": "Geburtsname", "mainzellisteField": "geburtsname"},
{ "i18n": "birth_date_text", "name": "Geburtdatum", "mainzellisteFields": ["geburtstag", "geburtsmonat", "geburtsjahr"]},
{ "i18n": "residence_text", "name": "Wohnort", "mainzellisteField": "ort"},
{ "i18n": "zip_code_text", "name": "PLZ", "mainzellisteField": "plz"}
],
"debug": false,
"betaFeatures": {
"consent": false,
"copyConcatenatedId": false,
"copyId": true,
"configuration": true
}
}
]
}
- Run
ng serve
for a dev server. Navigate tohttp://localhost:4200
. The app will automatically reload if you change any of the source files. - You can now login with an admin user
username:admin and password:demo
or with other user e.g study nurseusername: study-nurse and password:demo
with restricted privileges
- Create new realm mainzelliste
- go to tab General and set Html display name:
<div class="kc-logo-text"><span></span></div>
- go to tab Themes and choose login theme mainzelliste
- go to tab General and set Html display name:
- Create new client mainzelliste-ui
- set Root URL, Home URL and Web origins to
http://localhost
- set valid redirect URI and valid post logout redirect URI to
http://localhost/*
- go to Login Setting and select mainzelliste as Login theme
- set Root URL, Home URL and Web origins to
- Create two roles:
- go to Clients in the menu
- open
mainzelliste-ui
from the list - go to tab Roles and create two roles
admin
andstudy-nurse
- Create Role Mapper:
- go to Client scopes in the menu
- open roles from the list
- got to tab Mappers
- Add new Mapper "by configuration" and choose User Client Role from the table
- set Name to e.g
User Client Role (Mainzelliste)
- set Token Claim Name to
roles
- Toggle the Add to userinfo switch to on
- set Name to e.g
- Create default new user for demo:
- go to Users in the menu
- add new user
- go to tab Credentials and add password
- go to tab Role Mapping and assign a Role:
- Filter the list by clients
- Select admin role and click assign
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory.
docker build -t medicalinformatics/mainzelliste-gui:develop .
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
In order to export realm configuration including all users to one file, just run "bash" in keycloak container and execute the following command:
./opt/keycloak/bin/kc.sh export --file ~/mainzelliste-realm.json --users realm_file --realm mainzelliste
Now you can just copy the file to the resource order "resources/keycloak/import/"
docker cp {keycloak-container-id}:/opt/keycloak/mainzelliste-realm.json ./resources/keycloak/import/
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.
Copyright 2021 - 2023 Federated Information Systems Team from DKFZ Heidelberg
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.