OpenREM 1.0.0b2__py3-none-any.whl → 1.0.0b3__py3-none-any.whl
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.
- openrem/locale/de/LC_MESSAGES/django.po +1060 -1059
- openrem/locale/django.pot +973 -972
- openrem/locale/es_MX/LC_MESSAGES/django.po +1049 -1048
- openrem/locale/it/LC_MESSAGES/django.po +1044 -1043
- openrem/locale/lt/LC_MESSAGES/django.po +989 -988
- openrem/locale/nb_NO/LC_MESSAGES/django.po +985 -984
- openrem/locale/pt_BR/LC_MESSAGES/django.po +1003 -1002
- openrem/manage.py +10 -10
- openrem/openremproject/__init__.py +1 -1
- openrem/openremproject/local_settings.py.linux +128 -128
- openrem/openremproject/local_settings.py.windows +144 -144
- openrem/openremproject/local_settings.py.windows-sqlite3 +129 -129
- openrem/openremproject/settings.py +278 -278
- openrem/openremproject/urls.py +32 -32
- openrem/openremproject/wsgi.py.example +28 -28
- openrem/remapp/__init__.py +2 -2
- openrem/remapp/admin.py +31 -31
- openrem/remapp/exports/ct_export.py +780 -753
- openrem/remapp/exports/dx_export.py +817 -805
- openrem/remapp/exports/export_common.py +931 -951
- openrem/remapp/exports/export_common_pandas.py +2422 -0
- openrem/remapp/exports/exportviews.py +815 -860
- openrem/remapp/exports/mg_csv_nhsbsp.py +292 -292
- openrem/remapp/exports/mg_export.py +673 -510
- openrem/remapp/exports/nm_export.py +796 -575
- openrem/remapp/exports/rf_export.py +1418 -1431
- openrem/remapp/extractors/ct_philips.py +424 -414
- openrem/remapp/extractors/ct_toshiba.py +2116 -2108
- openrem/remapp/extractors/dx.py +1033 -952
- openrem/remapp/extractors/extract_common.py +817 -817
- openrem/remapp/extractors/import_views.py +426 -426
- openrem/remapp/extractors/mam.py +685 -672
- openrem/remapp/extractors/nm_image.py +439 -431
- openrem/remapp/extractors/ptsizecsv2db.py +368 -368
- openrem/remapp/extractors/rdsr.py +667 -654
- openrem/remapp/extractors/rdsr_methods.py +1771 -1768
- openrem/remapp/extractors/rrdsr_methods.py +630 -622
- openrem/remapp/fixtures/openskin_safelist.json +11 -11
- openrem/remapp/forms.py +2286 -2277
- openrem/remapp/interface/chart_functions.py +2412 -2393
- openrem/remapp/interface/mod_filters.py +1241 -1243
- openrem/remapp/migrations/0001_initial.py.1-0-upgrade +1043 -1043
- openrem/remapp/models.py +3418 -3407
- openrem/remapp/netdicom/dicomviews.py +681 -683
- openrem/remapp/netdicom/qrscu.py +2646 -2646
- openrem/remapp/netdicom/tools.py +134 -134
- openrem/remapp/static/css/bootstrap-theme.css +587 -587
- openrem/remapp/static/css/bootstrap-theme.min.css +4 -4
- openrem/remapp/static/css/bootstrap.css +6800 -6800
- openrem/remapp/static/css/bootstrap.min.css +4 -4
- openrem/remapp/static/css/datepicker3.css +790 -790
- openrem/remapp/static/css/jquery.qtip.min.css +2 -2
- openrem/remapp/static/css/openrem-extra.css +442 -442
- openrem/remapp/static/css/openrem.css +96 -96
- openrem/remapp/static/css/registration.css +34 -34
- openrem/remapp/static/fonts/glyphicons-halflings-regular.svg +287 -287
- openrem/remapp/static/js/bootstrap-datepicker.js +1671 -1671
- openrem/remapp/static/js/bootstrap.js +2363 -2363
- openrem/remapp/static/js/bootstrap.min.js +6 -6
- openrem/remapp/static/js/charts/chartCommonFunctions.js +75 -75
- openrem/remapp/static/js/charts/chartFullScreen.js +41 -41
- openrem/remapp/static/js/charts/ctChartAjax.js +331 -331
- openrem/remapp/static/js/charts/dxChartAjax.js +290 -290
- openrem/remapp/static/js/charts/mgChartAjax.js +144 -144
- openrem/remapp/static/js/charts/nmChartAjax.js +64 -64
- openrem/remapp/static/js/charts/plotly-2.35.2.min.js +8 -0
- openrem/remapp/static/js/charts/rfChartAjax.js +128 -128
- openrem/remapp/static/js/chroma.min.js +32 -32
- openrem/remapp/static/js/datepicker.js +5 -5
- openrem/remapp/static/js/dicom.js +115 -115
- openrem/remapp/static/js/django_reverse/reverse.js +13 -13
- openrem/remapp/static/js/formatDate.js +7 -7
- openrem/remapp/static/js/html5shiv.min.js +8 -8
- openrem/remapp/static/js/jquery-1.11.0.min.js +4 -4
- openrem/remapp/static/js/npm.js +12 -12
- openrem/remapp/static/js/respond.min.js +4 -4
- openrem/remapp/static/js/skin-dose-maps/jquery.qtip.min.js +4 -4
- openrem/remapp/static/js/skin-dose-maps/rfSkinDoseMap3dHUDObject.js +112 -112
- openrem/remapp/static/js/skin-dose-maps/rfSkinDoseMap3dObject.js +367 -367
- openrem/remapp/static/js/skin-dose-maps/rfSkinDoseMap3dPersonObject.js +158 -158
- openrem/remapp/static/js/skin-dose-maps/rfSkinDoseMapColourScaleObject.js +153 -153
- openrem/remapp/static/js/skin-dose-maps/rfSkinDoseMapObject.js +367 -367
- openrem/remapp/static/js/skin-dose-maps/rfSkinDoseMapping.js +584 -584
- openrem/remapp/static/js/skin-dose-maps/rfSkinDoseMapping3d.js +255 -255
- openrem/remapp/static/js/skin-dose-maps/rfSkinDoseMappingAjax.js +267 -212
- openrem/remapp/static/js/skin-dose-maps/three.min.js +835 -835
- openrem/remapp/static/js/sorttable.js +495 -495
- openrem/remapp/templates/base.html +253 -253
- openrem/remapp/templates/registration/changepassword.html +25 -25
- openrem/remapp/templates/registration/changepassworddone.html +12 -12
- openrem/remapp/templates/registration/login.html +42 -42
- openrem/remapp/templates/remapp/backgroundtaskmaximumrows_form.html +29 -29
- openrem/remapp/templates/remapp/base.html +1 -1
- openrem/remapp/templates/remapp/ctdetail.html +235 -235
- openrem/remapp/templates/remapp/ctfiltered.html +310 -310
- openrem/remapp/templates/remapp/dicomdeletesettings_form.html +31 -31
- openrem/remapp/templates/remapp/dicomqr.html +147 -147
- openrem/remapp/templates/remapp/dicomquerydetails.html +83 -83
- openrem/remapp/templates/remapp/dicomqueryimages.html +49 -49
- openrem/remapp/templates/remapp/dicomqueryseries.html +109 -109
- openrem/remapp/templates/remapp/dicomquerysummary.html +48 -48
- openrem/remapp/templates/remapp/dicomremoteqr_confirm_delete.html +60 -60
- openrem/remapp/templates/remapp/dicomremoteqr_form.html +32 -32
- openrem/remapp/templates/remapp/dicomstorescp_confirm_delete.html +53 -53
- openrem/remapp/templates/remapp/dicomstorescp_form.html +48 -48
- openrem/remapp/templates/remapp/dicomsummary.html +257 -257
- openrem/remapp/templates/remapp/displaychartoptions.html +184 -184
- openrem/remapp/templates/remapp/displayhomepageoptions.html +57 -57
- openrem/remapp/templates/remapp/displayname-count.html +6 -6
- openrem/remapp/templates/remapp/displayname-last-date.html +3 -3
- openrem/remapp/templates/remapp/displayname-modality.html +86 -105
- openrem/remapp/templates/remapp/displayname-skinmap.html +18 -18
- openrem/remapp/templates/remapp/displaynameupdate.html +100 -100
- openrem/remapp/templates/remapp/displaynameview.html +222 -219
- openrem/remapp/templates/remapp/dxdetail.html +176 -176
- openrem/remapp/templates/remapp/dxfiltered.html +324 -324
- openrem/remapp/templates/remapp/exports-active.html +25 -25
- openrem/remapp/templates/remapp/exports-complete.html +35 -35
- openrem/remapp/templates/remapp/exports-error.html +26 -26
- openrem/remapp/templates/remapp/exports-queue.html +18 -18
- openrem/remapp/templates/remapp/exports.html +191 -191
- openrem/remapp/templates/remapp/failed_summary_list.html +27 -27
- openrem/remapp/templates/remapp/filteredbase.html +162 -162
- openrem/remapp/templates/remapp/highdosemetricalertsettings_form.html +76 -76
- openrem/remapp/templates/remapp/home-list-modalities.html +94 -94
- openrem/remapp/templates/remapp/home.html +202 -202
- openrem/remapp/templates/remapp/list_filters.html +24 -24
- openrem/remapp/templates/remapp/mgdetail.html +160 -138
- openrem/remapp/templates/remapp/mgfiltered.html +311 -311
- openrem/remapp/templates/remapp/nmdetail.html +300 -300
- openrem/remapp/templates/remapp/nmfiltered.html +255 -255
- openrem/remapp/templates/remapp/notpatient.html +190 -190
- openrem/remapp/templates/remapp/notpatientindicators_form_base.html +81 -81
- openrem/remapp/templates/remapp/notpatientindicatorsid_confirm_delete.html +54 -54
- openrem/remapp/templates/remapp/notpatientindicatorsid_form.html +23 -23
- openrem/remapp/templates/remapp/notpatientindicatorsname_confirm_delete.html +54 -54
- openrem/remapp/templates/remapp/notpatientindicatorsname_form.html +23 -23
- openrem/remapp/templates/remapp/notpatientindicatorsname_form_base.html +85 -85
- openrem/remapp/templates/remapp/openskinsafelist_add.html +130 -130
- openrem/remapp/templates/remapp/openskinsafelist_confirm_delete.html +100 -100
- openrem/remapp/templates/remapp/openskinsafelist_form.html +207 -207
- openrem/remapp/templates/remapp/patientidsettings_form.html +83 -83
- openrem/remapp/templates/remapp/populate_summary_progress.html +83 -83
- openrem/remapp/templates/remapp/populate_summary_progress_error.html +36 -36
- openrem/remapp/templates/remapp/review_failed_imports.html +157 -157
- openrem/remapp/templates/remapp/review_failed_study.html +41 -41
- openrem/remapp/templates/remapp/review_studies_delete_button.html +20 -20
- openrem/remapp/templates/remapp/review_study.html +19 -19
- openrem/remapp/templates/remapp/review_summary_list.html +245 -245
- openrem/remapp/templates/remapp/rf_dose_alert_email_template.html +14 -1
- openrem/remapp/templates/remapp/rfalertnotificationsview.html +59 -59
- openrem/remapp/templates/remapp/rfdetail.html +547 -543
- openrem/remapp/templates/remapp/rfdetailbase.html +18 -18
- openrem/remapp/templates/remapp/rffiltered.html +404 -404
- openrem/remapp/templates/remapp/sizeimports.html +119 -119
- openrem/remapp/templates/remapp/sizeprocess.html +96 -96
- openrem/remapp/templates/remapp/sizeupload.html +110 -110
- openrem/remapp/templates/remapp/skindosemapcalcsettings_form.html +28 -28
- openrem/remapp/templates/remapp/standardname-modality.html +69 -69
- openrem/remapp/templates/remapp/standardnames_confirm_delete.html +71 -71
- openrem/remapp/templates/remapp/standardnames_form.html +87 -87
- openrem/remapp/templates/remapp/standardnamesettings_form.html +41 -41
- openrem/remapp/templates/remapp/standardnamesrefreshall.html +92 -92
- openrem/remapp/templates/remapp/standardnameview.html +103 -103
- openrem/remapp/templates/remapp/study_confirm_delete.html +147 -147
- openrem/remapp/templates/remapp/task_admin.html +265 -265
- openrem/remapp/templates/remapp/tasks.html +76 -76
- openrem/remapp/templatetags/formfilters.py +13 -13
- openrem/remapp/templatetags/proper_paginate.py +38 -38
- openrem/remapp/templatetags/remappduration.py +36 -36
- openrem/remapp/templatetags/sigdig.py +38 -38
- openrem/remapp/templatetags/sort_class_property_value.py +15 -15
- openrem/remapp/templatetags/update_variable.py +20 -20
- openrem/remapp/templatetags/url_replace.py +25 -25
- openrem/remapp/tests/test_charts_common.py +202 -202
- openrem/remapp/tests/test_charts_ct.py +7111 -7111
- openrem/remapp/tests/test_charts_dx.py +3513 -3513
- openrem/remapp/tests/test_charts_mg.py +1116 -1115
- openrem/remapp/tests/test_dcmdatetime.py +189 -189
- openrem/remapp/tests/test_dicom_qr.py +2580 -2580
- openrem/remapp/tests/test_display_name.py +274 -274
- openrem/remapp/tests/test_export_ct_xlsx.py +272 -248
- openrem/remapp/tests/test_export_dx_xlsx.py +137 -134
- openrem/remapp/tests/test_export_mammo_csv.py +242 -242
- openrem/remapp/tests/test_export_rf_xlsx.py +246 -246
- openrem/remapp/tests/test_files/DX-Im-DRGEM.dcm +0 -0
- openrem/remapp/tests/test_files/MG-RDSR-GEPristina-2D.dcm +0 -0
- openrem/remapp/tests/test_files/MG-RDSR-GEPristina-DBT.dcm +0 -0
- openrem/remapp/tests/test_files/MG-RDSR-Giotto-DBT.dcm +0 -0
- openrem/remapp/tests/test_files/skin_map_alphenix.py +590 -590
- openrem/remapp/tests/test_files/skin_map_zee.py +354 -354
- openrem/remapp/tests/test_filters_ct.py +321 -321
- openrem/remapp/tests/test_filters_dx.py +92 -92
- openrem/remapp/tests/test_filters_mammo.py +183 -183
- openrem/remapp/tests/test_filters_rf.py +118 -118
- openrem/remapp/tests/test_get_values.py +72 -72
- openrem/remapp/tests/test_hash_id.py +65 -65
- openrem/remapp/tests/test_import_ct_esr_ge.py +3034 -3034
- openrem/remapp/tests/test_import_ct_philips_rdsr.py +42 -42
- openrem/remapp/tests/test_import_ct_rdsr_multiple.py +256 -256
- openrem/remapp/tests/test_import_ct_rdsr_siemens.py +827 -827
- openrem/remapp/tests/test_import_ct_rdsr_spectrumdynamics.py +91 -91
- openrem/remapp/tests/test_import_ct_rdsr_toshiba_dosecheck.py +67 -67
- openrem/remapp/tests/test_import_ct_rdsr_toshiba_multivaluesd.py +33 -33
- openrem/remapp/tests/test_import_ct_rdsr_toshiba_pixelmed.py +118 -118
- openrem/remapp/tests/test_import_ct_sc_philips.py +44 -44
- openrem/remapp/tests/test_import_dual_rdsr.py +110 -110
- openrem/remapp/tests/test_import_dx.py +1267 -1191
- openrem/remapp/tests/test_import_dx_rdsr.py +1250 -1253
- openrem/remapp/tests/test_import_mam.py +438 -438
- openrem/remapp/tests/test_import_mg_im_hol_proj.py +46 -46
- openrem/remapp/tests/test_import_mg_rdsr.py +586 -586
- openrem/remapp/tests/test_import_nm_image.py +420 -420
- openrem/remapp/tests/test_import_nm_siemens_rdsr.py +396 -396
- openrem/remapp/tests/test_import_px.py +161 -161
- openrem/remapp/tests/test_import_rf_rdsr.py +420 -418
- openrem/remapp/tests/test_missing_date.py +42 -42
- openrem/remapp/tests/test_not_patient.py +60 -60
- openrem/remapp/tests/test_openskin.py +272 -272
- openrem/remapp/tests/test_patient_id_settings.py +72 -72
- openrem/remapp/tests/test_pt_size_import.py +232 -232
- openrem/remapp/tests/test_rf_detail.py +113 -113
- openrem/remapp/tests/test_rf_high_dose_alert.py +361 -361
- openrem/remapp/tools/background.py +361 -361
- openrem/remapp/tools/check_standard_name_status.py +47 -0
- openrem/remapp/tools/check_uid.py +70 -70
- openrem/remapp/tools/dcmdatetime.py +248 -248
- openrem/remapp/tools/default_import.py +44 -47
- openrem/remapp/tools/get_values.py +230 -230
- openrem/remapp/tools/hash_id.py +58 -58
- openrem/remapp/tools/make_skin_map.py +448 -406
- openrem/remapp/tools/not_patient_indicators.py +72 -72
- openrem/remapp/tools/openskin/calc_exp_map.py +173 -173
- openrem/remapp/tools/openskin/geomclass.py +475 -475
- openrem/remapp/tools/openskin/geomfunc.py +433 -432
- openrem/remapp/tools/openskin/skinmap.py +417 -417
- openrem/remapp/tools/populate_summary.py +185 -193
- openrem/remapp/tools/save_skin_map_structure.py +73 -73
- openrem/remapp/tools/send_high_dose_alert_emails.py +238 -207
- openrem/remapp/urls.py +456 -448
- openrem/remapp/version.py +11 -11
- openrem/remapp/views.py +1147 -1052
- openrem/remapp/views_admin.py +3876 -3936
- openrem/remapp/views_charts_ct.py +2110 -2058
- openrem/remapp/views_charts_dx.py +1906 -1836
- openrem/remapp/views_charts_mg.py +1349 -1196
- openrem/remapp/views_charts_nm.py +535 -535
- openrem/remapp/views_charts_rf.py +1219 -1241
- openrem/remapp/views_openskin.py +379 -384
- openrem/sample-config/openrem-consumer.service +12 -12
- openrem/sample-config/openrem-gunicorn.service +13 -13
- openrem/sample-config/openrem-server +14 -13
- openrem/sample-config/openrem_orthanc_config_linux.lua +454 -454
- openrem/sample-config/openrem_orthanc_config_windows.lua +455 -455
- openrem/sample-config/queue-init.bat +73 -73
- openrem/scripts/openrem_ctphilips.py +25 -25
- openrem/scripts/openrem_cttoshiba.py +28 -28
- openrem/scripts/openrem_dx.py +22 -22
- openrem/scripts/openrem_mg.py +22 -22
- openrem/scripts/openrem_nm.py +22 -22
- openrem/scripts/openrem_ptsizecsv.py +17 -17
- openrem/scripts/openrem_qr.py +12 -12
- openrem/scripts/openrem_rdsr.py +25 -25
- {OpenREM-1.0.0b2.dist-info → openrem-1.0.0b3.dist-info}/METADATA +39 -29
- openrem-1.0.0b3.dist-info/RECORD +379 -0
- {OpenREM-1.0.0b2.dist-info → openrem-1.0.0b3.dist-info}/WHEEL +1 -1
- {OpenREM-1.0.0b2.dist-info → openrem-1.0.0b3.dist-info/licenses}/COPYING-GPLv3 +674 -674
- {OpenREM-1.0.0b2.dist-info → openrem-1.0.0b3.dist-info/licenses}/LICENSE +22 -22
- OpenREM-1.0.0b2.dist-info/RECORD +0 -373
- openrem/remapp/static/js/charts/plotly-2.17.1.min.js +0 -8
- {OpenREM-1.0.0b2.data → openrem-1.0.0b3.data}/scripts/openrem_ctphilips.py +0 -0
- {OpenREM-1.0.0b2.data → openrem-1.0.0b3.data}/scripts/openrem_cttoshiba.py +0 -0
- {OpenREM-1.0.0b2.data → openrem-1.0.0b3.data}/scripts/openrem_dx.py +0 -0
- {OpenREM-1.0.0b2.data → openrem-1.0.0b3.data}/scripts/openrem_mg.py +0 -0
- {OpenREM-1.0.0b2.data → openrem-1.0.0b3.data}/scripts/openrem_nm.py +0 -0
- {OpenREM-1.0.0b2.data → openrem-1.0.0b3.data}/scripts/openrem_ptsizecsv.py +0 -0
- {OpenREM-1.0.0b2.data → openrem-1.0.0b3.data}/scripts/openrem_qr.py +0 -0
- {OpenREM-1.0.0b2.data → openrem-1.0.0b3.data}/scripts/openrem_rdsr.py +0 -0
- {OpenREM-1.0.0b2.dist-info → openrem-1.0.0b3.dist-info}/top_level.txt +0 -0
|
@@ -1,1191 +1,1267 @@
|
|
|
1
|
-
# This Python file uses the following encoding: utf-8
|
|
2
|
-
# test_get_values.py
|
|
3
|
-
|
|
4
|
-
import os
|
|
5
|
-
from collections import Counter
|
|
6
|
-
import datetime
|
|
7
|
-
from django.contrib.auth.models import User, Group
|
|
8
|
-
from django.test import TestCase
|
|
9
|
-
from pydicom.dataset import Dataset
|
|
10
|
-
from pydicom.dataelem import DataElement
|
|
11
|
-
from pydicom.multival import MultiValue
|
|
12
|
-
import logging
|
|
13
|
-
from testfixtures import LogCapture
|
|
14
|
-
|
|
15
|
-
from
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
ds
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
self.assertEqual(
|
|
63
|
-
source.xrayfilters_set.order_by("id")
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
)
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
pid
|
|
120
|
-
pid.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
self.
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
)
|
|
191
|
-
self.assertEqual(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
)
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
)
|
|
217
|
-
)
|
|
218
|
-
|
|
219
|
-
studies[1].
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
]
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
self.assertEqual(
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
studies[
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
.
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
.
|
|
282
|
-
.
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
self.
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
(
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
.
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
(
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
.
|
|
362
|
-
.
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
(
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
.
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
.
|
|
395
|
-
.
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
self.assertAlmostEqual(
|
|
402
|
-
float(
|
|
403
|
-
studies[0]
|
|
404
|
-
.projectionxrayradiationdose_set.get()
|
|
405
|
-
.irradeventxraydata_set.order_by("id")[0]
|
|
406
|
-
.irradeventxraysourcedata_set.get()
|
|
407
|
-
.
|
|
408
|
-
),
|
|
409
|
-
|
|
410
|
-
)
|
|
411
|
-
self.assertAlmostEqual(
|
|
412
|
-
float(
|
|
413
|
-
studies[0]
|
|
414
|
-
.projectionxrayradiationdose_set.get()
|
|
415
|
-
.irradeventxraydata_set.order_by("id")[
|
|
416
|
-
.irradeventxraysourcedata_set.get()
|
|
417
|
-
.
|
|
418
|
-
),
|
|
419
|
-
|
|
420
|
-
)
|
|
421
|
-
self.assertAlmostEqual(
|
|
422
|
-
float(
|
|
423
|
-
studies[0]
|
|
424
|
-
.projectionxrayradiationdose_set.get()
|
|
425
|
-
.irradeventxraydata_set.order_by("id")[
|
|
426
|
-
.irradeventxraysourcedata_set.get()
|
|
427
|
-
.
|
|
428
|
-
),
|
|
429
|
-
|
|
430
|
-
)
|
|
431
|
-
self.assertAlmostEqual(
|
|
432
|
-
float(
|
|
433
|
-
studies[0]
|
|
434
|
-
.projectionxrayradiationdose_set.get()
|
|
435
|
-
.irradeventxraydata_set.order_by("id")[
|
|
436
|
-
.irradeventxraysourcedata_set.get()
|
|
437
|
-
.
|
|
438
|
-
),
|
|
439
|
-
|
|
440
|
-
)
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
.
|
|
446
|
-
.
|
|
447
|
-
.
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
.
|
|
456
|
-
.
|
|
457
|
-
.
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
.
|
|
466
|
-
.
|
|
467
|
-
.
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
self.assertAlmostEqual(
|
|
473
|
-
float(
|
|
474
|
-
studies[1]
|
|
475
|
-
.projectionxrayradiationdose_set.get()
|
|
476
|
-
.irradeventxraydata_set.order_by("id")[
|
|
477
|
-
.irradeventxraysourcedata_set.get()
|
|
478
|
-
.
|
|
479
|
-
),
|
|
480
|
-
|
|
481
|
-
)
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
.
|
|
487
|
-
.
|
|
488
|
-
.
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
.
|
|
497
|
-
.
|
|
498
|
-
.
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
.
|
|
507
|
-
.
|
|
508
|
-
.
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
.
|
|
518
|
-
.
|
|
519
|
-
.
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
.
|
|
528
|
-
.
|
|
529
|
-
.
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
self.assertAlmostEqual(
|
|
545
|
-
float(
|
|
546
|
-
studies[1]
|
|
547
|
-
.projectionxrayradiationdose_set.get()
|
|
548
|
-
.irradeventxraydata_set.order_by("id")[0]
|
|
549
|
-
.irradeventxraysourcedata_set.get()
|
|
550
|
-
.
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
.
|
|
559
|
-
.
|
|
560
|
-
.
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
.
|
|
570
|
-
.
|
|
571
|
-
.
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
.
|
|
580
|
-
.
|
|
581
|
-
.
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
.
|
|
591
|
-
.
|
|
592
|
-
.
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
.
|
|
602
|
-
.
|
|
603
|
-
.
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
.
|
|
612
|
-
.
|
|
613
|
-
.
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
.
|
|
623
|
-
.
|
|
624
|
-
.
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
.
|
|
645
|
-
.
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
.
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
.
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
.
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
.
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
.
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
.
|
|
735
|
-
.
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
.
|
|
746
|
-
.
|
|
747
|
-
.
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
.
|
|
756
|
-
.
|
|
757
|
-
.
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
.
|
|
766
|
-
.
|
|
767
|
-
.
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
.
|
|
777
|
-
.
|
|
778
|
-
.
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
.
|
|
787
|
-
.
|
|
788
|
-
.
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
.
|
|
797
|
-
.
|
|
798
|
-
.
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
.
|
|
808
|
-
.
|
|
809
|
-
.
|
|
810
|
-
|
|
811
|
-
),
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
.
|
|
818
|
-
.
|
|
819
|
-
.
|
|
820
|
-
|
|
821
|
-
),
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
.
|
|
828
|
-
.
|
|
829
|
-
.
|
|
830
|
-
|
|
831
|
-
),
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
.
|
|
839
|
-
.
|
|
840
|
-
.
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
.
|
|
849
|
-
.
|
|
850
|
-
.
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
)
|
|
888
|
-
|
|
889
|
-
self.assertEqual(
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
)
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
with LogCapture("remapp.extractors", level=logging.DEBUG) as log:
|
|
1054
|
-
dx.dx(os.path.join(root_tests, dx_ge_xr220_2))
|
|
1055
|
-
|
|
1056
|
-
log.check_present(
|
|
1057
|
-
(
|
|
1058
|
-
"remapp.extractors.dx",
|
|
1059
|
-
"WARNING",
|
|
1060
|
-
"Duplicate DX study UID 1.3.6.1.4.1.5962.99.1.2282339064.1266597797.1479751121656.24.0 in "
|
|
1061
|
-
"database - could be a problem! There are 2 copies.",
|
|
1062
|
-
),
|
|
1063
|
-
(
|
|
1064
|
-
"remapp.extractors.dx",
|
|
1065
|
-
"DEBUG",
|
|
1066
|
-
"Duplicate DX study UID 1.3.6.1.4.1.5962.99.1.2282339064.1266597797.1479751121656.24.0 - "
|
|
1067
|
-
"first instance (pk={0}) with modality type assigned (DX) selected to import new event "
|
|
1068
|
-
"into.".format(
|
|
1069
|
-
),
|
|
1070
|
-
)
|
|
1071
|
-
|
|
1072
|
-
number_of_events_study_1 = (
|
|
1073
|
-
GeneralStudyModuleAttr.objects.order_by("pk")
|
|
1074
|
-
.first()
|
|
1075
|
-
.projectionxrayradiationdose_set.get()
|
|
1076
|
-
.irradeventxraydata_set.all()
|
|
1077
|
-
.count()
|
|
1078
|
-
)
|
|
1079
|
-
self.assertEqual(number_of_events_study_1,
|
|
1080
|
-
number_of_events_study_2 = (
|
|
1081
|
-
GeneralStudyModuleAttr.objects.order_by("pk")[1]
|
|
1082
|
-
.projectionxrayradiationdose_set.get()
|
|
1083
|
-
.irradeventxraydata_set.all()
|
|
1084
|
-
.count()
|
|
1085
|
-
)
|
|
1086
|
-
self.assertEqual(number_of_events_study_2,
|
|
1087
|
-
|
|
1088
|
-
def
|
|
1089
|
-
"""Imports second image,
|
|
1090
|
-
|
|
1091
|
-
dx_ge_xr220_2 = os.path.join("test_files", "DX-Im-GE_XR220-2.dcm")
|
|
1092
|
-
root_tests = os.path.dirname(os.path.abspath(__file__))
|
|
1093
|
-
|
|
1094
|
-
self.assertEqual(GeneralStudyModuleAttr.objects.all().count(), 2)
|
|
1095
|
-
|
|
1096
|
-
# Set modality
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
"
|
|
1109
|
-
"
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
"
|
|
1115
|
-
"
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
.
|
|
1124
|
-
.
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
.
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
Imports
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
)
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1
|
+
# This Python file uses the following encoding: utf-8
|
|
2
|
+
# test_get_values.py
|
|
3
|
+
|
|
4
|
+
import os
|
|
5
|
+
from collections import Counter
|
|
6
|
+
import datetime
|
|
7
|
+
from django.contrib.auth.models import User, Group
|
|
8
|
+
from django.test import TestCase
|
|
9
|
+
from pydicom.dataset import Dataset
|
|
10
|
+
from pydicom.dataelem import DataElement
|
|
11
|
+
from pydicom.multival import MultiValue
|
|
12
|
+
import logging
|
|
13
|
+
from testfixtures import LogCapture
|
|
14
|
+
|
|
15
|
+
from django.core.exceptions import ObjectDoesNotExist
|
|
16
|
+
|
|
17
|
+
from remapp.extractors import dx
|
|
18
|
+
from remapp.models import (
|
|
19
|
+
GeneralStudyModuleAttr,
|
|
20
|
+
ProjectionXRayRadiationDose,
|
|
21
|
+
IrradEventXRayData,
|
|
22
|
+
IrradEventXRaySourceData,
|
|
23
|
+
PatientIDSettings,
|
|
24
|
+
XrayFilters,
|
|
25
|
+
StandardNameSettings,
|
|
26
|
+
StandardNames,
|
|
27
|
+
DicomDeleteSettings,
|
|
28
|
+
)
|
|
29
|
+
from openremproject import settings
|
|
30
|
+
|
|
31
|
+
settings.LOGGING["loggers"]["remapp"]["level"] = "DEBUG"
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class DXFilterTests(TestCase):
|
|
35
|
+
def test_multiple_filter_kodak_drxevolution(self):
|
|
36
|
+
"""
|
|
37
|
+
Test the material extraction process when the materials are in a MultiValue format
|
|
38
|
+
"""
|
|
39
|
+
ds = Dataset()
|
|
40
|
+
multi = MultiValue(str, ["ALUMINUM", "COPPER"])
|
|
41
|
+
data_el = DataElement(0x187050, "CS", multi, already_converted=True)
|
|
42
|
+
ds[0x187050] = data_el
|
|
43
|
+
ds.FilterThicknessMinimum = "1.0\\0.1"
|
|
44
|
+
ds.FilterThicknessMaximum = "1.0\\0.1"
|
|
45
|
+
ds.FilterType = "WEDGE"
|
|
46
|
+
|
|
47
|
+
g = GeneralStudyModuleAttr.objects.create()
|
|
48
|
+
g.save()
|
|
49
|
+
proj = ProjectionXRayRadiationDose.objects.create(
|
|
50
|
+
general_study_module_attributes=g
|
|
51
|
+
)
|
|
52
|
+
proj.save()
|
|
53
|
+
event = IrradEventXRayData.objects.create(projection_xray_radiation_dose=proj)
|
|
54
|
+
event.save()
|
|
55
|
+
source = IrradEventXRaySourceData.objects.create(
|
|
56
|
+
irradiation_event_xray_data=event
|
|
57
|
+
)
|
|
58
|
+
source.save()
|
|
59
|
+
|
|
60
|
+
dx._xray_filters_prep(ds, source)
|
|
61
|
+
|
|
62
|
+
self.assertEqual(
|
|
63
|
+
source.xrayfilters_set.order_by("id").count(),
|
|
64
|
+
2,
|
|
65
|
+
"Wrong number of filters recorded",
|
|
66
|
+
)
|
|
67
|
+
self.assertEqual(
|
|
68
|
+
source.xrayfilters_set.order_by("id")[0].xray_filter_material.code_meaning,
|
|
69
|
+
"Aluminum or Aluminum compound",
|
|
70
|
+
)
|
|
71
|
+
self.assertEqual(
|
|
72
|
+
source.xrayfilters_set.order_by("id")[1].xray_filter_material.code_meaning,
|
|
73
|
+
"Copper or Copper compound",
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
def test_single_filter(self):
|
|
77
|
+
"""
|
|
78
|
+
Test the material extraction process when there is just one filter
|
|
79
|
+
"""
|
|
80
|
+
ds = Dataset()
|
|
81
|
+
ds.FilterType = "FLAT"
|
|
82
|
+
ds.FilterMaterial = "LEAD"
|
|
83
|
+
ds.FilterThicknessMinimum = "1.0"
|
|
84
|
+
ds.FilterThicknessMaximum = "1.0"
|
|
85
|
+
|
|
86
|
+
g = GeneralStudyModuleAttr.objects.create()
|
|
87
|
+
g.save()
|
|
88
|
+
proj = ProjectionXRayRadiationDose.objects.create(
|
|
89
|
+
general_study_module_attributes=g
|
|
90
|
+
)
|
|
91
|
+
proj.save()
|
|
92
|
+
event = IrradEventXRayData.objects.create(projection_xray_radiation_dose=proj)
|
|
93
|
+
event.save()
|
|
94
|
+
source = IrradEventXRaySourceData.objects.create(
|
|
95
|
+
irradiation_event_xray_data=event
|
|
96
|
+
)
|
|
97
|
+
source.save()
|
|
98
|
+
|
|
99
|
+
dx._xray_filters_prep(ds, source)
|
|
100
|
+
|
|
101
|
+
self.assertEqual(source.xrayfilters_set.order_by("id").count(), 1)
|
|
102
|
+
self.assertEqual(
|
|
103
|
+
source.xrayfilters_set.order_by("id")[0].xray_filter_material.code_meaning,
|
|
104
|
+
"Lead or Lead compound",
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
class ImportCarestreamDR7500(TestCase):
|
|
109
|
+
def setUp(self):
|
|
110
|
+
|
|
111
|
+
self.user = User.objects.create_user(
|
|
112
|
+
username="jacob", email="jacob@…", password="top_secret"
|
|
113
|
+
)
|
|
114
|
+
eg = Group(name="exportgroup")
|
|
115
|
+
eg.save()
|
|
116
|
+
eg.user_set.add(self.user)
|
|
117
|
+
eg.save()
|
|
118
|
+
|
|
119
|
+
pid = PatientIDSettings.objects.create()
|
|
120
|
+
pid.name_stored = True
|
|
121
|
+
pid.name_hashed = False
|
|
122
|
+
pid.id_stored = True
|
|
123
|
+
pid.id_hashed = False
|
|
124
|
+
pid.dob_stored = True
|
|
125
|
+
pid.save()
|
|
126
|
+
|
|
127
|
+
# Ensure test images are not deleted after import
|
|
128
|
+
try:
|
|
129
|
+
DicomDeleteSettings.objects.get()
|
|
130
|
+
except ObjectDoesNotExist:
|
|
131
|
+
DicomDeleteSettings.objects.create()
|
|
132
|
+
dicom_delete_settintgs = DicomDeleteSettings.objects.get()
|
|
133
|
+
dicom_delete_settintgs.del_dx_im = False
|
|
134
|
+
dicom_delete_settintgs.save()
|
|
135
|
+
|
|
136
|
+
# Ensure standard name objects are created and the feature is enabled
|
|
137
|
+
try:
|
|
138
|
+
StandardNameSettings.objects.get()
|
|
139
|
+
except ObjectDoesNotExist:
|
|
140
|
+
StandardNameSettings.objects.create()
|
|
141
|
+
standard_name_settings = StandardNameSettings.objects.get()
|
|
142
|
+
standard_name_settings.enable_standard_names = True
|
|
143
|
+
standard_name_settings.save()
|
|
144
|
+
|
|
145
|
+
# Add a standard acquisition name entry for the acquisition protocol used in the DX-Im-GE_XR220 images
|
|
146
|
+
standard_name = StandardNames.objects.create()
|
|
147
|
+
standard_name.modality = "DX"
|
|
148
|
+
standard_name.standard_name = "AbdoView"
|
|
149
|
+
standard_name.acquisition_protocol = "ABD_1_VIEW"
|
|
150
|
+
standard_name.save()
|
|
151
|
+
|
|
152
|
+
dx_ge_xr220_1 = os.path.join("test_files", "DX-Im-GE_XR220-1.dcm")
|
|
153
|
+
dx_ge_xr220_2 = os.path.join("test_files", "DX-Im-GE_XR220-2.dcm")
|
|
154
|
+
dx_ge_xr220_3 = os.path.join("test_files", "DX-Im-GE_XR220-3.dcm")
|
|
155
|
+
dx_carestream_dr7500_1 = os.path.join(
|
|
156
|
+
"test_files", "DX-Im-Carestream_DR7500-1.dcm"
|
|
157
|
+
)
|
|
158
|
+
dx_carestream_dr7500_2 = os.path.join(
|
|
159
|
+
"test_files", "DX-Im-Carestream_DR7500-2.dcm"
|
|
160
|
+
)
|
|
161
|
+
root_tests = os.path.dirname(os.path.abspath(__file__))
|
|
162
|
+
|
|
163
|
+
with LogCapture("remapp.extractors", level=logging.DEBUG) as self.log:
|
|
164
|
+
dx.dx(os.path.join(root_tests, dx_ge_xr220_1))
|
|
165
|
+
dx.dx(os.path.join(root_tests, dx_ge_xr220_2))
|
|
166
|
+
dx.dx(os.path.join(root_tests, dx_ge_xr220_3))
|
|
167
|
+
dx.dx(os.path.join(root_tests, dx_carestream_dr7500_1))
|
|
168
|
+
dx.dx(os.path.join(root_tests, dx_carestream_dr7500_2))
|
|
169
|
+
dx.dx(os.path.join(root_tests, dx_ge_xr220_2))
|
|
170
|
+
|
|
171
|
+
def test_dr7500_and_xr220(self):
|
|
172
|
+
studies = GeneralStudyModuleAttr.objects.order_by("id")
|
|
173
|
+
|
|
174
|
+
# Test that two studies have been imported
|
|
175
|
+
self.assertEqual(studies.count(), 2)
|
|
176
|
+
|
|
177
|
+
# Test that the second attempt to import dx_ge_xr220_2 results in debug message
|
|
178
|
+
self.log.check_present(
|
|
179
|
+
(
|
|
180
|
+
"remapp.extractors.dx",
|
|
181
|
+
"DEBUG",
|
|
182
|
+
"DX instance UID 1.3.6.1.4.1.5962.99.1.2282339064.1266597797.1479751121656.26.0 of "
|
|
183
|
+
"study UID 1.3.6.1.4.1.5962.99.1.2282339064.1266597797.1479751121656.24.0 "
|
|
184
|
+
"previously processed, stopping.",
|
|
185
|
+
)
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
# Test that study level data is recorded correctly
|
|
189
|
+
self.assertEqual(studies[0].study_date, datetime.date(2014, 9, 30))
|
|
190
|
+
self.assertEqual(studies[1].study_date, datetime.date(2014, 6, 20))
|
|
191
|
+
self.assertEqual(studies[0].study_time, datetime.time(14, 10, 24))
|
|
192
|
+
self.assertEqual(studies[1].study_time, datetime.time(10, 48, 5))
|
|
193
|
+
self.assertEqual(studies[1].study_description, "AEC")
|
|
194
|
+
self.assertEqual(studies[1].operator_name, "PHYSICS")
|
|
195
|
+
|
|
196
|
+
self.assertEqual(
|
|
197
|
+
studies[0].generalequipmentmoduleattr_set.get().institution_name,
|
|
198
|
+
"Digital Mobile Hospital",
|
|
199
|
+
)
|
|
200
|
+
self.assertEqual(
|
|
201
|
+
studies[1].generalequipmentmoduleattr_set.get().institution_name,
|
|
202
|
+
"Carestream Clinic",
|
|
203
|
+
)
|
|
204
|
+
self.assertEqual(
|
|
205
|
+
studies[0].generalequipmentmoduleattr_set.get().institution_address,
|
|
206
|
+
"Kvitfjell",
|
|
207
|
+
)
|
|
208
|
+
self.assertEqual(
|
|
209
|
+
studies[0].generalequipmentmoduleattr_set.get().manufacturer,
|
|
210
|
+
"GE Healthcare",
|
|
211
|
+
)
|
|
212
|
+
self.assertEqual(
|
|
213
|
+
studies[1].generalequipmentmoduleattr_set.get().manufacturer, "KODAK"
|
|
214
|
+
)
|
|
215
|
+
self.assertEqual(
|
|
216
|
+
studies[0].generalequipmentmoduleattr_set.get().station_name, "01234MOB54"
|
|
217
|
+
)
|
|
218
|
+
self.assertEqual(
|
|
219
|
+
studies[1].generalequipmentmoduleattr_set.get().station_name, "KODAK7500"
|
|
220
|
+
)
|
|
221
|
+
self.assertEqual(
|
|
222
|
+
studies[0].generalequipmentmoduleattr_set.get().manufacturer_model_name,
|
|
223
|
+
"Optima XR220",
|
|
224
|
+
)
|
|
225
|
+
self.assertEqual(
|
|
226
|
+
studies[1].generalequipmentmoduleattr_set.get().manufacturer_model_name,
|
|
227
|
+
"DR 7500",
|
|
228
|
+
)
|
|
229
|
+
self.assertEqual(
|
|
230
|
+
studies[0].generalequipmentmoduleattr_set.get().software_versions,
|
|
231
|
+
"dm_Platform_release_superbee-FW23.1-SB",
|
|
232
|
+
)
|
|
233
|
+
self.assertEqual(
|
|
234
|
+
studies[1].generalequipmentmoduleattr_set.get().software_versions,
|
|
235
|
+
"4.0.3.B8.P6",
|
|
236
|
+
)
|
|
237
|
+
self.assertEqual(
|
|
238
|
+
studies[1].generalequipmentmoduleattr_set.get().device_serial_number,
|
|
239
|
+
"00012345abc",
|
|
240
|
+
)
|
|
241
|
+
|
|
242
|
+
# Test the SOP instance UIDs have been recorded correctly
|
|
243
|
+
sop_instance_uid_list0 = Counter(
|
|
244
|
+
studies[0].objectuidsprocessed_set.values_list(
|
|
245
|
+
"sop_instance_uid", flat=True
|
|
246
|
+
)
|
|
247
|
+
)
|
|
248
|
+
sop_instance_uid_list1 = Counter(
|
|
249
|
+
studies[1].objectuidsprocessed_set.values_list(
|
|
250
|
+
"sop_instance_uid", flat=True
|
|
251
|
+
)
|
|
252
|
+
)
|
|
253
|
+
uid_list0 = Counter(
|
|
254
|
+
[
|
|
255
|
+
"1.3.6.1.4.1.5962.99.1.2282339064.1266597797.1479751121656.20.0",
|
|
256
|
+
"1.3.6.1.4.1.5962.99.1.2282339064.1266597797.1479751121656.26.0",
|
|
257
|
+
"1.3.6.1.4.1.5962.99.1.2282339064.1266597797.1479751121656.28.0",
|
|
258
|
+
]
|
|
259
|
+
)
|
|
260
|
+
uid_list1 = Counter(
|
|
261
|
+
[
|
|
262
|
+
"1.2.276.0.7230010.3.1.4.8323329.11838.1483692281.541544",
|
|
263
|
+
"1.2.276.0.7230010.3.1.4.8323329.11853.1483692311.916929",
|
|
264
|
+
]
|
|
265
|
+
)
|
|
266
|
+
self.assertEqual(sop_instance_uid_list0, uid_list0)
|
|
267
|
+
self.assertEqual(sop_instance_uid_list1, uid_list1)
|
|
268
|
+
|
|
269
|
+
# Test that patient level data is recorded correctly
|
|
270
|
+
self.assertEqual(
|
|
271
|
+
studies[0].patientmoduleattr_set.get().patient_name, "XR220^Samantha"
|
|
272
|
+
)
|
|
273
|
+
self.assertEqual(
|
|
274
|
+
studies[1].patientmoduleattr_set.get().patient_name, "PHYSICS^TABLE AEC"
|
|
275
|
+
)
|
|
276
|
+
self.assertEqual(studies[0].patientmoduleattr_set.get().patient_id, "00098765")
|
|
277
|
+
self.assertEqual(
|
|
278
|
+
studies[1].patientmoduleattr_set.get().patient_id, "PHY12320140620YU"
|
|
279
|
+
)
|
|
280
|
+
self.assertEqual(
|
|
281
|
+
studies[0].patientmoduleattr_set.get().patient_birth_date,
|
|
282
|
+
datetime.date(1957, 11, 12),
|
|
283
|
+
)
|
|
284
|
+
self.assertEqual(
|
|
285
|
+
studies[1].patientmoduleattr_set.get().patient_birth_date,
|
|
286
|
+
datetime.date(2014, 6, 20),
|
|
287
|
+
)
|
|
288
|
+
self.assertAlmostEqual(
|
|
289
|
+
float(studies[0].patientstudymoduleattr_set.get().patient_age_decimal),
|
|
290
|
+
56.9,
|
|
291
|
+
)
|
|
292
|
+
|
|
293
|
+
# Test that irradiation event data is stored correctly
|
|
294
|
+
self.assertEqual(
|
|
295
|
+
studies[0]
|
|
296
|
+
.projectionxrayradiationdose_set.get()
|
|
297
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
298
|
+
.acquisition_protocol,
|
|
299
|
+
"ABD_1_VIEW",
|
|
300
|
+
)
|
|
301
|
+
self.assertEqual(
|
|
302
|
+
studies[0]
|
|
303
|
+
.projectionxrayradiationdose_set.get()
|
|
304
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
305
|
+
.acquisition_protocol,
|
|
306
|
+
"ABD_1_VIEW",
|
|
307
|
+
)
|
|
308
|
+
self.assertEqual(
|
|
309
|
+
studies[0]
|
|
310
|
+
.projectionxrayradiationdose_set.get()
|
|
311
|
+
.irradeventxraydata_set.order_by("id")[2]
|
|
312
|
+
.acquisition_protocol,
|
|
313
|
+
"ABD_1_VIEW",
|
|
314
|
+
)
|
|
315
|
+
self.assertAlmostEqual(
|
|
316
|
+
float(
|
|
317
|
+
studies[0]
|
|
318
|
+
.projectionxrayradiationdose_set.get()
|
|
319
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
320
|
+
.dose_area_product
|
|
321
|
+
),
|
|
322
|
+
(0.41 / 100000),
|
|
323
|
+
)
|
|
324
|
+
self.assertAlmostEqual(
|
|
325
|
+
float(
|
|
326
|
+
studies[0]
|
|
327
|
+
.projectionxrayradiationdose_set.get()
|
|
328
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
329
|
+
.dose_area_product
|
|
330
|
+
),
|
|
331
|
+
(0.82 / 100000),
|
|
332
|
+
)
|
|
333
|
+
self.assertAlmostEqual(
|
|
334
|
+
float(
|
|
335
|
+
studies[0]
|
|
336
|
+
.projectionxrayradiationdose_set.get()
|
|
337
|
+
.irradeventxraydata_set.order_by("id")[2]
|
|
338
|
+
.dose_area_product
|
|
339
|
+
),
|
|
340
|
+
(2.05 / 100000),
|
|
341
|
+
)
|
|
342
|
+
|
|
343
|
+
self.assertEqual(
|
|
344
|
+
studies[1]
|
|
345
|
+
.projectionxrayradiationdose_set.get()
|
|
346
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
347
|
+
.acquisition_protocol,
|
|
348
|
+
"AEC",
|
|
349
|
+
)
|
|
350
|
+
self.assertEqual(
|
|
351
|
+
studies[1]
|
|
352
|
+
.projectionxrayradiationdose_set.get()
|
|
353
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
354
|
+
.acquisition_protocol,
|
|
355
|
+
"AEC",
|
|
356
|
+
)
|
|
357
|
+
self.assertAlmostEqual(
|
|
358
|
+
float(
|
|
359
|
+
studies[1]
|
|
360
|
+
.projectionxrayradiationdose_set.get()
|
|
361
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
362
|
+
.dose_area_product
|
|
363
|
+
),
|
|
364
|
+
(11.013 / 100000),
|
|
365
|
+
)
|
|
366
|
+
self.assertAlmostEqual(
|
|
367
|
+
float(
|
|
368
|
+
studies[1]
|
|
369
|
+
.projectionxrayradiationdose_set.get()
|
|
370
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
371
|
+
.dose_area_product
|
|
372
|
+
),
|
|
373
|
+
(10.157 / 100000),
|
|
374
|
+
)
|
|
375
|
+
|
|
376
|
+
# Check that dose related distance measurement data is stored correctly
|
|
377
|
+
self.assertAlmostEqual(
|
|
378
|
+
float(
|
|
379
|
+
studies[1]
|
|
380
|
+
.projectionxrayradiationdose_set.get()
|
|
381
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
382
|
+
.irradeventxraymechanicaldata_set.get()
|
|
383
|
+
.doserelateddistancemeasurements_set.get()
|
|
384
|
+
.distance_source_to_detector
|
|
385
|
+
),
|
|
386
|
+
(11.5 * 100),
|
|
387
|
+
)
|
|
388
|
+
self.assertAlmostEqual(
|
|
389
|
+
float(
|
|
390
|
+
studies[1]
|
|
391
|
+
.projectionxrayradiationdose_set.get()
|
|
392
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
393
|
+
.irradeventxraymechanicaldata_set.get()
|
|
394
|
+
.doserelateddistancemeasurements_set.get()
|
|
395
|
+
.distance_source_to_detector
|
|
396
|
+
),
|
|
397
|
+
(11.5 * 100),
|
|
398
|
+
)
|
|
399
|
+
|
|
400
|
+
# Test that irradiation event source data is stored correctly
|
|
401
|
+
self.assertAlmostEqual(
|
|
402
|
+
float(
|
|
403
|
+
studies[0]
|
|
404
|
+
.projectionxrayradiationdose_set.get()
|
|
405
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
406
|
+
.irradeventxraysourcedata_set.get()
|
|
407
|
+
.exposure_time
|
|
408
|
+
),
|
|
409
|
+
6,
|
|
410
|
+
)
|
|
411
|
+
self.assertAlmostEqual(
|
|
412
|
+
float(
|
|
413
|
+
studies[0]
|
|
414
|
+
.projectionxrayradiationdose_set.get()
|
|
415
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
416
|
+
.irradeventxraysourcedata_set.get()
|
|
417
|
+
.exposure_time
|
|
418
|
+
),
|
|
419
|
+
11,
|
|
420
|
+
)
|
|
421
|
+
self.assertAlmostEqual(
|
|
422
|
+
float(
|
|
423
|
+
studies[0]
|
|
424
|
+
.projectionxrayradiationdose_set.get()
|
|
425
|
+
.irradeventxraydata_set.order_by("id")[2]
|
|
426
|
+
.irradeventxraysourcedata_set.get()
|
|
427
|
+
.exposure_time
|
|
428
|
+
),
|
|
429
|
+
27,
|
|
430
|
+
)
|
|
431
|
+
self.assertAlmostEqual(
|
|
432
|
+
float(
|
|
433
|
+
studies[0]
|
|
434
|
+
.projectionxrayradiationdose_set.get()
|
|
435
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
436
|
+
.irradeventxraysourcedata_set.get()
|
|
437
|
+
.average_xray_tube_current
|
|
438
|
+
),
|
|
439
|
+
189,
|
|
440
|
+
)
|
|
441
|
+
self.assertAlmostEqual(
|
|
442
|
+
float(
|
|
443
|
+
studies[0]
|
|
444
|
+
.projectionxrayradiationdose_set.get()
|
|
445
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
446
|
+
.irradeventxraysourcedata_set.get()
|
|
447
|
+
.focal_spot_size
|
|
448
|
+
),
|
|
449
|
+
0.6,
|
|
450
|
+
)
|
|
451
|
+
self.assertAlmostEqual(
|
|
452
|
+
float(
|
|
453
|
+
studies[0]
|
|
454
|
+
.projectionxrayradiationdose_set.get()
|
|
455
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
456
|
+
.irradeventxraysourcedata_set.get()
|
|
457
|
+
.focal_spot_size
|
|
458
|
+
),
|
|
459
|
+
0.6,
|
|
460
|
+
)
|
|
461
|
+
self.assertAlmostEqual(
|
|
462
|
+
float(
|
|
463
|
+
studies[0]
|
|
464
|
+
.projectionxrayradiationdose_set.get()
|
|
465
|
+
.irradeventxraydata_set.order_by("id")[2]
|
|
466
|
+
.irradeventxraysourcedata_set.get()
|
|
467
|
+
.focal_spot_size
|
|
468
|
+
),
|
|
469
|
+
0.6,
|
|
470
|
+
)
|
|
471
|
+
|
|
472
|
+
self.assertAlmostEqual(
|
|
473
|
+
float(
|
|
474
|
+
studies[1]
|
|
475
|
+
.projectionxrayradiationdose_set.get()
|
|
476
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
477
|
+
.irradeventxraysourcedata_set.get()
|
|
478
|
+
.exposure_time
|
|
479
|
+
),
|
|
480
|
+
19,
|
|
481
|
+
)
|
|
482
|
+
self.assertAlmostEqual(
|
|
483
|
+
float(
|
|
484
|
+
studies[1]
|
|
485
|
+
.projectionxrayradiationdose_set.get()
|
|
486
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
487
|
+
.irradeventxraysourcedata_set.get()
|
|
488
|
+
.exposure_time
|
|
489
|
+
),
|
|
490
|
+
18,
|
|
491
|
+
)
|
|
492
|
+
self.assertAlmostEqual(
|
|
493
|
+
float(
|
|
494
|
+
studies[1]
|
|
495
|
+
.projectionxrayradiationdose_set.get()
|
|
496
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
497
|
+
.irradeventxraysourcedata_set.get()
|
|
498
|
+
.focal_spot_size
|
|
499
|
+
),
|
|
500
|
+
1.2,
|
|
501
|
+
)
|
|
502
|
+
self.assertAlmostEqual(
|
|
503
|
+
float(
|
|
504
|
+
studies[1]
|
|
505
|
+
.projectionxrayradiationdose_set.get()
|
|
506
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
507
|
+
.irradeventxraysourcedata_set.get()
|
|
508
|
+
.focal_spot_size
|
|
509
|
+
),
|
|
510
|
+
1.2,
|
|
511
|
+
)
|
|
512
|
+
|
|
513
|
+
self.assertAlmostEqual(
|
|
514
|
+
float(
|
|
515
|
+
studies[0]
|
|
516
|
+
.projectionxrayradiationdose_set.get()
|
|
517
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
518
|
+
.irradeventxraysourcedata_set.get()
|
|
519
|
+
.average_xray_tube_current
|
|
520
|
+
),
|
|
521
|
+
189,
|
|
522
|
+
)
|
|
523
|
+
self.assertAlmostEqual(
|
|
524
|
+
float(
|
|
525
|
+
studies[0]
|
|
526
|
+
.projectionxrayradiationdose_set.get()
|
|
527
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
528
|
+
.irradeventxraysourcedata_set.get()
|
|
529
|
+
.average_xray_tube_current
|
|
530
|
+
),
|
|
531
|
+
192,
|
|
532
|
+
)
|
|
533
|
+
self.assertAlmostEqual(
|
|
534
|
+
float(
|
|
535
|
+
studies[0]
|
|
536
|
+
.projectionxrayradiationdose_set.get()
|
|
537
|
+
.irradeventxraydata_set.order_by("id")[2]
|
|
538
|
+
.irradeventxraysourcedata_set.get()
|
|
539
|
+
.average_xray_tube_current
|
|
540
|
+
),
|
|
541
|
+
190,
|
|
542
|
+
)
|
|
543
|
+
|
|
544
|
+
self.assertAlmostEqual(
|
|
545
|
+
float(
|
|
546
|
+
studies[1]
|
|
547
|
+
.projectionxrayradiationdose_set.get()
|
|
548
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
549
|
+
.irradeventxraysourcedata_set.get()
|
|
550
|
+
.average_xray_tube_current
|
|
551
|
+
),
|
|
552
|
+
500,
|
|
553
|
+
)
|
|
554
|
+
self.assertAlmostEqual(
|
|
555
|
+
float(
|
|
556
|
+
studies[1]
|
|
557
|
+
.projectionxrayradiationdose_set.get()
|
|
558
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
559
|
+
.irradeventxraysourcedata_set.get()
|
|
560
|
+
.average_xray_tube_current
|
|
561
|
+
),
|
|
562
|
+
500,
|
|
563
|
+
)
|
|
564
|
+
|
|
565
|
+
self.assertEqual(
|
|
566
|
+
studies[1]
|
|
567
|
+
.projectionxrayradiationdose_set.get()
|
|
568
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
569
|
+
.irradeventxraysourcedata_set.get()
|
|
570
|
+
.xrayfilters_set.get()
|
|
571
|
+
.xray_filter_material.code_meaning,
|
|
572
|
+
"Aluminum or Aluminum compound",
|
|
573
|
+
)
|
|
574
|
+
self.assertAlmostEqual(
|
|
575
|
+
float(
|
|
576
|
+
studies[1]
|
|
577
|
+
.projectionxrayradiationdose_set.get()
|
|
578
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
579
|
+
.irradeventxraysourcedata_set.get()
|
|
580
|
+
.xrayfilters_set.get()
|
|
581
|
+
.xray_filter_thickness_minimum
|
|
582
|
+
),
|
|
583
|
+
0.94,
|
|
584
|
+
)
|
|
585
|
+
self.assertAlmostEqual(
|
|
586
|
+
float(
|
|
587
|
+
studies[1]
|
|
588
|
+
.projectionxrayradiationdose_set.get()
|
|
589
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
590
|
+
.irradeventxraysourcedata_set.get()
|
|
591
|
+
.xrayfilters_set.get()
|
|
592
|
+
.xray_filter_thickness_maximum
|
|
593
|
+
),
|
|
594
|
+
1.06,
|
|
595
|
+
)
|
|
596
|
+
|
|
597
|
+
self.assertEqual(
|
|
598
|
+
studies[1]
|
|
599
|
+
.projectionxrayradiationdose_set.get()
|
|
600
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
601
|
+
.irradeventxraysourcedata_set.get()
|
|
602
|
+
.xrayfilters_set.order_by("id")[0]
|
|
603
|
+
.xray_filter_material.code_meaning,
|
|
604
|
+
"Aluminum or Aluminum compound",
|
|
605
|
+
)
|
|
606
|
+
self.assertAlmostEqual(
|
|
607
|
+
float(
|
|
608
|
+
studies[1]
|
|
609
|
+
.projectionxrayradiationdose_set.get()
|
|
610
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
611
|
+
.irradeventxraysourcedata_set.get()
|
|
612
|
+
.xrayfilters_set.order_by("id")[0]
|
|
613
|
+
.xray_filter_thickness_minimum
|
|
614
|
+
),
|
|
615
|
+
0.94,
|
|
616
|
+
)
|
|
617
|
+
self.assertAlmostEqual(
|
|
618
|
+
float(
|
|
619
|
+
studies[1]
|
|
620
|
+
.projectionxrayradiationdose_set.get()
|
|
621
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
622
|
+
.irradeventxraysourcedata_set.get()
|
|
623
|
+
.xrayfilters_set.order_by("id")[0]
|
|
624
|
+
.xray_filter_thickness_maximum
|
|
625
|
+
),
|
|
626
|
+
1.06,
|
|
627
|
+
)
|
|
628
|
+
|
|
629
|
+
self.assertEqual(
|
|
630
|
+
studies[1]
|
|
631
|
+
.projectionxrayradiationdose_set.get()
|
|
632
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
633
|
+
.irradeventxraysourcedata_set.get()
|
|
634
|
+
.xrayfilters_set.order_by("id")[1]
|
|
635
|
+
.xray_filter_material.code_meaning,
|
|
636
|
+
"Copper or Copper compound",
|
|
637
|
+
)
|
|
638
|
+
self.assertAlmostEqual(
|
|
639
|
+
float(
|
|
640
|
+
studies[1]
|
|
641
|
+
.projectionxrayradiationdose_set.get()
|
|
642
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
643
|
+
.irradeventxraysourcedata_set.get()
|
|
644
|
+
.xrayfilters_set.order_by("id")[1]
|
|
645
|
+
.xray_filter_thickness_minimum
|
|
646
|
+
),
|
|
647
|
+
0.194,
|
|
648
|
+
)
|
|
649
|
+
self.assertAlmostEqual(
|
|
650
|
+
float(
|
|
651
|
+
studies[1]
|
|
652
|
+
.projectionxrayradiationdose_set.get()
|
|
653
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
654
|
+
.irradeventxraysourcedata_set.get()
|
|
655
|
+
.xrayfilters_set.order_by("id")[1]
|
|
656
|
+
.xray_filter_thickness_maximum
|
|
657
|
+
),
|
|
658
|
+
0.206,
|
|
659
|
+
)
|
|
660
|
+
|
|
661
|
+
self.assertAlmostEqual(
|
|
662
|
+
float(
|
|
663
|
+
studies[1]
|
|
664
|
+
.projectionxrayradiationdose_set.get()
|
|
665
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
666
|
+
.irradeventxraysourcedata_set.get()
|
|
667
|
+
.grid_focal_distance
|
|
668
|
+
),
|
|
669
|
+
1828.8,
|
|
670
|
+
)
|
|
671
|
+
self.assertAlmostEqual(
|
|
672
|
+
float(
|
|
673
|
+
studies[1]
|
|
674
|
+
.projectionxrayradiationdose_set.get()
|
|
675
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
676
|
+
.irradeventxraysourcedata_set.get()
|
|
677
|
+
.grid_focal_distance
|
|
678
|
+
),
|
|
679
|
+
1828.8,
|
|
680
|
+
)
|
|
681
|
+
|
|
682
|
+
# Test exposure data is stored correctly
|
|
683
|
+
self.assertAlmostEqual(
|
|
684
|
+
float(
|
|
685
|
+
studies[0]
|
|
686
|
+
.projectionxrayradiationdose_set.get()
|
|
687
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
688
|
+
.irradeventxraysourcedata_set.get()
|
|
689
|
+
.exposure_set.get()
|
|
690
|
+
.exposure
|
|
691
|
+
),
|
|
692
|
+
1040,
|
|
693
|
+
)
|
|
694
|
+
self.assertAlmostEqual(
|
|
695
|
+
float(
|
|
696
|
+
studies[0]
|
|
697
|
+
.projectionxrayradiationdose_set.get()
|
|
698
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
699
|
+
.irradeventxraysourcedata_set.get()
|
|
700
|
+
.exposure_set.get()
|
|
701
|
+
.exposure
|
|
702
|
+
),
|
|
703
|
+
2040,
|
|
704
|
+
)
|
|
705
|
+
self.assertAlmostEqual(
|
|
706
|
+
float(
|
|
707
|
+
studies[0]
|
|
708
|
+
.projectionxrayradiationdose_set.get()
|
|
709
|
+
.irradeventxraydata_set.order_by("id")[2]
|
|
710
|
+
.irradeventxraysourcedata_set.get()
|
|
711
|
+
.exposure_set.get()
|
|
712
|
+
.exposure
|
|
713
|
+
),
|
|
714
|
+
5040,
|
|
715
|
+
)
|
|
716
|
+
|
|
717
|
+
self.assertAlmostEqual(
|
|
718
|
+
float(
|
|
719
|
+
studies[1]
|
|
720
|
+
.projectionxrayradiationdose_set.get()
|
|
721
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
722
|
+
.irradeventxraysourcedata_set.get()
|
|
723
|
+
.exposure_set.get()
|
|
724
|
+
.exposure
|
|
725
|
+
),
|
|
726
|
+
(10 * 1000),
|
|
727
|
+
)
|
|
728
|
+
self.assertAlmostEqual(
|
|
729
|
+
float(
|
|
730
|
+
studies[1]
|
|
731
|
+
.projectionxrayradiationdose_set.get()
|
|
732
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
733
|
+
.irradeventxraysourcedata_set.get()
|
|
734
|
+
.exposure_set.get()
|
|
735
|
+
.exposure
|
|
736
|
+
),
|
|
737
|
+
(9 * 1000),
|
|
738
|
+
)
|
|
739
|
+
|
|
740
|
+
# Test that irradiation event detector data is stored correctly
|
|
741
|
+
self.assertAlmostEqual(
|
|
742
|
+
float(
|
|
743
|
+
studies[0]
|
|
744
|
+
.projectionxrayradiationdose_set.get()
|
|
745
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
746
|
+
.irradeventxraydetectordata_set.get()
|
|
747
|
+
.exposure_index
|
|
748
|
+
),
|
|
749
|
+
51.745061,
|
|
750
|
+
)
|
|
751
|
+
self.assertAlmostEqual(
|
|
752
|
+
float(
|
|
753
|
+
studies[0]
|
|
754
|
+
.projectionxrayradiationdose_set.get()
|
|
755
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
756
|
+
.irradeventxraydetectordata_set.get()
|
|
757
|
+
.exposure_index
|
|
758
|
+
),
|
|
759
|
+
108.843060,
|
|
760
|
+
)
|
|
761
|
+
self.assertAlmostEqual(
|
|
762
|
+
float(
|
|
763
|
+
studies[0]
|
|
764
|
+
.projectionxrayradiationdose_set.get()
|
|
765
|
+
.irradeventxraydata_set.order_by("id")[2]
|
|
766
|
+
.irradeventxraydetectordata_set.get()
|
|
767
|
+
.exposure_index
|
|
768
|
+
),
|
|
769
|
+
286.828227,
|
|
770
|
+
)
|
|
771
|
+
|
|
772
|
+
self.assertAlmostEqual(
|
|
773
|
+
float(
|
|
774
|
+
studies[0]
|
|
775
|
+
.projectionxrayradiationdose_set.get()
|
|
776
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
777
|
+
.irradeventxraydetectordata_set.get()
|
|
778
|
+
.target_exposure_index
|
|
779
|
+
),
|
|
780
|
+
438.469173,
|
|
781
|
+
)
|
|
782
|
+
self.assertAlmostEqual(
|
|
783
|
+
float(
|
|
784
|
+
studies[0]
|
|
785
|
+
.projectionxrayradiationdose_set.get()
|
|
786
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
787
|
+
.irradeventxraydetectordata_set.get()
|
|
788
|
+
.target_exposure_index
|
|
789
|
+
),
|
|
790
|
+
438.469173,
|
|
791
|
+
)
|
|
792
|
+
self.assertAlmostEqual(
|
|
793
|
+
float(
|
|
794
|
+
studies[0]
|
|
795
|
+
.projectionxrayradiationdose_set.get()
|
|
796
|
+
.irradeventxraydata_set.order_by("id")[2]
|
|
797
|
+
.irradeventxraydetectordata_set.get()
|
|
798
|
+
.target_exposure_index
|
|
799
|
+
),
|
|
800
|
+
438.469173,
|
|
801
|
+
)
|
|
802
|
+
|
|
803
|
+
self.assertAlmostEqual(
|
|
804
|
+
float(
|
|
805
|
+
studies[0]
|
|
806
|
+
.projectionxrayradiationdose_set.get()
|
|
807
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
808
|
+
.irradeventxraydetectordata_set.get()
|
|
809
|
+
.deviation_index
|
|
810
|
+
),
|
|
811
|
+
(-9.3),
|
|
812
|
+
)
|
|
813
|
+
self.assertAlmostEqual(
|
|
814
|
+
float(
|
|
815
|
+
studies[0]
|
|
816
|
+
.projectionxrayradiationdose_set.get()
|
|
817
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
818
|
+
.irradeventxraydetectordata_set.get()
|
|
819
|
+
.deviation_index
|
|
820
|
+
),
|
|
821
|
+
(-6.1),
|
|
822
|
+
)
|
|
823
|
+
self.assertAlmostEqual(
|
|
824
|
+
float(
|
|
825
|
+
studies[0]
|
|
826
|
+
.projectionxrayradiationdose_set.get()
|
|
827
|
+
.irradeventxraydata_set.order_by("id")[2]
|
|
828
|
+
.irradeventxraydetectordata_set.get()
|
|
829
|
+
.deviation_index
|
|
830
|
+
),
|
|
831
|
+
(-1.8),
|
|
832
|
+
)
|
|
833
|
+
|
|
834
|
+
self.assertAlmostEqual(
|
|
835
|
+
float(
|
|
836
|
+
studies[0]
|
|
837
|
+
.projectionxrayradiationdose_set.get()
|
|
838
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
839
|
+
.irradeventxraydetectordata_set.get()
|
|
840
|
+
.sensitivity
|
|
841
|
+
),
|
|
842
|
+
97.213916,
|
|
843
|
+
)
|
|
844
|
+
self.assertAlmostEqual(
|
|
845
|
+
float(
|
|
846
|
+
studies[0]
|
|
847
|
+
.projectionxrayradiationdose_set.get()
|
|
848
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
849
|
+
.irradeventxraydetectordata_set.get()
|
|
850
|
+
.sensitivity
|
|
851
|
+
),
|
|
852
|
+
97.213916,
|
|
853
|
+
)
|
|
854
|
+
self.assertAlmostEqual(
|
|
855
|
+
float(
|
|
856
|
+
studies[0]
|
|
857
|
+
.projectionxrayradiationdose_set.get()
|
|
858
|
+
.irradeventxraydata_set.order_by("id")[2]
|
|
859
|
+
.irradeventxraydetectordata_set.get()
|
|
860
|
+
.sensitivity
|
|
861
|
+
),
|
|
862
|
+
97.213916,
|
|
863
|
+
)
|
|
864
|
+
|
|
865
|
+
self.assertAlmostEqual(
|
|
866
|
+
float(
|
|
867
|
+
studies[1]
|
|
868
|
+
.projectionxrayradiationdose_set.get()
|
|
869
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
870
|
+
.irradeventxraydetectordata_set.get()
|
|
871
|
+
.relative_xray_exposure
|
|
872
|
+
),
|
|
873
|
+
1460,
|
|
874
|
+
)
|
|
875
|
+
self.assertAlmostEqual(
|
|
876
|
+
float(
|
|
877
|
+
studies[1]
|
|
878
|
+
.projectionxrayradiationdose_set.get()
|
|
879
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
880
|
+
.irradeventxraydetectordata_set.get()
|
|
881
|
+
.relative_xray_exposure
|
|
882
|
+
),
|
|
883
|
+
1430,
|
|
884
|
+
)
|
|
885
|
+
|
|
886
|
+
# Test summary fields
|
|
887
|
+
self.assertAlmostEqual(float(studies[0].total_dap_a), (3.28 / 100000))
|
|
888
|
+
self.assertAlmostEqual(float(studies[0].total_dap), (3.28 / 100000))
|
|
889
|
+
self.assertEqual(studies[0].number_of_events, 3)
|
|
890
|
+
self.assertEqual(studies[0].number_of_planes, 1)
|
|
891
|
+
self.assertAlmostEqual(float(studies[1].total_dap_a), (21.17 / 100000))
|
|
892
|
+
self.assertAlmostEqual(float(studies[1].total_dap), (21.17 / 100000))
|
|
893
|
+
self.assertEqual(studies[1].number_of_events, 2)
|
|
894
|
+
self.assertEqual(studies[1].number_of_planes, 1)
|
|
895
|
+
|
|
896
|
+
def test_filter_thickness_order(self):
|
|
897
|
+
|
|
898
|
+
all_filters = XrayFilters.objects.order_by("id")
|
|
899
|
+
for exposure in all_filters:
|
|
900
|
+
self.assertGreaterEqual(
|
|
901
|
+
exposure.xray_filter_thickness_maximum,
|
|
902
|
+
exposure.xray_filter_thickness_minimum,
|
|
903
|
+
)
|
|
904
|
+
|
|
905
|
+
def test_multiple_filter_carestream_comma(self):
|
|
906
|
+
"""
|
|
907
|
+
Testing the DR7500 file can be imported with illegal comma separated floats
|
|
908
|
+
:return: None
|
|
909
|
+
"""
|
|
910
|
+
|
|
911
|
+
study = GeneralStudyModuleAttr.objects.order_by("id")[1]
|
|
912
|
+
|
|
913
|
+
source = (
|
|
914
|
+
study.projectionxrayradiationdose_set.get()
|
|
915
|
+
.irradeventxraydata_set.order_by("id")[1]
|
|
916
|
+
.irradeventxraysourcedata_set.get()
|
|
917
|
+
)
|
|
918
|
+
|
|
919
|
+
self.assertEqual(
|
|
920
|
+
source.xrayfilters_set.order_by("id").count(),
|
|
921
|
+
2,
|
|
922
|
+
"Testing Kodak old style, two filters should have been stored, {0} were".format(
|
|
923
|
+
source.xrayfilters_set.order_by("id").count()
|
|
924
|
+
),
|
|
925
|
+
)
|
|
926
|
+
self.assertEqual(
|
|
927
|
+
source.xrayfilters_set.order_by("id")[0].xray_filter_material.code_meaning,
|
|
928
|
+
"Aluminum or Aluminum compound",
|
|
929
|
+
)
|
|
930
|
+
self.assertAlmostEqual(
|
|
931
|
+
float(
|
|
932
|
+
source.xrayfilters_set.order_by("id")[0].xray_filter_thickness_minimum
|
|
933
|
+
),
|
|
934
|
+
0.94,
|
|
935
|
+
)
|
|
936
|
+
self.assertEqual(
|
|
937
|
+
source.xrayfilters_set.order_by("id")[1].xray_filter_material.code_meaning,
|
|
938
|
+
"Copper or Copper compound",
|
|
939
|
+
)
|
|
940
|
+
self.assertAlmostEqual(
|
|
941
|
+
float(
|
|
942
|
+
source.xrayfilters_set.order_by("id")[1].xray_filter_thickness_minimum
|
|
943
|
+
),
|
|
944
|
+
0.194,
|
|
945
|
+
)
|
|
946
|
+
|
|
947
|
+
def test_standard_acquisition_names(self):
|
|
948
|
+
"""
|
|
949
|
+
Testing that all images within the GE 220 study have the correct standard acquisition name.
|
|
950
|
+
All three images within this study should have the standard study name "AbdoView".
|
|
951
|
+
:return: None
|
|
952
|
+
"""
|
|
953
|
+
study = GeneralStudyModuleAttr.objects.filter(
|
|
954
|
+
procedure_code_meaning="ABD_1_VIEW"
|
|
955
|
+
)[0]
|
|
956
|
+
|
|
957
|
+
irradiations = (
|
|
958
|
+
study.projectionxrayradiationdose_set.get().irradeventxraydata_set.all()
|
|
959
|
+
)
|
|
960
|
+
|
|
961
|
+
for irradiation in irradiations:
|
|
962
|
+
std_acq_names = irradiation.standard_protocols.all()
|
|
963
|
+
|
|
964
|
+
for std_acq_name in std_acq_names:
|
|
965
|
+
self.assertEqual(std_acq_name.standard_name, "AbdoView")
|
|
966
|
+
|
|
967
|
+
|
|
968
|
+
class ImportCarestreamDRXRevolution(TestCase):
|
|
969
|
+
def setUp(self):
|
|
970
|
+
"""
|
|
971
|
+
Imports a known radigraphic image file derived from a Carestream DRX Revolution image.
|
|
972
|
+
"""
|
|
973
|
+
|
|
974
|
+
pid = PatientIDSettings.objects.create()
|
|
975
|
+
pid.name_stored = True
|
|
976
|
+
pid.name_hashed = False
|
|
977
|
+
pid.id_stored = True
|
|
978
|
+
pid.id_hashed = False
|
|
979
|
+
pid.dob_stored = True
|
|
980
|
+
pid.save()
|
|
981
|
+
|
|
982
|
+
dx_carestream_drx_revolution = os.path.join(
|
|
983
|
+
"test_files", "DX-Im-Carestream_DRX.dcm"
|
|
984
|
+
)
|
|
985
|
+
root_tests = os.path.dirname(os.path.abspath(__file__))
|
|
986
|
+
dx.dx(os.path.join(root_tests, dx_carestream_drx_revolution))
|
|
987
|
+
|
|
988
|
+
def test_requested_procedure_name(self):
|
|
989
|
+
"""
|
|
990
|
+
Tests the imported value of requested procedure code meaning against what is expected.
|
|
991
|
+
"""
|
|
992
|
+
study = GeneralStudyModuleAttr.objects.order_by("id")[0]
|
|
993
|
+
|
|
994
|
+
self.assertEqual(study.requested_procedure_code_meaning, "XR CHEST")
|
|
995
|
+
|
|
996
|
+
|
|
997
|
+
class ImportDuplicateDX(TestCase):
|
|
998
|
+
def setUp(self):
|
|
999
|
+
""""""
|
|
1000
|
+
|
|
1001
|
+
pid = PatientIDSettings.objects.create()
|
|
1002
|
+
pid.name_stored = True
|
|
1003
|
+
pid.name_hashed = False
|
|
1004
|
+
pid.id_stored = True
|
|
1005
|
+
pid.id_hashed = False
|
|
1006
|
+
pid.dob_stored = True
|
|
1007
|
+
pid.save()
|
|
1008
|
+
|
|
1009
|
+
dx_ge_xr220_1 = os.path.join("test_files", "DX-Im-GE_XR220-1.dcm")
|
|
1010
|
+
root_tests = os.path.dirname(os.path.abspath(__file__))
|
|
1011
|
+
|
|
1012
|
+
dx.dx(os.path.join(root_tests, dx_ge_xr220_1))
|
|
1013
|
+
study_one = GeneralStudyModuleAttr.objects.order_by("pk")[0]
|
|
1014
|
+
original_study_uid = study_one.study_instance_uid
|
|
1015
|
+
original_sop_instance_uid = (
|
|
1016
|
+
study_one.projectionxrayradiationdose_set.get()
|
|
1017
|
+
.irradeventxraydata_set.get()
|
|
1018
|
+
.irradiation_event_uid
|
|
1019
|
+
)
|
|
1020
|
+
study_one.study_instance_uid = "1.2.3.4.5.6.7.8"
|
|
1021
|
+
study_one.projectionxrayradiationdose_set.get().irradeventxraydata_set.get().irradiation_event_uid = (
|
|
1022
|
+
"2.3.4.5.6.7.8.9"
|
|
1023
|
+
)
|
|
1024
|
+
study_one.save()
|
|
1025
|
+
|
|
1026
|
+
# Check there is one study in the database
|
|
1027
|
+
self.assertEqual(GeneralStudyModuleAttr.objects.all().count(), 1)
|
|
1028
|
+
|
|
1029
|
+
# Import the image again...
|
|
1030
|
+
dx.dx(os.path.join(root_tests, dx_ge_xr220_1))
|
|
1031
|
+
|
|
1032
|
+
# Check there are two studies now
|
|
1033
|
+
self.assertEqual(GeneralStudyModuleAttr.objects.all().count(), 2)
|
|
1034
|
+
|
|
1035
|
+
study_one.study_instance_uid = original_study_uid
|
|
1036
|
+
study_one.projectionxrayradiationdose_set.get().irradeventxraydata_set.get().irradiation_event_uid = (
|
|
1037
|
+
original_sop_instance_uid
|
|
1038
|
+
)
|
|
1039
|
+
study_one.save()
|
|
1040
|
+
|
|
1041
|
+
# Now we are ready to test import with duplicate study UIDs.
|
|
1042
|
+
|
|
1043
|
+
def test_duplicate_study_dx(self):
|
|
1044
|
+
"""Imports second image, original two both have modality set."""
|
|
1045
|
+
|
|
1046
|
+
dx_ge_xr220_2 = os.path.join("test_files", "DX-Im-GE_XR220-2.dcm")
|
|
1047
|
+
root_tests = os.path.dirname(os.path.abspath(__file__))
|
|
1048
|
+
|
|
1049
|
+
self.assertEqual(GeneralStudyModuleAttr.objects.all().count(), 2)
|
|
1050
|
+
|
|
1051
|
+
study_1_pk = GeneralStudyModuleAttr.objects.order_by("pk").first().pk
|
|
1052
|
+
|
|
1053
|
+
with LogCapture("remapp.extractors", level=logging.DEBUG) as log:
|
|
1054
|
+
dx.dx(os.path.join(root_tests, dx_ge_xr220_2))
|
|
1055
|
+
|
|
1056
|
+
log.check_present(
|
|
1057
|
+
(
|
|
1058
|
+
"remapp.extractors.dx",
|
|
1059
|
+
"WARNING",
|
|
1060
|
+
"Duplicate DX study UID 1.3.6.1.4.1.5962.99.1.2282339064.1266597797.1479751121656.24.0 in "
|
|
1061
|
+
"database - could be a problem! There are 2 copies.",
|
|
1062
|
+
),
|
|
1063
|
+
(
|
|
1064
|
+
"remapp.extractors.dx",
|
|
1065
|
+
"DEBUG",
|
|
1066
|
+
"Duplicate DX study UID 1.3.6.1.4.1.5962.99.1.2282339064.1266597797.1479751121656.24.0 - "
|
|
1067
|
+
"first instance (pk={0}) with modality type assigned (DX) selected to import new event "
|
|
1068
|
+
"into.".format(study_1_pk),
|
|
1069
|
+
),
|
|
1070
|
+
)
|
|
1071
|
+
|
|
1072
|
+
number_of_events_study_1 = (
|
|
1073
|
+
GeneralStudyModuleAttr.objects.order_by("pk")
|
|
1074
|
+
.first()
|
|
1075
|
+
.projectionxrayradiationdose_set.get()
|
|
1076
|
+
.irradeventxraydata_set.all()
|
|
1077
|
+
.count()
|
|
1078
|
+
)
|
|
1079
|
+
self.assertEqual(number_of_events_study_1, 2)
|
|
1080
|
+
number_of_events_study_2 = (
|
|
1081
|
+
GeneralStudyModuleAttr.objects.order_by("pk")[1]
|
|
1082
|
+
.projectionxrayradiationdose_set.get()
|
|
1083
|
+
.irradeventxraydata_set.all()
|
|
1084
|
+
.count()
|
|
1085
|
+
)
|
|
1086
|
+
self.assertEqual(number_of_events_study_2, 1)
|
|
1087
|
+
|
|
1088
|
+
def test_duplicate_study_dx_second_mod(self):
|
|
1089
|
+
"""Imports second image, later existing has modality set."""
|
|
1090
|
+
|
|
1091
|
+
dx_ge_xr220_2 = os.path.join("test_files", "DX-Im-GE_XR220-2.dcm")
|
|
1092
|
+
root_tests = os.path.dirname(os.path.abspath(__file__))
|
|
1093
|
+
|
|
1094
|
+
self.assertEqual(GeneralStudyModuleAttr.objects.all().count(), 2)
|
|
1095
|
+
|
|
1096
|
+
# Set first study modality to None
|
|
1097
|
+
study_1 = GeneralStudyModuleAttr.objects.order_by("pk").first()
|
|
1098
|
+
study_1.modality_type = None
|
|
1099
|
+
study_1.save()
|
|
1100
|
+
|
|
1101
|
+
study_2_pk = GeneralStudyModuleAttr.objects.order_by("pk")[1].pk
|
|
1102
|
+
|
|
1103
|
+
with LogCapture("remapp.extractors", level=logging.DEBUG) as log:
|
|
1104
|
+
dx.dx(os.path.join(root_tests, dx_ge_xr220_2))
|
|
1105
|
+
|
|
1106
|
+
log.check_present(
|
|
1107
|
+
(
|
|
1108
|
+
"remapp.extractors.dx",
|
|
1109
|
+
"WARNING",
|
|
1110
|
+
"Duplicate DX study UID 1.3.6.1.4.1.5962.99.1.2282339064.1266597797.1479751121656.24.0 in "
|
|
1111
|
+
"database - could be a problem! There are 2 copies.",
|
|
1112
|
+
),
|
|
1113
|
+
(
|
|
1114
|
+
"remapp.extractors.dx",
|
|
1115
|
+
"DEBUG",
|
|
1116
|
+
"Duplicate DX study UID 1.3.6.1.4.1.5962.99.1.2282339064.1266597797.1479751121656.24.0 - "
|
|
1117
|
+
"first instance (pk={0}) with modality type assigned (DX) selected to import new event "
|
|
1118
|
+
"into.".format(study_2_pk),
|
|
1119
|
+
),
|
|
1120
|
+
)
|
|
1121
|
+
|
|
1122
|
+
number_of_events_study_1 = (
|
|
1123
|
+
GeneralStudyModuleAttr.objects.order_by("pk")
|
|
1124
|
+
.first()
|
|
1125
|
+
.projectionxrayradiationdose_set.get()
|
|
1126
|
+
.irradeventxraydata_set.all()
|
|
1127
|
+
.count()
|
|
1128
|
+
)
|
|
1129
|
+
self.assertEqual(number_of_events_study_1, 1)
|
|
1130
|
+
number_of_events_study_2 = (
|
|
1131
|
+
GeneralStudyModuleAttr.objects.order_by("pk")[1]
|
|
1132
|
+
.projectionxrayradiationdose_set.get()
|
|
1133
|
+
.irradeventxraydata_set.all()
|
|
1134
|
+
.count()
|
|
1135
|
+
)
|
|
1136
|
+
self.assertEqual(number_of_events_study_2, 2)
|
|
1137
|
+
|
|
1138
|
+
def test_duplicate_study_dx_no_mod(self):
|
|
1139
|
+
"""Imports second image, original two don't have modality set."""
|
|
1140
|
+
|
|
1141
|
+
dx_ge_xr220_2 = os.path.join("test_files", "DX-Im-GE_XR220-2.dcm")
|
|
1142
|
+
root_tests = os.path.dirname(os.path.abspath(__file__))
|
|
1143
|
+
|
|
1144
|
+
self.assertEqual(GeneralStudyModuleAttr.objects.all().count(), 2)
|
|
1145
|
+
|
|
1146
|
+
# Set modality type to None
|
|
1147
|
+
for study in GeneralStudyModuleAttr.objects.order_by("pk"):
|
|
1148
|
+
study.modality_type = None
|
|
1149
|
+
study.save()
|
|
1150
|
+
|
|
1151
|
+
with LogCapture("remapp.extractors", level=logging.DEBUG) as log:
|
|
1152
|
+
dx.dx(os.path.join(root_tests, dx_ge_xr220_2))
|
|
1153
|
+
|
|
1154
|
+
log.check_present(
|
|
1155
|
+
(
|
|
1156
|
+
"remapp.extractors.dx",
|
|
1157
|
+
"WARNING",
|
|
1158
|
+
"Duplicate DX study UID 1.3.6.1.4.1.5962.99.1.2282339064.1266597797.1479751121656.24.0 in "
|
|
1159
|
+
"database - could be a problem! There are 2 copies.",
|
|
1160
|
+
),
|
|
1161
|
+
(
|
|
1162
|
+
"remapp.extractors.dx",
|
|
1163
|
+
"WARNING",
|
|
1164
|
+
"Duplicate DX study UID 1.3.6.1.4.1.5962.99.1.2282339064.1266597797.1479751121656.24.0, "
|
|
1165
|
+
"none of which have modality_type assigned! Setting first instance to DX",
|
|
1166
|
+
),
|
|
1167
|
+
)
|
|
1168
|
+
|
|
1169
|
+
number_of_events_study_1 = (
|
|
1170
|
+
GeneralStudyModuleAttr.objects.order_by("pk")
|
|
1171
|
+
.first()
|
|
1172
|
+
.projectionxrayradiationdose_set.get()
|
|
1173
|
+
.irradeventxraydata_set.all()
|
|
1174
|
+
.count()
|
|
1175
|
+
)
|
|
1176
|
+
self.assertEqual(number_of_events_study_1, 2)
|
|
1177
|
+
number_of_events_study_2 = (
|
|
1178
|
+
GeneralStudyModuleAttr.objects.order_by("pk")[1]
|
|
1179
|
+
.projectionxrayradiationdose_set.get()
|
|
1180
|
+
.irradeventxraydata_set.all()
|
|
1181
|
+
.count()
|
|
1182
|
+
)
|
|
1183
|
+
self.assertEqual(number_of_events_study_2, 1)
|
|
1184
|
+
|
|
1185
|
+
|
|
1186
|
+
class ImportSiemensDX(TestCase):
|
|
1187
|
+
def setUp(self):
|
|
1188
|
+
"""
|
|
1189
|
+
Imports a known radigraphic image file derived from a Siemens MultixFD image.
|
|
1190
|
+
"""
|
|
1191
|
+
|
|
1192
|
+
pid = PatientIDSettings.objects.create()
|
|
1193
|
+
pid.name_stored = True
|
|
1194
|
+
pid.name_hashed = False
|
|
1195
|
+
pid.id_stored = True
|
|
1196
|
+
pid.id_hashed = False
|
|
1197
|
+
pid.dob_stored = True
|
|
1198
|
+
pid.save()
|
|
1199
|
+
|
|
1200
|
+
dx_siemens_multix = os.path.join("test_files", "DX-Im-SiemensMultix.dcm")
|
|
1201
|
+
root_tests = os.path.dirname(os.path.abspath(__file__))
|
|
1202
|
+
dx.dx(os.path.join(root_tests, dx_siemens_multix))
|
|
1203
|
+
|
|
1204
|
+
def test_siemens_dx_filter_data(self):
|
|
1205
|
+
"""Check filter type and thickness is extracted"""
|
|
1206
|
+
studies = GeneralStudyModuleAttr.objects.order_by("id")
|
|
1207
|
+
|
|
1208
|
+
# Test that one study have been imported
|
|
1209
|
+
self.assertEqual(studies.count(), 1)
|
|
1210
|
+
|
|
1211
|
+
self.assertEqual(
|
|
1212
|
+
studies[0]
|
|
1213
|
+
.projectionxrayradiationdose_set.get()
|
|
1214
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
1215
|
+
.irradeventxraysourcedata_set.get()
|
|
1216
|
+
.xrayfilters_set.get()
|
|
1217
|
+
.xray_filter_material.code_meaning,
|
|
1218
|
+
"Copper or Copper compound",
|
|
1219
|
+
)
|
|
1220
|
+
self.assertAlmostEqual(
|
|
1221
|
+
float(
|
|
1222
|
+
studies[0]
|
|
1223
|
+
.projectionxrayradiationdose_set.get()
|
|
1224
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
1225
|
+
.irradeventxraysourcedata_set.get()
|
|
1226
|
+
.xrayfilters_set.get()
|
|
1227
|
+
.xray_filter_thickness_minimum
|
|
1228
|
+
),
|
|
1229
|
+
0.2,
|
|
1230
|
+
)
|
|
1231
|
+
self.assertAlmostEqual(
|
|
1232
|
+
float(
|
|
1233
|
+
studies[0]
|
|
1234
|
+
.projectionxrayradiationdose_set.get()
|
|
1235
|
+
.irradeventxraydata_set.order_by("id")[0]
|
|
1236
|
+
.irradeventxraysourcedata_set.get()
|
|
1237
|
+
.xrayfilters_set.get()
|
|
1238
|
+
.xray_filter_thickness_maximum
|
|
1239
|
+
),
|
|
1240
|
+
0.2,
|
|
1241
|
+
)
|
|
1242
|
+
|
|
1243
|
+
|
|
1244
|
+
class ImportDRGEMDX(TestCase):
|
|
1245
|
+
def setUp(self):
|
|
1246
|
+
"""
|
|
1247
|
+
Imports a known radigraphic image file derived from a DRGEM DIAMOND image.
|
|
1248
|
+
"""
|
|
1249
|
+
|
|
1250
|
+
pid = PatientIDSettings.objects.create()
|
|
1251
|
+
pid.name_stored = True
|
|
1252
|
+
pid.name_hashed = False
|
|
1253
|
+
pid.id_stored = True
|
|
1254
|
+
pid.id_hashed = False
|
|
1255
|
+
pid.dob_stored = True
|
|
1256
|
+
pid.save()
|
|
1257
|
+
|
|
1258
|
+
dx_drgem = os.path.join("test_files", "DX-Im-DRGEM.dcm")
|
|
1259
|
+
root_tests = os.path.dirname(os.path.abspath(__file__))
|
|
1260
|
+
dx.dx(os.path.join(root_tests, dx_drgem))
|
|
1261
|
+
|
|
1262
|
+
def test_drgem_dx_exposure_data(self):
|
|
1263
|
+
"""Check exposure information is extracted"""
|
|
1264
|
+
studies = GeneralStudyModuleAttr.objects.order_by("id")
|
|
1265
|
+
|
|
1266
|
+
# Test that one study have been imported
|
|
1267
|
+
self.assertEqual(studies.count(), 1)
|