Добавлен эндпоинт getDiagnosticResults
This commit is contained in:
@ -144,6 +144,16 @@ async def get_hosp_routes():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@router.get('/getDiagnosticResults')
|
||||||
|
async def get_diagnostic_results():
|
||||||
|
"""
|
||||||
|
Get list of diagnostic results.
|
||||||
|
"""
|
||||||
|
return await c.vitacore_api.getDiagnosticResults(
|
||||||
|
'4867cc79-9805-4ae2-98d3-2f822848635e'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@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)],
|
||||||
@ -213,11 +223,6 @@ async def get_elns(user: Annotated[str, Depends(login)]):
|
|||||||
return mock.elns[0]
|
return mock.elns[0]
|
||||||
|
|
||||||
|
|
||||||
@router.get('/getDiagnosticResults')
|
|
||||||
async def get_diagnostic_results(user: Annotated[str, Depends(login)]):
|
|
||||||
return mock.diagnosticResults
|
|
||||||
|
|
||||||
|
|
||||||
@router.get('/getPatFLG')
|
@router.get('/getPatFLG')
|
||||||
async def get_pat_flg(user: Annotated[str, Depends(login)]):
|
async def get_pat_flg(user: Annotated[str, Depends(login)]):
|
||||||
return mock.patFLG[0]
|
return mock.patFLG[0]
|
||||||
|
|||||||
@ -155,3 +155,13 @@ class VITACORE_API(AsyncClient):
|
|||||||
case _:
|
case _:
|
||||||
self.logger.error(req.json())
|
self.logger.error(req.json())
|
||||||
raise e.UnknownException
|
raise e.UnknownException
|
||||||
|
|
||||||
|
async def getDiagnosticResults(self, patId: str):
|
||||||
|
req = await self.get('/getDiagnosticResults', params={'patId': patId})
|
||||||
|
|
||||||
|
match req.status_code:
|
||||||
|
case st.HTTP_200_OK:
|
||||||
|
return s.DiagnosticResultsModel.model_validate(req.json())
|
||||||
|
case _:
|
||||||
|
self.logger.error(req.json())
|
||||||
|
raise e.UnknownException
|
||||||
|
|||||||
@ -516,3 +516,39 @@ class HospRoutesModel(BaseModel):
|
|||||||
RoutesToDiagnostic: list[RouteToDiagnosticModel] = Field(
|
RoutesToDiagnostic: list[RouteToDiagnosticModel] = Field(
|
||||||
title='Направления на услугу'
|
title='Направления на услугу'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class DiagnosticResultModel(BaseModel):
|
||||||
|
DiagResultID: str = Field(
|
||||||
|
title='Идентификатор результата исследования',
|
||||||
|
examples=['1407910a-1901-4b21-be2d-0ef89041f4fe'],
|
||||||
|
)
|
||||||
|
ContainsFile: str = Field(
|
||||||
|
title='Признак наличия файла исследования (из ЛИС)', examples=['0']
|
||||||
|
)
|
||||||
|
PostingDate: datetime = Field(
|
||||||
|
title='Дата направления', examples=['2025-05-06']
|
||||||
|
)
|
||||||
|
MedServiceCode: str = Field(
|
||||||
|
title='Код исследования', examples=['A12.05.004.002']
|
||||||
|
)
|
||||||
|
MedServiceName: str = Field(
|
||||||
|
title='Наименование исследования',
|
||||||
|
examples=[
|
||||||
|
'Проба на совместимость перед переливанием эритроцитов по '
|
||||||
|
'неполным антителам (IgG)'
|
||||||
|
],
|
||||||
|
)
|
||||||
|
PostName: str = Field(title='Врач', examples=['Сиразиева Г.Р.'])
|
||||||
|
PostSpec: str = Field(title='Специальность', examples=['Терапевт'])
|
||||||
|
LpuName: str = Field(title='Наименование МО', examples=['ГАУЗ "ГКБ №7"'])
|
||||||
|
EventID: str = Field(
|
||||||
|
title='Идентификатор случая',
|
||||||
|
examples=['36cf2c90-fdad-4961-899c-652c5e0817a9'],
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class DiagnosticResultsModel(BaseModel):
|
||||||
|
DainosticsResults: list[DiagnosticResultModel] = Field(
|
||||||
|
title='Список результатов исследований'
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user