endoreg-db 0.8.6.1__py3-none-any.whl → 0.8.8.0__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.

Potentially problematic release.


This version of endoreg-db might be problematic. Click here for more details.

Files changed (360) hide show
  1. endoreg_db/authz/auth.py +74 -0
  2. endoreg_db/authz/backends.py +168 -0
  3. endoreg_db/authz/management/commands/list_routes.py +18 -0
  4. endoreg_db/authz/middleware.py +83 -0
  5. endoreg_db/authz/permissions.py +127 -0
  6. endoreg_db/authz/policy.py +218 -0
  7. endoreg_db/authz/views_auth.py +66 -0
  8. endoreg_db/config/env.py +13 -8
  9. endoreg_db/data/__init__.py +8 -31
  10. endoreg_db/data/_examples/disease.yaml +55 -0
  11. endoreg_db/data/_examples/disease_classification.yaml +13 -0
  12. endoreg_db/data/_examples/disease_classification_choice.yaml +62 -0
  13. endoreg_db/data/_examples/event.yaml +64 -0
  14. endoreg_db/data/_examples/examination.yaml +72 -0
  15. endoreg_db/data/_examples/finding/anatomy_colon.yaml +128 -0
  16. endoreg_db/data/_examples/finding/colonoscopy.yaml +40 -0
  17. endoreg_db/data/_examples/finding/colonoscopy_bowel_prep.yaml +56 -0
  18. endoreg_db/data/_examples/finding/complication.yaml +16 -0
  19. endoreg_db/data/_examples/finding/data.yaml +105 -0
  20. endoreg_db/data/_examples/finding/examination_setting.yaml +16 -0
  21. endoreg_db/data/_examples/finding/medication_related.yaml +18 -0
  22. endoreg_db/data/_examples/finding/outcome.yaml +12 -0
  23. endoreg_db/data/_examples/finding_classification/colonoscopy_bowel_preparation.yaml +68 -0
  24. endoreg_db/data/_examples/finding_classification/colonoscopy_jnet.yaml +22 -0
  25. endoreg_db/data/_examples/finding_classification/colonoscopy_kudo.yaml +25 -0
  26. endoreg_db/data/_examples/finding_classification/colonoscopy_lesion_circularity.yaml +20 -0
  27. endoreg_db/data/_examples/finding_classification/colonoscopy_lesion_planarity.yaml +24 -0
  28. endoreg_db/data/_examples/finding_classification/colonoscopy_lesion_size.yaml +68 -0
  29. endoreg_db/data/_examples/finding_classification/colonoscopy_lesion_surface.yaml +20 -0
  30. endoreg_db/data/_examples/finding_classification/colonoscopy_location.yaml +80 -0
  31. endoreg_db/data/_examples/finding_classification/colonoscopy_lst.yaml +21 -0
  32. endoreg_db/data/_examples/finding_classification/colonoscopy_nice.yaml +20 -0
  33. endoreg_db/data/_examples/finding_classification/colonoscopy_paris.yaml +26 -0
  34. endoreg_db/data/_examples/finding_classification/colonoscopy_sano.yaml +22 -0
  35. endoreg_db/data/_examples/finding_classification/colonoscopy_summary.yaml +53 -0
  36. endoreg_db/data/_examples/finding_classification/complication_generic.yaml +25 -0
  37. endoreg_db/data/_examples/finding_classification/examination_setting_generic.yaml +40 -0
  38. endoreg_db/data/_examples/finding_classification/histology_colo.yaml +51 -0
  39. endoreg_db/data/_examples/finding_classification/intervention_required.yaml +26 -0
  40. endoreg_db/data/_examples/finding_classification/medication_related.yaml +23 -0
  41. endoreg_db/data/_examples/finding_classification/visualized.yaml +33 -0
  42. endoreg_db/data/_examples/finding_classification_choice/bowel_preparation.yaml +78 -0
  43. endoreg_db/data/_examples/finding_classification_choice/colon_lesion_circularity_default.yaml +32 -0
  44. endoreg_db/data/_examples/finding_classification_choice/colon_lesion_jnet.yaml +15 -0
  45. endoreg_db/data/_examples/finding_classification_choice/colon_lesion_kudo.yaml +23 -0
  46. endoreg_db/data/_examples/finding_classification_choice/colon_lesion_lst.yaml +15 -0
  47. endoreg_db/data/_examples/finding_classification_choice/colon_lesion_nice.yaml +17 -0
  48. endoreg_db/data/_examples/finding_classification_choice/colon_lesion_paris.yaml +57 -0
  49. endoreg_db/data/_examples/finding_classification_choice/colon_lesion_planarity_default.yaml +49 -0
  50. endoreg_db/data/_examples/finding_classification_choice/colon_lesion_sano.yaml +14 -0
  51. endoreg_db/data/_examples/finding_classification_choice/colon_lesion_surface_intact_default.yaml +36 -0
  52. endoreg_db/data/_examples/finding_classification_choice/colonoscopy_location.yaml +229 -0
  53. endoreg_db/data/_examples/finding_classification_choice/colonoscopy_not_complete_reason.yaml +19 -0
  54. endoreg_db/data/_examples/finding_classification_choice/colonoscopy_size.yaml +82 -0
  55. endoreg_db/data/_examples/finding_classification_choice/colonoscopy_summary_worst_finding.yaml +15 -0
  56. endoreg_db/data/_examples/finding_classification_choice/complication_generic_types.yaml +15 -0
  57. endoreg_db/data/_examples/finding_classification_choice/examination_setting_generic_types.yaml +15 -0
  58. endoreg_db/data/_examples/finding_classification_choice/histology.yaml +24 -0
  59. endoreg_db/data/_examples/finding_classification_choice/histology_polyp.yaml +20 -0
  60. endoreg_db/data/_examples/finding_classification_choice/outcome.yaml +19 -0
  61. endoreg_db/data/_examples/finding_classification_choice/yes_no_na.yaml +11 -0
  62. endoreg_db/data/_examples/finding_classification_type/colonoscopy_basic.yaml +48 -0
  63. endoreg_db/data/_examples/finding_intervention/endoscopy.yaml +43 -0
  64. endoreg_db/data/_examples/finding_intervention/endoscopy_colonoscopy.yaml +168 -0
  65. endoreg_db/data/_examples/finding_intervention/endoscopy_egd.yaml +128 -0
  66. endoreg_db/data/_examples/finding_intervention/endoscopy_ercp.yaml +32 -0
  67. endoreg_db/data/_examples/finding_intervention/endoscopy_eus_lower.yaml +9 -0
  68. endoreg_db/data/_examples/finding_intervention/endoscopy_eus_upper.yaml +36 -0
  69. endoreg_db/data/_examples/finding_intervention_type/endoscopy.yaml +15 -0
  70. endoreg_db/data/_examples/finding_type/data.yaml +43 -0
  71. endoreg_db/data/_examples/requirement/age.yaml +26 -0
  72. endoreg_db/data/_examples/requirement/colonoscopy_baseline_austria.yaml +45 -0
  73. endoreg_db/data/_examples/requirement/disease_cardiovascular.yaml +79 -0
  74. endoreg_db/data/_examples/requirement/disease_classification_choice_cardiovascular.yaml +41 -0
  75. endoreg_db/data/_examples/requirement/disease_hepatology.yaml +12 -0
  76. endoreg_db/data/_examples/requirement/disease_misc.yaml +12 -0
  77. endoreg_db/data/_examples/requirement/disease_renal.yaml +96 -0
  78. endoreg_db/data/_examples/requirement/endoscopy_bleeding_risk.yaml +59 -0
  79. endoreg_db/data/_examples/requirement/event_cardiology.yaml +251 -0
  80. endoreg_db/data/_examples/requirement/event_requirements.yaml +145 -0
  81. endoreg_db/data/_examples/requirement/finding_colon_polyp.yaml +50 -0
  82. endoreg_db/data/_examples/requirement/gender.yaml +25 -0
  83. endoreg_db/data/_examples/requirement/lab_value.yaml +441 -0
  84. endoreg_db/data/_examples/requirement/medication.yaml +93 -0
  85. endoreg_db/data/_examples/requirement_operator/age.yaml +13 -0
  86. endoreg_db/data/_examples/requirement_operator/lab_operators.yaml +129 -0
  87. endoreg_db/data/_examples/requirement_operator/model_operators.yaml +96 -0
  88. endoreg_db/data/_examples/requirement_set/01_endoscopy_generic.yaml +48 -0
  89. endoreg_db/data/_examples/requirement_set/colonoscopy_austria_screening.yaml +57 -0
  90. endoreg_db/data/_examples/yaml_examples.xlsx +0 -0
  91. endoreg_db/data/ai_model_meta/default_multilabel_classification.yaml +4 -3
  92. endoreg_db/data/event_classification/data.yaml +4 -0
  93. endoreg_db/data/event_classification_choice/data.yaml +9 -0
  94. endoreg_db/data/finding_classification/colonoscopy_bowel_preparation.yaml +43 -70
  95. endoreg_db/data/finding_classification/colonoscopy_lesion_size.yaml +22 -52
  96. endoreg_db/data/finding_classification/colonoscopy_location.yaml +31 -62
  97. endoreg_db/data/finding_classification/histology_colo.yaml +28 -36
  98. endoreg_db/data/requirement/colon_polyp_intervention.yaml +49 -0
  99. endoreg_db/data/requirement/coloreg_colon_polyp.yaml +49 -0
  100. endoreg_db/data/requirement_set/01_endoscopy_generic.yaml +31 -12
  101. endoreg_db/data/requirement_set/01_laboratory.yaml +13 -0
  102. endoreg_db/data/requirement_set/02_endoscopy_bleeding_risk.yaml +46 -0
  103. endoreg_db/data/requirement_set/90_coloreg.yaml +178 -0
  104. endoreg_db/data/requirement_set/_old_ +109 -0
  105. endoreg_db/data/requirement_set_type/data.yaml +21 -0
  106. endoreg_db/data/setup_config.yaml +4 -4
  107. endoreg_db/data/tag/requirement_set_tags.yaml +21 -0
  108. endoreg_db/exceptions.py +5 -2
  109. endoreg_db/helpers/data_loader.py +1 -1
  110. endoreg_db/management/commands/create_model_meta_from_huggingface.py +21 -10
  111. endoreg_db/management/commands/create_multilabel_model_meta.py +299 -129
  112. endoreg_db/management/commands/import_video.py +9 -10
  113. endoreg_db/management/commands/import_video_with_classification.py +1 -1
  114. endoreg_db/management/commands/init_default_ai_model.py +1 -1
  115. endoreg_db/management/commands/list_routes.py +18 -0
  116. endoreg_db/management/commands/load_center_data.py +12 -12
  117. endoreg_db/management/commands/load_requirement_data.py +60 -31
  118. endoreg_db/management/commands/load_requirement_set_tags.py +95 -0
  119. endoreg_db/management/commands/setup_endoreg_db.py +3 -3
  120. endoreg_db/management/commands/storage_management.py +271 -203
  121. endoreg_db/migrations/0001_initial.py +1799 -1300
  122. endoreg_db/migrations/0002_requirementset_depends_on.py +18 -0
  123. endoreg_db/migrations/_old/0001_initial.py +1857 -0
  124. endoreg_db/migrations/_old/0004_employee_city_employee_post_code_employee_street_and_more.py +68 -0
  125. endoreg_db/migrations/_old/0004_remove_casetemplate_rules_and_more.py +77 -0
  126. endoreg_db/migrations/_old/0005_merge_20251111_1003.py +14 -0
  127. endoreg_db/migrations/_old/0006_sensitivemeta_anonymized_text_and_more.py +68 -0
  128. endoreg_db/migrations/_old/0007_remove_rule_attribute_dtype_remove_rule_rule_type_and_more.py +89 -0
  129. endoreg_db/migrations/_old/0008_remove_event_event_classification_and_more.py +27 -0
  130. endoreg_db/migrations/_old/0009_alter_modelmeta_options_and_more.py +21 -0
  131. endoreg_db/models/__init__.py +78 -123
  132. endoreg_db/models/administration/__init__.py +21 -42
  133. endoreg_db/models/administration/ai/active_model.py +2 -2
  134. endoreg_db/models/administration/ai/ai_model.py +7 -6
  135. endoreg_db/models/administration/case/__init__.py +1 -15
  136. endoreg_db/models/administration/case/case.py +3 -3
  137. endoreg_db/models/administration/case/case_template/__init__.py +2 -14
  138. endoreg_db/models/administration/case/case_template/case_template.py +2 -124
  139. endoreg_db/models/administration/case/case_template/case_template_rule.py +2 -268
  140. endoreg_db/models/administration/case/case_template/case_template_rule_value.py +2 -85
  141. endoreg_db/models/administration/case/case_template/case_template_type.py +2 -25
  142. endoreg_db/models/administration/center/center.py +33 -19
  143. endoreg_db/models/administration/center/center_product.py +12 -9
  144. endoreg_db/models/administration/center/center_resource.py +25 -19
  145. endoreg_db/models/administration/center/center_shift.py +21 -17
  146. endoreg_db/models/administration/center/center_waste.py +16 -8
  147. endoreg_db/models/administration/person/__init__.py +2 -0
  148. endoreg_db/models/administration/person/employee/employee.py +10 -5
  149. endoreg_db/models/administration/person/employee/employee_qualification.py +9 -4
  150. endoreg_db/models/administration/person/employee/employee_type.py +12 -6
  151. endoreg_db/models/administration/person/examiner/examiner.py +13 -11
  152. endoreg_db/models/administration/person/patient/__init__.py +2 -0
  153. endoreg_db/models/administration/person/patient/patient.py +103 -100
  154. endoreg_db/models/administration/person/patient/patient_external_id.py +37 -0
  155. endoreg_db/models/administration/person/person.py +4 -0
  156. endoreg_db/models/administration/person/profession/__init__.py +8 -4
  157. endoreg_db/models/administration/person/user/portal_user_information.py +11 -7
  158. endoreg_db/models/administration/product/product.py +20 -15
  159. endoreg_db/models/administration/product/product_material.py +17 -18
  160. endoreg_db/models/administration/product/product_weight.py +12 -8
  161. endoreg_db/models/administration/product/reference_product.py +23 -55
  162. endoreg_db/models/administration/qualification/qualification.py +7 -3
  163. endoreg_db/models/administration/qualification/qualification_type.py +7 -3
  164. endoreg_db/models/administration/shift/scheduled_days.py +8 -5
  165. endoreg_db/models/administration/shift/shift.py +16 -12
  166. endoreg_db/models/administration/shift/shift_type.py +23 -31
  167. endoreg_db/models/label/__init__.py +7 -8
  168. endoreg_db/models/label/annotation/image_classification.py +10 -9
  169. endoreg_db/models/label/annotation/video_segmentation_annotation.py +8 -5
  170. endoreg_db/models/label/label.py +15 -15
  171. endoreg_db/models/label/label_set.py +19 -6
  172. endoreg_db/models/label/label_type.py +1 -1
  173. endoreg_db/models/label/label_video_segment/_create_from_video.py +5 -8
  174. endoreg_db/models/label/label_video_segment/label_video_segment.py +76 -102
  175. endoreg_db/models/label/video_segmentation_label.py +4 -0
  176. endoreg_db/models/label/video_segmentation_labelset.py +4 -3
  177. endoreg_db/models/media/frame/frame.py +22 -22
  178. endoreg_db/models/media/pdf/raw_pdf.py +110 -182
  179. endoreg_db/models/media/pdf/report_file.py +25 -29
  180. endoreg_db/models/media/pdf/report_reader/report_reader_config.py +30 -46
  181. endoreg_db/models/media/pdf/report_reader/report_reader_flag.py +23 -7
  182. endoreg_db/models/media/video/__init__.py +1 -0
  183. endoreg_db/models/media/video/create_from_file.py +48 -56
  184. endoreg_db/models/media/video/pipe_2.py +8 -9
  185. endoreg_db/models/media/video/video_file.py +150 -108
  186. endoreg_db/models/media/video/video_file_ai.py +288 -74
  187. endoreg_db/models/media/video/video_file_anonymize.py +38 -38
  188. endoreg_db/models/media/video/video_file_frames/__init__.py +3 -1
  189. endoreg_db/models/media/video/video_file_frames/_bulk_create_frames.py +6 -8
  190. endoreg_db/models/media/video/video_file_frames/_create_frame_object.py +7 -9
  191. endoreg_db/models/media/video/video_file_frames/_delete_frames.py +9 -8
  192. endoreg_db/models/media/video/video_file_frames/_extract_frames.py +38 -45
  193. endoreg_db/models/media/video/video_file_frames/_get_frame.py +6 -8
  194. endoreg_db/models/media/video/video_file_frames/_get_frame_number.py +4 -18
  195. endoreg_db/models/media/video/video_file_frames/_get_frame_path.py +4 -3
  196. endoreg_db/models/media/video/video_file_frames/_get_frame_paths.py +7 -6
  197. endoreg_db/models/media/video/video_file_frames/_get_frame_range.py +6 -8
  198. endoreg_db/models/media/video/video_file_frames/_get_frames.py +6 -8
  199. endoreg_db/models/media/video/video_file_frames/_initialize_frames.py +15 -25
  200. endoreg_db/models/media/video/video_file_frames/_manage_frame_range.py +26 -23
  201. endoreg_db/models/media/video/video_file_frames/_mark_frames_extracted_status.py +23 -14
  202. endoreg_db/models/media/video/video_file_io.py +109 -62
  203. endoreg_db/models/media/video/video_file_meta/get_crop_template.py +3 -3
  204. endoreg_db/models/media/video/video_file_meta/get_endo_roi.py +5 -3
  205. endoreg_db/models/media/video/video_file_meta/get_fps.py +37 -34
  206. endoreg_db/models/media/video/video_file_meta/initialize_video_specs.py +19 -25
  207. endoreg_db/models/media/video/video_file_meta/text_meta.py +41 -38
  208. endoreg_db/models/media/video/video_file_meta/video_meta.py +14 -7
  209. endoreg_db/models/media/video/video_file_segments.py +24 -17
  210. endoreg_db/models/media/video/video_metadata.py +19 -35
  211. endoreg_db/models/media/video/video_processing.py +96 -95
  212. endoreg_db/models/medical/contraindication/__init__.py +13 -3
  213. endoreg_db/models/medical/disease.py +22 -16
  214. endoreg_db/models/medical/event.py +31 -18
  215. endoreg_db/models/medical/examination/__init__.py +13 -6
  216. endoreg_db/models/medical/examination/examination.py +17 -18
  217. endoreg_db/models/medical/examination/examination_indication.py +26 -25
  218. endoreg_db/models/medical/examination/examination_time.py +16 -6
  219. endoreg_db/models/medical/examination/examination_time_type.py +9 -6
  220. endoreg_db/models/medical/examination/examination_type.py +3 -4
  221. endoreg_db/models/medical/finding/finding.py +38 -39
  222. endoreg_db/models/medical/finding/finding_classification.py +37 -48
  223. endoreg_db/models/medical/finding/finding_intervention.py +27 -22
  224. endoreg_db/models/medical/finding/finding_type.py +13 -12
  225. endoreg_db/models/medical/hardware/endoscope.py +20 -26
  226. endoreg_db/models/medical/hardware/endoscopy_processor.py +2 -2
  227. endoreg_db/models/medical/laboratory/lab_value.py +62 -91
  228. endoreg_db/models/medical/medication/medication.py +22 -10
  229. endoreg_db/models/medical/medication/medication_indication.py +29 -3
  230. endoreg_db/models/medical/medication/medication_indication_type.py +25 -14
  231. endoreg_db/models/medical/medication/medication_intake_time.py +31 -19
  232. endoreg_db/models/medical/medication/medication_schedule.py +27 -16
  233. endoreg_db/models/medical/organ/__init__.py +15 -12
  234. endoreg_db/models/medical/patient/medication_examples.py +1 -5
  235. endoreg_db/models/medical/patient/patient_disease.py +20 -23
  236. endoreg_db/models/medical/patient/patient_event.py +19 -22
  237. endoreg_db/models/medical/patient/patient_examination.py +48 -54
  238. endoreg_db/models/medical/patient/patient_examination_indication.py +16 -14
  239. endoreg_db/models/medical/patient/patient_finding.py +122 -139
  240. endoreg_db/models/medical/patient/patient_finding_classification.py +44 -49
  241. endoreg_db/models/medical/patient/patient_finding_intervention.py +8 -19
  242. endoreg_db/models/medical/patient/patient_lab_sample.py +28 -23
  243. endoreg_db/models/medical/patient/patient_lab_value.py +82 -89
  244. endoreg_db/models/medical/patient/patient_medication.py +27 -38
  245. endoreg_db/models/medical/patient/patient_medication_schedule.py +28 -36
  246. endoreg_db/models/medical/risk/risk.py +7 -6
  247. endoreg_db/models/medical/risk/risk_type.py +8 -5
  248. endoreg_db/models/metadata/model_meta.py +60 -29
  249. endoreg_db/models/metadata/model_meta_logic.py +125 -18
  250. endoreg_db/models/metadata/pdf_meta.py +19 -24
  251. endoreg_db/models/metadata/sensitive_meta.py +102 -85
  252. endoreg_db/models/metadata/sensitive_meta_logic.py +192 -173
  253. endoreg_db/models/metadata/video_meta.py +51 -31
  254. endoreg_db/models/metadata/video_prediction_logic.py +16 -23
  255. endoreg_db/models/metadata/video_prediction_meta.py +29 -33
  256. endoreg_db/models/other/distribution/date_value_distribution.py +89 -29
  257. endoreg_db/models/other/distribution/multiple_categorical_value_distribution.py +21 -5
  258. endoreg_db/models/other/distribution/numeric_value_distribution.py +114 -53
  259. endoreg_db/models/other/distribution/single_categorical_value_distribution.py +4 -3
  260. endoreg_db/models/other/emission/emission_factor.py +18 -8
  261. endoreg_db/models/other/gender.py +10 -5
  262. endoreg_db/models/other/information_source.py +25 -25
  263. endoreg_db/models/other/material.py +9 -5
  264. endoreg_db/models/other/resource.py +6 -4
  265. endoreg_db/models/other/tag.py +10 -5
  266. endoreg_db/models/other/transport_route.py +13 -8
  267. endoreg_db/models/other/unit.py +10 -6
  268. endoreg_db/models/other/waste.py +6 -5
  269. endoreg_db/models/requirement/requirement.py +580 -272
  270. endoreg_db/models/requirement/requirement_error.py +85 -0
  271. endoreg_db/models/requirement/requirement_evaluation/evaluate_with_dependencies.py +268 -0
  272. endoreg_db/models/requirement/requirement_evaluation/operator_evaluation_models.py +3 -6
  273. endoreg_db/models/requirement/requirement_evaluation/requirement_type_parser.py +90 -64
  274. endoreg_db/models/requirement/requirement_operator.py +36 -33
  275. endoreg_db/models/requirement/requirement_set.py +74 -57
  276. endoreg_db/models/state/__init__.py +4 -4
  277. endoreg_db/models/state/abstract.py +2 -2
  278. endoreg_db/models/state/anonymization.py +12 -0
  279. endoreg_db/models/state/audit_ledger.py +46 -47
  280. endoreg_db/models/state/label_video_segment.py +9 -0
  281. endoreg_db/models/state/raw_pdf.py +40 -46
  282. endoreg_db/models/state/sensitive_meta.py +6 -2
  283. endoreg_db/models/state/video.py +58 -53
  284. endoreg_db/models/upload_job.py +32 -55
  285. endoreg_db/models/utils.py +1 -2
  286. endoreg_db/root_urls.py +21 -2
  287. endoreg_db/serializers/__init__.py +0 -2
  288. endoreg_db/serializers/anonymization.py +18 -10
  289. endoreg_db/serializers/meta/report_meta.py +1 -1
  290. endoreg_db/serializers/meta/sensitive_meta_detail.py +63 -118
  291. endoreg_db/serializers/misc/file_overview.py +11 -99
  292. endoreg_db/serializers/requirements/requirement_sets.py +92 -22
  293. endoreg_db/serializers/video/segmentation.py +2 -1
  294. endoreg_db/serializers/video/video_processing_history.py +20 -5
  295. endoreg_db/services/anonymization.py +75 -73
  296. endoreg_db/services/lookup_service.py +37 -24
  297. endoreg_db/services/pdf_import.py +166 -68
  298. endoreg_db/services/storage_aware_video_processor.py +140 -114
  299. endoreg_db/services/video_import.py +193 -283
  300. endoreg_db/urls/__init__.py +7 -20
  301. endoreg_db/urls/media.py +108 -67
  302. endoreg_db/urls/root_urls.py +29 -0
  303. endoreg_db/utils/__init__.py +15 -5
  304. endoreg_db/utils/ai/multilabel_classification_net.py +116 -20
  305. endoreg_db/utils/case_generator/__init__.py +3 -0
  306. endoreg_db/utils/dataloader.py +88 -16
  307. endoreg_db/utils/defaults/set_default_center.py +32 -0
  308. endoreg_db/utils/names.py +22 -16
  309. endoreg_db/utils/permissions.py +2 -1
  310. endoreg_db/utils/pipelines/process_video_dir.py +1 -1
  311. endoreg_db/utils/requirement_operator_logic/model_evaluators.py +414 -127
  312. endoreg_db/utils/setup_config.py +8 -5
  313. endoreg_db/utils/storage.py +115 -0
  314. endoreg_db/utils/validate_endo_roi.py +8 -2
  315. endoreg_db/utils/video/ffmpeg_wrapper.py +184 -188
  316. endoreg_db/views/__init__.py +0 -10
  317. endoreg_db/views/anonymization/media_management.py +198 -163
  318. endoreg_db/views/anonymization/overview.py +4 -1
  319. endoreg_db/views/anonymization/validate.py +174 -40
  320. endoreg_db/views/media/__init__.py +2 -0
  321. endoreg_db/views/media/pdf_media.py +131 -152
  322. endoreg_db/views/media/sensitive_metadata.py +46 -6
  323. endoreg_db/views/media/video_media.py +89 -82
  324. endoreg_db/views/media/video_segments.py +2 -3
  325. endoreg_db/views/meta/sensitive_meta_detail.py +0 -63
  326. endoreg_db/views/patient/patient.py +5 -4
  327. endoreg_db/views/pdf/pdf_stream.py +20 -21
  328. endoreg_db/views/pdf/reimport.py +11 -32
  329. endoreg_db/views/requirement/evaluate.py +188 -187
  330. endoreg_db/views/requirement/lookup.py +17 -3
  331. endoreg_db/views/requirement/requirement_utils.py +89 -0
  332. endoreg_db/views/video/__init__.py +0 -2
  333. endoreg_db/views/video/correction.py +2 -2
  334. {endoreg_db-0.8.6.1.dist-info → endoreg_db-0.8.8.0.dist-info}/METADATA +7 -3
  335. {endoreg_db-0.8.6.1.dist-info → endoreg_db-0.8.8.0.dist-info}/RECORD +341 -245
  336. endoreg_db/models/administration/permissions/__init__.py +0 -44
  337. endoreg_db/models/media/video/video_file_frames.py +0 -0
  338. endoreg_db/models/metadata/frame_ocr_result.py +0 -0
  339. endoreg_db/models/rule/__init__.py +0 -13
  340. endoreg_db/models/rule/rule.py +0 -27
  341. endoreg_db/models/rule/rule_applicator.py +0 -224
  342. endoreg_db/models/rule/rule_attribute_dtype.py +0 -17
  343. endoreg_db/models/rule/rule_type.py +0 -20
  344. endoreg_db/models/rule/ruleset.py +0 -17
  345. endoreg_db/serializers/video/video_metadata.py +0 -105
  346. endoreg_db/urls/report.py +0 -48
  347. endoreg_db/urls/video.py +0 -61
  348. endoreg_db/utils/case_generator/case_generator.py +0 -159
  349. endoreg_db/utils/case_generator/utils.py +0 -30
  350. endoreg_db/views/report/__init__.py +0 -9
  351. endoreg_db/views/report/report_list.py +0 -112
  352. endoreg_db/views/report/report_with_secure_url.py +0 -28
  353. endoreg_db/views/report/start_examination.py +0 -7
  354. endoreg_db/views.py +0 -0
  355. /endoreg_db/data/{requirement_set → _examples/requirement_set}/endoscopy_bleeding_risk.yaml +0 -0
  356. /endoreg_db/migrations/{0002_add_video_correction_models.py → _old/0002_add_video_correction_models.py} +0 -0
  357. /endoreg_db/migrations/{0003_add_center_display_name.py → _old/0003_add_center_display_name.py} +0 -0
  358. /endoreg_db/{models/media/video/refactor_plan.md → views/pdf/pdf_stream_views.py} +0 -0
  359. {endoreg_db-0.8.6.1.dist-info → endoreg_db-0.8.8.0.dist-info}/WHEEL +0 -0
  360. {endoreg_db-0.8.6.1.dist-info → endoreg_db-0.8.8.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,66 @@
1
+ # libs/endoreg-db/endoreg_db/authz/views_auth.py
2
+
3
+ from rest_framework.decorators import api_view, permission_classes
4
+ from rest_framework.permissions import IsAuthenticated
5
+ from rest_framework.response import Response
6
+
7
+ from .policy import REQUIRED_ROLES, DEFAULT_ROLE_BY_METHOD, satisfies, get_needed_role
8
+
9
+ # Map frontend page keys → (DRF route name, HTTP method)
10
+ #
11
+ # Route names come from your router registration, e.g.:
12
+ # router.register(r'patients', PatientViewSet, basename='patient')
13
+ # => "patient-list", "patient-detail"
14
+ PAGE_CAPS = {
15
+ # Vue route /patienten
16
+ "page.patients.view": ("patient-list", "GET"),
17
+ # You can extend later, e.g.:
18
+ # "page.reports.view": ("report-list", "GET"),
19
+ # "page.anonymization.view": ("anonymization-list", "GET"),
20
+ }
21
+
22
+
23
+ @api_view(["GET"])
24
+ @permission_classes([IsAuthenticated])
25
+ def auth_bootstrap(request):
26
+ """
27
+ Return auth context for the frontend:
28
+ - current user (username, basic info)
29
+ - roles (Django groups, synced from Keycloak)
30
+ - capabilities (what parts of UI the user may access)
31
+ """
32
+ user = request.user
33
+
34
+ # Roles = Django group names = Keycloak roles synced from Keycloak
35
+ roles = set(user.groups.values_list("name", flat=True))
36
+
37
+ capabilities = {}
38
+
39
+ for cap_key, (route_name, method) in PAGE_CAPS.items():
40
+ method = method.upper()
41
+
42
+ # Look up which role is needed for this route/method
43
+ #needed = REQUIRED_ROLES.get(route_name) or DEFAULT_ROLE_BY_METHOD.get(method)
44
+ needed = get_needed_role(route_name, method)
45
+
46
+ if not needed:
47
+ # No role mapping defined → secure default: deny
48
+ capabilities[cap_key] = {"read": False, "write": False}
49
+ continue
50
+
51
+ allowed = satisfies(roles, needed) # uses your existing rule: write ⇒ read, etc.
52
+
53
+ # For UI pages we usually only care about "read"
54
+ capabilities[cap_key] = {
55
+ "read": bool(allowed),
56
+ "write": False, # or bool(allowed) if this page allows writes in UI
57
+ }
58
+
59
+ return Response({
60
+ "user": {
61
+ "username": user.username,
62
+ "roles": sorted(roles),
63
+ },
64
+ "roles": sorted(roles),
65
+ "capabilities": capabilities,
66
+ })
endoreg_db/config/env.py CHANGED
@@ -5,11 +5,12 @@ This module is the single place to read environment variables and .env files.
5
5
  It avoids loading .env during pytest, and provides typed helpers.
6
6
  No Django imports here to prevent early settings configuration.
7
7
  """
8
+
8
9
  from __future__ import annotations
9
10
 
10
- from pathlib import Path
11
11
  import os
12
- from typing import Optional, Dict, Any
12
+ from pathlib import Path
13
+ from typing import Any, Dict, Optional
13
14
 
14
15
  # Detect pytest early to avoid loading .env in test runs
15
16
  IS_PYTEST = bool(os.environ.get("PYTEST_CURRENT_TEST"))
@@ -21,7 +22,8 @@ BASE_DIR = Path(__file__).resolve().parents[2]
21
22
  _DOTENV_LOADED = False
22
23
  try:
23
24
  if not IS_PYTEST:
24
- import dotenv # type: ignore
25
+ import dotenv
26
+
25
27
  dotenv.load_dotenv()
26
28
  _DOTENV_LOADED = True
27
29
  except Exception:
@@ -90,12 +92,15 @@ def snapshot() -> Dict[str, Any]:
90
92
  "SKIP_EXPENSIVE_TESTS",
91
93
  ]
92
94
  data: Dict[str, Any] = {k: os.environ.get(k) for k in keys}
93
- data.update({
94
- "IS_PYTEST": IS_PYTEST,
95
- "DOTENV_LOADED": _DOTENV_LOADED,
96
- "BASE_DIR": str(BASE_DIR),
97
- })
95
+ data.update(
96
+ {
97
+ "IS_PYTEST": IS_PYTEST,
98
+ "DOTENV_LOADED": _DOTENV_LOADED,
99
+ "BASE_DIR": str(BASE_DIR),
100
+ }
101
+ )
98
102
  return data
99
103
 
104
+
100
105
  # Back-compat short aliases used by settings modules
101
106
  ENV = os.environ.get
@@ -27,29 +27,17 @@ CONTRAINDICATION_DATA_DIR = DATA_DIR / "contraindication"
27
27
 
28
28
  # Examination
29
29
  EXAMINATION_INDICATION_DATA_DIR = DATA_DIR / "examination_indication"
30
- EXAMINATION_INDICATION_CLASSIFICATION_DATA_DIR = (
31
- DATA_DIR / "examination_indication_classification"
32
- )
33
- EXAMINATION_INDICATION_CLASSIFICATION_CHOICE_DATA_DIR = (
34
- DATA_DIR / "examination_indication_classification_choice"
35
- )
30
+ EXAMINATION_INDICATION_CLASSIFICATION_DATA_DIR = DATA_DIR / "examination_indication_classification"
31
+ EXAMINATION_INDICATION_CLASSIFICATION_CHOICE_DATA_DIR = DATA_DIR / "examination_indication_classification_choice"
36
32
 
37
33
  # Finding
38
34
  FINDING_TYPE_DATA_DIR = DATA_DIR / "finding_type"
39
35
  FINDING_DATA_DIR = DATA_DIR / "finding"
40
36
  FINDING_LOCATION_CLASSIFICATION_DATA_DIR = DATA_DIR / "finding_location_classification"
41
- FINDING_LOCATION_CLASSIFICATION_CHOICE_DATA_DIR = (
42
- DATA_DIR / "finding_location_classification_choice"
43
- )
44
- FINDING_MORPHOLOGY_CLASSIFICATION_DATA_DIR = (
45
- DATA_DIR / "finding_morphology_classification"
46
- )
47
- FINDING_MORPHOLOGY_CLASSIFICATION_CHOICE_DATA_DIR = (
48
- DATA_DIR / "finding_morphology_classification_choice"
49
- )
50
- FINDING_MORPGOLOGY_CLASSIFICATION_TYPE_DATA_DIR = (
51
- DATA_DIR / "finding_morphology_classification_type"
52
- )
37
+ FINDING_LOCATION_CLASSIFICATION_CHOICE_DATA_DIR = DATA_DIR / "finding_location_classification_choice"
38
+ FINDING_MORPHOLOGY_CLASSIFICATION_DATA_DIR = DATA_DIR / "finding_morphology_classification"
39
+ FINDING_MORPHOLOGY_CLASSIFICATION_CHOICE_DATA_DIR = DATA_DIR / "finding_morphology_classification_choice"
40
+ FINDING_MORPGOLOGY_CLASSIFICATION_TYPE_DATA_DIR = DATA_DIR / "finding_morphology_classification_type"
53
41
  FINDING_INTERVETION_DATA_DIR = DATA_DIR / "finding_intervention"
54
42
  FINIDNG_INTERVENTION_TYPE_DATA_DIR = DATA_DIR / "finding_intervention_type"
55
43
 
@@ -81,20 +69,9 @@ MEDICATION_INDICATION_TYPE_DATA_DIR = DATA_DIR / "medication_indication_type"
81
69
  DISTRIBUTION_BASE_DIR = DATA_DIR / "distribution"
82
70
  DISTRIBUTION_SINGLE_CATEGORICAL_DATA_DIR = DISTRIBUTION_BASE_DIR / "single_categorical"
83
71
  DISTRIBUTION_NUMERIC_DATA_DIR = DISTRIBUTION_BASE_DIR / "numeric"
84
- DISTRIBUTION_MULTIPLE_CATEGORICAL_DATA_DIR = (
85
- DISTRIBUTION_BASE_DIR / "multiple_categorical"
86
- )
72
+ DISTRIBUTION_MULTIPLE_CATEGORICAL_DATA_DIR = DISTRIBUTION_BASE_DIR / "multiple_categorical"
87
73
  DISTRIBUTION_DATE_DATA_DIR = DISTRIBUTION_BASE_DIR / "date"
88
74
 
89
- # G-Play Stuffs
90
- CASE_TEMPLATE_BASE_DIR = DATA_DIR / "case_template"
91
- CASE_TEMPLATE_DATA_DIR = CASE_TEMPLATE_BASE_DIR / "template"
92
- CASE_TEMPLATE_TYPE_DATA_DIR = CASE_TEMPLATE_BASE_DIR / "template_type"
93
- CASE_TEMPLATE_RULE_DATA_DIR = CASE_TEMPLATE_BASE_DIR / "rule"
94
- CASE_TEMPLATE_RULE_TYPE_DATA_DIR = CASE_TEMPLATE_BASE_DIR / "rule_type"
95
- CASE_TEMPLATE_RULE_VALUE_DATA_DIR = CASE_TEMPLATE_BASE_DIR / "rule_value"
96
- CASE_TEMPLATE_RULE_VALUE_TYPE_DATA_DIR = CASE_TEMPLATE_BASE_DIR / "rule_value_type"
97
-
98
75
  # NETWORK
99
76
  NETWORK_DEVICE_DATA_DIR = DATA_DIR / "network_device"
100
77
  NETWORK_DEVICE_TYPE_DATA_DIR = DATA_DIR / "network_device_type"
@@ -141,4 +118,4 @@ QUALIFICATION_DATA_DIR = DATA_DIR / "qualification"
141
118
 
142
119
  TAG_DATA_DIR = DATA_DIR / "tag"
143
120
 
144
- EXAMINATION_REQUIREMENT_SET_DATA_DIR = DATA_DIR / "examination_requirement_set"
121
+ EXAMINATION_REQUIREMENT_SET_DATA_DIR = DATA_DIR / "examination_requirement_set"
@@ -0,0 +1,55 @@
1
+ - model: endoreg_db.disease
2
+ fields:
3
+ name: "hypertension"
4
+ name_de: "Arterielle Hypertonie"
5
+ name_en: "Hypertension"
6
+
7
+ - model: endoreg_db.disease
8
+ fields:
9
+ name: "coronary_artery_disease"
10
+ name_de: "Koronare Herzkrankheit"
11
+ name_en: "Coronary Artery Disease"
12
+
13
+ - model: endoreg_db.disease
14
+ fields:
15
+ name: "congestive_heart_failure"
16
+ name_de: "Chron. Herzinsuffizienz"
17
+ name_en: "Congestive Heart Failure"
18
+
19
+ # diabetes mellitus I
20
+ - model: endoreg_db.disease
21
+ fields:
22
+ name: "diabetes_mellitus_I"
23
+ name_de: "Diabetes mellitus Typ I"
24
+ name_en: "Diabetes Mellitus Type I"
25
+
26
+ # diabetes mellitus II
27
+ - model: endoreg_db.disease
28
+ fields:
29
+ name: "diabetes_mellitus_II"
30
+ name_de: "Diabetes mellitus Typ II"
31
+ name_en: "Diabetes Mellitus Type II"
32
+
33
+ - model: endoreg_db.disease
34
+ fields:
35
+ name: "non_valvular_atrial_fibrillation"
36
+ name_de: "nicht valvuläres Vorhofflimmern"
37
+ name_en: "non valvular Atrial Fibrillation"
38
+
39
+ - model: endoreg_db.disease
40
+ fields:
41
+ name: "liver_cirrhosis"
42
+ name_de: "Leberzirrhose"
43
+ name_en: "Liver Cirrhosis"
44
+
45
+ - model: endoreg_db.disease
46
+ fields:
47
+ name: "disease_is_malignoma_unspecified"
48
+ name_de: "Malignom, nicht näher bezeichnet"
49
+ name_en: "Malignoma, unspecified"
50
+
51
+ - model: endoreg_db.disease
52
+ fields:
53
+ name: "chronic_kidney_disease"
54
+ name_de: "Chronische Nierenerkrankung"
55
+ name_en: "Chronic Kidney Disease"
@@ -0,0 +1,13 @@
1
+ - model: endoreg_db.disease_classification
2
+ fields:
3
+ name: "chronic_kidney_disease_kdigo"
4
+ name_de: "Chronische Nierenerkrankung (KDIGO)"
5
+ name_en: "Chronic Kidney Disease (KDIGO)"
6
+ disease: "chronic_kidney_disease"
7
+
8
+ - model: endoreg_db.disease_classification
9
+ fields:
10
+ name: "coronary_artery_disease_base_classification"
11
+ name_de: "Koronare Gefäßerkrankung (N-Gefäß-Erkrankung)"
12
+ name_en: "Coronary Vessel Disease (N-Vessel Disease)"
13
+ disease: "coronary_artery_disease"
@@ -0,0 +1,62 @@
1
+ - model: endoreg_db.disease_classification_choice
2
+ fields:
3
+ name: "ckd_kdigo_1"
4
+ name_de: "Chronische Nierenerkrankung (KDIGO) (Stadium 1)"
5
+ name_en: "Chronic Kidney Disease (KDIGO) (Stage 1)"
6
+ disease_classification: "chronic_kidney_disease_kdigo"
7
+
8
+ - model: endoreg_db.disease_classification_choice
9
+ fields:
10
+ name: "ckd_kdigo_2"
11
+ name_de: "Chronische Nierenerkrankung (KDIGO) (Stadium 2)"
12
+ name_en: "Chronic Kidney Disease (KDIGO) (Stage 2)"
13
+ disease_classification: "chronic_kidney_disease_kdigo"
14
+
15
+ - model: endoreg_db.disease_classification_choice
16
+ fields:
17
+ name: "ckd_kdigo_3a"
18
+ name_de: "Chronische Nierenerkrankung (KDIGO) (Stadium 3a)"
19
+ name_en: "Chronic Kidney Disease (KDIGO) (Stage 3a)"
20
+ disease_classification: "chronic_kidney_disease_kdigo"
21
+
22
+ - model: endoreg_db.disease_classification_choice
23
+ fields:
24
+ name: "ckd_kdigo_3b"
25
+ name_de: "Chronische Nierenerkrankung (KDIGO) (Stadium 3b)"
26
+ name_en: "Chronic Kidney Disease (KDIGO) (Stage 3b)"
27
+ disease_classification: "chronic_kidney_disease_kdigo"
28
+
29
+ - model: endoreg_db.disease_classification_choice
30
+ fields:
31
+ name: "ckd_kdigo_4"
32
+ name_de: "Chronische Nierenerkrankung (KDIGO) (Stadium 4)"
33
+ name_en: "Chronic Kidney Disease (KDIGO) (Stage 4)"
34
+ disease_classification: "chronic_kidney_disease_kdigo"
35
+
36
+ - model: endoreg_db.disease_classification_choice
37
+ fields:
38
+ name: "ckd_kdigo_5"
39
+ name_de: "Chronische Nierenerkrankung (KDIGO) (Stadium 5)"
40
+ name_en: "Chronic Kidney Disease (KDIGO) (Stage 5)"
41
+ disease_classification: "chronic_kidney_disease_kdigo"
42
+
43
+ - model: endoreg_db.disease_classification_choice
44
+ fields:
45
+ name: "khk_1_ge"
46
+ name_de: "Koronare Gefäßerkrankung (1-Gefäß-Erkrankung)"
47
+ name_en: "Coronary Vessel Disease (1-Vessel Disease)"
48
+ disease_classification: "coronary_artery_disease_base_classification"
49
+
50
+ - model: endoreg_db.disease_classification_choice
51
+ fields:
52
+ name: "khk_2_ge"
53
+ name_de: "Koronare Gefäßerkrankung (2-Gefäß-Erkrankung)"
54
+ name_en: "Coronary Vessel Disease (2-Vessel Disease)"
55
+ disease_classification: "coronary_artery_disease_base_classification"
56
+
57
+ - model: endoreg_db.disease_classification_choice
58
+ fields:
59
+ name: "khk_3_ge"
60
+ name_de: "Koronare Gefäßerkrankung (3-Gefäß-Erkrankung)"
61
+ name_en: "Coronary Vessel Disease (3-Vessel Disease)"
62
+ disease_classification: "coronary_artery_disease_base_classification"
@@ -0,0 +1,64 @@
1
+ - model: endoreg_db.event
2
+ fields:
3
+ name: "coro_des_implantation"
4
+ name_de: "Koronarstent-Implantation (DES)"
5
+ name_en: "Coronary Stent Implantation (DES)"
6
+
7
+ - model: endoreg_db.event
8
+ fields:
9
+ name: "coro_bms_implantation"
10
+ name_de: "Koronarstent-Implantation (BMS)"
11
+ name_en: "Coronary Stent Implantation (BMS)"
12
+
13
+ - model: endoreg_db.event
14
+ fields:
15
+ name: "complication_coro_stent_thrombosis"
16
+ name_de: "Komplikation: Koronar Stent Thrombose"
17
+ name_en: "Complication: Coronary Stent Thrombosis"
18
+
19
+ - model: endoreg_db.event
20
+ fields:
21
+ name: "stroke"
22
+ name_de: "Schlaganfall"
23
+ name_en: "Stroke"
24
+
25
+ - model: endoreg_db.event
26
+ fields:
27
+ name: "transient_ischemic_attack"
28
+ name_de: "Transitorische ischämische Attacke"
29
+ name_en: "Transient Ischemic Attack"
30
+
31
+ - model: endoreg_db.event
32
+ fields:
33
+ name: "hip_replacement_surgery"
34
+ name_de: "Hüft-TEP Operation"
35
+ name_en: "Hip replacement surgery"
36
+ description: "Hip replacement surgery"
37
+
38
+ - model: endoreg_db.event
39
+ fields:
40
+ name: "knee_replacement_surgery"
41
+ name_de: "Knie-TEP Operation"
42
+ name_en: "Knee replacement surgery"
43
+ description: "Knee replacement surgery"
44
+
45
+ - model: endoreg_db.event
46
+ fields:
47
+ name: "deep_vein_thrombosis"
48
+ name_de: "Tiefe Beinvenenthrombose"
49
+ name_en: "Deep Vein Thrombosis"
50
+ description: "Deep Vein Thrombosis"
51
+
52
+ - model: endoreg_db.event
53
+ fields:
54
+ name: "pulmonary_embolism"
55
+ name_de: "Lungenembolie"
56
+ name_en: "Pulmonary Embolism"
57
+ description: "Pulmonary Embolism"
58
+
59
+ - model: endoreg_db.event
60
+ fields:
61
+ name: "recurrent_thrombembolism"
62
+ name_de: "Rezidivierende Thrombembolien"
63
+ name_en: "Recurrent Thrombembolism"
64
+ description: "Recurrent Thrombembolism"
@@ -0,0 +1,72 @@
1
+ - model: endoreg_db.Examination
2
+ fields:
3
+ name: "colonoscopy"
4
+ name_de: "Koloskopie"
5
+ name_en: "Colonoscopy"
6
+ examination_types: ["endoscopy"]
7
+
8
+ - model: endoreg_db.Examination
9
+ fields:
10
+ name: "gastroscopy"
11
+ name_de: "Gastroskopie"
12
+ name_en: "Gastroscopy"
13
+ examination_types: ["endoscopy"]
14
+
15
+ # endosonography_upper_gi
16
+ - model: endoreg_db.Examination
17
+ fields:
18
+ name: "endosonography_upper_gi"
19
+ name_de: "Endosonographie oberer GI-Trakt"
20
+ name_en: "Endosonography Upper GI Tract"
21
+ examination_types: ["endoscopy"]
22
+
23
+ - model: endoreg_db.Examination
24
+ fields:
25
+ name: "endosonography_lower_gi"
26
+ name_de: "Endosonographie unterer GI-Trakt"
27
+ name_en: "Endosonography Lower GI Tract"
28
+ examination_types: ["endoscopy"]
29
+
30
+ # ERCP
31
+ - model: endoreg_db.Examination
32
+ fields:
33
+ name: "ercp"
34
+ name_de: "ERCP"
35
+ name_en: "ERCP"
36
+ examination_types: ["endoscopy"]
37
+
38
+ # small bowel endoscopy
39
+ - model: endoreg_db.Examination
40
+ fields:
41
+ name: "small_bowel_endoscopy"
42
+ name_de: "Dünndarmendoskopie"
43
+ name_en: "Small Bowel Endoscopy"
44
+ examination_types: ["endoscopy"]
45
+
46
+ # capsule endoscopy
47
+ - model: endoreg_db.Examination
48
+ fields:
49
+ name: "capsule_endoscopy"
50
+ name_de: "Kapselendoskopie"
51
+ name_en: "Capsule Endoscopy"
52
+ examination_types: ["endoscopy"]
53
+
54
+ - model: endoreg_db.Examination
55
+ fields:
56
+ name: "percutaneous_transhepatic_biliary_drainage"
57
+ name_de: "Perkutane transhepatische Gallengangdrainage"
58
+ name_en: "Percutaneous Transhepatic Biliary Drainage"
59
+ examination_types: ["endoscopy", "sonography", "xray"]
60
+
61
+ # percutaneous_transhepatic_cholangiography
62
+ - model: endoreg_db.Examination
63
+ fields:
64
+ name: "percutaneous_transhepatic_cholangiography"
65
+ name_de: "Perkutane transhepatische Cholangiographie"
66
+ name_en: "Percutaneous Transhepatic Cholangiography"
67
+ examination_types: ["endoscopy", "sonography", "xray"]
68
+
69
+ - model: endoreg_db.Examination
70
+ fields:
71
+ name: "colonoscopy_austria_screening"
72
+ examination_types: ["endoscopy"]
@@ -0,0 +1,128 @@
1
+ - model: endoreg_db.finding
2
+ fields:
3
+ name: "cecum"
4
+ description: "Anatomical structure: Cecum"
5
+ examinations:
6
+ [
7
+ "colonoscopy",
8
+ "colonoscopy_austria_screening",
9
+ ]
10
+
11
+ finding_types: ["anatomy", "anatomy_colon"]
12
+
13
+ - model: endoreg_db.finding
14
+ fields:
15
+ name: "terminal_ileum"
16
+ description: "Anatomical structure: Terminal ileum"
17
+ examinations:
18
+ [
19
+ "colonoscopy",
20
+ "colonoscopy_austria_screening",
21
+ ]
22
+ finding_types: ["anatomy", "anatomy_colon"]
23
+
24
+ - model: endoreg_db.finding
25
+ fields:
26
+ name: "ileocecal_valve"
27
+ description: "Anatomical structure: Ileocecal valve"
28
+ examinations:
29
+ [
30
+ "colonoscopy",
31
+ "colonoscopy_austria_screening",
32
+ ]
33
+ finding_types: ["anatomy", "anatomy_colon"]
34
+
35
+ - model: endoreg_db.finding
36
+ fields:
37
+ name: "ascending_colon"
38
+ description: "Anatomical structure: Ascending colon"
39
+ examinations:
40
+ [
41
+ "colonoscopy",
42
+ "colonoscopy_austria_screening",
43
+ ]
44
+ finding_types: ["anatomy", "anatomy_colon"]
45
+
46
+ # "right_flexure",
47
+ - model: endoreg_db.finding
48
+ fields:
49
+ name: "right_flexure"
50
+ description: "Anatomical structure: Right flexure"
51
+ examinations:
52
+ [
53
+ "colonoscopy",
54
+ "colonoscopy_austria_screening",
55
+ ]
56
+ finding_types: ["anatomy", "anatomy_colon"]
57
+
58
+ # "transverse_colon",
59
+ - model: endoreg_db.finding
60
+ fields:
61
+ name: "transverse_colon"
62
+ description: "Anatomical structure: Transverse colon"
63
+ examinations:
64
+ [
65
+ "colonoscopy",
66
+ "colonoscopy_austria_screening",
67
+ ]
68
+ finding_types: ["anatomy", "anatomy_colon"]
69
+
70
+ # "left_flexure",
71
+ - model: endoreg_db.finding
72
+ fields:
73
+ name: "left_flexure"
74
+ description: "Anatomical structure: Left flexure"
75
+ examinations:
76
+ [
77
+ "colonoscopy",
78
+ "colonoscopy_austria_screening",
79
+ ]
80
+ finding_types: ["anatomy", "anatomy_colon"]
81
+
82
+ # "descending_colon",
83
+ - model: endoreg_db.finding
84
+ fields:
85
+ name: "descending_colon"
86
+ description: "Anatomical structure: Descending colon"
87
+ examinations:
88
+ [
89
+ "colonoscopy",
90
+ "colonoscopy_austria_screening",
91
+ ]
92
+ finding_types: ["anatomy", "anatomy_colon"]
93
+
94
+ # "sigmoid_colon",
95
+ - model: endoreg_db.finding
96
+ fields:
97
+ name: "sigmoid_colon"
98
+ description: "Anatomical structure: Sigmoid colon"
99
+ examinations:
100
+ [
101
+ "colonoscopy",
102
+ "colonoscopy_austria_screening",
103
+ ]
104
+ finding_types: ["anatomy", "anatomy_colon"]
105
+
106
+ # "rectum",
107
+ - model: endoreg_db.finding
108
+ fields:
109
+ name: "rectum"
110
+ description: "Anatomical structure: Rectum"
111
+ examinations:
112
+ [
113
+ "colonoscopy",
114
+ "colonoscopy_austria_screening",
115
+ ]
116
+ finding_types: ["anatomy", "anatomy_colon"]
117
+
118
+ # "rectum_anus",
119
+ - model: endoreg_db.finding
120
+ fields:
121
+ name: "rectum_anus"
122
+ description: "Anatomical structure: Rectum and anus"
123
+ examinations:
124
+ [
125
+ "colonoscopy",
126
+ "colonoscopy_austria_screening",
127
+ ]
128
+ finding_types: ["anatomy", "anatomy_colon"]
@@ -0,0 +1,40 @@
1
+ - model: endoreg_db.finding
2
+ fields:
3
+ name: "colon_polyp"
4
+ name_de: "Kolonpolyp"
5
+ name_en: "Colon Polyp"
6
+
7
+ finding_interventions:
8
+ [
9
+ "colon_lesion_polypectomy_cold_snare",
10
+ "colon_lesion_polypectomy_hot_snare",
11
+ "colon_lesion_injection_liftup",
12
+ "colon_lesion_injection_vasoactive",
13
+ "colon_lesion_biopsy",
14
+ "colon_lesion_emr",
15
+ "colon_lesion_esd",
16
+ "colon_lesion_eftr",
17
+ "colon_lesion_clip",
18
+ ]
19
+ examinations: ["colonoscopy", "colonoscopy_austria_screening"]
20
+
21
+ finding_types: ["macroscopic"]
22
+
23
+ - model: endoreg_db.finding
24
+ fields:
25
+ name: "colonoscopy_complete"
26
+ examinations:
27
+ [
28
+ "colonoscopy",
29
+ "colonoscopy_austria_screening",
30
+ ]
31
+ finding_types: ["summary"]
32
+
33
+ - model: endoreg_db.finding
34
+ fields:
35
+ name: "colonoscopy_austria_screening_findings_summary"
36
+ examinations:
37
+ [
38
+ "colonoscopy_austria_screening",
39
+ ]
40
+ finding_types: ["summary"]
@@ -0,0 +1,56 @@
1
+ - model: endoreg_db.finding
2
+ fields:
3
+ name: "bowel_preparation_lc"
4
+ name_de: "Darmvorbereitung (Linkes Kolon)"
5
+ name_en: "Bowel Preparation (Left Colon)"
6
+ examinations:
7
+ [
8
+ "colonoscopy",
9
+ ]
10
+
11
+ finding_types: ["macroscopic"]
12
+
13
+ - model: endoreg_db.finding
14
+ fields:
15
+ name: "bowel_preparation_tc"
16
+ name_de: "Darmvorbereitung (Kolon Transversum)"
17
+ name_en: "Bowel Preparation (Transverse Colon)"
18
+ examinations:
19
+ [
20
+ "colonoscopy",
21
+ ]
22
+
23
+ finding_types: ["macroscopic"]
24
+
25
+ - model: endoreg_db.finding
26
+ fields:
27
+ name: "bowel_preparation_rc"
28
+ name_de: "Darmvorbereitung (Rechtes Kolon)"
29
+ name_en: "Bowel Preparation (Right Colon)"
30
+ examinations:
31
+ [
32
+ "colonoscopy",
33
+ ]
34
+
35
+ finding_types: ["macroscopic"]
36
+
37
+ - model: endoreg_db.finding
38
+ fields:
39
+ name: "bowel_preparation_simplified"
40
+ name_de: "Darmvorbereitung (Vereinfacht)"
41
+ name_en: "Bowel Preparation (Simplified)"
42
+ examinations:
43
+ [
44
+ "colonoscopy",
45
+ ]
46
+
47
+ finding_types: ["macroscopic"]
48
+
49
+ - model: endoreg_db.finding
50
+ fields:
51
+ name: "bowel_prep_screening_austria"
52
+ examinations:
53
+ [
54
+ "colonoscopy_austria_screening",
55
+ ]
56
+ finding_types: ["macroscopic"]
@@ -0,0 +1,16 @@
1
+ - model: endoreg_db.finding
2
+ fields:
3
+ name: "complication"
4
+ examinations: [
5
+ "gastroscopy",
6
+ "endosonography_upper_gi",
7
+ "endosonography_lower_gi",
8
+ "ercp",
9
+ "small_bowel_endoscopy",
10
+ "capsule_endoscopy",
11
+ "percutaneous_transhepatic_biliary_drainage",
12
+ "colonoscopy",
13
+ "colonoscopy_austria_screening",
14
+ ]
15
+
16
+ finding_types: ["complication"]