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
18namespace Google\Service\CloudHealthcare\Resource;
19
20use Google\Service\CloudHealthcare\HealthcareEmpty;
21use Google\Service\CloudHealthcare\HttpBody;
22use Google\Service\CloudHealthcare\SearchResourcesRequest;
23
24/**
25 * The "fhir" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $healthcareService = new Google\Service\CloudHealthcare(...);
29 *   $fhir = $healthcareService->fhir;
30 *  </code>
31 */
32class ProjectsLocationsDatasetsFhirStoresFhir extends \Google\Service\Resource
33{
34  /**
35   * Retrieves a Patient resource and resources related to that patient.
36   * Implements the FHIR extended operation Patient-everything
37   * ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/patient-
38   * operations.html#everything),
39   * [STU3](http://hl7.org/implement/standards/fhir/STU3/patient-
40   * operations.html#everything), [R4](http://hl7.org/implement/standards/fhir/R4
41   * /patient-operations.html#everything)). On success, the response body contains
42   * a JSON-encoded representation of a `Bundle` resource of type `searchset`,
43   * containing the results of the operation. Errors generated by the FHIR store
44   * contain a JSON-encoded `OperationOutcome` resource describing the reason for
45   * the error. If the request cannot be mapped to a valid API method on a FHIR
46   * store, a generic GCP error might be returned instead. The resources in scope
47   * for the response are: * The patient resource itself. * All the resources
48   * directly referenced by the patient resource. * Resources directly referencing
49   * the patient resource that meet the inclusion criteria. The inclusion criteria
50   * are based on the membership rules in the patient compartment definition
51   * ([DSTU2](http://hl7.org/fhir/DSTU2/compartment-patient.html),
52   * [STU3](http://www.hl7.org/fhir/stu3/compartmentdefinition-patient.html),
53   * [R4](http://hl7.org/fhir/R4/compartmentdefinition-patient.html)), which
54   * details the eligible resource types and referencing search parameters. For
55   * samples that show how to call `Patient-everything`, see [Getting all patient
56   * compartment resources](/healthcare/docs/how-tos/fhir-
57   * resources#getting_all_patient_compartment_resources).
58   * (fhir.PatientEverything)
59   *
60   * @param string $name Name of the `Patient` resource for which the information
61   * is required.
62   * @param array $optParams Optional parameters.
63   *
64   * @opt_param int _count Maximum number of resources in a page. If not
65   * specified, 100 is used. May not be larger than 1000.
66   * @opt_param string _page_token Used to retrieve the next or previous page of
67   * results when using pagination. Set `_page_token` to the value of _page_token
68   * set in next or previous page links' url. Next and previous page are returned
69   * in the response bundle's links field, where `link.relation` is "previous" or
70   * "next". Omit `_page_token` if no previous request has been made.
71   * @opt_param string _since If provided, only resources updated after this time
72   * are returned. The time uses the format YYYY-MM-DDThh:mm:ss.sss+zz:zz. For
73   * example, `2015-02-07T13:28:17.239+02:00` or `2017-01-01T00:00:00Z`. The time
74   * must be specified to the second and include a time zone.
75   * @opt_param string _type String of comma-delimited FHIR resource types. If
76   * provided, only resources of the specified resource type(s) are returned.
77   * @opt_param string end The response includes records prior to the end date. If
78   * no end date is provided, all records subsequent to the start date are in
79   * scope.
80   * @opt_param string start The response includes records subsequent to the start
81   * date. If no start date is provided, all records prior to the end date are in
82   * scope.
83   * @return HttpBody
84   */
85  public function PatientEverything($name, $optParams = [])
86  {
87    $params = ['name' => $name];
88    $params = array_merge($params, $optParams);
89    return $this->call('Patient-everything', [$params], HttpBody::class);
90  }
91  /**
92   * Deletes all the historical versions of a resource (excluding the current
93   * version) from the FHIR store. To remove all versions of a resource, first
94   * delete the current version and then call this method. This is not a FHIR
95   * standard operation. For samples that show how to call `Resource-purge`, see
96   * [Deleting historical versions of a FHIR resource](/healthcare/docs/how-tos
97   * /fhir-resources#deleting_historical_versions_of_a_fhir_resource).
98   * (fhir.ResourcePurge)
99   *
100   * @param string $name The name of the resource to purge.
101   * @param array $optParams Optional parameters.
102   * @return HealthcareEmpty
103   */
104  public function ResourcePurge($name, $optParams = [])
105  {
106    $params = ['name' => $name];
107    $params = array_merge($params, $optParams);
108    return $this->call('Resource-purge', [$params], HealthcareEmpty::class);
109  }
110  /**
111   * Validates an input FHIR resource's conformance to its profiles and the
112   * profiles configured on the FHIR store. Implements the FHIR extended operation
113   * $validate ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resource-
114   * operations.html#validate),
115   * [STU3](http://hl7.org/implement/standards/fhir/STU3/resource-
116   * operations.html#validate), or [R4](http://hl7.org/implement/standards/fhir/R4
117   * /resource-operation-validate.html)). The request body must contain a JSON-
118   * encoded FHIR resource, and the request headers must contain `Content-Type:
119   * application/fhir+json`. The `Parameters` input syntax is not supported. The
120   * `profile` query parameter can be used to request that the resource only be
121   * validated against a specific profile. If a profile with the given URL cannot
122   * be found in the FHIR store then an error is returned. Errors generated by
123   * validation contain a JSON-encoded `OperationOutcome` resource describing the
124   * reason for the error. If the request cannot be mapped to a valid API method
125   * on a FHIR store, a generic GCP error might be returned instead.
126   * (fhir.ResourceValidate)
127   *
128   * @param string $parent The name of the FHIR store that holds the profiles
129   * being used for validation.
130   * @param string $type The FHIR resource type of the resource being validated.
131   * For a complete list, see the FHIR Resource Index
132   * ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html),
133   * [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html), or
134   * [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). Must
135   * match the resource type in the provided content.
136   * @param HttpBody $postBody
137   * @param array $optParams Optional parameters.
138   *
139   * @opt_param string profile A profile that this resource should be validated
140   * against.
141   * @return HttpBody
142   */
143  public function ResourceValidate($parent, $type, HttpBody $postBody, $optParams = [])
144  {
145    $params = ['parent' => $parent, 'type' => $type, 'postBody' => $postBody];
146    $params = array_merge($params, $optParams);
147    return $this->call('Resource-validate', [$params], HttpBody::class);
148  }
149  /**
150   * Gets the FHIR capability statement ([STU3](http://hl7.org/implement/standards
151   * /fhir/STU3/capabilitystatement.html),
152   * [R4](http://hl7.org/implement/standards/fhir/R4/capabilitystatement.html)),
153   * or the [conformance
154   * statement](http://hl7.org/implement/standards/fhir/DSTU2/conformance.html) in
155   * the DSTU2 case for the store, which contains a description of functionality
156   * supported by the server. Implements the FHIR standard capabilities
157   * interaction
158   * ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#capabilities),
159   * [R4](http://hl7.org/implement/standards/fhir/R4/http.html#capabilities)), or
160   * the [conformance interaction](http://hl7.org/implement/standards/fhir/DSTU2/h
161   * ttp.html#conformance) in the DSTU2 case. On success, the response body
162   * contains a JSON-encoded representation of a `CapabilityStatement` resource.
163   * (fhir.capabilities)
164   *
165   * @param string $name Name of the FHIR store to retrieve the capabilities for.
166   * @param array $optParams Optional parameters.
167   * @return HttpBody
168   */
169  public function capabilities($name, $optParams = [])
170  {
171    $params = ['name' => $name];
172    $params = array_merge($params, $optParams);
173    return $this->call('capabilities', [$params], HttpBody::class);
174  }
175  /**
176   * Creates a FHIR resource. Implements the FHIR standard create interaction
177   * ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#create),
178   * [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#create),
179   * [R4](http://hl7.org/implement/standards/fhir/R4/http.html#create)), which
180   * creates a new resource with a server-assigned resource ID. The request body
181   * must contain a JSON-encoded FHIR resource, and the request headers must
182   * contain `Content-Type: application/fhir+json`. On success, the response body
183   * contains a JSON-encoded representation of the resource as it was created on
184   * the server, including the server-assigned resource ID and version ID. Errors
185   * generated by the FHIR store contain a JSON-encoded `OperationOutcome`
186   * resource describing the reason for the error. If the request cannot be mapped
187   * to a valid API method on a FHIR store, a generic GCP error might be returned
188   * instead. For samples that show how to call `create`, see [Creating a FHIR
189   * resource](/healthcare/docs/how-tos/fhir-resources#creating_a_fhir_resource).
190   * (fhir.create)
191   *
192   * @param string $parent The name of the FHIR store this resource belongs to.
193   * @param string $type The FHIR resource type to create, such as Patient or
194   * Observation. For a complete list, see the FHIR Resource Index
195   * ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html),
196   * [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html),
197   * [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)). Must
198   * match the resource type in the provided content.
199   * @param HttpBody $postBody
200   * @param array $optParams Optional parameters.
201   * @return HttpBody
202   */
203  public function create($parent, $type, HttpBody $postBody, $optParams = [])
204  {
205    $params = ['parent' => $parent, 'type' => $type, 'postBody' => $postBody];
206    $params = array_merge($params, $optParams);
207    return $this->call('create', [$params], HttpBody::class);
208  }
209  /**
210   * Deletes a FHIR resource. Implements the FHIR standard delete interaction
211   * ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#delete),
212   * [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#delete),
213   * [R4](http://hl7.org/implement/standards/fhir/R4/http.html#delete)). Note:
214   * Unless resource versioning is disabled by setting the
215   * disable_resource_versioning flag on the FHIR store, the deleted resources
216   * will be moved to a history repository that can still be retrieved through
217   * vread and related methods, unless they are removed by the purge method. For
218   * samples that show how to call `delete`, see [Deleting a FHIR
219   * resource](/healthcare/docs/how-tos/fhir-resources#deleting_a_fhir_resource).
220   * (fhir.delete)
221   *
222   * @param string $name The name of the resource to delete.
223   * @param array $optParams Optional parameters.
224   * @return HttpBody
225   */
226  public function delete($name, $optParams = [])
227  {
228    $params = ['name' => $name];
229    $params = array_merge($params, $optParams);
230    return $this->call('delete', [$params], HttpBody::class);
231  }
232  /**
233   * Executes all the requests in the given Bundle. Implements the FHIR standard
234   * batch/transaction interaction ([DSTU2](http://hl7.org/implement/standards/fhi
235   * r/DSTU2/http.html#transaction),
236   * [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#transaction),
237   * [R4](http://hl7.org/implement/standards/fhir/R4/http.html#transaction)).
238   * Supports all interactions within a bundle, except search. This method accepts
239   * Bundles of type `batch` and `transaction`, processing them according to the
240   * batch processing rules
241   * ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.16.1),
242   * [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.1),
243   * [R4](http://hl7.org/implement/standards/fhir/R4/http.html#brules)) and
244   * transaction processing rules
245   * ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#2.1.0.16.2),
246   * [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#2.21.0.17.2),
247   * [R4](http://hl7.org/implement/standards/fhir/R4/http.html#trules)). The
248   * request body must contain a JSON-encoded FHIR `Bundle` resource, and the
249   * request headers must contain `Content-Type: application/fhir+json`. For a
250   * batch bundle or a successful transaction the response body will contain a
251   * JSON-encoded representation of a `Bundle` resource of type `batch-response`
252   * or `transaction-response` containing one entry for each entry in the request,
253   * with the outcome of processing the entry. In the case of an error for a
254   * transaction bundle, the response body will contain a JSON-encoded
255   * `OperationOutcome` resource describing the reason for the error. If the
256   * request cannot be mapped to a valid API method on a FHIR store, a generic GCP
257   * error might be returned instead. For samples that show how to call
258   * `executeBundle`, see [Managing FHIR resources using FHIR
259   * bundles](/healthcare/docs/how-tos/fhir-bundles). (fhir.executeBundle)
260   *
261   * @param string $parent Name of the FHIR store in which this bundle will be
262   * executed.
263   * @param HttpBody $postBody
264   * @param array $optParams Optional parameters.
265   * @return HttpBody
266   */
267  public function executeBundle($parent, HttpBody $postBody, $optParams = [])
268  {
269    $params = ['parent' => $parent, 'postBody' => $postBody];
270    $params = array_merge($params, $optParams);
271    return $this->call('executeBundle', [$params], HttpBody::class);
272  }
273  /**
274   * Lists all the versions of a resource (including the current version and
275   * deleted versions) from the FHIR store. Implements the per-resource form of
276   * the FHIR standard history interaction
277   * ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#history),
278   * [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#history),
279   * [R4](http://hl7.org/implement/standards/fhir/R4/http.html#history)). On
280   * success, the response body contains a JSON-encoded representation of a
281   * `Bundle` resource of type `history`, containing the version history sorted
282   * from most recent to oldest versions. Errors generated by the FHIR store
283   * contain a JSON-encoded `OperationOutcome` resource describing the reason for
284   * the error. If the request cannot be mapped to a valid API method on a FHIR
285   * store, a generic GCP error might be returned instead. For samples that show
286   * how to call `history`, see [Listing FHIR resource versions](/healthcare/docs
287   * /how-tos/fhir-resources#listing_fhir_resource_versions). (fhir.history)
288   *
289   * @param string $name The name of the resource to retrieve.
290   * @param array $optParams Optional parameters.
291   *
292   * @opt_param string _at Only include resource versions that were current at
293   * some point during the time period specified in the date time value. The date
294   * parameter format is yyyy-mm-ddThh:mm:ss[Z|(+|-)hh:mm] Clients may specify any
295   * of the following: * An entire year: `_at=2019` * An entire month:
296   * `_at=2019-01` * A specific day: `_at=2019-01-20` * A specific second:
297   * `_at=2018-12-31T23:59:58Z`
298   * @opt_param int _count The maximum number of search results on a page. If not
299   * specified, 100 is used. May not be larger than 1000.
300   * @opt_param string _page_token Used to retrieve the first, previous, next, or
301   * last page of resource versions when using pagination. Value should be set to
302   * the value of `_page_token` set in next or previous page links' URLs. Next and
303   * previous page are returned in the response bundle's links field, where
304   * `link.relation` is "previous" or "next". Omit `_page_token` if no previous
305   * request has been made.
306   * @opt_param string _since Only include resource versions that were created at
307   * or after the given instant in time. The instant in time uses the format YYYY-
308   * MM-DDThh:mm:ss.sss+zz:zz (for example 2015-02-07T13:28:17.239+02:00 or
309   * 2017-01-01T00:00:00Z). The time must be specified to the second and include a
310   * time zone.
311   * @return HttpBody
312   */
313  public function history($name, $optParams = [])
314  {
315    $params = ['name' => $name];
316    $params = array_merge($params, $optParams);
317    return $this->call('history', [$params], HttpBody::class);
318  }
319  /**
320   * Updates part of an existing resource by applying the operations specified in
321   * a [JSON Patch](http://jsonpatch.com/) document. Implements the FHIR standard
322   * patch interaction
323   * ([STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#patch),
324   * [R4](http://hl7.org/implement/standards/fhir/R4/http.html#patch)). DSTU2
325   * doesn't define a patch method, but the server supports it in the same way it
326   * supports STU3. The request body must contain a JSON Patch document, and the
327   * request headers must contain `Content-Type: application/json-patch+json`. On
328   * success, the response body contains a JSON-encoded representation of the
329   * updated resource, including the server-assigned version ID. Errors generated
330   * by the FHIR store contain a JSON-encoded `OperationOutcome` resource
331   * describing the reason for the error. If the request cannot be mapped to a
332   * valid API method on a FHIR store, a generic GCP error might be returned
333   * instead. For samples that show how to call `patch`, see [Patching a FHIR
334   * resource](/healthcare/docs/how-tos/fhir-resources#patching_a_fhir_resource).
335   * (fhir.patch)
336   *
337   * @param string $name The name of the resource to update.
338   * @param HttpBody $postBody
339   * @param array $optParams Optional parameters.
340   * @return HttpBody
341   */
342  public function patch($name, HttpBody $postBody, $optParams = [])
343  {
344    $params = ['name' => $name, 'postBody' => $postBody];
345    $params = array_merge($params, $optParams);
346    return $this->call('patch', [$params], HttpBody::class);
347  }
348  /**
349   * Gets the contents of a FHIR resource. Implements the FHIR standard read
350   * interaction
351   * ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#read),
352   * [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#read),
353   * [R4](http://hl7.org/implement/standards/fhir/R4/http.html#read)). Also
354   * supports the FHIR standard conditional read interaction
355   * ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#cread),
356   * [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#cread),
357   * [R4](http://hl7.org/implement/standards/fhir/R4/http.html#cread)) specified
358   * by supplying an `If-Modified-Since` header with a date/time value or an `If-
359   * None-Match` header with an ETag value. On success, the response body contains
360   * a JSON-encoded representation of the resource. Errors generated by the FHIR
361   * store contain a JSON-encoded `OperationOutcome` resource describing the
362   * reason for the error. If the request cannot be mapped to a valid API method
363   * on a FHIR store, a generic GCP error might be returned instead. For samples
364   * that show how to call `read`, see [Getting a FHIR resource](/healthcare/docs
365   * /how-tos/fhir-resources#getting_a_fhir_resource). (fhir.read)
366   *
367   * @param string $name The name of the resource to retrieve.
368   * @param array $optParams Optional parameters.
369   * @return HttpBody
370   */
371  public function read($name, $optParams = [])
372  {
373    $params = ['name' => $name];
374    $params = array_merge($params, $optParams);
375    return $this->call('read', [$params], HttpBody::class);
376  }
377  /**
378   * Searches for resources in the given FHIR store according to criteria
379   * specified as query parameters. Implements the FHIR standard search
380   * interaction
381   * ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#search),
382   * [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#search),
383   * [R4](http://hl7.org/implement/standards/fhir/R4/http.html#search)) using the
384   * search semantics described in the FHIR Search specification
385   * ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/search.html),
386   * [STU3](http://hl7.org/implement/standards/fhir/STU3/search.html),
387   * [R4](http://hl7.org/implement/standards/fhir/R4/search.html)). Supports four
388   * methods of search defined by the specification: * `GET [base]?[parameters]`
389   * to search across all resources. * `GET [base]/[type]?[parameters]` to search
390   * resources of a specified type. * `POST [base]/_search?[parameters]` as an
391   * alternate form having the same semantics as the `GET` method across all
392   * resources. * `POST [base]/[type]/_search?[parameters]` as an alternate form
393   * having the same semantics as the `GET` method for the specified type. The
394   * `GET` and `POST` methods do not support compartment searches. The `POST`
395   * method does not support `application/x-www-form-urlencoded` search
396   * parameters. On success, the response body contains a JSON-encoded
397   * representation of a `Bundle` resource of type `searchset`, containing the
398   * results of the search. Errors generated by the FHIR store contain a JSON-
399   * encoded `OperationOutcome` resource describing the reason for the error. If
400   * the request cannot be mapped to a valid API method on a FHIR store, a generic
401   * GCP error might be returned instead. The server's capability statement,
402   * retrieved through capabilities, indicates what search parameters are
403   * supported on each FHIR resource. A list of all search parameters defined by
404   * the specification can be found in the FHIR Search Parameter Registry
405   * ([STU3](http://hl7.org/implement/standards/fhir/STU3/searchparameter-
406   * registry.html), [R4](http://hl7.org/implement/standards/fhir/R4
407   * /searchparameter-registry.html)). FHIR search parameters for DSTU2 can be
408   * found on each resource's definition page. Supported search modifiers:
409   * `:missing`, `:exact`, `:contains`, `:text`, `:in`, `:not-in`, `:above`,
410   * `:below`, `:[type]`, `:not`, and `:recurse`. Supported search result
411   * parameters: `_sort`, `_count`, `_include`, `_revinclude`, `_summary=text`,
412   * `_summary=data`, and `_elements`. The maximum number of search results
413   * returned defaults to 100, which can be overridden by the `_count` parameter
414   * up to a maximum limit of 1000. If there are additional results, the returned
415   * `Bundle` contains a link of `relation` "next", which has a `_page_token`
416   * parameter for an opaque pagination token that can be used to retrieve the
417   * next page. Resources with a total size larger than 5MB or a field count
418   * larger than 50,000 might not be fully searchable as the server might trim its
419   * generated search index in those cases. Note: FHIR resources are indexed
420   * asynchronously, so there might be a slight delay between the time a resource
421   * is created or changes and when the change is reflected in search results. For
422   * samples and detailed information, see [Searching for FHIR
423   * resources](/healthcare/docs/how-tos/fhir-search) and [Advanced FHIR search
424   * features](/healthcare/docs/how-tos/fhir-advanced-search). (fhir.search)
425   *
426   * @param string $parent Name of the FHIR store to retrieve resources from.
427   * @param SearchResourcesRequest $postBody
428   * @param array $optParams Optional parameters.
429   * @return HttpBody
430   */
431  public function search($parent, SearchResourcesRequest $postBody, $optParams = [])
432  {
433    $params = ['parent' => $parent, 'postBody' => $postBody];
434    $params = array_merge($params, $optParams);
435    return $this->call('search', [$params], HttpBody::class);
436  }
437  /**
438   * Searches for resources in the given FHIR store according to criteria
439   * specified as query parameters. Implements the FHIR standard search
440   * interaction
441   * ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#search),
442   * [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#search),
443   * [R4](http://hl7.org/implement/standards/fhir/R4/http.html#search)) using the
444   * search semantics described in the FHIR Search specification
445   * ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/search.html),
446   * [STU3](http://hl7.org/implement/standards/fhir/STU3/search.html),
447   * [R4](http://hl7.org/implement/standards/fhir/R4/search.html)). Supports four
448   * methods of search defined by the specification: * `GET [base]?[parameters]`
449   * to search across all resources. * `GET [base]/[type]?[parameters]` to search
450   * resources of a specified type. * `POST [base]/_search?[parameters]` as an
451   * alternate form having the same semantics as the `GET` method across all
452   * resources. * `POST [base]/[type]/_search?[parameters]` as an alternate form
453   * having the same semantics as the `GET` method for the specified type. The
454   * `GET` and `POST` methods do not support compartment searches. The `POST`
455   * method does not support `application/x-www-form-urlencoded` search
456   * parameters. On success, the response body contains a JSON-encoded
457   * representation of a `Bundle` resource of type `searchset`, containing the
458   * results of the search. Errors generated by the FHIR store contain a JSON-
459   * encoded `OperationOutcome` resource describing the reason for the error. If
460   * the request cannot be mapped to a valid API method on a FHIR store, a generic
461   * GCP error might be returned instead. The server's capability statement,
462   * retrieved through capabilities, indicates what search parameters are
463   * supported on each FHIR resource. A list of all search parameters defined by
464   * the specification can be found in the FHIR Search Parameter Registry
465   * ([STU3](http://hl7.org/implement/standards/fhir/STU3/searchparameter-
466   * registry.html), [R4](http://hl7.org/implement/standards/fhir/R4
467   * /searchparameter-registry.html)). FHIR search parameters for DSTU2 can be
468   * found on each resource's definition page. Supported search modifiers:
469   * `:missing`, `:exact`, `:contains`, `:text`, `:in`, `:not-in`, `:above`,
470   * `:below`, `:[type]`, `:not`, and `:recurse`. Supported search result
471   * parameters: `_sort`, `_count`, `_include`, `_revinclude`, `_summary=text`,
472   * `_summary=data`, and `_elements`. The maximum number of search results
473   * returned defaults to 100, which can be overridden by the `_count` parameter
474   * up to a maximum limit of 1000. If there are additional results, the returned
475   * `Bundle` contains a link of `relation` "next", which has a `_page_token`
476   * parameter for an opaque pagination token that can be used to retrieve the
477   * next page. Resources with a total size larger than 5MB or a field count
478   * larger than 50,000 might not be fully searchable as the server might trim its
479   * generated search index in those cases. Note: FHIR resources are indexed
480   * asynchronously, so there might be a slight delay between the time a resource
481   * is created or changes and when the change is reflected in search results. For
482   * samples and detailed information, see [Searching for FHIR
483   * resources](/healthcare/docs/how-tos/fhir-search) and [Advanced FHIR search
484   * features](/healthcare/docs/how-tos/fhir-advanced-search). (fhir.searchType)
485   *
486   * @param string $parent Name of the FHIR store to retrieve resources from.
487   * @param string $resourceType The FHIR resource type to search, such as Patient
488   * or Observation. For a complete list, see the FHIR Resource Index
489   * ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/resourcelist.html),
490   * [STU3](http://hl7.org/implement/standards/fhir/STU3/resourcelist.html),
491   * [R4](http://hl7.org/implement/standards/fhir/R4/resourcelist.html)).
492   * @param SearchResourcesRequest $postBody
493   * @param array $optParams Optional parameters.
494   * @return HttpBody
495   */
496  public function searchType($parent, $resourceType, SearchResourcesRequest $postBody, $optParams = [])
497  {
498    $params = ['parent' => $parent, 'resourceType' => $resourceType, 'postBody' => $postBody];
499    $params = array_merge($params, $optParams);
500    return $this->call('search-type', [$params], HttpBody::class);
501  }
502  /**
503   * Updates the entire contents of a resource. Implements the FHIR standard
504   * update interaction
505   * ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#update),
506   * [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#update),
507   * [R4](http://hl7.org/implement/standards/fhir/R4/http.html#update)). If the
508   * specified resource does not exist and the FHIR store has enable_update_create
509   * set, creates the resource with the client-specified ID. It is strongly
510   * advised not to include or encode any sensitive data such as patient
511   * identifiers in client-specified resource IDs. Those IDs are part of the FHIR
512   * resource path recorded in Cloud Audit Logs and Pub/Sub notifications. Those
513   * IDs can also be contained in reference fields within other resources. The
514   * request body must contain a JSON-encoded FHIR resource, and the request
515   * headers must contain `Content-Type: application/fhir+json`. The resource must
516   * contain an `id` element having an identical value to the ID in the REST path
517   * of the request. On success, the response body contains a JSON-encoded
518   * representation of the updated resource, including the server-assigned version
519   * ID. Errors generated by the FHIR store contain a JSON-encoded
520   * `OperationOutcome` resource describing the reason for the error. If the
521   * request cannot be mapped to a valid API method on a FHIR store, a generic GCP
522   * error might be returned instead. For samples that show how to call `update`,
523   * see [Updating a FHIR resource](/healthcare/docs/how-tos/fhir-
524   * resources#updating_a_fhir_resource). (fhir.update)
525   *
526   * @param string $name The name of the resource to update.
527   * @param HttpBody $postBody
528   * @param array $optParams Optional parameters.
529   * @return HttpBody
530   */
531  public function update($name, HttpBody $postBody, $optParams = [])
532  {
533    $params = ['name' => $name, 'postBody' => $postBody];
534    $params = array_merge($params, $optParams);
535    return $this->call('update', [$params], HttpBody::class);
536  }
537  /**
538   * Gets the contents of a version (current or historical) of a FHIR resource by
539   * version ID. Implements the FHIR standard vread interaction
540   * ([DSTU2](http://hl7.org/implement/standards/fhir/DSTU2/http.html#vread),
541   * [STU3](http://hl7.org/implement/standards/fhir/STU3/http.html#vread),
542   * [R4](http://hl7.org/implement/standards/fhir/R4/http.html#vread)). On
543   * success, the response body contains a JSON-encoded representation of the
544   * resource. Errors generated by the FHIR store contain a JSON-encoded
545   * `OperationOutcome` resource describing the reason for the error. If the
546   * request cannot be mapped to a valid API method on a FHIR store, a generic GCP
547   * error might be returned instead. For samples that show how to call `vread`,
548   * see [Retrieving a FHIR resource version](/healthcare/docs/how-tos/fhir-
549   * resources#retrieving_a_fhir_resource_version). (fhir.vread)
550   *
551   * @param string $name The name of the resource version to retrieve.
552   * @param array $optParams Optional parameters.
553   * @return HttpBody
554   */
555  public function vread($name, $optParams = [])
556  {
557    $params = ['name' => $name];
558    $params = array_merge($params, $optParams);
559    return $this->call('vread', [$params], HttpBody::class);
560  }
561}
562
563// Adding a class alias for backwards compatibility with the previous class name.
564class_alias(ProjectsLocationsDatasetsFhirStoresFhir::class, 'Google_Service_CloudHealthcare_Resource_ProjectsLocationsDatasetsFhirStoresFhir');
565