Client for PIMS keyfile management swagger web API.
- Pseudonymize and reidentify using PIMS keyfile management as backend
- Supports multiple identity/pseudonym types:
- PatientUID
- StudyInstanceUID
- SeriesInstanceUID
- SOPInstanceUID
- AccessionNumber
- Authentication via NTLM
pip install pimsclient
To use pimsclient in a project
# Create a KeyFile instance
keyfile = KeyFile.init_from_id(
keyfile_id=49,
client=AuthenticatedClient(session=session),
server=PIMSServer(url="https://url_to_pims_api")
# I have some patientIDs I want to pseudonymize with PIMS
keys = keyfile.pseudonymize([PatientID('1234'),
PatientID('5678'),
PatientID('9012')])
# I found some pseudo patientIDs. What was the original ID?
keys = keyfile.reidentify([PseudoPatientID('Patient1'),
PseudoPatientID('Patient2'),
PseudoPatientID('Patient3')])
pimsclient needs an authenticated requests.Session()
object to interact with PIMS API.
Check with the admins of the PIMS API server for credentials
You can contribute in different ways
Report bugs at https://github.com/sjoerdk/pimsclient/issues.
Fork this repo, create a feature branch
pimsclient uses poetry for dependency and package management
- Install poetry (see poetry docs)
- Create a virtual env. Go to the folder where cloned pimsclient and use
poetry install
- Install pre-commit hooks.
pre-commit install
Make your code contributions. Make sure document and add tests for new features. To automatically publish to pypi, increment the version number and push to master. See below.
- Run all tests
- Run pre-commit:
pre-commit run
Create a pull request
A merged pull request will only be published to pypi if it has a new version number. To bump pimsclient's version, do the following.
-
pimsclient uses semantic versioning Check whether your addition is a PATCH, MINOR or MAJOR version.
-
Manually increment the version number:
-
pyproject.toml
->version = "0.1.2"
-
-
Add a brief description of your updates new version to
HISTORY.md
This package was originally created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.