Files
HospitalAssistantBackend/src/apps/vitacore/v1/router.py
Miwory 19cad74587
All checks were successful
Build And Push / publish (push) Successful in 1m28s
Patch
2025-12-16 16:02:33 +03:00

31 lines
669 B
Python

from logging import getLogger
from fastapi import APIRouter
from orjson import loads
from shared.redis import client as cache
from . import schema as s
logger = getLogger(__name__)
router = APIRouter(
prefix='/vitacore',
tags=[
'Витакор',
],
)
@router.post('/hospComplaint')
async def callback(complaint: s.HospComplaint):
value = await cache.get(f'complaint:{complaint.patID}')
value = loads(value.decode()) if value else ''
return s.ComplaintData(
patId=complaint.patID,
complaints=(
f'{value} | {complaint.eventId} | {complaint.datetime} | '
f'{complaint.MO_id}'
),
)