예제 #1
0
파일: files.py 프로젝트: wooque/openpacs
    async def post(self, request):
        file_id = get_id(request)
        data = await request.json()

        async with get_conn() as conn:
            key = await SharedFiles(conn).share(file_id, data['duration'])
        return UJSONResponse({'key': key})
예제 #2
0
파일: files.py 프로젝트: wooque/openpacs
 async def post(self, request):
     file_id = get_id(request)
     data = await request.json()
     if 'tools_state' in data:
         async with get_conn() as conn:
             await Files(conn).update_tools_state(
                 file_id,
                 request.user.id,
                 data['tools_state'],
             )
     return UJSONResponse(data)
예제 #3
0
파일: files.py 프로젝트: wooque/openpacs
    async def get(self, request):
        file_id = get_id(request)
        if not file_id:
            raise HTTPException(status_code=404)

        async with get_conn() as conn:
            master = await Replica(conn).master()
            file = await ReplicaFiles(conn).get_file_from_replica(
                master['id'], file_id)
            storage = await Storage.get(master)

        if not file:
            raise HTTPException(status_code=404)
        return await storage.serve(file)
예제 #4
0
async def get_patient_by_id(request):
    patient_id = get_id(request)
    async with get_conn() as conn:
        return await Patient(conn).get_extra(patient_id)
예제 #5
0
파일: files.py 프로젝트: wooque/openpacs
    async def get(self, request):
        file_id = get_id(request)
        async with get_conn() as conn:
            data = await FileChange(conn).for_file(file_id)

        return UJSONResponse({'data': data})