soulmv-sync-link-python-sdk 1.0.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.
__init__.py ADDED
File without changes
soulmv/__init__.py ADDED
File without changes
File without changes
soulmv/synclink/api.py ADDED
@@ -0,0 +1,40 @@
1
+ import os, jsonpickle
2
+ from http import HTTPMethod
3
+
4
+ from fmconsult.http.api import ApiBase
5
+ from fmconsult.utils.url import UrlUtil
6
+
7
+ class SoulMVSyncLinkApi(ApiBase):
8
+
9
+ def __init__(self):
10
+ try:
11
+ self.api_tenant_id = os.environ['soulmv.synclink.api.tenant.id']
12
+ self.api_user = os.environ['soulmv.synclink.api.user']
13
+
14
+ self.base_url = 'https://mv-sync-link.use77seg.com.br/synclink-ehr-service'
15
+ self.headers = {
16
+ 'X-Tenant-ID': self.api_tenant_id
17
+ }
18
+
19
+ self.__login()
20
+ except:
21
+ raise
22
+ def __login(self):
23
+ try:
24
+ res = self.call_request(
25
+ http_method = HTTPMethod.POST,
26
+ request_url = UrlUtil().make_url(self.base_url, ['auth','login']),
27
+ payload = {
28
+ 'user': self.api_user
29
+ }
30
+ )
31
+ res = jsonpickle.decode(res)
32
+ if res.get('status') == 200:
33
+ self.token_type = res.get('data').get('token_type')
34
+ self.access_token = res.get('data').get('access_token')
35
+ self.refresh_token = res.get('data').get('refresh_token')
36
+ self.headers['Authorization'] = f'{self.token_type} {self.access_token}'
37
+ else:
38
+ raise Exception(res.get('message'))
39
+ except:
40
+ raise
@@ -0,0 +1,37 @@
1
+ import logging, jsonpickle, json
2
+ from http import HTTPMethod
3
+
4
+ from fmconsult.utils.url import UrlUtil
5
+
6
+ from soulmv.synclink.api import SoulMVSyncLinkApi
7
+
8
+ class PatientRecordApi(SoulMVSyncLinkApi):
9
+ def __init__(self):
10
+ super().__init__()
11
+ self.endpoint_url = UrlUtil().make_url(self.base_url, ['api', 'v1', 'PatientRecord'])
12
+
13
+ def searchByCPF(self, cpf_number):
14
+ try:
15
+ self.endpoint_url = UrlUtil().make_url(self.base_url, ['search'])
16
+
17
+ payload = { 'cpf': cpf_number }
18
+
19
+ res = self.call_request(HTTPMethod.POST, self.endpoint_url, None, payload=payload)
20
+ res = jsonpickle.decode(res)
21
+
22
+ return res
23
+ except:
24
+ raise
25
+
26
+ def searchByCNS(self, cns_number):
27
+ try:
28
+ self.endpoint_url = UrlUtil().make_url(self.base_url, ['search'])
29
+
30
+ payload = { 'cns': cns_number }
31
+
32
+ res = self.call_request(HTTPMethod.POST, self.endpoint_url, None, payload=payload)
33
+ res = jsonpickle.decode(res)
34
+
35
+ return res
36
+ except:
37
+ raise
@@ -0,0 +1,21 @@
1
+ Metadata-Version: 2.4
2
+ Name: soulmv-sync-link-python-sdk
3
+ Version: 1.0.0
4
+ Summary: Client de comunicaçao c/ Sync Link API do Soul/MV
5
+ Author-email: Filipe Coelho <filipe@fmconsult.com.br>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 Seu Nome
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy...
11
+
12
+ Project-URL: Homepage, https://github.com/seuuser/minha-biblioteca
13
+ Project-URL: Bug Tracker, https://github.com/seuuser/minha-biblioteca/issues
14
+ Keywords: sdk,api,soulmv-sync-link
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Requires-Python: >=3.11
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Dynamic: license-file
@@ -0,0 +1,10 @@
1
+ __init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ soulmv/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ soulmv/synclink/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ soulmv/synclink/api.py,sha256=C1N9eF0x8bCkmsFRJHuVHGlJ-xJtNI57PUlMvEVrH7E,1198
5
+ soulmv/synclink/apis/patient_record.py,sha256=7HaSP4u759qe0a2-xWJ3kxo65TuKoNqv3GlZ7-2J0i0,1099
6
+ soulmv_sync_link_python_sdk-1.0.0.dist-info/licenses/LICENSE,sha256=YZjQnFjzXGFa0D3iCQkNDwGBNuTGJREkRmItGX1B3YM,122
7
+ soulmv_sync_link_python_sdk-1.0.0.dist-info/METADATA,sha256=1W0D185D4BcNVJ91AzwLhqL-moZQj-l75hYyYY5WCb8,790
8
+ soulmv_sync_link_python_sdk-1.0.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
9
+ soulmv_sync_link_python_sdk-1.0.0.dist-info/top_level.txt,sha256=VA_DOtC674fwv0EgkwM2H-OKBAj0ySrP1YXkLGov8t0,16
10
+ soulmv_sync_link_python_sdk-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,5 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Seu Nome
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy...
@@ -0,0 +1,2 @@
1
+ __init__
2
+ soulmv