mbu-dev-shared-components 0.2.0__tar.gz → 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mbu_dev_shared_components-0.3.1/PKG-INFO +45 -0
- mbu_dev_shared_components-0.3.1/README.md +26 -0
- mbu_dev_shared_components-0.3.1/mbu_dev_shared_components/solteqtand/db_handler.py +305 -0
- mbu_dev_shared_components-0.3.1/mbu_dev_shared_components.egg-info/PKG-INFO +45 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/pyproject.toml +1 -1
- mbu_dev_shared_components-0.2.0/PKG-INFO +0 -94
- mbu_dev_shared_components-0.2.0/README.md +0 -75
- mbu_dev_shared_components-0.2.0/mbu_dev_shared_components/solteqtand/db_handler.py +0 -251
- mbu_dev_shared_components-0.2.0/mbu_dev_shared_components.egg-info/PKG-INFO +0 -94
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/LICENSE +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/getorganized/__init__.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/getorganized/auth.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/getorganized/cases.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/getorganized/contacts.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/getorganized/documents.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/getorganized/objects.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/google/__init__.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/google/api/__init__.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/google/api/auth.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/google/workspace/__init__.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/google/workspace/alerts.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/msoffice365/__init__.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/msoffice365/excel/__init__.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/msoffice365/excel/excel_reader.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/msoffice365/sharepoint_api/__init__.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/msoffice365/sharepoint_api/files.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/os2forms/__init__.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/os2forms/documents.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/os2forms/forms.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/sap/__init__.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/sap/create_invoice.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/solteqtand/__init__.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/solteqtand/app_handler.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/utils/__init__.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/utils/db_stored_procedure_executor.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/utils/fernet_encryptor.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/utils/file_handler.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components/utils/json_handler.py +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components.egg-info/SOURCES.txt +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components.egg-info/dependency_links.txt +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components.egg-info/requires.txt +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/mbu_dev_shared_components.egg-info/top_level.txt +0 -0
- {mbu_dev_shared_components-0.2.0 → mbu_dev_shared_components-0.3.1}/setup.cfg +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: mbu_dev_shared_components
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: Shared components to use in RPA projects
|
|
5
|
+
Author-email: MBU <rpa@mbu.aarhus.dk>
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
9
|
+
Requires-Python: >=3.7
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: openpyxl>=3.1.2
|
|
13
|
+
Requires-Dist: pyodbc>=5.1.0
|
|
14
|
+
Requires-Dist: requests_ntlm>=1.2.0
|
|
15
|
+
Requires-Dist: python-dateutil==2.9.*
|
|
16
|
+
Requires-Dist: cryptography>=43.0.0
|
|
17
|
+
Requires-Dist: office365-rest-python-client
|
|
18
|
+
Requires-Dist: uiautomation
|
|
19
|
+
|
|
20
|
+
# MBU Dev Shared Components
|
|
21
|
+
|
|
22
|
+
[](https://badge.fury.io/py/mbu-dev-shared-components)
|
|
23
|
+
[](https://opensource.org/licenses/MIT)
|
|
24
|
+
|
|
25
|
+
## Overview
|
|
26
|
+
|
|
27
|
+
MBU Dev Shared Components is a Python library that provides helper modules to streamline Robotic Process Automation (RPA) development.
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- **Office365 Integration**:
|
|
32
|
+
- SharePoint
|
|
33
|
+
- Excel
|
|
34
|
+
- **SAP Integration**
|
|
35
|
+
- **Solteq Tand Integration**
|
|
36
|
+
- **Utility Modules**:
|
|
37
|
+
- JSON handling
|
|
38
|
+
- Fernet encryption
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
Install the package using pip:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pip install mbu-dev-shared-components
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# MBU Dev Shared Components
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/py/mbu-dev-shared-components)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
## Overview
|
|
7
|
+
|
|
8
|
+
MBU Dev Shared Components is a Python library that provides helper modules to streamline Robotic Process Automation (RPA) development.
|
|
9
|
+
|
|
10
|
+
## Features
|
|
11
|
+
|
|
12
|
+
- **Office365 Integration**:
|
|
13
|
+
- SharePoint
|
|
14
|
+
- Excel
|
|
15
|
+
- **SAP Integration**
|
|
16
|
+
- **Solteq Tand Integration**
|
|
17
|
+
- **Utility Modules**:
|
|
18
|
+
- JSON handling
|
|
19
|
+
- Fernet encryption
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
Install the package using pip:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install mbu-dev-shared-components
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This module defines the SolteqTandDatabase class, which provides
|
|
3
|
+
an interface to interact with the Solteq Tand database.
|
|
4
|
+
"""
|
|
5
|
+
import pyodbc
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
HUSK ORDER BY!!!!!
|
|
9
|
+
|
|
10
|
+
class SolteqTandDatabase:
|
|
11
|
+
"""Handles database operations related to the Solteq Tand system."""
|
|
12
|
+
|
|
13
|
+
def __init__(self, conn_str: str):
|
|
14
|
+
"""
|
|
15
|
+
Initializes the SolteqTandDatabase instance.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
conn_str (str): Connection string to the Solteq Tand database.
|
|
19
|
+
"""
|
|
20
|
+
self.connection_string = conn_str
|
|
21
|
+
|
|
22
|
+
def _execute_query(self, query: str, params: tuple):
|
|
23
|
+
"""
|
|
24
|
+
Executes a SQL query with parameters and returns the results as a list of dictionaries.
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
query (str): The SQL query to execute.
|
|
28
|
+
params (tuple): The parameters for the SQL query.
|
|
29
|
+
|
|
30
|
+
Returns:
|
|
31
|
+
list: A list of dictionaries, where each dictionary represents a row from the query result.
|
|
32
|
+
"""
|
|
33
|
+
conn = pyodbc.connect(self.connection_string)
|
|
34
|
+
cursor = conn.cursor()
|
|
35
|
+
cursor.execute(query, params)
|
|
36
|
+
rows = cursor.fetchall()
|
|
37
|
+
columns = [column[0] for column in cursor.description]
|
|
38
|
+
|
|
39
|
+
result = [dict(zip(columns, row)) for row in rows]
|
|
40
|
+
|
|
41
|
+
return result
|
|
42
|
+
|
|
43
|
+
def _construct_sql_statement(self, base_query, filters=None, or_filters=None): # noqa
|
|
44
|
+
"""
|
|
45
|
+
Dynamically constructs a SQL query by applying filters.
|
|
46
|
+
|
|
47
|
+
Args:
|
|
48
|
+
base_query (str): The base SQL query with a WHERE clause.
|
|
49
|
+
filters (dict, optional): Key-value pairs for AND conditions.
|
|
50
|
+
or_filters (list of dict, optional): List of OR condition dictionaries.
|
|
51
|
+
|
|
52
|
+
Returns:
|
|
53
|
+
tuple: The final SQL query and the corresponding parameters.
|
|
54
|
+
"""
|
|
55
|
+
params = []
|
|
56
|
+
where_clauses = []
|
|
57
|
+
|
|
58
|
+
# Handling AND filters
|
|
59
|
+
if filters:
|
|
60
|
+
for key, value in filters.items():
|
|
61
|
+
if isinstance(value, tuple) and len(value) == 2: # BETWEEN filtering
|
|
62
|
+
where_clauses.append(f"{key} BETWEEN ? AND ?")
|
|
63
|
+
params.extend(value)
|
|
64
|
+
elif isinstance(value, list): # IN filtering
|
|
65
|
+
placeholders = ", ".join("?" for _ in value)
|
|
66
|
+
where_clauses.append(f"{key} IN ({placeholders})")
|
|
67
|
+
params.extend(value)
|
|
68
|
+
elif isinstance(value, str) and "%" in value: # LIKE filtering
|
|
69
|
+
where_clauses.append(f"{key} LIKE ?")
|
|
70
|
+
params.append(value)
|
|
71
|
+
else: # Default equality filtering
|
|
72
|
+
where_clauses.append(f"{key} = ?")
|
|
73
|
+
params.append(value)
|
|
74
|
+
|
|
75
|
+
# Handling OR filters
|
|
76
|
+
or_clauses = []
|
|
77
|
+
if or_filters:
|
|
78
|
+
for or_filter in or_filters:
|
|
79
|
+
sub_clauses = []
|
|
80
|
+
sub_params = []
|
|
81
|
+
for key, value in or_filter.items():
|
|
82
|
+
if isinstance(value, list):
|
|
83
|
+
placeholders = ", ".join("?" for _ in value)
|
|
84
|
+
sub_clauses.append(f"{key} IN ({placeholders})")
|
|
85
|
+
sub_params.extend(value)
|
|
86
|
+
elif isinstance(value, str) and "%" in value:
|
|
87
|
+
sub_clauses.append(f"{key} LIKE ?")
|
|
88
|
+
sub_params.append(value)
|
|
89
|
+
else:
|
|
90
|
+
sub_clauses.append(f"{key} = ?")
|
|
91
|
+
sub_params.append(value)
|
|
92
|
+
|
|
93
|
+
if sub_clauses:
|
|
94
|
+
or_clauses.append(f"({' OR '.join(sub_clauses)})")
|
|
95
|
+
params.extend(sub_params)
|
|
96
|
+
|
|
97
|
+
# Adding AND filters
|
|
98
|
+
if where_clauses:
|
|
99
|
+
base_query += " AND " + " AND ".join(where_clauses)
|
|
100
|
+
|
|
101
|
+
# Adding OR filters
|
|
102
|
+
if or_clauses:
|
|
103
|
+
base_query += " AND (" + " OR ".join(or_clauses) + ")"
|
|
104
|
+
|
|
105
|
+
return base_query, params
|
|
106
|
+
|
|
107
|
+
def get_list_of_documents(self, filters=None, or_filters=None):
|
|
108
|
+
"""
|
|
109
|
+
Retrieves a list of documents based on the specified filters.
|
|
110
|
+
|
|
111
|
+
Args:
|
|
112
|
+
filters (dict, optional): Filtering criteria for document retrieval.
|
|
113
|
+
or_filters (list of dict, optional): OR conditions for filtering.
|
|
114
|
+
|
|
115
|
+
Returns:
|
|
116
|
+
list: A list of document records matching the criteria.
|
|
117
|
+
"""
|
|
118
|
+
base_query = """
|
|
119
|
+
WITH LatestActiveDocuments AS (
|
|
120
|
+
SELECT
|
|
121
|
+
ds.DocumentId,
|
|
122
|
+
ds.entityId,
|
|
123
|
+
ds.OriginalFilename,
|
|
124
|
+
ds.UniqueFilename,
|
|
125
|
+
ds.DocumentType,
|
|
126
|
+
ds.DocumentDescription,
|
|
127
|
+
ds.Priviledged,
|
|
128
|
+
ds.ContentType,
|
|
129
|
+
dss.Document_HistoryId,
|
|
130
|
+
dss.DocumentStoreStatusId,
|
|
131
|
+
dss.SentToNemSMS,
|
|
132
|
+
dss.Documented AS [DocumentCreatedDate],
|
|
133
|
+
dss.Decided AS [DocumentLastEditedDate],
|
|
134
|
+
ROW_NUMBER() OVER (
|
|
135
|
+
PARTITION BY ds.DocumentId
|
|
136
|
+
ORDER BY dss.Document_HistoryId DESC
|
|
137
|
+
) AS rn
|
|
138
|
+
FROM [tmtdata_prod].[dbo].[DocumentStore] ds
|
|
139
|
+
JOIN DocumentStoreStatus dss ON ds.DocumentId = dss.DocumentId
|
|
140
|
+
)
|
|
141
|
+
SELECT
|
|
142
|
+
ds.DocumentId,
|
|
143
|
+
ds.entityId,
|
|
144
|
+
ds.OriginalFilename,
|
|
145
|
+
ds.UniqueFilename,
|
|
146
|
+
ds.DocumentType,
|
|
147
|
+
ds.DocumentDescription,
|
|
148
|
+
ds.DocumentCreatedDate,
|
|
149
|
+
ds.DocumentLastEditedDate,
|
|
150
|
+
ds.SentToNemSMS,
|
|
151
|
+
p.cpr
|
|
152
|
+
FROM [tmtdata_prod].[dbo].[PATIENT] p
|
|
153
|
+
JOIN LatestActiveDocuments ds ON ds.entityId = p.patientId
|
|
154
|
+
WHERE 1=1
|
|
155
|
+
"""
|
|
156
|
+
final_query, params = self._construct_sql_statement(base_query, filters, or_filters)
|
|
157
|
+
return self._execute_query(final_query, params)
|
|
158
|
+
|
|
159
|
+
def get_list_of_extern_dentist(self, filters=None, or_filters=None):
|
|
160
|
+
"""
|
|
161
|
+
Retrieves a list of external dentists associated with the patient.
|
|
162
|
+
|
|
163
|
+
Args:
|
|
164
|
+
filters (dict, optional): Filtering criteria for external dentists.
|
|
165
|
+
or_filters (list of dict, optional): OR conditions for filtering.
|
|
166
|
+
|
|
167
|
+
Returns:
|
|
168
|
+
list: A list of external dentist records.
|
|
169
|
+
"""
|
|
170
|
+
base_query = """
|
|
171
|
+
SELECT p.[patientId]
|
|
172
|
+
,p.[cpr]
|
|
173
|
+
,p.[privateClinicId]
|
|
174
|
+
,c.[contractorId]
|
|
175
|
+
,c.[isPrimary]
|
|
176
|
+
,c.[name]
|
|
177
|
+
,c.[streetAddress]
|
|
178
|
+
,c.[zip]
|
|
179
|
+
,c.[phoneNumber]
|
|
180
|
+
FROM [tmtdata_prod].[dbo].[PATIENT] p
|
|
181
|
+
JOIN [CLINIC] c on c.clinicId = p.privateClinicId
|
|
182
|
+
WHERE 1=1
|
|
183
|
+
"""
|
|
184
|
+
final_query, params = self._construct_sql_statement(base_query, filters, or_filters)
|
|
185
|
+
return self._execute_query(final_query, params)
|
|
186
|
+
|
|
187
|
+
def get_list_of_bookings(self, filters=None, or_filters=None):
|
|
188
|
+
"""
|
|
189
|
+
Retrieves a list of bookings for the specified patient.
|
|
190
|
+
|
|
191
|
+
Args:
|
|
192
|
+
filters (dict, optional): Filtering criteria for booking retrieval.
|
|
193
|
+
or_filters (list of dict, optional): OR conditions for filtering.
|
|
194
|
+
|
|
195
|
+
Returns:
|
|
196
|
+
list: A list of booking records.
|
|
197
|
+
"""
|
|
198
|
+
base_query = """
|
|
199
|
+
SELECT b.StartTime,
|
|
200
|
+
b.EndTime,
|
|
201
|
+
b.PatientNotified,
|
|
202
|
+
b.PatientNotifiedVia,
|
|
203
|
+
b.BookingText,
|
|
204
|
+
b.Warnings,
|
|
205
|
+
b.CreatedDateTime,
|
|
206
|
+
b.LastModifiedDateTime,
|
|
207
|
+
bt.Description,
|
|
208
|
+
bt.PrinterFriendlyText
|
|
209
|
+
FROM [tmtdata_prod].[dbo].[BOOKING] b
|
|
210
|
+
JOIN PATIENT p on p.patientId = b.patientId
|
|
211
|
+
JOIN BOOKINGTYPE bt on bt.BookingTypeID = b.BookingTypeID
|
|
212
|
+
WHERE 1=1
|
|
213
|
+
"""
|
|
214
|
+
final_query, params = self._construct_sql_statement(base_query, filters, or_filters)
|
|
215
|
+
return self._execute_query(final_query, params)
|
|
216
|
+
|
|
217
|
+
def get_list_of_events(self, filters=None, or_filters=None):
|
|
218
|
+
"""
|
|
219
|
+
Retrieves a list of events related to the patient.
|
|
220
|
+
|
|
221
|
+
Args:
|
|
222
|
+
filters (dict, optional): Filtering criteria for event retrieval.
|
|
223
|
+
or_filters (list of dict, optional): OR conditions for filtering.
|
|
224
|
+
|
|
225
|
+
Returns:
|
|
226
|
+
list: A list of event records matching the criteria.
|
|
227
|
+
"""
|
|
228
|
+
base_query = """
|
|
229
|
+
SELECT e.[eventId],
|
|
230
|
+
e.[type],
|
|
231
|
+
e.[currentStateText],
|
|
232
|
+
e.[currentStateDate],
|
|
233
|
+
e.[timestamp],
|
|
234
|
+
e.[clinicId],
|
|
235
|
+
c.name,
|
|
236
|
+
e.[entityId],
|
|
237
|
+
e.[eventTriggerDate],
|
|
238
|
+
p.cpr,
|
|
239
|
+
e.archived
|
|
240
|
+
FROM [EVENT] e
|
|
241
|
+
JOIN [PATIENT] p ON p.patientId = e.entityId
|
|
242
|
+
JOIN [CLINIC] c ON c.clinicId = e.clinicId
|
|
243
|
+
WHERE 1=1
|
|
244
|
+
"""
|
|
245
|
+
final_query, params = self._construct_sql_statement(base_query, filters, or_filters)
|
|
246
|
+
return self._execute_query(final_query, params)
|
|
247
|
+
|
|
248
|
+
def get_list_of_primary_dental_clinics(self, filters=None, or_filters=None):
|
|
249
|
+
"""
|
|
250
|
+
Retrieves details of the primary dental clinics associated with the patient.
|
|
251
|
+
|
|
252
|
+
Args:
|
|
253
|
+
filters (dict, optional): Filtering criteria for clinic retrieval.
|
|
254
|
+
or_filters (list of dict, optional): OR conditions for filtering.
|
|
255
|
+
|
|
256
|
+
Returns:
|
|
257
|
+
list: A list of primary dental clinic details.
|
|
258
|
+
"""
|
|
259
|
+
base_query = """
|
|
260
|
+
SELECT p.cpr,
|
|
261
|
+
p.patientId,
|
|
262
|
+
p.firstName,
|
|
263
|
+
p.lastName,
|
|
264
|
+
p.preferredDentalClinicId,
|
|
265
|
+
p.isPreferredDentalClinicLocked,
|
|
266
|
+
c.name AS preferredDentalClinicName
|
|
267
|
+
FROM [tmtdata_prod].[dbo].[PATIENT] p
|
|
268
|
+
JOIN [CLINIC] c ON c.clinicId = p.preferredDentalClinicId
|
|
269
|
+
WHERE 1=1
|
|
270
|
+
"""
|
|
271
|
+
final_query, params = self._construct_sql_statement(base_query, filters, or_filters)
|
|
272
|
+
return self._execute_query(final_query, params)
|
|
273
|
+
|
|
274
|
+
def get_list_of_journal_notes(self, filters=None, or_filters=None):
|
|
275
|
+
"""
|
|
276
|
+
Retrieves journal notes associated with the specified patient.
|
|
277
|
+
|
|
278
|
+
Args:
|
|
279
|
+
filters (dict, optional): Filtering criteria for journal note retrieval.
|
|
280
|
+
or_filters (list of dict, optional): OR conditions for filtering.
|
|
281
|
+
|
|
282
|
+
Returns:
|
|
283
|
+
list: A list of journal notes matching the criteria.
|
|
284
|
+
"""
|
|
285
|
+
base_query = """
|
|
286
|
+
SELECT
|
|
287
|
+
dn.Beskrivelse,
|
|
288
|
+
ds.Dokumenteret,
|
|
289
|
+
ds.Besluttet,
|
|
290
|
+
ds.Art,
|
|
291
|
+
ds.EjerArt
|
|
292
|
+
FROM
|
|
293
|
+
[tmtdata_prod].[dbo].[Forloeb] f
|
|
294
|
+
JOIN
|
|
295
|
+
ForloebSymbolisering fs ON fs.ForloebID = f.ForloebID
|
|
296
|
+
JOIN
|
|
297
|
+
DiagnoseStatus ds ON ds.GEpjID = fs.DiagnoseID
|
|
298
|
+
JOIN
|
|
299
|
+
DiagnostikNotat dn ON dn.KontekstID = ds.KontekstID
|
|
300
|
+
JOIN
|
|
301
|
+
PATIENT p ON p.patientId = f.patientId
|
|
302
|
+
WHERE 1=1
|
|
303
|
+
"""
|
|
304
|
+
final_query, params = self._construct_sql_statement(base_query, filters, or_filters)
|
|
305
|
+
return self._execute_query(final_query, params)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: mbu_dev_shared_components
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: Shared components to use in RPA projects
|
|
5
|
+
Author-email: MBU <rpa@mbu.aarhus.dk>
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
9
|
+
Requires-Python: >=3.7
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: openpyxl>=3.1.2
|
|
13
|
+
Requires-Dist: pyodbc>=5.1.0
|
|
14
|
+
Requires-Dist: requests_ntlm>=1.2.0
|
|
15
|
+
Requires-Dist: python-dateutil==2.9.*
|
|
16
|
+
Requires-Dist: cryptography>=43.0.0
|
|
17
|
+
Requires-Dist: office365-rest-python-client
|
|
18
|
+
Requires-Dist: uiautomation
|
|
19
|
+
|
|
20
|
+
# MBU Dev Shared Components
|
|
21
|
+
|
|
22
|
+
[](https://badge.fury.io/py/mbu-dev-shared-components)
|
|
23
|
+
[](https://opensource.org/licenses/MIT)
|
|
24
|
+
|
|
25
|
+
## Overview
|
|
26
|
+
|
|
27
|
+
MBU Dev Shared Components is a Python library that provides helper modules to streamline Robotic Process Automation (RPA) development.
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- **Office365 Integration**:
|
|
32
|
+
- SharePoint
|
|
33
|
+
- Excel
|
|
34
|
+
- **SAP Integration**
|
|
35
|
+
- **Solteq Tand Integration**
|
|
36
|
+
- **Utility Modules**:
|
|
37
|
+
- JSON handling
|
|
38
|
+
- Fernet encryption
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
Install the package using pip:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pip install mbu-dev-shared-components
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.2
|
|
2
|
-
Name: mbu_dev_shared_components
|
|
3
|
-
Version: 0.2.0
|
|
4
|
-
Summary: Shared components to use in RPA projects
|
|
5
|
-
Author-email: MBU <rpa@mbu.aarhus.dk>
|
|
6
|
-
Classifier: Programming Language :: Python :: 3
|
|
7
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
-
Classifier: Operating System :: Microsoft :: Windows
|
|
9
|
-
Requires-Python: >=3.7
|
|
10
|
-
Description-Content-Type: text/markdown
|
|
11
|
-
License-File: LICENSE
|
|
12
|
-
Requires-Dist: openpyxl>=3.1.2
|
|
13
|
-
Requires-Dist: pyodbc>=5.1.0
|
|
14
|
-
Requires-Dist: requests_ntlm>=1.2.0
|
|
15
|
-
Requires-Dist: python-dateutil==2.9.*
|
|
16
|
-
Requires-Dist: cryptography>=43.0.0
|
|
17
|
-
Requires-Dist: office365-rest-python-client
|
|
18
|
-
Requires-Dist: uiautomation
|
|
19
|
-
|
|
20
|
-
# mbu-dev-shared-components
|
|
21
|
-
|
|
22
|
-
## Installation
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
pip install mbu-dev-shared-components
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Intro
|
|
29
|
-
|
|
30
|
-
This python library contains helper modules for RPA development.
|
|
31
|
-
It's based on the need of MBU, but it has been
|
|
32
|
-
generalized to be useful for others as well.
|
|
33
|
-
|
|
34
|
-
## Integrations
|
|
35
|
-
|
|
36
|
-
### Office365
|
|
37
|
-
#### - SharePoint
|
|
38
|
-
|
|
39
|
-
Helper functions for using SharePoint api. A few examples include:
|
|
40
|
-
|
|
41
|
-
- Authentication.
|
|
42
|
-
- Get list of files from a specified folder.
|
|
43
|
-
- Get file from folder.
|
|
44
|
-
- Get files from folder.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
#### - Excel
|
|
48
|
-
|
|
49
|
-
This module provides the ExcelReader class to read data from Excel files with .xlsx format.
|
|
50
|
-
|
|
51
|
-
The ExcelReader class offers methods to read specific cells, rows, and convert the row data to JSON format.
|
|
52
|
-
Additionally, it provides functionalities to count the total number of rows and nodes in the JSON data.
|
|
53
|
-
|
|
54
|
-
- Read cell
|
|
55
|
-
- Read cells
|
|
56
|
-
- Read rows
|
|
57
|
-
- Get row count
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
### SAP
|
|
61
|
-
#### - Invoices
|
|
62
|
-
|
|
63
|
-
This module provides the InvoiceCreator class to create invoices in SAP.
|
|
64
|
-
The InvoiceCreator class offers methods to open a specified business partner, and creat an invoice.
|
|
65
|
-
|
|
66
|
-
- Open business partner
|
|
67
|
-
- Create invoice
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
### Solteq Tand
|
|
71
|
-
#### - Application
|
|
72
|
-
#### - Database
|
|
73
|
-
|
|
74
|
-
This module provides the SolteqTandApp and SolteqTandDatabase class to handle patients data in Solteq Tand.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
### Utils
|
|
78
|
-
#### - JSON
|
|
79
|
-
This module provides a class for manipulating JSON objects by transforming lists
|
|
80
|
-
within the JSON into dictionaries with specified keys.
|
|
81
|
-
|
|
82
|
-
The primary class in this module is JSONManipulator, which contains methods for
|
|
83
|
-
converting lists associated with keys in a JSON object into dictionaries.
|
|
84
|
-
|
|
85
|
-
- Transform all lists
|
|
86
|
-
- Insert key value pairs
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
#### - Fernet Encryptor
|
|
90
|
-
This module provides a class for encrypting and decrypting data using the
|
|
91
|
-
Fernet symmetric encryption algorithm.
|
|
92
|
-
|
|
93
|
-
- Encrypts
|
|
94
|
-
- Decrypts
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# mbu-dev-shared-components
|
|
2
|
-
|
|
3
|
-
## Installation
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
pip install mbu-dev-shared-components
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Intro
|
|
10
|
-
|
|
11
|
-
This python library contains helper modules for RPA development.
|
|
12
|
-
It's based on the need of MBU, but it has been
|
|
13
|
-
generalized to be useful for others as well.
|
|
14
|
-
|
|
15
|
-
## Integrations
|
|
16
|
-
|
|
17
|
-
### Office365
|
|
18
|
-
#### - SharePoint
|
|
19
|
-
|
|
20
|
-
Helper functions for using SharePoint api. A few examples include:
|
|
21
|
-
|
|
22
|
-
- Authentication.
|
|
23
|
-
- Get list of files from a specified folder.
|
|
24
|
-
- Get file from folder.
|
|
25
|
-
- Get files from folder.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
#### - Excel
|
|
29
|
-
|
|
30
|
-
This module provides the ExcelReader class to read data from Excel files with .xlsx format.
|
|
31
|
-
|
|
32
|
-
The ExcelReader class offers methods to read specific cells, rows, and convert the row data to JSON format.
|
|
33
|
-
Additionally, it provides functionalities to count the total number of rows and nodes in the JSON data.
|
|
34
|
-
|
|
35
|
-
- Read cell
|
|
36
|
-
- Read cells
|
|
37
|
-
- Read rows
|
|
38
|
-
- Get row count
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
### SAP
|
|
42
|
-
#### - Invoices
|
|
43
|
-
|
|
44
|
-
This module provides the InvoiceCreator class to create invoices in SAP.
|
|
45
|
-
The InvoiceCreator class offers methods to open a specified business partner, and creat an invoice.
|
|
46
|
-
|
|
47
|
-
- Open business partner
|
|
48
|
-
- Create invoice
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
### Solteq Tand
|
|
52
|
-
#### - Application
|
|
53
|
-
#### - Database
|
|
54
|
-
|
|
55
|
-
This module provides the SolteqTandApp and SolteqTandDatabase class to handle patients data in Solteq Tand.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
### Utils
|
|
59
|
-
#### - JSON
|
|
60
|
-
This module provides a class for manipulating JSON objects by transforming lists
|
|
61
|
-
within the JSON into dictionaries with specified keys.
|
|
62
|
-
|
|
63
|
-
The primary class in this module is JSONManipulator, which contains methods for
|
|
64
|
-
converting lists associated with keys in a JSON object into dictionaries.
|
|
65
|
-
|
|
66
|
-
- Transform all lists
|
|
67
|
-
- Insert key value pairs
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
#### - Fernet Encryptor
|
|
71
|
-
This module provides a class for encrypting and decrypting data using the
|
|
72
|
-
Fernet symmetric encryption algorithm.
|
|
73
|
-
|
|
74
|
-
- Encrypts
|
|
75
|
-
- Decrypts
|
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
This module defines the SolteqTandDatabase class, which provides
|
|
3
|
-
an interface to interact with the Solteq Tand database.
|
|
4
|
-
"""
|
|
5
|
-
import pyodbc
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class SolteqTandDatabase:
|
|
9
|
-
"""Handles database operations related to the Solteq Tand system."""
|
|
10
|
-
|
|
11
|
-
def __init__(self, conn_str: str, ssn: str):
|
|
12
|
-
"""
|
|
13
|
-
Initializes the SolteqTandDatabase instance.
|
|
14
|
-
|
|
15
|
-
Args:
|
|
16
|
-
conn_str (str): Connection string to the Solteq Tand database.
|
|
17
|
-
ssn (str): Social Security Number (CPR) for identifying the patient.
|
|
18
|
-
"""
|
|
19
|
-
self.connection_string = conn_str
|
|
20
|
-
self.ssn = ssn
|
|
21
|
-
|
|
22
|
-
def _execute_query(self, query: str, params: tuple):
|
|
23
|
-
"""
|
|
24
|
-
Executes a query with the provided parameters and returns the result.
|
|
25
|
-
|
|
26
|
-
Args:
|
|
27
|
-
query (str): SQL query to execute.
|
|
28
|
-
params (tuple): Parameters to include in the SQL query.
|
|
29
|
-
|
|
30
|
-
Returns:
|
|
31
|
-
list: A list of rows returned by the query, where each row is a dictionary.
|
|
32
|
-
"""
|
|
33
|
-
conn = pyodbc.connect(self.connection_string)
|
|
34
|
-
cursor = conn.cursor()
|
|
35
|
-
cursor.execute(query, params)
|
|
36
|
-
rows = cursor.fetchall()
|
|
37
|
-
columns = [column[0] for column in cursor.description]
|
|
38
|
-
result = {'data': dict(zip(columns, row)) for row in rows}
|
|
39
|
-
return result
|
|
40
|
-
|
|
41
|
-
def check_if_document_exists(self, filename: str, documenttype: str = None, form_id: str = None):
|
|
42
|
-
"""
|
|
43
|
-
Checks if a document with the given filename exists for the specified patient,
|
|
44
|
-
optionally filtering by document type and form ID.
|
|
45
|
-
|
|
46
|
-
Args:
|
|
47
|
-
filename (str): Name of the file to search for.
|
|
48
|
-
documenttype (str, optional): Type of the document to filter by.
|
|
49
|
-
form_id (str, optional): Form ID to filter by.
|
|
50
|
-
|
|
51
|
-
Returns:
|
|
52
|
-
list: A list of matching document records.
|
|
53
|
-
"""
|
|
54
|
-
query = """
|
|
55
|
-
WITH LatestActiveDocuments AS (
|
|
56
|
-
SELECT
|
|
57
|
-
ds.DocumentId,
|
|
58
|
-
ds.entityId,
|
|
59
|
-
ds.OriginalFilename,
|
|
60
|
-
ds.UniqueFilename,
|
|
61
|
-
ds.DocumentType,
|
|
62
|
-
ds.DocumentDescription,
|
|
63
|
-
ds.Priviledged,
|
|
64
|
-
ds.ContentType,
|
|
65
|
-
dss.Document_HistoryId,
|
|
66
|
-
dss.DocumentStoreStatusId,
|
|
67
|
-
dss.SentToNemSMS,
|
|
68
|
-
dss.Documented AS [DocumentCreatedDate],
|
|
69
|
-
dss.Decided AS [DocumentLastEditedDate],
|
|
70
|
-
ROW_NUMBER() OVER (
|
|
71
|
-
PARTITION BY ds.DocumentId
|
|
72
|
-
ORDER BY dss.Document_HistoryId DESC
|
|
73
|
-
) AS rn
|
|
74
|
-
FROM [tmtdata_prod].[dbo].[DocumentStore] ds
|
|
75
|
-
JOIN DocumentStoreStatus dss ON ds.DocumentId = dss.DocumentId
|
|
76
|
-
)
|
|
77
|
-
SELECT
|
|
78
|
-
ds.DocumentId,
|
|
79
|
-
ds.entityId,
|
|
80
|
-
ds.OriginalFilename,
|
|
81
|
-
ds.UniqueFilename,
|
|
82
|
-
ds.DocumentType,
|
|
83
|
-
ds.DocumentDescription,
|
|
84
|
-
ds.DocumentCreatedDate,
|
|
85
|
-
ds.DocumentLastEditedDate,
|
|
86
|
-
ds.SentToNemSMS,
|
|
87
|
-
p.cpr
|
|
88
|
-
FROM [tmtdata_prod].[dbo].[PATIENT] p
|
|
89
|
-
JOIN LatestActiveDocuments ds ON ds.entityId = p.patientId
|
|
90
|
-
WHERE ds.rn = 1
|
|
91
|
-
AND ds.DocumentStoreStatusId = 1
|
|
92
|
-
AND p.cpr = ?
|
|
93
|
-
AND ds.OriginalFilename = ?
|
|
94
|
-
"""
|
|
95
|
-
|
|
96
|
-
params = [self.ssn, filename]
|
|
97
|
-
|
|
98
|
-
if documenttype:
|
|
99
|
-
query += " AND ds.DocumentType = ?"
|
|
100
|
-
params.append(documenttype)
|
|
101
|
-
|
|
102
|
-
if form_id:
|
|
103
|
-
query += " AND ds.DocumentDescription = ?"
|
|
104
|
-
params.append(form_id)
|
|
105
|
-
|
|
106
|
-
params = tuple(params)
|
|
107
|
-
|
|
108
|
-
return self._execute_query(query, params)
|
|
109
|
-
|
|
110
|
-
def check_extern_dentist(self):
|
|
111
|
-
"""
|
|
112
|
-
Checks if the patient is associated with an external dentist.
|
|
113
|
-
(This method is a placeholder and needs to be implemented based on specific requirements.)
|
|
114
|
-
"""
|
|
115
|
-
query = """
|
|
116
|
-
SELECT [patientId]
|
|
117
|
-
,[cpr]
|
|
118
|
-
,[privateClinicId]
|
|
119
|
-
,[c.contractorId]
|
|
120
|
-
,[c.isPrimary]
|
|
121
|
-
,[c.name]
|
|
122
|
-
,[c.streetAddress]
|
|
123
|
-
,[c.zip]
|
|
124
|
-
,[c.phoneNumber]
|
|
125
|
-
FROM [tmtdata_prod].[dbo].[PATIENT] p
|
|
126
|
-
JOIN [CLINIC] c on c.clinicId = p.privateClinicId
|
|
127
|
-
WHERE cpr = ?
|
|
128
|
-
"""
|
|
129
|
-
return self._execute_query(query, (self.ssn))
|
|
130
|
-
|
|
131
|
-
def check_if_booking_exists(self):
|
|
132
|
-
"""
|
|
133
|
-
Checks if any booking exists for the specified patient.
|
|
134
|
-
|
|
135
|
-
Returns:
|
|
136
|
-
list: A list of booking records for the patient.
|
|
137
|
-
"""
|
|
138
|
-
query = """
|
|
139
|
-
SELECT b.StartTime,
|
|
140
|
-
b.EndTime,
|
|
141
|
-
b.PatientNotified,
|
|
142
|
-
b.PatientNotifiedVia,
|
|
143
|
-
b.BookingText,
|
|
144
|
-
b.Warnings,
|
|
145
|
-
b.CreatedDateTime,
|
|
146
|
-
b.LastModifiedDateTime,
|
|
147
|
-
bt.Description,
|
|
148
|
-
bt.PrinterFriendlyText
|
|
149
|
-
FROM [tmtdata_prod].[dbo].[BOOKING] b
|
|
150
|
-
JOIN PATIENT p on p.patientId = b.patientId
|
|
151
|
-
JOIN BOOKINGTYPE bt on bt.BookingTypeID = b.BookingTypeID
|
|
152
|
-
WHERE p.cpr = ?
|
|
153
|
-
"""
|
|
154
|
-
return self._execute_query(query, (self.ssn,))
|
|
155
|
-
|
|
156
|
-
def check_if_event_exists(self, event_name: str, event_message: str, is_archived: int = None):
|
|
157
|
-
"""
|
|
158
|
-
Checks if a specific event exists for the patient based on the event name and message.
|
|
159
|
-
|
|
160
|
-
Args:
|
|
161
|
-
event_name (str): The name of the event (clinic name).
|
|
162
|
-
event_message (str): The event message or state.
|
|
163
|
-
|
|
164
|
-
Returns:
|
|
165
|
-
list: A list of matching event records for the patient.
|
|
166
|
-
"""
|
|
167
|
-
query = """
|
|
168
|
-
SELECT e.[eventId],
|
|
169
|
-
e.[type],
|
|
170
|
-
e.[currentStateText],
|
|
171
|
-
e.[currentStateDate],
|
|
172
|
-
e.[timestamp],
|
|
173
|
-
e.[clinicId],
|
|
174
|
-
c.name,
|
|
175
|
-
e.[entityId],
|
|
176
|
-
e.[eventTriggerDate],
|
|
177
|
-
p.cpr,
|
|
178
|
-
e.archived
|
|
179
|
-
FROM [EVENT] e
|
|
180
|
-
JOIN [PATIENT] p ON p.patientId = e.entityId
|
|
181
|
-
JOIN [CLINIC] c ON c.clinicId = e.clinicId
|
|
182
|
-
WHERE p.cpr = ?
|
|
183
|
-
AND c.name = ?
|
|
184
|
-
AND e.currentStateText = ?
|
|
185
|
-
"""
|
|
186
|
-
params = [self.ssn, event_name, event_message]
|
|
187
|
-
|
|
188
|
-
if is_archived is not None:
|
|
189
|
-
query += " AND e.archived = ?"
|
|
190
|
-
params.append(is_archived)
|
|
191
|
-
|
|
192
|
-
return self._execute_query(query, (params))
|
|
193
|
-
|
|
194
|
-
def get_primary_dental_clinic(self):
|
|
195
|
-
"""
|
|
196
|
-
Fetches the primary dental clinic details for the specified patient.
|
|
197
|
-
|
|
198
|
-
Returns:
|
|
199
|
-
dict: A dictionary containing patient and clinic details.
|
|
200
|
-
"""
|
|
201
|
-
query = """
|
|
202
|
-
SELECT p.cpr,
|
|
203
|
-
p.patientId,
|
|
204
|
-
p.firstName,
|
|
205
|
-
p.lastName,
|
|
206
|
-
p.preferredDentalClinicId,
|
|
207
|
-
p.isPreferredDentalClinicLocked,
|
|
208
|
-
c.name AS preferredDentalClinicName
|
|
209
|
-
FROM [tmtdata_prod].[dbo].[PATIENT] p
|
|
210
|
-
JOIN [CLINIC] c ON c.clinicId = p.preferredDentalClinicId
|
|
211
|
-
WHERE p.cpr = ?
|
|
212
|
-
"""
|
|
213
|
-
return self._execute_query(query, (self.ssn,))
|
|
214
|
-
|
|
215
|
-
def get_journal_notes(self, note_message: str = None):
|
|
216
|
-
"""
|
|
217
|
-
Fetches the journal notes for the specified patient.
|
|
218
|
-
|
|
219
|
-
Returns:
|
|
220
|
-
dict: A dictionary containing the journal notes.
|
|
221
|
-
"""
|
|
222
|
-
query = """
|
|
223
|
-
SELECT
|
|
224
|
-
dn.Beskrivelse,
|
|
225
|
-
ds.Dokumenteret,
|
|
226
|
-
ds.Besluttet,
|
|
227
|
-
ds.Art,
|
|
228
|
-
ds.EjerArt
|
|
229
|
-
FROM
|
|
230
|
-
[tmtdata_prod].[dbo].[Forloeb] f
|
|
231
|
-
JOIN
|
|
232
|
-
ForloebSymbolisering fs ON fs.ForloebID = f.ForloebID
|
|
233
|
-
JOIN
|
|
234
|
-
DiagnoseStatus ds ON ds.GEpjID = fs.DiagnoseID
|
|
235
|
-
JOIN
|
|
236
|
-
DiagnostikNotat dn ON dn.KontekstID = ds.KontekstID
|
|
237
|
-
JOIN
|
|
238
|
-
PATIENT p ON p.patientId = f.patientId
|
|
239
|
-
WHERE
|
|
240
|
-
p.cpr = ?
|
|
241
|
-
"""
|
|
242
|
-
params = [self.ssn]
|
|
243
|
-
|
|
244
|
-
if note_message:
|
|
245
|
-
query += " AND dn.Beskrivelse = ?"
|
|
246
|
-
params.append(note_message)
|
|
247
|
-
|
|
248
|
-
query += " ORDER BY ds.Dokumenteret DESC"
|
|
249
|
-
params = tuple(params)
|
|
250
|
-
|
|
251
|
-
return self._execute_query(query, params)
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.2
|
|
2
|
-
Name: mbu_dev_shared_components
|
|
3
|
-
Version: 0.2.0
|
|
4
|
-
Summary: Shared components to use in RPA projects
|
|
5
|
-
Author-email: MBU <rpa@mbu.aarhus.dk>
|
|
6
|
-
Classifier: Programming Language :: Python :: 3
|
|
7
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
-
Classifier: Operating System :: Microsoft :: Windows
|
|
9
|
-
Requires-Python: >=3.7
|
|
10
|
-
Description-Content-Type: text/markdown
|
|
11
|
-
License-File: LICENSE
|
|
12
|
-
Requires-Dist: openpyxl>=3.1.2
|
|
13
|
-
Requires-Dist: pyodbc>=5.1.0
|
|
14
|
-
Requires-Dist: requests_ntlm>=1.2.0
|
|
15
|
-
Requires-Dist: python-dateutil==2.9.*
|
|
16
|
-
Requires-Dist: cryptography>=43.0.0
|
|
17
|
-
Requires-Dist: office365-rest-python-client
|
|
18
|
-
Requires-Dist: uiautomation
|
|
19
|
-
|
|
20
|
-
# mbu-dev-shared-components
|
|
21
|
-
|
|
22
|
-
## Installation
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
pip install mbu-dev-shared-components
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Intro
|
|
29
|
-
|
|
30
|
-
This python library contains helper modules for RPA development.
|
|
31
|
-
It's based on the need of MBU, but it has been
|
|
32
|
-
generalized to be useful for others as well.
|
|
33
|
-
|
|
34
|
-
## Integrations
|
|
35
|
-
|
|
36
|
-
### Office365
|
|
37
|
-
#### - SharePoint
|
|
38
|
-
|
|
39
|
-
Helper functions for using SharePoint api. A few examples include:
|
|
40
|
-
|
|
41
|
-
- Authentication.
|
|
42
|
-
- Get list of files from a specified folder.
|
|
43
|
-
- Get file from folder.
|
|
44
|
-
- Get files from folder.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
#### - Excel
|
|
48
|
-
|
|
49
|
-
This module provides the ExcelReader class to read data from Excel files with .xlsx format.
|
|
50
|
-
|
|
51
|
-
The ExcelReader class offers methods to read specific cells, rows, and convert the row data to JSON format.
|
|
52
|
-
Additionally, it provides functionalities to count the total number of rows and nodes in the JSON data.
|
|
53
|
-
|
|
54
|
-
- Read cell
|
|
55
|
-
- Read cells
|
|
56
|
-
- Read rows
|
|
57
|
-
- Get row count
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
### SAP
|
|
61
|
-
#### - Invoices
|
|
62
|
-
|
|
63
|
-
This module provides the InvoiceCreator class to create invoices in SAP.
|
|
64
|
-
The InvoiceCreator class offers methods to open a specified business partner, and creat an invoice.
|
|
65
|
-
|
|
66
|
-
- Open business partner
|
|
67
|
-
- Create invoice
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
### Solteq Tand
|
|
71
|
-
#### - Application
|
|
72
|
-
#### - Database
|
|
73
|
-
|
|
74
|
-
This module provides the SolteqTandApp and SolteqTandDatabase class to handle patients data in Solteq Tand.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
### Utils
|
|
78
|
-
#### - JSON
|
|
79
|
-
This module provides a class for manipulating JSON objects by transforming lists
|
|
80
|
-
within the JSON into dictionaries with specified keys.
|
|
81
|
-
|
|
82
|
-
The primary class in this module is JSONManipulator, which contains methods for
|
|
83
|
-
converting lists associated with keys in a JSON object into dictionaries.
|
|
84
|
-
|
|
85
|
-
- Transform all lists
|
|
86
|
-
- Insert key value pairs
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
#### - Fernet Encryptor
|
|
90
|
-
This module provides a class for encrypting and decrypting data using the
|
|
91
|
-
Fernet symmetric encryption algorithm.
|
|
92
|
-
|
|
93
|
-
- Encrypts
|
|
94
|
-
- Decrypts
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|