This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
|
|
||||||
from fastapi import APIRouter
|
from fastapi import APIRouter
|
||||||
|
from orjson import loads
|
||||||
|
|
||||||
from shared.redis import client as cache
|
from shared.redis import client as cache
|
||||||
|
|
||||||
@ -18,7 +19,7 @@ router = APIRouter(
|
|||||||
@router.post('/hospComplaint')
|
@router.post('/hospComplaint')
|
||||||
async def callback(complaint: s.HospComplaint):
|
async def callback(complaint: s.HospComplaint):
|
||||||
value = await cache.get(f'complaint:{complaint.patID}')
|
value = await cache.get(f'complaint:{complaint.patID}')
|
||||||
value = value.decode() if value else ''
|
value = loads(value.decode()) if value else ''
|
||||||
|
|
||||||
return s.ComplaintData(
|
return s.ComplaintData(
|
||||||
patId=complaint.patID,
|
patId=complaint.patID,
|
||||||
|
|||||||
Reference in New Issue
Block a user