Skip to content

Commit

Permalink
Add linking duplicates script
Browse files Browse the repository at this point in the history
  • Loading branch information
Wambere committed Nov 8, 2024
1 parent a70d0cb commit c35133e
Show file tree
Hide file tree
Showing 5 changed files with 482 additions and 0 deletions.
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

0 comments on commit c35133e

Please sign in to comment.