Добавлен эндпоинт getHospRecommendations
This commit is contained in:
@ -124,6 +124,16 @@ async def get_hosps():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@router.get('/getHospRecommendations')
|
||||||
|
async def get_hosp_recommendations():
|
||||||
|
"""
|
||||||
|
Get list of recommended hospitals.
|
||||||
|
"""
|
||||||
|
return await c.vitacore_api.getHospRecommendations(
|
||||||
|
'b708e782-4f83-4f3b-8639-512c0c9637bf'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@router.post('/measurement', status_code=status.HTTP_202_ACCEPTED)
|
@router.post('/measurement', status_code=status.HTTP_202_ACCEPTED)
|
||||||
async def measurement(
|
async def measurement(
|
||||||
user: Annotated[str, Depends(login)],
|
user: Annotated[str, Depends(login)],
|
||||||
@ -203,11 +213,6 @@ async def get_pat_flg(user: Annotated[str, Depends(login)]):
|
|||||||
return mock.patFLG[0]
|
return mock.patFLG[0]
|
||||||
|
|
||||||
|
|
||||||
@router.get('/getHospRecommendations')
|
|
||||||
async def get_hosp_recommendations(user: Annotated[str, Depends(login)]):
|
|
||||||
return mock.hospRecommendations
|
|
||||||
|
|
||||||
|
|
||||||
@router.get('/getHospRoutes')
|
@router.get('/getHospRoutes')
|
||||||
async def get_hosp_routes(user: Annotated[str, Depends(login)]):
|
async def get_hosp_routes(user: Annotated[str, Depends(login)]):
|
||||||
return mock.hospRoutes
|
return mock.hospRoutes
|
||||||
|
|||||||
@ -133,3 +133,15 @@ class VITACORE_API(AsyncClient):
|
|||||||
case _:
|
case _:
|
||||||
self.logger.error(req.json())
|
self.logger.error(req.json())
|
||||||
raise e.UnknownException
|
raise e.UnknownException
|
||||||
|
|
||||||
|
async def getHospRecommendations(self, patId: str):
|
||||||
|
req = await self.get(
|
||||||
|
'/getHospRecommendations', params={'patId': patId}
|
||||||
|
)
|
||||||
|
|
||||||
|
match req.status_code:
|
||||||
|
case st.HTTP_200_OK:
|
||||||
|
return s.HospRecommendationsModel.model_validate(req.json())
|
||||||
|
case _:
|
||||||
|
self.logger.error(req.json())
|
||||||
|
raise e.UnknownException
|
||||||
|
|||||||
@ -443,7 +443,7 @@ class HospitalizationModel(BaseModel):
|
|||||||
title='Идентификатор случая госпитализации',
|
title='Идентификатор случая госпитализации',
|
||||||
examples=['ddfa23ea-b0de-4d88-8abe-7d6a7a241df1'],
|
examples=['ddfa23ea-b0de-4d88-8abe-7d6a7a241df1'],
|
||||||
)
|
)
|
||||||
CreationDateTime: str = Field(
|
CreationDateTime: datetime = Field(
|
||||||
title='Дата и время регистрации', examples=['2025-07-10 17:29']
|
title='Дата и время регистрации', examples=['2025-07-10 17:29']
|
||||||
)
|
)
|
||||||
ReceptionDiagnosis: str = Field(
|
ReceptionDiagnosis: str = Field(
|
||||||
@ -477,3 +477,26 @@ class HospitalizationsModel(BaseModel):
|
|||||||
Hospitalizations: list[HospitalizationModel] = Field(
|
Hospitalizations: list[HospitalizationModel] = Field(
|
||||||
title='Список госпитализаций'
|
title='Список госпитализаций'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class RecommendationModel(BaseModel):
|
||||||
|
Type: str = Field(title='Тип осмотра', examples=['Осмотр', 'Эпикриз'])
|
||||||
|
DateTime: datetime = Field(
|
||||||
|
title='Дата и время создания', examples=['18.07.2025 8:30:43']
|
||||||
|
)
|
||||||
|
Recommendation: str = Field(
|
||||||
|
title='Текст рекомендации', examples=['рекомендации тест']
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class HospRecommendationsModel(BaseModel):
|
||||||
|
EventID: str = Field(
|
||||||
|
title='Идентификатор случая госпитализации',
|
||||||
|
examples=['ddfa23ea-b0de-4d88-8abe-7d6a7a241df1'],
|
||||||
|
)
|
||||||
|
EventDate: datetime = Field(
|
||||||
|
title='Дата обращения', examples=['2025-07-10']
|
||||||
|
)
|
||||||
|
Recommendations: list[RecommendationModel] = Field(
|
||||||
|
title='Список рекомендаций'
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user