pylantir 0.0.9__tar.gz → 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. pylantir-0.1.1/.devcontainer/Dockerfile +12 -0
  2. pylantir-0.1.1/.devcontainer/devcontainer.json +44 -0
  3. pylantir-0.1.1/.github/dependabot.yml +22 -0
  4. pylantir-0.1.1/.github/template-sync.yml +21 -0
  5. pylantir-0.1.1/.github/workflows/CI.yml +21 -0
  6. pylantir-0.1.1/.github/workflows/publish.yml +33 -0
  7. pylantir-0.1.1/.github/workflows/schedule-update-actions.yml +25 -0
  8. pylantir-0.1.1/.github/workflows/semantic-pr-check.yml +17 -0
  9. pylantir-0.1.1/.github/workflows/sphinx.yml +18 -0
  10. pylantir-0.1.1/.github/workflows/template-sync.yml +12 -0
  11. pylantir-0.1.1/.gitignore +129 -0
  12. pylantir-0.1.1/.pre-commit-config.yaml +60 -0
  13. pylantir-0.1.1/.pypirc +10 -0
  14. pylantir-0.1.1/.vscode/launch.json +19 -0
  15. pylantir-0.1.1/.vscode/settings.json +29 -0
  16. pylantir-0.1.1/CODE_OF_CONDUCT.md +9 -0
  17. {pylantir-0.0.9 → pylantir-0.1.1}/PKG-INFO +16 -6
  18. {pylantir-0.0.9 → pylantir-0.1.1}/README.md +15 -5
  19. pylantir-0.1.1/SECURITY.md +41 -0
  20. pylantir-0.1.1/SUPPORT.md +25 -0
  21. pylantir-0.1.1/docs/Makefile +20 -0
  22. pylantir-0.1.1/docs/conf.py +67 -0
  23. pylantir-0.1.1/docs/devcontainer.md +16 -0
  24. pylantir-0.1.1/docs/developer.md +3 -0
  25. pylantir-0.1.1/docs/index.rst +20 -0
  26. pylantir-0.1.1/docs/make.bat +35 -0
  27. pylantir-0.1.1/docs/modules.rst +7 -0
  28. pylantir-0.1.1/docs/pre-commit-config.md +6 -0
  29. pylantir-0.1.1/docs/pylint.md +507 -0
  30. pylantir-0.1.1/docs/pyproject.md +9 -0
  31. pylantir-0.1.1/docs/python_package.hello_world.rst +21 -0
  32. pylantir-0.1.1/docs/python_package.rst +29 -0
  33. pylantir-0.1.1/docs/requirements.txt +3 -0
  34. pylantir-0.1.1/docs/vscode.md +1 -0
  35. pylantir-0.1.1/docs/workflows.md +4 -0
  36. pylantir-0.1.1/pylantir.png +0 -0
  37. {pylantir-0.0.9 → pylantir-0.1.1}/pyproject.toml +1 -1
  38. pylantir-0.1.1/src/README.md +1 -0
  39. {pylantir-0.0.9 → pylantir-0.1.1}/src/pylantir/__init__.py +1 -1
  40. {pylantir-0.0.9 → pylantir-0.1.1}/src/pylantir/cli/run.py +4 -1
  41. {pylantir-0.0.9 → pylantir-0.1.1}/src/pylantir/config/mwl_config.json +12 -2
  42. {pylantir-0.0.9 → pylantir-0.1.1}/src/pylantir/redcap_to_db.py +88 -18
  43. pylantir-0.1.1/tests/client.py +63 -0
  44. pylantir-0.1.1/tests/client2.py +46 -0
  45. pylantir-0.1.1/tests/conftest.py +30 -0
  46. pylantir-0.1.1/tests/mpps_tester.py +147 -0
  47. pylantir-0.1.1/tests/query_db.py +44 -0
  48. pylantir-0.1.1/tests/test_methods.py +32 -0
  49. pylantir-0.0.9/src/pylantir/.env +0 -2
  50. {pylantir-0.0.9 → pylantir-0.1.1}/LICENSE +0 -0
  51. {pylantir-0.0.9 → pylantir-0.1.1}/src/pylantir/cli/__init__.py +0 -0
  52. {pylantir-0.0.9 → pylantir-0.1.1}/src/pylantir/db_setup.py +0 -0
  53. {pylantir-0.0.9 → pylantir-0.1.1}/src/pylantir/models.py +0 -0
  54. {pylantir-0.0.9 → pylantir-0.1.1}/src/pylantir/mwl_server.py +0 -0
  55. {pylantir-0.0.9 → pylantir-0.1.1}/src/pylantir/populate_db.py +0 -0
@@ -0,0 +1,12 @@
1
+ FROM mcr.microsoft.com/devcontainers/python:3
2
+
3
+ RUN python -m pip install --upgrade pip \
4
+ && python -m pip install 'flit>=3.8.0'
5
+
6
+ ENV FLIT_ROOT_INSTALL=1
7
+
8
+ COPY pyproject.toml .
9
+ RUN touch README.md \
10
+ && mkdir -p src/python_package \
11
+ && python -m flit install --only-deps --deps develop \
12
+ && rm -r pyproject.toml README.md src
@@ -0,0 +1,44 @@
1
+ // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2
+ // https://github.com/microsoft/vscode-dev-containers/tree/v0.222.0/containers/python-3-miniconda
3
+ {
4
+ "name": "Python Environment",
5
+ "build": {
6
+ "dockerfile": "Dockerfile",
7
+ "context": ".."
8
+ },
9
+ "customizations": {
10
+ "vscode": {
11
+ "extensions": [
12
+ "editorconfig.editorconfig",
13
+ "github.vscode-pull-request-github",
14
+ "ms-azuretools.vscode-docker",
15
+ "ms-python.python",
16
+ "ms-python.vscode-pylance",
17
+ "ms-python.pylint",
18
+ "ms-python.isort",
19
+ "ms-python.flake8",
20
+ "ms-python.black-formatter",
21
+ "ms-vsliveshare.vsliveshare",
22
+ "ryanluker.vscode-coverage-gutters",
23
+ "bungcip.better-toml",
24
+ "GitHub.copilot"
25
+ ],
26
+ "settings": {
27
+ "python.defaultInterpreterPath": "/usr/local/bin/python",
28
+ "black-formatter.path": [
29
+ "/usr/local/py-utils/bin/black"
30
+ ],
31
+ "pylint.path": [
32
+ "/usr/local/py-utils/bin/pylint"
33
+ ],
34
+ "flake8.path": [
35
+ "/usr/local/py-utils/bin/flake8"
36
+ ],
37
+ "isort.path": [
38
+ "/usr/local/py-utils/bin/isort"
39
+ ]
40
+ }
41
+ }
42
+ },
43
+ "onCreateCommand": "pre-commit install-hooks"
44
+ }
@@ -0,0 +1,22 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: pip
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ time: "13:00"
8
+ open-pull-requests-limit: 10
9
+ reviewers:
10
+ - dciborow
11
+ allow:
12
+ - dependency-type: direct
13
+ - dependency-type: indirect
14
+ commit-message:
15
+ prefix: "fix: "
16
+ - package-ecosystem: "github-actions"
17
+ directory: "/"
18
+ schedule:
19
+ interval: daily
20
+ time: "13:00"
21
+ commit-message:
22
+ prefix: "fix: "
@@ -0,0 +1,21 @@
1
+ files:
2
+ - ".gitignore" # include
3
+ - ".github"
4
+ - ".vscode"
5
+ - "tests/conftest.py"
6
+ - ".flake8"
7
+ - ".pre-commit-config.yml"
8
+ - ".pypirc"
9
+ - "docs"
10
+ - "src/README.md"
11
+ - "CODE_OF_CONDUCT.md"
12
+ - "LICENSE"
13
+ - "README.md"
14
+ - "SECURITY.md"
15
+ - "SUPPORT.md"
16
+ - "pyproject.toml"
17
+
18
+ - "!.github/workflows/template-sync.yml"
19
+ - "!.github/template-sync.yml"
20
+ - "!src/python_project"
21
+ - "!tests/test_methods.py"
@@ -0,0 +1,21 @@
1
+ name: Python CI
2
+ on:
3
+ push:
4
+ branches: [ main ]
5
+ pull_request:
6
+ branches: [ main ]
7
+ release:
8
+ types: [created]
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+ validation:
13
+ uses: microsoft/action-python/.github/workflows/validation.yml@0.6.4
14
+ with:
15
+ workdir: '.'
16
+
17
+ publish:
18
+ uses: microsoft/action-python/.github/workflows/publish.yml@0.6.4
19
+ secrets:
20
+ PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
21
+ TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
@@ -0,0 +1,33 @@
1
+ name: Publish Python Package
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*" # Only run on version tags like v1.2.3
7
+
8
+ jobs:
9
+ build-and-publish:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Checkout code
14
+ uses: actions/checkout@v4
15
+
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v5
18
+ with:
19
+ python-version: '3.11'
20
+
21
+ - name: Install build tools
22
+ run: |
23
+ python -m pip install --upgrade pip
24
+ pip install build twine
25
+
26
+ - name: Build package
27
+ run: python -m build
28
+
29
+ - name: Publish to PyPI
30
+ env:
31
+ TWINE_USERNAME: __token__
32
+ TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
33
+ run: twine upload dist/*
@@ -0,0 +1,25 @@
1
+ name: GitHub Actions Version Updater
2
+
3
+ # Controls when the action will run.
4
+ on:
5
+ workflow_dispatch:
6
+ schedule:
7
+ # Automatically run on every Sunday
8
+ - cron: '0 0 * * 0'
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - uses: actions/checkout@v3.5.2
16
+ with:
17
+ # [Required] Access token with `workflow` scope.
18
+ token: ${{ secrets.PAT }}
19
+
20
+ - name: Run GitHub Actions Version Updater
21
+ uses: saadmk11/github-actions-version-updater@v0.7.4
22
+ with:
23
+ # [Required] Access token with `workflow` scope.
24
+ token: ${{ secrets.PAT }}
25
+ pull_request_title: "ci: Update GitHub Actions to Latest Version"
@@ -0,0 +1,17 @@
1
+ name: "Semantic PR Check"
2
+
3
+ on:
4
+ pull_request_target:
5
+ types:
6
+ - opened
7
+ - edited
8
+ - synchronize
9
+
10
+ jobs:
11
+ main:
12
+ name: Validate PR title
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: amannn/action-semantic-pull-request@v5.2.0
16
+ env:
17
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,18 @@
1
+ name: Deploy Sphinx documentation to Pages
2
+
3
+ on:
4
+ push:
5
+ branches: [main] # branch to trigger deployment
6
+
7
+ jobs:
8
+ pages:
9
+ runs-on: ubuntu-20.04
10
+ environment:
11
+ name: github-pages
12
+ url: ${{ steps.deployment.outputs.page_url }}
13
+ permissions:
14
+ pages: write
15
+ id-token: write
16
+ steps:
17
+ - id: deployment
18
+ uses: sphinx-notes/pages@v3
@@ -0,0 +1,12 @@
1
+ name: Template Sync
2
+ on:
3
+ workflow_dispatch:
4
+ jobs:
5
+ sync:
6
+ runs-on: ubuntu-latest
7
+ steps:
8
+ - uses: actions/checkout@v3.5.2 # important!
9
+ - uses: euphoricsystems/action-sync-template-repository@v2.5.1
10
+ with:
11
+ github-token: ${{ secrets.GITHUB_TOKEN }}
12
+ dry-run: true
@@ -0,0 +1,129 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .nox/
44
+ .coverage
45
+ .coverage.*
46
+ .cache
47
+ nosetests.xml
48
+ coverage.xml
49
+ *.cover
50
+ *.py,cover
51
+ .hypothesis/
52
+ .pytest_cache/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ target/
76
+
77
+ # Jupyter Notebook
78
+ .ipynb_checkpoints
79
+
80
+ # IPython
81
+ profile_default/
82
+ ipython_config.py
83
+
84
+ # pyenv
85
+ .python-version
86
+
87
+ # pipenv
88
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
90
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
91
+ # install all needed dependencies.
92
+ #Pipfile.lock
93
+
94
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95
+ __pypackages__/
96
+
97
+ # Celery stuff
98
+ celerybeat-schedule
99
+ celerybeat.pid
100
+
101
+ # SageMath parsed files
102
+ *.sage.py
103
+
104
+ # Environments
105
+ .env
106
+ .venv
107
+ env/
108
+ venv/
109
+ ENV/
110
+ env.bak/
111
+ venv.bak/
112
+
113
+ # Spyder project settings
114
+ .spyderproject
115
+ .spyproject
116
+
117
+ # Rope project settings
118
+ .ropeproject
119
+
120
+ # mkdocs documentation
121
+ /site
122
+
123
+ # mypy
124
+ .mypy_cache/
125
+ .dmypy.json
126
+ dmypy.json
127
+
128
+ # Pyre type checker
129
+ .pyre/
@@ -0,0 +1,60 @@
1
+ ci:
2
+ autoupdate_commit_msg: "chore: update pre-commit hooks"
3
+ autofix_commit_msg: "style: pre-commit fixes"
4
+
5
+ repos:
6
+ - repo: https://github.com/pre-commit/pre-commit-hooks
7
+ rev: v4.1.0
8
+ hooks:
9
+ - id: check-added-large-files
10
+ - id: check-case-conflict
11
+ - id: check-merge-conflict
12
+ - id: check-symlinks
13
+ - id: check-yaml
14
+ - id: debug-statements
15
+ - id: end-of-file-fixer
16
+ - id: mixed-line-ending
17
+ - id: requirements-txt-fixer
18
+ - id: trailing-whitespace
19
+
20
+ - repo: https://github.com/PyCQA/isort
21
+ rev: 5.12.0
22
+ hooks:
23
+ - id: isort
24
+ args: ["-a", "from __future__ import annotations"]
25
+
26
+ - repo: https://github.com/asottile/pyupgrade
27
+ rev: v2.31.0
28
+ hooks:
29
+ - id: pyupgrade
30
+ args: [--py37-plus]
31
+
32
+ - repo: https://github.com/hadialqattan/pycln
33
+ rev: v1.2.5
34
+ hooks:
35
+ - id: pycln
36
+ args: [--config=pyproject.toml]
37
+ stages: [manual]
38
+
39
+ - repo: https://github.com/codespell-project/codespell
40
+ rev: v2.1.0
41
+ hooks:
42
+ - id: codespell
43
+
44
+ - repo: https://github.com/pre-commit/pygrep-hooks
45
+ rev: v1.9.0
46
+ hooks:
47
+ - id: python-check-blanket-noqa
48
+ - id: python-check-blanket-type-ignore
49
+ - id: python-no-log-warn
50
+ - id: python-no-eval
51
+ - id: python-use-type-annotations
52
+ - id: rst-backticks
53
+ - id: rst-directive-colons
54
+ - id: rst-inline-touching-normal
55
+
56
+ - repo: https://github.com/mgedmin/check-manifest
57
+ rev: "0.47"
58
+ hooks:
59
+ - id: check-manifest
60
+ stages: [manual]
pylantir-0.1.1/.pypirc ADDED
@@ -0,0 +1,10 @@
1
+ [distutils]
2
+ index-servers =
3
+ pypi
4
+ testpypi
5
+
6
+ [pypi]
7
+ repository = https://upload.pypi.org/legacy/
8
+
9
+ [testpypi]
10
+ repository = https://test.pypi.org/legacy/
@@ -0,0 +1,19 @@
1
+ {
2
+ "version": "0.1.0",
3
+ "configurations": [
4
+ {
5
+ "name": "Python: Debug Tests",
6
+ "type": "python",
7
+ "request": "launch",
8
+ "program": "${file}",
9
+ "purpose": [
10
+ "debug-test"
11
+ ],
12
+ "console": "integratedTerminal",
13
+ "justMyCode": false,
14
+ "env": {
15
+ "PYTEST_ADDOPTS": "--no-cov -n0 --dist no"
16
+ }
17
+ }
18
+ ]
19
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "editor.formatOnSave": true,
3
+ "editor.formatOnPaste": true,
4
+ "files.trimTrailingWhitespace": true,
5
+ "files.autoSave": "onFocusChange",
6
+ "git.autofetch": true,
7
+ "[jsonc]": {
8
+ "editor.defaultFormatter": "vscode.json-language-features"
9
+ },
10
+ "[python]": {
11
+ "editor.defaultFormatter": "ms-python.black-formatter"
12
+ },
13
+ "python.defaultInterpreterPath": "/usr/local/bin/python",
14
+ "python.formatting.provider": "black",
15
+ "python.testing.unittestEnabled": false,
16
+ "python.testing.pytestEnabled": true,
17
+ "pylint.args": [
18
+ "--rcfile=pyproject.toml"
19
+ ],
20
+ "black-formatter.args": [
21
+ "--config=pyproject.toml"
22
+ ],
23
+ "flake8.args": [
24
+ "--toml-config=pyproject.toml"
25
+ ],
26
+ "isort.args": [
27
+ "--settings-path=pyproject.toml"
28
+ ]
29
+ }
@@ -0,0 +1,9 @@
1
+ # Microsoft Open Source Code of Conduct
2
+
3
+ This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4
+
5
+ Resources:
6
+
7
+ - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8
+ - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9
+ - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pylantir
3
- Version: 0.0.9
3
+ Version: 0.1.1
4
4
  Summary: Python - DICOM Modality WorkList
5
5
  Author-email: Milton Camacho <miltoncamachoicc@gmail.com>
6
6
  Requires-Python: >=3.11.1
@@ -82,12 +82,19 @@ pylantir start --ip 127.0.0.1 --port 4242 --AEtitle MWL_SERVER --pylantir_config
82
82
 
83
83
  ## Tests
84
84
 
85
- Once your modality worklist server is running you can test it running the following:
85
+ If you want to run the tests make sure to clone the repository and run them from there.
86
+
87
+ Git clone the repository:
88
+
89
+ ```bash
90
+ git clone https://github.com/miltoncamacho/pylantir
91
+ cd pylantir/tests
92
+ ```
86
93
 
87
94
  Query the worklist database to check that you have some entries using:
88
95
 
89
96
  ```bash
90
- pylantir query-db
97
+ python query-db.py
91
98
  ```
92
99
 
93
100
  Then, you can get a StudyUID from one of the entries to test the MPPS workflow. For example: 1.2.840.10008.3.1.2.3.4.55635351412689303463019139483773956632
@@ -95,19 +102,19 @@ Then, you can get a StudyUID from one of the entries to test the MPPS workflow.
95
102
  Take this and run a create action to mark the worklist Procedure Step Status as IN_PROGRESS
96
103
 
97
104
  ```bash
98
- pylantir test-mpps --AEtitle MWL_SERVER --mpps_action create --callingAEtitle MWL_TESTER --ip 127.0.0.1 --port 4242 --study_uid 1.2.840.10008.3.1.2.3.4.55635351412689303463019139483773956632
105
+ python test-mpps.py --AEtitle MWL_SERVER --mpps_action create --callingAEtitle MWL_TESTER --ip 127.0.0.1 --port 4242 --study_uid 1.2.840.10008.3.1.2.3.4.55635351412689303463019139483773956632
99
106
  ```
100
107
 
101
108
  You can verify that this in fact modified your database re-running:
102
109
 
103
110
  ```bash
104
- pylantir query-db
111
+ python query-db.py
105
112
  ```
106
113
 
107
114
  Finally, you can also simulate the pocedure completion efectively updating the Procedure Step Status to COMPLETED or DISCONTINUED:
108
115
 
109
116
  ```bash
110
- pylantir test-mpps --AEtitle MWL_SERVER --mpps_action set --mpps_status COMPLETED --callingAEtitle MWL_TESTER --ip 127.0.0.1 --port 4242 --study_uid 1.2.840.10008.3.1.2.3.4.55635351412689303463019139483773956632 --sop_uid 1.2.840.10008.3.1.2.3.4.187176383255263644225774937658729238426
117
+ python test-mpps.py --AEtitle MWL_SERVER --mpps_action set --mpps_status COMPLETED --callingAEtitle MWL_TESTER --ip 127.0.0.1 --port 4242 --study_uid 1.2.840.10008.3.1.2.3.4.55635351412689303463019139483773956632 --sop_uid 1.2.840.10008.3.1.2.3.4.187176383255263644225774937658729238426
111
118
  ```
112
119
 
113
120
  ## Usage
@@ -137,6 +144,8 @@ usage: pylantir [-h] [--AEtitle AETITLE] [--ip IP] [--port PORT] [--pylantir_con
137
144
  - **site**: Site ID:string
138
145
  - **protocol**: `{"site": "protocol_name", "mapping": "HIS/RIS mapping"}`
139
146
  - **redcap2wl**: Dictionary of REDCap fields to worklist fields mapping e.g., `{"redcap_field": "worklist_field"}`
147
+ - **db_update_interval**: How often to reload the database e
148
+ - **operation_interval**: What is the time range in a day in which the database will be updated e.g., `{"start_time":[hours,minutes],"end_time":[hours,minutes]}`
140
149
  - **--mpps_action {create,set}**: Action to perform for MPPS either create or set
141
150
  - **--mpps_status {COMPLETED,DISCONTINUED}**: Status to set for MPPS either COMPLETED or DISCONTINUED
142
151
  - **--callingAEtitle CALLINGAETITLE**: Calling AE Title for MPPS, it helps when the MWL is limited to only accept certain AE titles
@@ -152,6 +161,7 @@ As a default pylantir will try to read a JSON structured file with the following
152
161
  "db_path": "/path/to/worklist.db",
153
162
  "db_echo": "False",
154
163
  "db_update_interval": 60,
164
+ "operation_interval": {"start_time": [0,0],"end_time": [23,59]},
155
165
  "allowed_aet": [],
156
166
  "site": "792",
157
167
  "redcap2wl": {
@@ -35,12 +35,19 @@ pylantir start --ip 127.0.0.1 --port 4242 --AEtitle MWL_SERVER --pylantir_config
35
35
 
36
36
  ## Tests
37
37
 
38
- Once your modality worklist server is running you can test it running the following:
38
+ If you want to run the tests make sure to clone the repository and run them from there.
39
+
40
+ Git clone the repository:
41
+
42
+ ```bash
43
+ git clone https://github.com/miltoncamacho/pylantir
44
+ cd pylantir/tests
45
+ ```
39
46
 
40
47
  Query the worklist database to check that you have some entries using:
41
48
 
42
49
  ```bash
43
- pylantir query-db
50
+ python query-db.py
44
51
  ```
45
52
 
46
53
  Then, you can get a StudyUID from one of the entries to test the MPPS workflow. For example: 1.2.840.10008.3.1.2.3.4.55635351412689303463019139483773956632
@@ -48,19 +55,19 @@ Then, you can get a StudyUID from one of the entries to test the MPPS workflow.
48
55
  Take this and run a create action to mark the worklist Procedure Step Status as IN_PROGRESS
49
56
 
50
57
  ```bash
51
- pylantir test-mpps --AEtitle MWL_SERVER --mpps_action create --callingAEtitle MWL_TESTER --ip 127.0.0.1 --port 4242 --study_uid 1.2.840.10008.3.1.2.3.4.55635351412689303463019139483773956632
58
+ python test-mpps.py --AEtitle MWL_SERVER --mpps_action create --callingAEtitle MWL_TESTER --ip 127.0.0.1 --port 4242 --study_uid 1.2.840.10008.3.1.2.3.4.55635351412689303463019139483773956632
52
59
  ```
53
60
 
54
61
  You can verify that this in fact modified your database re-running:
55
62
 
56
63
  ```bash
57
- pylantir query-db
64
+ python query-db.py
58
65
  ```
59
66
 
60
67
  Finally, you can also simulate the pocedure completion efectively updating the Procedure Step Status to COMPLETED or DISCONTINUED:
61
68
 
62
69
  ```bash
63
- pylantir test-mpps --AEtitle MWL_SERVER --mpps_action set --mpps_status COMPLETED --callingAEtitle MWL_TESTER --ip 127.0.0.1 --port 4242 --study_uid 1.2.840.10008.3.1.2.3.4.55635351412689303463019139483773956632 --sop_uid 1.2.840.10008.3.1.2.3.4.187176383255263644225774937658729238426
70
+ python test-mpps.py --AEtitle MWL_SERVER --mpps_action set --mpps_status COMPLETED --callingAEtitle MWL_TESTER --ip 127.0.0.1 --port 4242 --study_uid 1.2.840.10008.3.1.2.3.4.55635351412689303463019139483773956632 --sop_uid 1.2.840.10008.3.1.2.3.4.187176383255263644225774937658729238426
64
71
  ```
65
72
 
66
73
  ## Usage
@@ -90,6 +97,8 @@ usage: pylantir [-h] [--AEtitle AETITLE] [--ip IP] [--port PORT] [--pylantir_con
90
97
  - **site**: Site ID:string
91
98
  - **protocol**: `{"site": "protocol_name", "mapping": "HIS/RIS mapping"}`
92
99
  - **redcap2wl**: Dictionary of REDCap fields to worklist fields mapping e.g., `{"redcap_field": "worklist_field"}`
100
+ - **db_update_interval**: How often to reload the database e
101
+ - **operation_interval**: What is the time range in a day in which the database will be updated e.g., `{"start_time":[hours,minutes],"end_time":[hours,minutes]}`
93
102
  - **--mpps_action {create,set}**: Action to perform for MPPS either create or set
94
103
  - **--mpps_status {COMPLETED,DISCONTINUED}**: Status to set for MPPS either COMPLETED or DISCONTINUED
95
104
  - **--callingAEtitle CALLINGAETITLE**: Calling AE Title for MPPS, it helps when the MWL is limited to only accept certain AE titles
@@ -105,6 +114,7 @@ As a default pylantir will try to read a JSON structured file with the following
105
114
  "db_path": "/path/to/worklist.db",
106
115
  "db_echo": "False",
107
116
  "db_update_interval": 60,
117
+ "operation_interval": {"start_time": [0,0],"end_time": [23,59]},
108
118
  "allowed_aet": [],
109
119
  "site": "792",
110
120
  "redcap2wl": {
@@ -0,0 +1,41 @@
1
+ <!-- BEGIN MICROSOFT SECURITY.MD V0.0.5 BLOCK -->
2
+
3
+ ## Security
4
+
5
+ Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
6
+
7
+ If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below.
8
+
9
+ ## Reporting Security Issues
10
+
11
+ **Please do not report security vulnerabilities through public GitHub issues.**
12
+
13
+ Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
14
+
15
+ If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
16
+
17
+ You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18
+
19
+ Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20
+
21
+ * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22
+ * Full paths of source file(s) related to the manifestation of the issue
23
+ * The location of the affected source code (tag/branch/commit or direct URL)
24
+ * Any special configuration required to reproduce the issue
25
+ * Step-by-step instructions to reproduce the issue
26
+ * Proof-of-concept or exploit code (if possible)
27
+ * Impact of the issue, including how an attacker might exploit the issue
28
+
29
+ This information will help us triage your report more quickly.
30
+
31
+ If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
32
+
33
+ ## Preferred Languages
34
+
35
+ We prefer all communications to be in English.
36
+
37
+ ## Policy
38
+
39
+ Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
40
+
41
+ <!-- END MICROSOFT SECURITY.MD BLOCK -->