A Health Data Consent Manager (HDCM) is a new type of entity proposed here whose task is to provide health information aggregation services to customers of health care services. It enables customers to fetch their health information from one or more Health Information Providers (e.g., Hospitals, Diagnostic Labs, Medical Device Companies), based on their explicit Consent and to share such aggregated information with Health Information Users i.e. entities in need of such data (e.g., Insurers, Doctors, Medical Researchers).
- Git (also setup SSH Key)
- Intelli Idea IDE
- Install Lombok Plugin in the IDE and enable Lombok Annotations in preferences
When using IntelliJ Idea, open this project by importing the gradle file and check Auto Import
option to resolve
all the dependencies automatically.
Consent Manager must provide its customers an interface using which they can view and manage consent artefacts associated with them and, optionally, an interface for the customers to view their aggregated health information.
- Consent Manager needs a bunch of backends like RabbitMQ, Keycloak, Postgres. These backends also need some initialization, e.g. 2 Realms (consent-manager & central-registry) & a user consent-service-admin-user need to be created for user authentication in Keycloak. Also, relevant databases & schemas need to be created in postgresql. Run the following docker-compose command for initializing the backend
docker-compose -f docker-compose-backend.yml up
Leave the terminal window for these backends to be running.
Start and stop the backend using the following commands
#Stop backends
docker-compose -f docker-compose-backend.yml stop
#Start backends
docker-compose -f docker-compose-backend.yml start
If you want to remove all the backends for good
docker-compose -f docker-compose-backend.yml down
docker volume rm consent-manager_postgres_data
- With the above setup, you'll have all the required database created. Now run the database migrations to create the required schema for consent-manager app.
git clone https://github.com/ProjectEKA/cm-db-initializer
mvn clean install
java -Djdbc.url=jdbc:postgresql://localhost:5432/consent_manager -Djdbc.username=postgres -Djdbc.password=password -jar target/cmdb-initializer-1.0-SNAPSHOT.jar
docker volume rm consent-manager_postgres_data
- After you Keycloak setup, you'll need to keep track of the Secret associated to consent-manager
- Navigate to ConsentManager Realm
- Go to "Clients" > "Credentials"
- Get the Secret field
- Update the secret in docker-compose.yml under variables CONSENTMANAGER_CLIENTREGISTRY_XAUTHTOKEN & CONSENTMANAGER_KEYCLOAK_CLIENTSECRET CONSENTMANAGER_CLIENTREGISTRY_XAUTHTOKEN => this one needs to be copied from central-registry realm CONSENTMANAGER_KEYCLOAK_CLIENTSECRET => this one needs to be copied from ConsentManager realm
- Now run the rest of the containers with the following command
docker-compose -f docker-compose.yml up --build
This command will run consent-manager, otp & client-registry service.
You can choose to comment out the consent-manager part in the docker-compose.yml file and run it from your favorite IDE.
Create docker image
docker build -t consent-manager .
To run the image
docker run -d -p 8000:8000 consent-manager
To run
./gradlew bootRun
or if you want to run in dev environment setup
./gradlew bootRun --args='--spring.profiles.active=dev'
To run the tests
./grdlew test
- Consent Management
- Aggregate Health Information
Once ran the application, navigate to
{HOST}/index.html
Generates PNGs for all *.puml
files located in docs/diagrams
and <project>/docs/diagrams
.
make png