Пример #1
0
def handle_resources(resource_type, resource_id):
    if resource_type in [
            'callsets', 'variantsets', 'readgroupsets', 'referencesets',
            'variant'
    ]:
        if request.method == 'GET':
            return ga4gh.api.ga_handle_read(request, resource_type,
                                            resource_id)
    elif resource_type in [
            'variantset', 'genomes', 'files', 'runs', 'genomes'
    ]:
        if request.method == 'GET':
            return basespace.api.bs_handle_read(request, resource_type,
                                                resource_id)
    elif resource_type in RESOURCES:
        if request.method == 'GET':
            return ttam.api.ttam_handle_read(request, resource_type,
                                             resource_id)
    else:
        return fhir_error.inform_not_found()

    request.api_base = util.get_api_base()
    fhir_request = fhir_api.FHIRRequest(request, is_resource=False)

    if request.method == 'GET':
        return fhir_api.handle_read(fhir_request, resource_type, resource_id)
    elif request.method == 'PUT':
        return fhir_api.handle_update(fhir_request, resource_type, resource_id)
    else:
        return fhir_api.handle_delete(fhir_request, resource_type, resource_id)
Пример #2
0
def handle_resources(resource_type, resource_id):
    if resource_type in ['callsets', 'variantsets', 'readgroupsets', 'referencesets', 'variant']:
        if request.method == 'GET':
            return ga4gh.api.ga_handle_read(request, resource_type, resource_id)
    elif resource_type in ['variantset', 'genomes', 'files', 'runs', 'genomes']:
        if request.method == 'GET':
            return basespace.api.bs_handle_read(request, resource_type, resource_id)
    elif resource_type in RESOURCES:
        if request.method == 'GET':
            return ttam.api.ttam_handle_read(request, resource_type, resource_id)
    else:
        return fhir_error.inform_not_found()



    request.api_base = util.get_api_base() 
    fhir_request = fhir_api.FHIRRequest(request, is_resource=False)

    if request.method == 'GET':
        return fhir_api.handle_read(fhir_request,
                                    resource_type,
                                    resource_id)
    elif request.method == 'PUT':
        return fhir_api.handle_update(fhir_request,
                                      resource_type,
                                      resource_id)
    else:
        return fhir_api.handle_delete(fhir_request,
                                      resource_type,
                                      resource_id)
Пример #3
0
def handle_resources(resource_type, resource_id):
    if resource_type not in RESOURCES:
        return fhir_error.inform_not_found()

    request.api_base = util.get_api_base()
    fhir_request = fhir_api.FHIRRequest(request, is_resource=False)

    if request.method == 'GET':
        return fhir_api.handle_read(fhir_request, resource_type, resource_id)
    elif request.method == 'PUT':
        return fhir_api.handle_update(fhir_request, resource_type, resource_id)
    else:
        return fhir_api.handle_delete(fhir_request, resource_type, resource_id)
Пример #4
0
def handle_resources(resource_type, resource_id):
    if resource_type not in RESOURCES:
        return fhir_error.inform_not_found()

    request.api_base = util.get_api_base()
    fhir_request = fhir_api.FHIRRequest(request, is_resource=False)

    if request.method == "GET":
        return fhir_api.handle_read(fhir_request, resource_type, resource_id)
    elif request.method == "PUT":
        return fhir_api.handle_update(fhir_request, resource_type, resource_id)
    else:
        return fhir_api.handle_delete(fhir_request, resource_type, resource_id)