Skip to content

healthcare API: update all HL7v2 v1beta1 samples to v1 #3388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
184 changes: 184 additions & 0 deletions healthcare/api-client/v1/hl7v2/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
.. This file is automatically generated. Do not edit this file directly.
Cloud Healthcare API Python Samples
===============================================================================

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/hl7v2/README.rst


This directory contains samples for Cloud Healthcare API. `Cloud Healthcare API`_ implements healthcare-native protocols and formats to accelerate ingestion, storage, analysis, and integration of healthcare data with cloud-based applications.
- See the `migration guide`_ for information about migrating to Python client library v0.25.1.

.. _migration guide: https://cloud.google.com/vision/docs/python-client-migration




.. _Cloud Healthcare API: https://cloud.google.com/healthcare/docs

Setup
-------------------------------------------------------------------------------


Authentication
++++++++++++++

This sample requires you to have authentication setup. Refer to the
`Authentication Getting Started Guide`_ for instructions on setting up
credentials for applications.

.. _Authentication Getting Started Guide:
https://cloud.google.com/docs/authentication/getting-started

Install Dependencies
++++++++++++++++++++

#. Clone python-docs-samples and change directory to the sample directory you want to use.

.. code-block:: bash
$ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
#. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions.

.. _Python Development Environment Setup Guide:
https://cloud.google.com/python/setup
#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.

.. code-block:: bash
$ virtualenv env
$ source env/bin/activate
#. Install the dependencies needed to run the samples.

.. code-block:: bash
$ pip install -r requirements.txt
.. _pip: https://pip.pypa.io/
.. _virtualenv: https://virtualenv.pypa.io/

Samples
-------------------------------------------------------------------------------

HL7v2 stores
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/hl7v2/hl7v2_stores.py,healthcare/api-client/hl7v2/README.rst




To run this sample:

.. code-block:: bash
$ python hl7v2_stores.py
usage: hl7v2_stores.py [-h] [--project_id PROJECT_ID] [--cloud_region CLOUD_REGION]
[--dataset_id DATASET_ID]
[--hl7v2_store_id HL7V2_STORE_ID]
[--pubsub_topic PUBSUB_TOPIC] [--member MEMBER]
[--role ROLE]
{create-hl7v2-store,delete-hl7v2-store,get-hl7v2-store,list-hl7v2-stores,patch-hl7v2-store,get_iam_policy,set_iam_policy}
...
positional arguments:
{create-hl7v2-store,delete-hl7v2-store,get-hl7v2-store,list-hl7v2-stores,patch-hl7v2-store,get_iam_policy,set_iam_policy}
create-hl7v2-store Creates a new HL7v2 store within the parent dataset.
delete-hl7v2-store Deletes the specified HL7v2 store.
get-hl7v2-store Gets the specified HL7v2 store.
list-hl7v2-stores Lists the HL7v2 stores in the given dataset.
patch-hl7v2-store Updates the HL7v2 store.
get_iam_policy Gets the IAM policy for the specified hl7v2 store.
set_iam_policy Sets the IAM policy for the specified hl7v2 store. A
single member will be assigned a single role. A member
can be any of: - allUsers, that is, anyone -
allAuthenticatedUsers, anyone authenticated with a
Google account - user:email, as in
'user:[email protected]' - group:email, as in
'group:[email protected]' - domain:domainname, as in
'domain:example.com' - serviceAccount:email, as in
'serviceAccount:my-other-
[email protected]' A role can be any IAM
role, such as 'roles/viewer', 'roles/owner', or
'roles/editor'
optional arguments:
-h, --help show this help message and exit
--project_id PROJECT_ID
GCP project name
--cloud_region CLOUD_REGION
GCP region
--dataset_id DATASET_ID
Name of dataset
--hl7v2_store_id HL7V2_STORE_ID
Name of HL7v2 store
--pubsub_topic PUBSUB_TOPIC
The Cloud Pub/Sub topic where notifications of changes
are published
--member MEMBER Member to add to IAM policy (e.g.
"domain:example.com")
--role ROLE IAM Role to give to member (e.g. "roles/viewer")
HL7v2 messages
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. image:: https://gstatic.com/cloudssh/images/open-btn.png
:target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=healthcare/api-client/hl7v2/hl7v2_messages.py,healthcare/api-client/hl7v2/README.rst




To run this sample:

.. code-block:: bash
$ python hl7v2_messages.py
usage: hl7v2_messages.py [-h] [--project_id PROJECT_ID]
[--cloud_region CLOUD_REGION]
[--dataset_id DATASET_ID]
[--hl7v2_store_id HL7V2_STORE_ID]
[--hl7v2_message_file HL7V2_MESSAGE_FILE]
[--hl7v2_message_id HL7V2_MESSAGE_ID]
[--label_key LABEL_KEY] [--label_value LABEL_VALUE]
{create-hl7v2-message,delete-hl7v2-message,get-hl7v2-message,ingest-hl7v2-message,list-hl7v2-messages,patch-hl7v2-message}
...
positional arguments:
{create-hl7v2-message,delete-hl7v2-message,get-hl7v2-message,ingest-hl7v2-message,list-hl7v2-messages,patch-hl7v2-message}
create-hl7v2-message
Creates an HL7v2 message and sends a notification to
the Cloud Pub/Sub topic.
delete-hl7v2-message
Deletes an HL7v2 message.
get-hl7v2-message Gets an HL7v2 message.
ingest-hl7v2-message
Ingests a new HL7v2 message from the hospital and
sends a notification to the Cloud Pub/Sub topic.
Return is an HL7v2 ACK message if the message was
successfully stored.
list-hl7v2-messages
Lists all the messages in the given HL7v2 store with
support for filtering.
patch-hl7v2-message
Updates the message.
optional arguments:
-h, --help show this help message and exit
--project_id PROJECT_ID
GCP project name
--cloud_region CLOUD_REGION
GCP region
--dataset_id DATASET_ID
Name of dataset
--hl7v2_store_id HL7V2_STORE_ID
Name of HL7v2 store
--hl7v2_message_file HL7V2_MESSAGE_FILE
A file containing a base64-encoded HL7v2 message
--hl7v2_message_id HL7V2_MESSAGE_ID
The identifier for the message returned by the server
--label_key LABEL_KEY
Arbitrary label key to apply to the message
--label_value LABEL_VALUE
Arbitrary label value to apply to the message
The client library
-------------------------------------------------------------------------------
This sample uses the `Google Cloud Client Library for Python`_.
You can read the documentation for more details on API usage and use GitHub
to `browse the source`_ and `report issues`_.
.. _Google Cloud Client Library for Python:
https://googlecloudplatform.github.io/google-cloud-python/
.. _browse the source:
https://github.com/GoogleCloudPlatform/google-cloud-python
.. _report issues:
https://github.com/GoogleCloudPlatform/google-cloud-python/issues
.. _Google Cloud SDK: https://cloud.google.com/sdk/
32 changes: 32 additions & 0 deletions healthcare/api-client/v1/hl7v2/README.rst.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This file is used to generate README.rst

product:
name: Cloud Healthcare API
short_name: Healthcare API
url: https://cloud.google.com/healthcare/docs
description: >
`Cloud Healthcare API`_ implements healthcare-native protocols and formats
to accelerate ingestion, storage, analysis, and integration of healthcare
data with cloud-based applications.

- See the `migration guide`_ for information about migrating to Python client library v0.25.1.


.. _migration guide: https://cloud.google.com/vision/docs/python-client-migration

setup:
- auth
- install_deps

samples:
- name: HL7v2 stores
file: hl7v2_stores.py
show_help: True

- name: HL7v2 messages
file: hl7v2_messages.py
show_help: True

cloud_client_library: true

folder: healthcare/api-client/v1/hl7v2
Loading