mbu-dev-shared-components 0.3.5__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/PKG-INFO +7 -2
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/README.md +1 -0
- mbu_dev_shared_components-0.4.0/mbu_dev_shared_components/romexis/db_handler.py +137 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/solteqtand/app_handler.py +687 -30
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/solteqtand/db_handler.py +2 -0
- mbu_dev_shared_components-0.4.0/mbu_dev_shared_components/solteqtand/helper_functions.py +107 -0
- mbu_dev_shared_components-0.4.0/mbu_dev_shared_components/utils/__init__.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components.egg-info/PKG-INFO +7 -2
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components.egg-info/SOURCES.txt +3 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components.egg-info/requires.txt +3 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/pyproject.toml +4 -1
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/LICENSE +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/getorganized/__init__.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/getorganized/auth.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/getorganized/cases.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/getorganized/contacts.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/getorganized/documents.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/getorganized/objects.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/google/__init__.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/google/api/__init__.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/google/api/auth.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/google/workspace/__init__.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/google/workspace/alerts.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/msoffice365/__init__.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/msoffice365/excel/__init__.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/msoffice365/excel/excel_reader.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/msoffice365/sharepoint_api/__init__.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/msoffice365/sharepoint_api/files.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/os2forms/__init__.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/os2forms/documents.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/os2forms/forms.py +0 -0
- {mbu_dev_shared_components-0.3.5/mbu_dev_shared_components/sap → mbu_dev_shared_components-0.4.0/mbu_dev_shared_components/romexis}/__init__.py +0 -0
- {mbu_dev_shared_components-0.3.5/mbu_dev_shared_components/solteqtand → mbu_dev_shared_components-0.4.0/mbu_dev_shared_components/sap}/__init__.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/sap/create_invoice.py +0 -0
- {mbu_dev_shared_components-0.3.5/mbu_dev_shared_components/utils → mbu_dev_shared_components-0.4.0/mbu_dev_shared_components/solteqtand}/__init__.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/utils/db_stored_procedure_executor.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/utils/fernet_encryptor.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/utils/file_handler.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components/utils/json_handler.py +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components.egg-info/dependency_links.txt +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/mbu_dev_shared_components.egg-info/top_level.txt +0 -0
- {mbu_dev_shared_components-0.3.5 → mbu_dev_shared_components-0.4.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: mbu_dev_shared_components
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Shared components to use in RPA projects
|
|
5
5
|
Author-email: MBU <rpa@mbu.aarhus.dk>
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -16,6 +16,10 @@ Requires-Dist: python-dateutil==2.9.*
|
|
|
16
16
|
Requires-Dist: cryptography>=43.0.0
|
|
17
17
|
Requires-Dist: office365-rest-python-client
|
|
18
18
|
Requires-Dist: uiautomation
|
|
19
|
+
Requires-Dist: pillow
|
|
20
|
+
Requires-Dist: psutil
|
|
21
|
+
Requires-Dist: docx2pdf
|
|
22
|
+
Dynamic: license-file
|
|
19
23
|
|
|
20
24
|
# MBU Dev Shared Components
|
|
21
25
|
|
|
@@ -33,6 +37,7 @@ MBU Dev Shared Components is a Python library that provides helper modules to st
|
|
|
33
37
|
- Excel
|
|
34
38
|
- **SAP Integration**
|
|
35
39
|
- **Solteq Tand Integration**
|
|
40
|
+
- **Romexis Integration**
|
|
36
41
|
- **Utility Modules**:
|
|
37
42
|
- JSON handling
|
|
38
43
|
- Fernet encryption
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This module contains the RomexisDbHandler class,
|
|
3
|
+
which handles database operations related to the Romexis system.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import pyodbc
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class RomexisDbHandler:
|
|
10
|
+
"""Handles database operations related to the Romexis system."""
|
|
11
|
+
|
|
12
|
+
def __init__(self, conn_str: str):
|
|
13
|
+
"""
|
|
14
|
+
Initializes the database instance.
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
conn_str (str): Connection string to the database.
|
|
18
|
+
"""
|
|
19
|
+
self.connection_string = conn_str
|
|
20
|
+
|
|
21
|
+
def _execute_query(self, query: str, params: tuple):
|
|
22
|
+
"""
|
|
23
|
+
Executes a SQL query with parameters and returns the results as a list of dictionaries.
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
query (str): The SQL query to execute.
|
|
27
|
+
params (tuple): The parameters for the SQL query.
|
|
28
|
+
|
|
29
|
+
Returns:
|
|
30
|
+
list: A list of dictionaries, where each dictionary represents a row from the query result.
|
|
31
|
+
"""
|
|
32
|
+
conn = pyodbc.connect(self.connection_string)
|
|
33
|
+
cursor = conn.cursor()
|
|
34
|
+
cursor.execute(query, params)
|
|
35
|
+
rows = cursor.fetchall()
|
|
36
|
+
columns = [column[0] for column in cursor.description]
|
|
37
|
+
|
|
38
|
+
result = [dict(zip(columns, row)) for row in rows]
|
|
39
|
+
|
|
40
|
+
return result
|
|
41
|
+
|
|
42
|
+
def get_person_data(self, external_id: str) -> list:
|
|
43
|
+
"""
|
|
44
|
+
Gets person data from the database.
|
|
45
|
+
|
|
46
|
+
Returns:
|
|
47
|
+
list: A list of dictionaries, where each dictionary represents a person.
|
|
48
|
+
"""
|
|
49
|
+
query = """
|
|
50
|
+
SELECT
|
|
51
|
+
[person_id],
|
|
52
|
+
[external_id],
|
|
53
|
+
[first_name],
|
|
54
|
+
[second_name],
|
|
55
|
+
[third_name],
|
|
56
|
+
[last_name],
|
|
57
|
+
[date_of_birth]
|
|
58
|
+
FROM
|
|
59
|
+
[Romexis_db].[dbo].[RRM_Person]
|
|
60
|
+
WHERE
|
|
61
|
+
[external_id] = ?
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
return self._execute_query(query, (external_id,))
|
|
65
|
+
|
|
66
|
+
def get_image_ids(self, patient_id: int) -> list:
|
|
67
|
+
"""
|
|
68
|
+
Gets image ids from the database.
|
|
69
|
+
|
|
70
|
+
Returns:
|
|
71
|
+
list: A list of dictionaries, where each dictionary represents an image id.
|
|
72
|
+
"""
|
|
73
|
+
query = """
|
|
74
|
+
SELECT
|
|
75
|
+
[image_id]
|
|
76
|
+
FROM
|
|
77
|
+
[Romexis_db].[dbo].[RIM_Image_Info]
|
|
78
|
+
WHERE
|
|
79
|
+
[patient_id] = ?
|
|
80
|
+
"""
|
|
81
|
+
|
|
82
|
+
rows = self._execute_query(query, (patient_id,))
|
|
83
|
+
|
|
84
|
+
return [row["image_id"] for row in rows]
|
|
85
|
+
|
|
86
|
+
def get_image_data(self, image_ids: list) -> list:
|
|
87
|
+
"""
|
|
88
|
+
Gets image data from the database.
|
|
89
|
+
|
|
90
|
+
image_type 1 = Panorama
|
|
91
|
+
image_type 2 = Cephalostat
|
|
92
|
+
image_type 3 = interoralt
|
|
93
|
+
image_type 4 = foto
|
|
94
|
+
|
|
95
|
+
Returns:
|
|
96
|
+
list: A list of dictionaries, where each dictionary represents an image.
|
|
97
|
+
"""
|
|
98
|
+
|
|
99
|
+
placeholders = ", ".join(["?"] * len(image_ids))
|
|
100
|
+
|
|
101
|
+
query = f"""
|
|
102
|
+
SELECT
|
|
103
|
+
[person_id],
|
|
104
|
+
[first_name],
|
|
105
|
+
[last_name],
|
|
106
|
+
[date_of_birth],
|
|
107
|
+
[gender],
|
|
108
|
+
[external_id],
|
|
109
|
+
[doctor_id],
|
|
110
|
+
rii.[image_id],
|
|
111
|
+
[image_size],
|
|
112
|
+
[image_date],
|
|
113
|
+
[image_time],
|
|
114
|
+
[image_source],
|
|
115
|
+
[image_type],
|
|
116
|
+
[image_subtype],
|
|
117
|
+
[image_format],
|
|
118
|
+
[bit_depth],
|
|
119
|
+
[pixel_size],
|
|
120
|
+
[rotation_angle],
|
|
121
|
+
[is_mirrored],
|
|
122
|
+
[tooth_mask],
|
|
123
|
+
[tooth_mask_child],
|
|
124
|
+
[operator_id],
|
|
125
|
+
[string_value] AS [file_path]
|
|
126
|
+
FROM
|
|
127
|
+
[Romexis_db].[dbo].[RIM_Image_Info] rii
|
|
128
|
+
INNER JOIN [romexis_db].[dbo].[RRM_Person] rp
|
|
129
|
+
ON rii.patient_id = rp.person_id
|
|
130
|
+
INNER JOIN [Romexis_db].[dbo].[RIM_Image_Attrib] ria
|
|
131
|
+
ON ria.image_id = rii.image_id AND ria.attrib_type = 1
|
|
132
|
+
WHERE
|
|
133
|
+
rii.[image_id] IN ({placeholders})
|
|
134
|
+
AND rii.[image_type] IN (1, 2, 3, 4)
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
return self._execute_query(query, tuple(image_ids))
|