This commit is contained in:
@ -2,6 +2,10 @@ from logging import getLogger
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
from shared.redis import client as cache
|
||||
|
||||
from . import schema as s
|
||||
|
||||
logger = getLogger(__name__)
|
||||
router = APIRouter(
|
||||
prefix='/vitacore',
|
||||
@ -12,5 +16,14 @@ router = APIRouter(
|
||||
|
||||
|
||||
@router.post('/hospComplaint')
|
||||
async def callback():
|
||||
pass
|
||||
async def callback(complaint: s.HospComplaint):
|
||||
value = await cache.get(f'complaint:{complaint.patID}')
|
||||
value = value.decode() if value else ''
|
||||
|
||||
return s.ComplaintData(
|
||||
patId=complaint.patID,
|
||||
complaints=(
|
||||
f'{value} | {complaint.eventId} | {complaint.datetime} | '
|
||||
f'{complaint.MO_id}'
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user