Патч
All checks were successful
Build And Push / publish (push) Successful in 1m4s

This commit is contained in:
2025-11-13 10:10:55 +03:00
parent 043de7e034
commit a71bed1e18
3 changed files with 43 additions and 14 deletions

View File

@ -40,20 +40,28 @@ class TDN_API(AsyncClient):
raise e.UnknownException
async def patient_search(self, access_token: str, vitaId: str):
data = quote(dumps({'vitaId': vitaId}))
query = (
quote(dumps({'where': {'vitaId': vitaId}}))
.replace('%7B', '{')
.replace('%7D', '}')
)
_ = await self.get(
'/ddn/patient/search',
params={'query': data},
req = await self.get(
f'/ddn/patients/search?query={query}',
headers={'Authorization': f'Bearer {access_token}'},
)
return req.json()
async def observations_search(self, access_token: str, patientUid: str):
data = quote(dumps({'where': {'patientUid': patientUid}}))
query = (
quote(dumps({'where': {'patientUid': patientUid}}))
.replace('%7B', '{')
.replace('%7D', '}')
)
res = await self.get(
'/ddn/observations/search',
params={'query': data},
f'/ddn/observations/search?query={query}',
headers={'Authorization': f'Bearer {access_token}'},
)
@ -167,16 +175,25 @@ class TDN_API(AsyncClient):
access_token: str,
patientUid: str,
serial_number: str,
file: UploadFile,
ecg_file: UploadFile,
):
req = await self.post(
'/ddn/observation/series-values/ecg/krb02',
headers={'Authorization': f'Bearer {access_token}'},
files={'ekg': (file.filename, file.file, file.content_type)},
json={
headers={
'Authorization': f'Bearer {access_token}',
'Content-Type': 'multipart/form-data; boundary=+++',
},
data={
'patientUid': patientUid,
'serialNumber': serial_number,
},
files={
'ecg': (
ecg_file.filename,
ecg_file.file,
ecg_file.content_type or 'application/octet-stream',
)
},
)
match req.status_code: