Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linking duplicates script #310

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions linking/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Linking Duplicate Patient Resources

This script takes in the IDs of duplicate patient resources and links them using the `patient.link` attribute

## Setup
1. Navigate to the `linking` directory
```
cd .../linking
```
2. Create and activate a virtual environment
```
virtualenv venv
source venv/bin/activate
```
3. Install dependencies
```
pip install -r requirements.txt
```
4. Update the `config.py` file with the correct credentials to access your server

## Usage
- To run the script you need to pass in the IDs of two patient resource. For example
```
python3 main.py --patient_ids "12345678|91011121"
```
7 changes: 7 additions & 0 deletions linking/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
client_id = 'client_id'
client_secret = 'client_secret'
username = 'username'
password = 'password'
access_token_url = 'https://keycloak.smartregister.org/auth/realms/your-realm-here/protocol/openid-connect/token'
fhir_base_url = 'https://example.smartregister.org/fhir'
keycloak_url = 'https://keycloak.smartregister.org/auth/admin/realms/your-realm-here'
Loading
Loading