mbu-dev-shared-components 4.2.0__tar.gz → 4.2.2__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-4.2.0 → mbu_dev_shared_components-4.2.2}/PKG-INFO +1 -1
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/msoffice365/sharepoint_api/files.py +42 -12
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/solteqtand/application/app_handler.py +10 -1
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/solteqtand/application/base_ui.py +33 -12
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/solteqtand/application/edi_portal.py +30 -17
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components.egg-info/PKG-INFO +1 -1
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/pyproject.toml +1 -1
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/LICENSE +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/README.md +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/database/__init__.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/database/connection.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/database/constants.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/database/logging.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/database/utility.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/getorganized/__init__.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/getorganized/auth.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/getorganized/cases.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/getorganized/contacts.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/getorganized/documents.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/getorganized/objects.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/google/__init__.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/google/api/__init__.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/google/api/auth.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/google/workspace/__init__.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/google/workspace/alerts.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/msoffice365/__init__.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/msoffice365/excel/__init__.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/msoffice365/excel/excel_reader.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/msoffice365/sharepoint_api/__init__.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/os2forms/__init__.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/os2forms/documents.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/os2forms/forms.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/romexis/__init__.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/romexis/db_handler.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/romexis/helper_functions.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/sap/__init__.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/sap/create_invoice.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/solteqtand/__init__.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/solteqtand/application/__init__.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/solteqtand/application/aftalebog.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/solteqtand/application/appointment.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/solteqtand/application/clinic.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/solteqtand/application/document.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/solteqtand/application/event.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/solteqtand/application/exceptions.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/solteqtand/application/handler_base.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/solteqtand/application/journal_note.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/solteqtand/application/patient.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/solteqtand/database/__init__.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/solteqtand/database/db_handler.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/utils/__init__.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/utils/db_stored_procedure_executor.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/utils/fernet_encryptor.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/utils/file_handler.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components/utils/json_handler.py +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components.egg-info/SOURCES.txt +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components.egg-info/dependency_links.txt +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components.egg-info/requires.txt +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/mbu_dev_shared_components.egg-info/top_level.txt +0 -0
- {mbu_dev_shared_components-4.2.0 → mbu_dev_shared_components-4.2.2}/setup.cfg +0 -0
|
@@ -46,7 +46,6 @@ from openpyxl import load_workbook
|
|
|
46
46
|
|
|
47
47
|
import pandas as pd
|
|
48
48
|
|
|
49
|
-
from office365.runtime.auth.user_credential import UserCredential
|
|
50
49
|
from office365.sharepoint.client_context import ClientContext
|
|
51
50
|
from office365.sharepoint.files.file import File
|
|
52
51
|
|
|
@@ -57,25 +56,29 @@ class Sharepoint:
|
|
|
57
56
|
downloading, uploading, and saving functionalities within a specified SharePoint document library.
|
|
58
57
|
|
|
59
58
|
Attributes:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
tenant (str): Tenant name or domain (e.g. 'yourtenant.onmicrosoft.com').
|
|
60
|
+
client_id (str): The Azure AD application (client) ID.
|
|
61
|
+
thumbprint (str): The certificate thumbprint registered in Azure AD.
|
|
62
|
+
cert_path (str): Path to the PEM file containing the private key and certificate.
|
|
63
|
+
site_url (str): Base URL of the SharePoint tenant (e.g. 'https://contoso.sharepoint.com').
|
|
64
|
+
site_name (str): Name of the SharePoint site (e.g. 'MyTeamSite').
|
|
65
|
+
document_library (str): Name of the document library within the site.
|
|
65
66
|
"""
|
|
66
67
|
|
|
67
68
|
def __init__(
|
|
68
|
-
|
|
69
|
+
self, tenant: str, client_id: str, thumbprint: str, cert_path: str, site_url: str, site_name: str, document_library: str
|
|
69
70
|
):
|
|
70
71
|
"""Initializes the Sharepoint class with credentials and site details."""
|
|
71
|
-
self.
|
|
72
|
-
self.
|
|
72
|
+
self.tenant = tenant
|
|
73
|
+
self.client_id = client_id
|
|
74
|
+
self.thumbprint = thumbprint
|
|
75
|
+
self.cert_path = cert_path
|
|
73
76
|
self.site_url = site_url
|
|
74
77
|
self.site_name = site_name
|
|
75
78
|
self.document_library = document_library
|
|
76
79
|
self.ctx = self._auth()
|
|
77
80
|
|
|
78
|
-
def _auth(self)
|
|
81
|
+
def _auth(self):
|
|
79
82
|
"""
|
|
80
83
|
Authenticates to the SharePoint site and returns the client context.
|
|
81
84
|
|
|
@@ -85,9 +88,20 @@ class Sharepoint:
|
|
|
85
88
|
"""
|
|
86
89
|
try:
|
|
87
90
|
site_full_url = f"{self.site_url}/teams/{self.site_name}"
|
|
88
|
-
|
|
89
|
-
|
|
91
|
+
|
|
92
|
+
ctx = ClientContext(site_full_url).with_client_certificate(
|
|
93
|
+
tenant=self.tenant,
|
|
94
|
+
client_id=self.client_id,
|
|
95
|
+
thumbprint=self.thumbprint,
|
|
96
|
+
cert_path=self.cert_path
|
|
90
97
|
)
|
|
98
|
+
|
|
99
|
+
web = ctx.web
|
|
100
|
+
ctx.load(web)
|
|
101
|
+
ctx.execute_query()
|
|
102
|
+
|
|
103
|
+
print(f"Authenticated successfully. Site Title: {web.properties['Title']}")
|
|
104
|
+
|
|
91
105
|
return ctx
|
|
92
106
|
except Exception as e:
|
|
93
107
|
print(f"Failed to authenticate: {e}")
|
|
@@ -108,13 +122,20 @@ class Sharepoint:
|
|
|
108
122
|
folder_url = f"/teams/{self.site_name}/{self.document_library}/{folder_name}"
|
|
109
123
|
folder = self.ctx.web.get_folder_by_server_relative_url(folder_url)
|
|
110
124
|
files = folder.files
|
|
125
|
+
|
|
111
126
|
self.ctx.load(files)
|
|
112
127
|
self.ctx.execute_query()
|
|
128
|
+
|
|
113
129
|
files_list = [{"Name": file.name} for file in files]
|
|
130
|
+
|
|
114
131
|
return files_list
|
|
132
|
+
|
|
115
133
|
except Exception as e:
|
|
134
|
+
|
|
116
135
|
print(f"Error retrieving files: {e}")
|
|
136
|
+
|
|
117
137
|
return None
|
|
138
|
+
|
|
118
139
|
return None
|
|
119
140
|
|
|
120
141
|
def fetch_file_content(self, file_name: str, folder_name: str) -> Optional[bytes]:
|
|
@@ -146,12 +167,18 @@ class Sharepoint:
|
|
|
146
167
|
if self.ctx:
|
|
147
168
|
try:
|
|
148
169
|
file_url = f"/teams/{self.site_name}/{self.document_library}/{folder_name}/{file_name}"
|
|
170
|
+
|
|
149
171
|
file_content = File.open_binary(self.ctx, file_url)
|
|
172
|
+
|
|
150
173
|
return file_content.content
|
|
174
|
+
|
|
151
175
|
except Exception:
|
|
152
176
|
print("Failed to download file:")
|
|
177
|
+
|
|
153
178
|
traceback.print_exc()
|
|
179
|
+
|
|
154
180
|
return None
|
|
181
|
+
|
|
155
182
|
return None
|
|
156
183
|
|
|
157
184
|
def _write_file(self, folder_destination: str, file_name: str, file_content: bytes):
|
|
@@ -255,10 +282,13 @@ class Sharepoint:
|
|
|
255
282
|
if self.ctx:
|
|
256
283
|
try:
|
|
257
284
|
folder_url = f"/teams/{self.site_name}/{self.document_library}/{folder_name}"
|
|
285
|
+
|
|
258
286
|
target_folder = self.ctx.web.get_folder_by_server_relative_url(folder_url)
|
|
259
287
|
|
|
260
288
|
target_folder.upload_file(file_name, binary_content).execute_query()
|
|
289
|
+
|
|
261
290
|
print(f"File '{file_name}' uploaded successfully to '{folder_url}'.")
|
|
291
|
+
|
|
262
292
|
except Exception as e:
|
|
263
293
|
print(f"Failed to upload file '{file_name}': {e}")
|
|
264
294
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import os
|
|
4
4
|
|
|
5
|
+
import psutil
|
|
5
6
|
import uiautomation as auto
|
|
6
7
|
|
|
7
8
|
from .aftalebog import AftalebogHandler
|
|
@@ -158,6 +159,14 @@ class SolteqTandApp(
|
|
|
158
159
|
try:
|
|
159
160
|
if self.app_window:
|
|
160
161
|
self.close_window(self.app_window)
|
|
162
|
+
print(
|
|
163
|
+
"\n".join([p.info["name"] for p in psutil.process_iter(["name"])])
|
|
164
|
+
)
|
|
165
|
+
assert "TMTand.exe" not in [
|
|
166
|
+
p.info["name"] for p in psutil.process_iter(["name"])
|
|
167
|
+
]
|
|
161
168
|
self.app_window = None
|
|
162
169
|
except Exception as error:
|
|
163
|
-
|
|
170
|
+
raise RuntimeError(
|
|
171
|
+
f"Error closing Solteq Tand application window: {error}"
|
|
172
|
+
) from error
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"""Base UI-Automation helper methods for SolteqTand project."""
|
|
2
|
+
|
|
2
3
|
import time
|
|
4
|
+
|
|
3
5
|
import uiautomation as auto
|
|
4
6
|
|
|
5
7
|
|
|
6
8
|
class BaseUI:
|
|
7
9
|
"""Base UI-Automation helper methods."""
|
|
8
10
|
|
|
9
|
-
def find_element_by_property(
|
|
11
|
+
def find_element_by_property(
|
|
12
|
+
self, control, control_type=None, automation_id=None, name=None, class_name=None
|
|
13
|
+
) -> auto.Control:
|
|
10
14
|
"""
|
|
11
15
|
Uses GetChildren to traverse through controls and find an element based on the specified properties.
|
|
12
16
|
|
|
@@ -24,20 +28,29 @@ class BaseUI:
|
|
|
24
28
|
|
|
25
29
|
for child in children:
|
|
26
30
|
if (
|
|
27
|
-
(control_type is None or child.ControlType == control_type)
|
|
28
|
-
(automation_id is None or child.AutomationId == automation_id)
|
|
29
|
-
(name is None or child.Name == name)
|
|
30
|
-
(class_name is None or child.ClassName == class_name)
|
|
31
|
+
(control_type is None or child.ControlType == control_type)
|
|
32
|
+
and (automation_id is None or child.AutomationId == automation_id)
|
|
33
|
+
and (name is None or child.Name == name)
|
|
34
|
+
and (class_name is None or child.ClassName == class_name)
|
|
31
35
|
):
|
|
32
36
|
return child
|
|
33
37
|
|
|
34
|
-
found = self.find_element_by_property(
|
|
38
|
+
found = self.find_element_by_property(
|
|
39
|
+
child, control_type, automation_id, name, class_name
|
|
40
|
+
)
|
|
35
41
|
if found:
|
|
36
42
|
return found
|
|
37
43
|
|
|
38
44
|
return None
|
|
39
45
|
|
|
40
|
-
def wait_for_control(
|
|
46
|
+
def wait_for_control(
|
|
47
|
+
self,
|
|
48
|
+
control_type,
|
|
49
|
+
search_params,
|
|
50
|
+
search_depth=1,
|
|
51
|
+
timeout=30,
|
|
52
|
+
retry_interval=0.5,
|
|
53
|
+
):
|
|
41
54
|
"""
|
|
42
55
|
Waits for a given control type to become available with the specified search parameters.
|
|
43
56
|
|
|
@@ -67,9 +80,13 @@ class BaseUI:
|
|
|
67
80
|
time.sleep(retry_interval)
|
|
68
81
|
print(f"Retrying to find control: {search_params}...")
|
|
69
82
|
|
|
70
|
-
raise TimeoutError(
|
|
83
|
+
raise TimeoutError(
|
|
84
|
+
f"Control with parameters {search_params} was not found within the {timeout} second timeout."
|
|
85
|
+
)
|
|
71
86
|
|
|
72
|
-
def wait_for_control_to_disappear(
|
|
87
|
+
def wait_for_control_to_disappear(
|
|
88
|
+
self, control_type, search_params, search_depth=1, timeout=30
|
|
89
|
+
):
|
|
73
90
|
"""
|
|
74
91
|
Waits for a given control type to disappear with the specified search parameters.
|
|
75
92
|
|
|
@@ -95,7 +112,9 @@ class BaseUI:
|
|
|
95
112
|
time.sleep(0.5)
|
|
96
113
|
print(f"Retrying to find control: {search_params}...")
|
|
97
114
|
|
|
98
|
-
raise TimeoutError(
|
|
115
|
+
raise TimeoutError(
|
|
116
|
+
f"Control with parameters {search_params} did not disappear within the timeout period."
|
|
117
|
+
)
|
|
99
118
|
|
|
100
119
|
def close_window(self, window_to_close: auto.WindowControl) -> None:
|
|
101
120
|
"""Closes specified window."""
|
|
@@ -105,7 +124,6 @@ class BaseUI:
|
|
|
105
124
|
|
|
106
125
|
# Handle popup when closin main window
|
|
107
126
|
if window_name.lower().startswith("hovedvindue"):
|
|
108
|
-
|
|
109
127
|
pop_up_window = window_to_close.WindowControl(Name="TMT - Afslut")
|
|
110
128
|
pop_up_window.SetFocus()
|
|
111
129
|
pop_up_window.ButtonControl(Name="Ja").Click(simulateMove=False, waitTime=0)
|
|
@@ -113,4 +131,7 @@ class BaseUI:
|
|
|
113
131
|
time.sleep(2)
|
|
114
132
|
|
|
115
133
|
else:
|
|
116
|
-
self.app_window = self.wait_for_control(
|
|
134
|
+
self.app_window = self.wait_for_control(
|
|
135
|
+
search_params={"AutomationId": "FormFront"},
|
|
136
|
+
control_type=auto.WindowControl,
|
|
137
|
+
)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"""This module contains the EDIHandler class for handling EDI portal interactions."""
|
|
2
|
+
|
|
2
3
|
import time
|
|
4
|
+
|
|
3
5
|
import uiautomation as auto
|
|
4
6
|
|
|
5
7
|
from .handler_base import HandlerBase
|
|
@@ -18,13 +20,13 @@ class EDIHandler(HandlerBase):
|
|
|
18
20
|
menu_edi_button = self.find_element_by_property(
|
|
19
21
|
control=self.app_window,
|
|
20
22
|
control_type=auto.ControlType.MenuItemControl,
|
|
21
|
-
name="EDI Portal"
|
|
23
|
+
name="EDI Portal",
|
|
22
24
|
)
|
|
23
25
|
menu_edi_button.Click(simulateMove=False, waitTime=0)
|
|
24
26
|
journalforsendelse_button = self.find_element_by_property(
|
|
25
27
|
control=self.app_window,
|
|
26
28
|
control_type=auto.ControlType.MenuItemControl,
|
|
27
|
-
name="Opret journalforsendelse"
|
|
29
|
+
name="Opret journalforsendelse",
|
|
28
30
|
)
|
|
29
31
|
journalforsendelse_button.Click(simulateMove=False, waitTime=0)
|
|
30
32
|
|
|
@@ -62,9 +64,7 @@ class EDIHandler(HandlerBase):
|
|
|
62
64
|
|
|
63
65
|
try:
|
|
64
66
|
next_button = self.wait_for_control(
|
|
65
|
-
auto.ButtonControl, {"Name": "Næste"},
|
|
66
|
-
search_depth=50,
|
|
67
|
-
timeout=5
|
|
67
|
+
auto.ButtonControl, {"Name": "Næste"}, search_depth=50, timeout=5
|
|
68
68
|
)
|
|
69
69
|
except TimeoutError:
|
|
70
70
|
next_button = None
|
|
@@ -72,9 +72,10 @@ class EDIHandler(HandlerBase):
|
|
|
72
72
|
if not next_button:
|
|
73
73
|
try:
|
|
74
74
|
next_button = self.wait_for_control(
|
|
75
|
-
auto.ButtonControl,
|
|
75
|
+
auto.ButtonControl,
|
|
76
|
+
{"AutomationId": "patientInformationNextButton"},
|
|
76
77
|
search_depth=50,
|
|
77
|
-
timeout=5
|
|
78
|
+
timeout=5,
|
|
78
79
|
)
|
|
79
80
|
except TimeoutError:
|
|
80
81
|
next_button = None
|
|
@@ -87,7 +88,9 @@ class EDIHandler(HandlerBase):
|
|
|
87
88
|
print(f"Error while clicking next button in EDI Portal: {e}")
|
|
88
89
|
raise
|
|
89
90
|
|
|
90
|
-
def edi_portal_check_contractor_id(
|
|
91
|
+
def edi_portal_check_contractor_id(
|
|
92
|
+
self, extern_clinic_data: dict, sleep_time: int = 5
|
|
93
|
+
) -> dict:
|
|
91
94
|
"""
|
|
92
95
|
Checks if the contractor ID is valid in the EDI portal.
|
|
93
96
|
|
|
@@ -100,36 +103,46 @@ class EDIHandler(HandlerBase):
|
|
|
100
103
|
"""
|
|
101
104
|
try:
|
|
102
105
|
# Handle Hasle Torv Clinic special case
|
|
103
|
-
if
|
|
106
|
+
if (
|
|
107
|
+
extern_clinic_data[0]["contractorId"] == "477052"
|
|
108
|
+
or extern_clinic_data[0]["contractorId"] == "470678"
|
|
109
|
+
):
|
|
104
110
|
contractor_id = "485055"
|
|
105
111
|
clinic_phone_number = "86135240"
|
|
106
112
|
else:
|
|
107
113
|
contractor_id = extern_clinic_data[0]["contractorId"]
|
|
108
114
|
clinic_phone_number = extern_clinic_data[0]["phoneNumber"]
|
|
109
115
|
|
|
110
|
-
self.edi_portal_click_next_button(sleep_time=
|
|
116
|
+
self.edi_portal_click_next_button(sleep_time=3)
|
|
117
|
+
|
|
118
|
+
root_web_area = self.wait_for_control(
|
|
119
|
+
auto.DocumentControl, {"AutomationId": "RootWebArea"}, search_depth=20
|
|
120
|
+
)
|
|
111
121
|
|
|
112
122
|
class_options = [
|
|
113
123
|
"form-control filter_search",
|
|
114
124
|
"form-control filter_search valid",
|
|
115
125
|
]
|
|
116
|
-
|
|
126
|
+
search_box = None
|
|
117
127
|
for class_name in class_options:
|
|
118
128
|
try:
|
|
119
129
|
search_box = self.wait_for_control(
|
|
120
|
-
|
|
130
|
+
root_web_area.EditControl,
|
|
121
131
|
{"ClassName": class_name},
|
|
122
132
|
search_depth=22,
|
|
123
|
-
timeout=
|
|
133
|
+
timeout=2,
|
|
124
134
|
)
|
|
125
135
|
except TimeoutError:
|
|
126
136
|
continue
|
|
127
137
|
if search_box:
|
|
128
138
|
break
|
|
129
|
-
|
|
130
|
-
|
|
139
|
+
if not search_box:
|
|
140
|
+
raise RuntimeError("Search box not found")
|
|
141
|
+
|
|
131
142
|
search_box.SetFocus()
|
|
132
|
-
search_box_value_pattern = search_box.GetPattern(
|
|
143
|
+
search_box_value_pattern = search_box.GetPattern(
|
|
144
|
+
auto.PatternId.ValuePattern
|
|
145
|
+
)
|
|
133
146
|
search_box_value_pattern.SetValue(contractor_id)
|
|
134
147
|
search_box.SendKeys("{ENTER}")
|
|
135
148
|
|
|
@@ -137,7 +150,7 @@ class EDIHandler(HandlerBase):
|
|
|
137
150
|
|
|
138
151
|
table_dentists = self.wait_for_control(
|
|
139
152
|
auto.TableControl,
|
|
140
|
-
{
|
|
153
|
+
{"AutomationId": "table_id1"},
|
|
141
154
|
search_depth=25,
|
|
142
155
|
)
|
|
143
156
|
grid_pattern = table_dentists.GetPattern(auto.PatternId.GridPattern)
|
|
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
|
|
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
|