Exemplo n.º 1
0
def test_get_patient_everything(test_dataset, test_fhir_store, capsys):
    fhir_resources.create_resource(service_account_json, base_url, project_id,
                                   cloud_region, dataset_id, fhir_store_id,
                                   resource_type)

    resource = fhir_resources.search_resources_get(service_account_json,
                                                   base_url, project_id,
                                                   cloud_region, dataset_id,
                                                   fhir_store_id,
                                                   resource_type)

    # Save the resource_id from the object returned by search_resources()
    # because you need to pass it into get_resource() and delete_resource()
    resource_id = resource["entry"][0]["resource"]["id"]

    fhir_resources.get_patient_everything(service_account_json, base_url,
                                          project_id, cloud_region, dataset_id,
                                          fhir_store_id, resource_id)

    fhir_resources.delete_resource(service_account_json, base_url, project_id,
                                   cloud_region, dataset_id, fhir_store_id,
                                   resource_type, resource_id)

    out, _ = capsys.readouterr()

    assert 'id' in out
def test_get_patient_everything(test_dataset, test_fhir_store, test_patient,
                                capsys):
    fhir_resources.get_patient_everything(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        fhir_store_id,
        test_patient,
    )

    out, _ = capsys.readouterr()

    # get_patient_everything test
    assert "id" in out
def test_get_patient_everything(test_dataset, test_fhir_store, capsys):
    fhir_resources.create_resource(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        fhir_store_id,
        resource_type)

    resource = fhir_resources.search_resources_get(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        fhir_store_id,
        resource_type)

    # Save the resource_id from the object returned by search_resources()
    # because you need to pass it into get_resource() and delete_resource()
    resource_id = resource["entry"][0]["resource"]["id"]

    fhir_resources.get_patient_everything(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        fhir_store_id,
        resource_id)

    fhir_resources.delete_resource(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        fhir_store_id,
        resource_type,
        resource_id)

    out, _ = capsys.readouterr()

    assert 'id' in out
def test_get_patient_everything(test_dataset, test_fhir_store, capsys):
    response = fhir_resources.create_resource(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        fhir_store_id,
        resource_type)

    # Save the resource_id because you need to pass it into later tests
    resource_id = response.json()['id']

    fhir_resources.search_resources_get(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        fhir_store_id,
        resource_type)

    fhir_resources.get_patient_everything(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        fhir_store_id,
        resource_id)

    fhir_resources.delete_resource(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        fhir_store_id,
        resource_type,
        resource_id)

    out, _ = capsys.readouterr()

    assert 'id' in out
def test_get_patient_everything(test_dataset, test_fhir_store, capsys):
    response = fhir_resources.create_resource(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        fhir_store_id,
        resource_type)

    # Save the resource_id because you need to pass it into later tests
    resource_id = response.json()['id']

    fhir_resources.search_resources_get(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        fhir_store_id,
        resource_type)

    fhir_resources.get_patient_everything(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        fhir_store_id,
        resource_id)

    fhir_resources.delete_resource(
        service_account_json,
        base_url,
        project_id,
        cloud_region,
        dataset_id,
        fhir_store_id,
        resource_type,
        resource_id)

    out, _ = capsys.readouterr()

    assert 'id' in out