Skip to content

Commit

Permalink
chore: some lint fixes (#3746)
Browse files Browse the repository at this point in the history
  • Loading branch information
Takashi Matsuo authored May 12, 2020
1 parent 31baf7a commit 369dcca
Show file tree
Hide file tree
Showing 17 changed files with 59 additions and 47 deletions.
5 changes: 3 additions & 2 deletions healthcare/api-client/fhir/fhir_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from google.auth.transport import requests
from google.oauth2 import service_account


_BASE_URL = "https://healthcare.googleapis.com/v1beta1"


Expand Down Expand Up @@ -95,7 +96,7 @@ def create_encounter(
):
"""Creates a new Encounter resource in a FHIR store based on a Patient."""
url = "{}/projects/{}/locations/{}".format(
base_url, project_id, cloud_region, patient_id
base_url, project_id, cloud_region
)

fhir_store_path = "{}/datasets/{}/fhirStores/{}/fhir/Encounter".format(
Expand Down Expand Up @@ -152,7 +153,7 @@ def create_observation(
an Encounter.
"""
url = "{}/projects/{}/locations/{}".format(
base_url, project_id, cloud_region, patient_id
base_url, project_id, cloud_region
)

fhir_store_path = "{}/datasets/{}/fhirStores/{}/fhir/Observation".format(
Expand Down
9 changes: 5 additions & 4 deletions healthcare/api-client/fhir/fhir_resources_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@
# limitations under the License.

import os
import pytest
import sys
import uuid

import backoff
import pytest
from requests.exceptions import HTTPError

# Add datasets for bootstrapping datasets for testing
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "datasets")) # noqa
import datasets
import fhir_stores
import fhir_resources
import datasets # noqa
import fhir_stores # noqa
import fhir_resources # noqa


cloud_region = "us-central1"
base_url = "https://healthcare.googleapis.com/v1beta1"
Expand Down
2 changes: 1 addition & 1 deletion healthcare/api-client/fhir/fhir_stores.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import argparse
import os

from googleapiclient import discovery
from google.oauth2 import service_account
from googleapiclient import discovery


# [START healthcare_get_client]
Expand Down
10 changes: 6 additions & 4 deletions healthcare/api-client/fhir/fhir_stores_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@
# limitations under the License.

import os
import pytest
import sys
import time
import uuid

from google.cloud import exceptions, storage
from google.cloud import exceptions
from google.cloud import storage
import pytest

# Add datasets for bootstrapping datasets for testing
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "datasets")) # noqa
import datasets
import fhir_stores
import datasets # noqa
import fhir_stores # noqa


cloud_region = "us-central1"
project_id = os.environ["GOOGLE_CLOUD_PROJECT"]
Expand Down
4 changes: 2 additions & 2 deletions healthcare/api-client/hl7v2/hl7v2_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import json
import os

from google.oauth2 import service_account
from googleapiclient import discovery
from googleapiclient.errors import HttpError
from google.oauth2 import service_account


# [START healthcare_get_client]
Expand Down Expand Up @@ -212,7 +212,7 @@ def patch_hl7v2_message(
"""Updates the message."""
client = get_client(service_account_json)
hl7v2_message_parent = 'projects/{}/locations/{}'.format(
project_id, cloud_region, dataset_id, hl7v2_store_id)
project_id, cloud_region)
hl7v2_message_name = '{}/datasets/{}/hl7V2Stores/{}/messages/{}'.format(
hl7v2_message_parent, dataset_id, hl7v2_store_id, hl7v2_message_id)

Expand Down
9 changes: 5 additions & 4 deletions healthcare/api-client/hl7v2/hl7v2_messages_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@
# limitations under the License.

import os
import pytest
import sys
import uuid

import backoff
import pytest

# Add datasets for bootstrapping datasets for testing
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'datasets')) # noqa
import datasets
import hl7v2_stores
import hl7v2_messages
import datasets # noqa
import hl7v2_messages # noqa
import hl7v2_stores # noqa


cloud_region = 'us-central1'
project_id = os.environ['GOOGLE_CLOUD_PROJECT']
Expand Down
2 changes: 1 addition & 1 deletion healthcare/api-client/hl7v2/hl7v2_stores.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
import argparse
import os

from google.oauth2 import service_account
from googleapiclient import discovery
from googleapiclient.errors import HttpError
from google.oauth2 import service_account


# [START healthcare_get_client]
Expand Down
10 changes: 6 additions & 4 deletions healthcare/api-client/hl7v2/hl7v2_stores_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
# limitations under the License.

import os
import pytest
import sys
import uuid

import pytest

# Add datasets for bootstrapping datasets for testing
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'datasets')) # noqa
import datasets
import hl7v2_stores
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'datasets')) # noqa
import datasets # noqa
import hl7v2_stores # noqa


cloud_region = 'us-central1'
project_id = os.environ['GOOGLE_CLOUD_PROJECT']
Expand Down
3 changes: 2 additions & 1 deletion healthcare/api-client/v1/datasets/datasets_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
# limitations under the License.

import os
import pytest
import uuid

from googleapiclient.errors import HttpError
import pytest
from retrying import retry

import datasets


cloud_region = 'us-central1'
project_id = os.environ['GOOGLE_CLOUD_PROJECT']

Expand Down
7 changes: 4 additions & 3 deletions healthcare/api-client/v1/dicom/dicom_stores_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@
# limitations under the License.

import os
import pytest
import sys
import uuid

import backoff
from googleapiclient.errors import HttpError
import pytest

# Add datasets for bootstrapping datasets for testing
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "datasets")) # noqa
import datasets
import dicom_stores
import datasets # noqa
import dicom_stores # noqa


cloud_region = "us-central1"
project_id = os.environ["GOOGLE_CLOUD_PROJECT"]
Expand Down
8 changes: 4 additions & 4 deletions healthcare/api-client/v1/dicom/dicomweb_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
# limitations under the License.

import os
import pytest
import sys
import uuid

import backoff
from googleapiclient.errors import HttpError
import pytest

# Add datasets for bootstrapping datasets for testing
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "datasets")) # noqa
import datasets
import dicom_stores
import dicomweb
import datasets # noqa
import dicom_stores # noqa
import dicomweb # noqa

cloud_region = "us-central1"
base_url = "https://healthcare.googleapis.com/v1"
Expand Down
4 changes: 2 additions & 2 deletions healthcare/api-client/v1/fhir/fhir_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def create_encounter(
):
"""Creates a new Encounter resource in a FHIR store based on a Patient."""
url = "{}/projects/{}/locations/{}".format(
base_url, project_id, cloud_region, patient_id
base_url, project_id, cloud_region
)

fhir_store_path = "{}/datasets/{}/fhirStores/{}/fhir/Encounter".format(
Expand Down Expand Up @@ -139,7 +139,7 @@ def create_observation(
an Encounter.
"""
url = "{}/projects/{}/locations/{}".format(
base_url, project_id, cloud_region, patient_id
base_url, project_id, cloud_region
)

fhir_store_path = "{}/datasets/{}/fhirStores/{}/fhir/Observation".format(
Expand Down
6 changes: 3 additions & 3 deletions healthcare/api-client/v1/fhir/fhir_resources_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

# Add datasets for bootstrapping datasets for testing
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "datasets")) # noqa
import datasets
import fhir_stores
import fhir_resources
import datasets # noqa
import fhir_stores # noqa
import fhir_resources # noqa

base_url = "https://healthcare.googleapis.com/v1"
cloud_region = "us-central1"
Expand Down
9 changes: 5 additions & 4 deletions healthcare/api-client/v1/fhir/fhir_stores_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
import uuid

import backoff
import pytest
from googleapiclient.errors import HttpError
from google.cloud import storage
from googleapiclient.errors import HttpError
import pytest

# Add datasets for bootstrapping datasets for testing
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "datasets")) # noqa
import datasets
import fhir_stores
import datasets # noqa
import fhir_stores # noqa


cloud_region = "us-central1"
project_id = os.environ["GOOGLE_CLOUD_PROJECT"]
Expand Down
2 changes: 1 addition & 1 deletion healthcare/api-client/v1/hl7v2/hl7v2_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def patch_hl7v2_message(
"""Updates the message."""
client = get_client()
hl7v2_message_parent = "projects/{}/locations/{}".format(
project_id, cloud_region, dataset_id, hl7v2_store_id
project_id, cloud_region
)
hl7v2_message_name = "{}/datasets/{}/hl7V2Stores/{}/messages/{}".format(
hl7v2_message_parent, dataset_id, hl7v2_store_id, hl7v2_message_id
Expand Down
9 changes: 5 additions & 4 deletions healthcare/api-client/v1/hl7v2/hl7v2_messages_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@
# limitations under the License.

import os
import pytest
import sys
import uuid

import backoff
from googleapiclient.errors import HttpError
import pytest

# Add datasets for bootstrapping datasets for testing
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "datasets")) # noqa
import datasets
import hl7v2_stores
import hl7v2_messages
import datasets # noqa
import hl7v2_messages # noqa
import hl7v2_stores # noqa


cloud_region = "us-central1"
project_id = os.environ["GOOGLE_CLOUD_PROJECT"]
Expand Down
7 changes: 4 additions & 3 deletions healthcare/api-client/v1/hl7v2/hl7v2_stores_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@
# limitations under the License.

import os
import pytest
import sys
import uuid

import backoff
from googleapiclient.errors import HttpError
import pytest

# Add datasets for bootstrapping datasets for testing
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "datasets")) # noqa
import datasets
import hl7v2_stores
import datasets # noqa
import hl7v2_stores # noqa


cloud_region = "us-central1"
project_id = os.environ["GOOGLE_CLOUD_PROJECT"]
Expand Down

0 comments on commit 369dcca

Please sign in to comment.