[e3d4e0a] | 1 | <?php
|
---|
| 2 | /*
|
---|
| 3 | * Copyright 2014 Google Inc.
|
---|
| 4 | *
|
---|
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
---|
| 6 | * use this file except in compliance with the License. You may obtain a copy of
|
---|
| 7 | * the License at
|
---|
| 8 | *
|
---|
| 9 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
| 10 | *
|
---|
| 11 | * Unless required by applicable law or agreed to in writing, software
|
---|
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
---|
| 13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
---|
| 14 | * License for the specific language governing permissions and limitations under
|
---|
| 15 | * the License.
|
---|
| 16 | */
|
---|
| 17 |
|
---|
| 18 | namespace Google\Service\CloudHealthcare\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\CloudHealthcare\CreateMessageRequest;
|
---|
| 21 | use Google\Service\CloudHealthcare\HealthcareEmpty;
|
---|
| 22 | use Google\Service\CloudHealthcare\IngestMessageRequest;
|
---|
| 23 | use Google\Service\CloudHealthcare\IngestMessageResponse;
|
---|
| 24 | use Google\Service\CloudHealthcare\ListMessagesResponse;
|
---|
| 25 | use Google\Service\CloudHealthcare\Message;
|
---|
| 26 |
|
---|
| 27 | /**
|
---|
| 28 | * The "messages" collection of methods.
|
---|
| 29 | * Typical usage is:
|
---|
| 30 | * <code>
|
---|
| 31 | * $healthcareService = new Google\Service\CloudHealthcare(...);
|
---|
| 32 | * $messages = $healthcareService->projects_locations_datasets_hl7V2Stores_messages;
|
---|
| 33 | * </code>
|
---|
| 34 | */
|
---|
| 35 | class ProjectsLocationsDatasetsHl7V2StoresMessages extends \Google\Service\Resource
|
---|
| 36 | {
|
---|
| 37 | /**
|
---|
| 38 | * Parses and stores an HL7v2 message. This method triggers an asynchronous
|
---|
| 39 | * notification to any Pub/Sub topic configured in
|
---|
| 40 | * Hl7V2Store.Hl7V2NotificationConfig, if the filtering matches the message. If
|
---|
| 41 | * an MLLP adapter is configured to listen to a Pub/Sub topic, the adapter
|
---|
| 42 | * transmits the message when a notification is received. (messages.create)
|
---|
| 43 | *
|
---|
| 44 | * @param string $parent Required. The name of the HL7v2 store this message
|
---|
| 45 | * belongs to.
|
---|
| 46 | * @param CreateMessageRequest $postBody
|
---|
| 47 | * @param array $optParams Optional parameters.
|
---|
| 48 | * @return Message
|
---|
| 49 | * @throws \Google\Service\Exception
|
---|
| 50 | */
|
---|
| 51 | public function create($parent, CreateMessageRequest $postBody, $optParams = [])
|
---|
| 52 | {
|
---|
| 53 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 54 | $params = array_merge($params, $optParams);
|
---|
| 55 | return $this->call('create', [$params], Message::class);
|
---|
| 56 | }
|
---|
| 57 | /**
|
---|
| 58 | * Deletes an HL7v2 message. (messages.delete)
|
---|
| 59 | *
|
---|
| 60 | * @param string $name Required. The resource name of the HL7v2 message to
|
---|
| 61 | * delete.
|
---|
| 62 | * @param array $optParams Optional parameters.
|
---|
| 63 | * @return HealthcareEmpty
|
---|
| 64 | * @throws \Google\Service\Exception
|
---|
| 65 | */
|
---|
| 66 | public function delete($name, $optParams = [])
|
---|
| 67 | {
|
---|
| 68 | $params = ['name' => $name];
|
---|
| 69 | $params = array_merge($params, $optParams);
|
---|
| 70 | return $this->call('delete', [$params], HealthcareEmpty::class);
|
---|
| 71 | }
|
---|
| 72 | /**
|
---|
| 73 | * Gets an HL7v2 message. (messages.get)
|
---|
| 74 | *
|
---|
| 75 | * @param string $name Required. The resource name of the HL7v2 message to
|
---|
| 76 | * retrieve.
|
---|
| 77 | * @param array $optParams Optional parameters.
|
---|
| 78 | *
|
---|
| 79 | * @opt_param string view Specifies which parts of the Message resource to
|
---|
| 80 | * return in the response. When unspecified, equivalent to FULL.
|
---|
| 81 | * @return Message
|
---|
| 82 | * @throws \Google\Service\Exception
|
---|
| 83 | */
|
---|
| 84 | public function get($name, $optParams = [])
|
---|
| 85 | {
|
---|
| 86 | $params = ['name' => $name];
|
---|
| 87 | $params = array_merge($params, $optParams);
|
---|
| 88 | return $this->call('get', [$params], Message::class);
|
---|
| 89 | }
|
---|
| 90 | /**
|
---|
| 91 | * Parses and stores an HL7v2 message. This method triggers an asynchronous
|
---|
| 92 | * notification to any Pub/Sub topic configured in
|
---|
| 93 | * Hl7V2Store.Hl7V2NotificationConfig, if the filtering matches the message. If
|
---|
| 94 | * an MLLP adapter is configured to listen to a Pub/Sub topic, the adapter
|
---|
| 95 | * transmits the message when a notification is received. If the method is
|
---|
| 96 | * successful, it generates a response containing an HL7v2 acknowledgment
|
---|
| 97 | * (`ACK`) message. If the method encounters an error, it returns a negative
|
---|
| 98 | * acknowledgment (`NACK`) message. This behavior is suitable for replying to
|
---|
| 99 | * HL7v2 interface systems that expect these acknowledgments. (messages.ingest)
|
---|
| 100 | *
|
---|
| 101 | * @param string $parent Required. The name of the HL7v2 store this message
|
---|
| 102 | * belongs to.
|
---|
| 103 | * @param IngestMessageRequest $postBody
|
---|
| 104 | * @param array $optParams Optional parameters.
|
---|
| 105 | * @return IngestMessageResponse
|
---|
| 106 | * @throws \Google\Service\Exception
|
---|
| 107 | */
|
---|
| 108 | public function ingest($parent, IngestMessageRequest $postBody, $optParams = [])
|
---|
| 109 | {
|
---|
| 110 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 111 | $params = array_merge($params, $optParams);
|
---|
| 112 | return $this->call('ingest', [$params], IngestMessageResponse::class);
|
---|
| 113 | }
|
---|
| 114 | /**
|
---|
| 115 | * Lists all the messages in the given HL7v2 store with support for filtering.
|
---|
| 116 | * Note: HL7v2 messages are indexed asynchronously, so there might be a slight
|
---|
| 117 | * delay between the time a message is created and when it can be found through
|
---|
| 118 | * a filter. (messages.listProjectsLocationsDatasetsHl7V2StoresMessages)
|
---|
| 119 | *
|
---|
| 120 | * @param string $parent Required. Name of the HL7v2 store to retrieve messages
|
---|
| 121 | * from.
|
---|
| 122 | * @param array $optParams Optional parameters.
|
---|
| 123 | *
|
---|
| 124 | * @opt_param string filter Restricts messages returned to those matching a
|
---|
| 125 | * filter. The following syntax is available: * A string field value can be
|
---|
| 126 | * written as text inside quotation marks, for example `"query text"`. The only
|
---|
| 127 | * valid relational operation for text fields is equality (`=`), where text is
|
---|
| 128 | * searched within the field, rather than having the field be equal to the text.
|
---|
| 129 | * For example, `"Comment = great"` returns messages with `great` in the comment
|
---|
| 130 | * field. * A number field value can be written as an integer, a decimal, or an
|
---|
| 131 | * exponential. The valid relational operators for number fields are the
|
---|
| 132 | * equality operator (`=`), along with the less than/greater than operators
|
---|
| 133 | * (`<`, `<=`, `>`, `>=`). Note that there is no inequality (`!=`) operator. You
|
---|
| 134 | * can prepend the `NOT` operator to an expression to negate it. * A date field
|
---|
| 135 | * value must be written in `yyyy-mm-dd` form. Fields with date and time use the
|
---|
| 136 | * RFC3339 time format. Leading zeros are required for one-digit months and
|
---|
| 137 | * days. The valid relational operators for date fields are the equality
|
---|
| 138 | * operator (`=`) , along with the less than/greater than operators (`<`, `<=`,
|
---|
| 139 | * `>`, `>=`). Note that there is no inequality (`!=`) operator. You can prepend
|
---|
| 140 | * the `NOT` operator to an expression to negate it. * Multiple field query
|
---|
| 141 | * expressions can be combined in one query by adding `AND` or `OR` operators
|
---|
| 142 | * between the expressions. If a boolean operator appears within a quoted
|
---|
| 143 | * string, it is not treated as special, it's just another part of the character
|
---|
| 144 | * string to be matched. You can prepend the `NOT` operator to an expression to
|
---|
| 145 | * negate it. Fields/functions available for filtering are: * `message_type`,
|
---|
| 146 | * from the MSH-9.1 field. For example, `NOT message_type = "ADT"`. *
|
---|
| 147 | * `send_date` or `sendDate`, the YYYY-MM-DD date the message was sent in the
|
---|
| 148 | * dataset's time_zone, from the MSH-7 segment. For example, `send_date <
|
---|
| 149 | * "2017-01-02"`. * `send_time`, the timestamp when the message was sent, using
|
---|
| 150 | * the RFC3339 time format for comparisons, from the MSH-7 segment. For example,
|
---|
| 151 | * `send_time < "2017-01-02T00:00:00-05:00"`. * `create_time`, the timestamp
|
---|
| 152 | * when the message was created in the HL7v2 store. Use the RFC3339 time format
|
---|
| 153 | * for comparisons. For example, `create_time < "2017-01-02T00:00:00-05:00"`. *
|
---|
| 154 | * `send_facility`, the care center that the message came from, from the MSH-4
|
---|
| 155 | * segment. For example, `send_facility = "ABC"`. * `PatientId(value, type)`,
|
---|
| 156 | * which matches if the message lists a patient having an ID of the given value
|
---|
| 157 | * and type in the PID-2, PID-3, or PID-4 segments. For example,
|
---|
| 158 | * `PatientId("123456", "MRN")`. * `labels.x`, a string value of the label with
|
---|
| 159 | * key `x` as set using the Message.labels map. For example,
|
---|
| 160 | * `labels."priority"="high"`. The operator `:*` can be used to assert the
|
---|
| 161 | * existence of a label. For example, `labels."priority":*`.
|
---|
| 162 | * @opt_param string orderBy Orders messages returned by the specified order_by
|
---|
| 163 | * clause. Syntax:
|
---|
| 164 | * https://cloud.google.com/apis/design/design_patterns#sorting_order Fields
|
---|
| 165 | * available for ordering are: * `send_time`
|
---|
| 166 | * @opt_param int pageSize Limit on the number of messages to return in a single
|
---|
| 167 | * response. If not specified, 100 is used. May not be larger than 1000.
|
---|
| 168 | * @opt_param string pageToken The next_page_token value returned from the
|
---|
| 169 | * previous List request, if any.
|
---|
| 170 | * @opt_param string view Specifies the parts of the Message to return in the
|
---|
| 171 | * response. When unspecified, equivalent to BASIC. Setting this to anything
|
---|
| 172 | * other than BASIC with a `page_size` larger than the default can generate a
|
---|
| 173 | * large response, which impacts the performance of this method.
|
---|
| 174 | * @return ListMessagesResponse
|
---|
| 175 | * @throws \Google\Service\Exception
|
---|
| 176 | */
|
---|
| 177 | public function listProjectsLocationsDatasetsHl7V2StoresMessages($parent, $optParams = [])
|
---|
| 178 | {
|
---|
| 179 | $params = ['parent' => $parent];
|
---|
| 180 | $params = array_merge($params, $optParams);
|
---|
| 181 | return $this->call('list', [$params], ListMessagesResponse::class);
|
---|
| 182 | }
|
---|
| 183 | /**
|
---|
| 184 | * Update the message. The contents of the message in Message.data and data
|
---|
| 185 | * extracted from the contents such as Message.create_time cannot be altered.
|
---|
| 186 | * Only the Message.labels field is allowed to be updated. The labels in the
|
---|
| 187 | * request are merged with the existing set of labels. Existing labels with the
|
---|
| 188 | * same keys are updated. (messages.patch)
|
---|
| 189 | *
|
---|
| 190 | * @param string $name Output only. Resource name of the Message, of the form `p
|
---|
| 191 | * rojects/{project_id}/locations/{location_id}/datasets/{dataset_id}/hl7V2Store
|
---|
| 192 | * s/{hl7_v2_store_id}/messages/{message_id}`.
|
---|
| 193 | * @param Message $postBody
|
---|
| 194 | * @param array $optParams Optional parameters.
|
---|
| 195 | *
|
---|
| 196 | * @opt_param string updateMask Required. The update mask applies to the
|
---|
| 197 | * resource. For the `FieldMask` definition, see
|
---|
| 198 | * https://developers.google.com/protocol-
|
---|
| 199 | * buffers/docs/reference/google.protobuf#fieldmask
|
---|
| 200 | * @return Message
|
---|
| 201 | * @throws \Google\Service\Exception
|
---|
| 202 | */
|
---|
| 203 | public function patch($name, Message $postBody, $optParams = [])
|
---|
| 204 | {
|
---|
| 205 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 206 | $params = array_merge($params, $optParams);
|
---|
| 207 | return $this->call('patch', [$params], Message::class);
|
---|
| 208 | }
|
---|
| 209 | }
|
---|
| 210 |
|
---|
| 211 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 212 | class_alias(ProjectsLocationsDatasetsHl7V2StoresMessages::class, 'Google_Service_CloudHealthcare_Resource_ProjectsLocationsDatasetsHl7V2StoresMessages');
|
---|