コード例 #1
0
def oauth_update(request, resource_type, id):
    if request.method == "PUT":
        return update(request, resource_type)
    elif request.method == "GET":
        return read(request, resource_type, id)
    if settings.DEBUG:
        print("fhir/oauth2/update: Passed protected_resource check:", request, resource_type, id)
    return HttpResponse(status=501)
コード例 #2
0
def oauth_update(request, resource_type, id):
    if request.method == "PUT":
        return update(request, resource_type)
    elif request.method == "GET":
        return read(request, resource_type, id)
    if settings.DEBUG:
        print("fhir/oauth2/update: Passed protected_resource check:", request, resource_type, id)
    return HttpResponse(status=501)
コード例 #3
0
ファイル: rud.py プロジェクト: govtmirror/BlueButtonFHIR_API
def read_or_update_or_delete(request, resource_type, id):
    """Route to read, update, or delete based on HTTP method FHIR Interaction"""

    if request.method == 'GET':
        # Read
        return read(request, resource_type, id)
    elif request.method == 'PUT':
        # update
        return update(request, resource_type, id)
    elif request.method == 'DELETE':
        # delete
        return delete(request, resource_type, id)
    #else:
    # Not supported.
    msg = "HTTP method %s not supported at this URL." % (request.method)
    return kickout_400(msg)