Добавлен эндпоинт getHospExaminations
This commit is contained in:
@ -93,6 +93,17 @@ async def get_routes_list():
|
||||
)
|
||||
|
||||
|
||||
@router.get('/getHospExaminations')
|
||||
async def get_hosp_examinations():
|
||||
"""
|
||||
Get list of hospital examinations.
|
||||
"""
|
||||
return await c.vitacore_api.getHospExaminations(
|
||||
'7bbdac30-9a33-4f13-9458-2c229c0c20f5',
|
||||
'f22be2c9-8e68-42d6-851e-fbf4a5e8f657',
|
||||
)
|
||||
|
||||
|
||||
@router.post('/measurement', status_code=status.HTTP_202_ACCEPTED)
|
||||
async def measurement(
|
||||
user: Annotated[str, Depends(login)],
|
||||
|
||||
@ -100,3 +100,16 @@ class VITACORE_API(AsyncClient):
|
||||
case _:
|
||||
self.logger.error(req.json())
|
||||
raise e.UnknownException
|
||||
|
||||
async def getHospExaminations(self, patId: str, examId: str):
|
||||
req = await self.get(
|
||||
'/getHospExaminations',
|
||||
params={'patId': patId, 'examId': examId},
|
||||
)
|
||||
|
||||
match req.status_code:
|
||||
case st.HTTP_200_OK:
|
||||
return s.HospExaminationsModel.model_validate(req.json())
|
||||
case _:
|
||||
self.logger.error(req.json())
|
||||
raise e.UnknownException
|
||||
|
||||
@ -333,3 +333,50 @@ class RoutesListModel(BaseModel):
|
||||
)
|
||||
LpuName: str = Field(title='Наименование МО', examples=['ГАУЗ "ГКБ №7"'])
|
||||
Routes: list[RouteModel] = Field(title='Список направлений')
|
||||
|
||||
|
||||
class SEMDModel(BaseModel):
|
||||
SEMDContent: str = Field(
|
||||
title='СЭМД (XML сжатый методом шифрования Base64)',
|
||||
examples=['77u/PD94bWwgdmVyc2lvbj0iMS...'],
|
||||
)
|
||||
|
||||
|
||||
class ExaminationModel(BaseModel):
|
||||
ExaminationId: str = Field(
|
||||
title='Идентификатор осмотра',
|
||||
examples=['f22be2c9-8e68-42d6-851e-fbf4a5e8f657'],
|
||||
)
|
||||
DateTime: str = Field(
|
||||
title='Дата и время создания', examples=['01.08.2025 15:47:15']
|
||||
)
|
||||
Resource: str = Field(
|
||||
title='Врач', examples=['Абдуллина Ирина Владимировна']
|
||||
)
|
||||
Speciality: str = Field(
|
||||
title='Специальность врача', examples=['Акушер-гинеколог']
|
||||
)
|
||||
ExaminationText: str = Field(
|
||||
title='Текст осмотра',
|
||||
examples=[
|
||||
'<TABLE id=e0f61ef0-8f5e-42c6-95b6-4074715902e6 class=Complaint '
|
||||
'style="BORDER-TOP: #ffffff 1px..... </TABLE>'
|
||||
],
|
||||
)
|
||||
Recommendation: str = Field(
|
||||
title='Идентификатор результата исследования',
|
||||
examples=['рекомендации 1 тест'],
|
||||
)
|
||||
SEMDs: list[SEMDModel] = Field(title='Список СЭМД')
|
||||
|
||||
|
||||
class HospExaminationsModel(BaseModel):
|
||||
EventID: str = Field(
|
||||
title='Идентификатор случая госпитализации',
|
||||
examples=['2f7d395d-f5fc-4a0e-af2d-855324f6e7f1'],
|
||||
)
|
||||
EventDate: datetime = Field(
|
||||
title='Дата обращения', examples=['2025-08-01']
|
||||
)
|
||||
LpuName: str = Field(title='Наименование МО', examples=['ГАУЗ "ГКБ №7"'])
|
||||
Examinations: list[ExaminationModel] = Field(title='Список осмотров')
|
||||
|
||||
Reference in New Issue
Block a user