Добавлен эндпоинт getHosps

This commit is contained in:
2025-09-30 11:02:24 +03:00
parent d553b93825
commit 4be216375c
2 changed files with 20 additions and 5 deletions

View File

@ -123,3 +123,13 @@ class VITACORE_API(AsyncClient):
case _:
self.logger.error(req.json())
raise e.UnknownException
async def getHosps(self, patId: str):
req = await self.get('/getHosps', params={'patId': patId})
match req.status_code:
case st.HTTP_200_OK:
return s.HospitalizationsModel.model_validate(req.json())
case _:
self.logger.error(req.json())
raise e.UnknownException