搜索 FHIR 资源

本页面介绍如何使用 projects.locations.datasets.fhirStores.fhir.search 方法搜索给定 FHIR 存储区中的资源。您可以使用 GETPOST 请求以不同的方式调用该方法。FHIR 搜索规范包含多种查询功能。本页面汇总了许多常用功能,但并未完整列出 Cloud Healthcare API 支持的部分搜索规范。

使用 search 方法和 GET

以下示例展示了如何使用 projects.locations.datasets.fhirStores.fhir.search 方法和 GET 在给定 FHIR 存储区中搜索资源。

curl

要搜索 FHIR 存储区中的资源,请发出 GET 请求并指定以下信息:

  • 数据集的名称
  • FHIR 存储区的名称
  • 要搜索的资源类型
  • 查询字符串包含要搜索的信息,如构建搜索查询部分中所述
  • 访问令牌

以下示例显示了一个使用 curl 搜索所有姓“Smith”患者的 GET 请求。

curl -X GET \
     -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
     "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient?family:exact=Smith"

如果请求成功,服务器将以 JSON 格式的 FHIR Bundle形式返回响应。Bundle.typesearchset,搜索结果是 Bundle.entry 数组中的条目。在此示例中,请求返回单个患者资源,包括该资源内的数据:

{
  "entry": [
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/PATIENT_ID",
      "resource": {
        "birthDate": "1970-01-01",
        "gender": "female",
        "id": "PATIENT_ID",
        "meta": {
          "lastUpdated": "LAST_UPDATED",
          "versionId": "VERSION_ID"
        },
        "name": [
          {
            "family": "Smith",
            "given": [
              "Darcy"
            ],
            "use": "official"
          }
        ],
        "resourceType": "Patient"
      },
      "search": {
        "mode": "match"
      }
    }
  ],
  "link": [
    {
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?family%3Aexact=Smith"
    }
  ],
  "resourceType": "Bundle",
  "total": 1,
  "type": "searchset"
}

PowerShell

要搜索 FHIR 存储区中的资源,请发出 GET 请求并指定以下信息:

  • 数据集的名称
  • FHIR 存储区的名称
  • 要搜索的资源类型
  • 查询字符串包含要搜索的信息,如构建搜索查询部分中所述
  • 访问令牌

以下示例显示了一个使用 Windows PowerShell 搜索所有姓“Smith”患者的 GET 请求。

$cred = gcloud auth application-default print-access-token
$headers = @{ Authorization = "Bearer $cred" }

Invoke-RestMethod `
  -Method Get `
  -Headers $headers `
  -Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/RESOURCE_TYPE?family:exact=Smith" | ConvertTo-Json

如果请求成功,服务器将以 JSON 格式的 FHIR Bundle形式返回响应。Bundle.typesearchset,搜索结果是 Bundle.entry 数组中的条目。在此示例中,请求返回单个患者资源,包括该资源内的数据:

{
  "entry": [
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/PATIENT_ID",
      "resource": {
        "birthDate": "1970-01-01",
        "gender": "female",
        "id": "PATIENT_ID",
        "meta": {
          "lastUpdated": "LAST_UPDATED",
          "versionId": "VERSION_ID"
        },
        "name": [
          {
            "family": "Smith",
            "given": [
              "Darcy"
            ],
            "use": "official"
          }
        ],
        "resourceType": "Patient"
      },
      "search": {
        "mode": "match"
      }
    }
  ],
  "link": [
    {
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?family%3Aexact=Smith"
    }
  ],
  "resourceType": "Bundle",
  "total": 1,
  "type": "searchset"
}

Java

import com.google.api.client.http.HttpRequestInitializer;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.services.healthcare.v1.CloudHealthcare;
import com.google.api.services.healthcare.v1.CloudHealthcareScopes;
import com.google.auth.http.HttpCredentialsAdapter;
import com.google.auth.oauth2.GoogleCredentials;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.Collections;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.client.methods.RequestBuilder;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;

public class FhirResourceSearchGet {
  private static final String FHIR_NAME =
      "projects/%s/locations/%s/datasets/%s/fhirStores/%s/fhir/%s";
  private static final JsonFactory JSON_FACTORY = new JacksonFactory();
  private static final NetHttpTransport HTTP_TRANSPORT = new NetHttpTransport();

  public static void fhirResourceSearchGet(String resourceName)
      throws IOException, URISyntaxException {
    // String resourceName =
    //    String.format(
    //        FHIR_NAME, "project-id", "region-id", "dataset-id", "store-id", "resource-type");

    // Initialize the client, which will be used to interact with the service.
    CloudHealthcare client = createClient();

    HttpClient httpClient = HttpClients.createDefault();
    String uri = String.format("%sv1/%s", client.getRootUrl(), resourceName);
    URIBuilder uriBuilder = new URIBuilder(uri).setParameter("access_token", getAccessToken());

    HttpUriRequest request =
        RequestBuilder.get()
            .setUri(uriBuilder.build())
            .addHeader("Content-Type", "application/fhir+json")
            .addHeader("Accept-Charset", "utf-8")
            .addHeader("Accept", "application/fhir+json; charset=utf-8")
            .build();

    // Execute the request and process the results.
    HttpResponse response = httpClient.execute(request);
    HttpEntity responseEntity = response.getEntity();
    if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
      System.err.print(
          String.format(
              "Exception searching GET FHIR resources: %s\n", response.getStatusLine().toString()));
      responseEntity.writeTo(System.err);
      throw new RuntimeException();
    }
    System.out.println("FHIR resource search results: ");
    responseEntity.writeTo(System.out);
  }

  private static CloudHealthcare createClient() throws IOException {
    // Use Application Default Credentials (ADC) to authenticate the requests
    // For more information see https://cloud.google.com/docs/authentication/production
    GoogleCredentials credential =
        GoogleCredentials.getApplicationDefault()
            .createScoped(Collections.singleton(CloudHealthcareScopes.CLOUD_PLATFORM));

    // Create a HttpRequestInitializer, which will provide a baseline configuration to all requests.
    HttpRequestInitializer requestInitializer =
        request -> {
          new HttpCredentialsAdapter(credential).initialize(request);
          request.setConnectTimeout(60000); // 1 minute connect timeout
          request.setReadTimeout(60000); // 1 minute read timeout
        };

    // Build the client for interacting with the service.
    return new CloudHealthcare.Builder(HTTP_TRANSPORT, JSON_FACTORY, requestInitializer)
        .setApplicationName("your-application-name")
        .build();
  }

  private static String getAccessToken() throws IOException {
    GoogleCredentials credential =
        GoogleCredentials.getApplicationDefault()
            .createScoped(Collections.singleton(CloudHealthcareScopes.CLOUD_PLATFORM));

    return credential.refreshAccessToken().getTokenValue();
  }
}

Node.js

const {google} = require('googleapis');
const healthcare = google.healthcare('v1');

const searchFhirResourcesGet = async () => {
  const auth = await google.auth.getClient({
    scopes: ['https://www.googleapis.com/auth/cloud-platform'],
  });
  google.options({auth});

  // TODO(developer): uncomment these lines before running the sample
  // const cloudRegion = 'us-central1';
  // const projectId = 'adjective-noun-123';
  // const datasetId = 'my-dataset';
  // const fhirStoreId = 'my-fhir-store';
  // const resourceType = 'Patient';
  const parent = `projects/${projectId}/locations/${cloudRegion}/datasets/${datasetId}/fhirStores/${fhirStoreId}/fhir`;
  const request = {parent, resourceType};

  const response = await healthcare.projects.locations.datasets.fhirStores.fhir.search(
    request
  );
  const resources = response.data.entry;
  console.log(`Resources found: ${resources.length}`);
  console.log(JSON.stringify(resources, null, 2));
};

searchFhirResourcesGet();

Python

def search_resources_get(
    base_url, project_id, cloud_region, dataset_id, fhir_store_id, resource_type,
):
    """
    Searches resources in the given FHIR store.

    It uses the searchResources GET method.
    """
    url = "{}/projects/{}/locations/{}".format(base_url, project_id, cloud_region)

    resource_path = "{}/datasets/{}/fhirStores/{}/fhir/{}".format(
        url, dataset_id, fhir_store_id, resource_type
    )

    # Make an authenticated API request
    session = get_session()

    response = session.get(resource_path)
    response.raise_for_status()

    resources = response.json()

    print(
        "Using GET request, found a total of {} {} resources:".format(
            resources["total"], resource_type
        )
    )
    print(json.dumps(resources, indent=2))

    return resources

使用 search 方法和 POST

以下示例展示了如何使用 projects.locations.datasets.fhirStores.fhir.search 方法和 POST 在给定 FHIR 存储区中搜索资源。

curl

要搜索 FHIR 存储区中的资源,请发出 POST 请求并指定以下信息:

  • 数据集的名称
  • FHIR 存储区的名称
  • 要搜索的资源类型
  • 查询字符串包含要搜索的信息,如构建搜索查询部分中所述
  • 访问令牌

以下示例显示了一个使用 curl 搜索所有姓“Smith”患者的 POST 请求。

curl -X POST \
    --data "" \
    -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
    -H "Content-Type: application/fhir+json; charset=utf-8" \
    "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/_search?family:exact=Smith"

如果请求成功,服务器将以 JSON 格式的 FHIR Bundle形式返回响应。Bundle.typesearchset,搜索结果是 Bundle.entry 数组中的条目。在此示例中,请求返回单个患者资源,包括该资源内的数据:

{
  "entry": [
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/PATIENT_ID",
      "resource": {
        "birthDate": "1970-01-01",
        "gender": "female",
        "id": "PATIENT_ID",
        "meta": {
          "lastUpdated": "LAST_UPDATED",
          "versionId": "VERSION_ID"
        },
        "name": [
          {
            "family": "Smith",
            "given": [
              "Darcy"
            ],
            "use": "official"
          }
        ],
        "resourceType": "Patient"
      },
      "search": {
        "mode": "match"
      }
    }
  ],
  "link": [
    {
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?family%3Aexact=Smith"
    }
  ],
  "resourceType": "Bundle",
  "total": 1,
  "type": "searchset"
}

PowerShell

要搜索 FHIR 存储区中的资源,请发出 POST 请求并指定以下信息:

  • 数据集的名称
  • FHIR 存储区的名称
  • 要搜索的资源类型
  • 查询字符串包含要搜索的信息,如构建搜索查询部分中所述
  • 访问令牌

以下示例显示了一个使用 Windows PowerShell 搜索所有姓“Smith”患者的 POST 请求。

$cred = gcloud auth application-default print-access-token
$headers = @{ Authorization = "Bearer $cred" }

Invoke-RestMethod `
  -Method Post `
  -Headers $headers `
  -ContentType: "application/fhir+json; charset=utf-8" `
  -Uri "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/_search?family:exact=Smith" | ConvertTo-Json

如果请求成功,服务器将以 JSON 格式的 FHIR Bundle形式返回响应。Bundle.typesearchset,搜索结果是 Bundle.entry 数组中的条目。在此示例中,请求返回单个患者资源,包括该资源内的数据:

{
  "entry": [
    {
      "fullUrl": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/PATIENT_ID",
      "resource": {
        "birthDate": "1970-01-01",
        "gender": "female",
        "id": "PATIENT_ID",
        "meta": {
          "lastUpdated": "LAST_UPDATED",
          "versionId": "VERSION_ID"
        },
        "name": [
          {
            "family": "Smith",
            "given": [
              "Darcy"
            ],
            "use": "official"
          }
        ],
        "resourceType": "Patient"
      },
      "search": {
        "mode": "match"
      }
    }
  ],
  "link": [
    {
      "url": "https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/Patient/?family%3Aexact=Smith"
    }
  ],
  "resourceType": "Bundle",
  "total": 1,
  "type": "searchset"
}

Java

import com.google.api.client.http.HttpRequestInitializer;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.services.healthcare.v1.CloudHealthcare;
import com.google.api.services.healthcare.v1.CloudHealthcareScopes;
import com.google.auth.http.HttpCredentialsAdapter;
import com.google.auth.oauth2.GoogleCredentials;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.Collections;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.client.methods.RequestBuilder;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.HttpClients;

public class FhirResourceSearchPost {
  private static final String FHIR_NAME =
      "projects/%s/locations/%s/datasets/%s/fhirStores/%s/fhir/%s";
  private static final JsonFactory JSON_FACTORY = new JacksonFactory();
  private static final NetHttpTransport HTTP_TRANSPORT = new NetHttpTransport();

  public static void fhirResourceSearchPost(String resourceName)
      throws IOException, URISyntaxException {
    // String resourceName =
    //    String.format(
    //        FHIR_NAME, "project-id", "region-id", "dataset-id", "store-id", "resource-type");

    // Initialize the client, which will be used to interact with the service.
    CloudHealthcare client = createClient();

    HttpClient httpClient = HttpClients.createDefault();
    String uri = String.format("%sv1/%s/_search", client.getRootUrl(), resourceName);
    URIBuilder uriBuilder = new URIBuilder(uri).setParameter("access_token", getAccessToken());
    StringEntity requestEntity = new StringEntity("");

    HttpUriRequest request =
        RequestBuilder.post()
            .setUri(uriBuilder.build())
            .setEntity(requestEntity)
            .addHeader("Content-Type", "application/fhir+json")
            .addHeader("Accept-Charset", "utf-8")
            .addHeader("Accept", "application/fhir+json; charset=utf-8")
            .build();

    // Execute the request and process the results.
    HttpResponse response = httpClient.execute(request);
    HttpEntity responseEntity = response.getEntity();
    if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
      System.err.print(
          String.format(
              "Exception searching POST FHIR resources: %s\n",
              response.getStatusLine().toString()));
      responseEntity.writeTo(System.err);
      throw new RuntimeException();
    }
    System.out.println("FHIR resource search results: ");
    responseEntity.writeTo(System.out);
  }

  private static CloudHealthcare createClient() throws IOException {
    // Use Application Default Credentials (ADC) to authenticate the requests
    // For more information see https://cloud.google.com/docs/authentication/production
    GoogleCredentials credential =
        GoogleCredentials.getApplicationDefault()
            .createScoped(Collections.singleton(CloudHealthcareScopes.CLOUD_PLATFORM));

    // Create a HttpRequestInitializer, which will provide a baseline configuration to all requests.
    HttpRequestInitializer requestInitializer =
        request -> {
          new HttpCredentialsAdapter(credential).initialize(request);
          request.setConnectTimeout(60000); // 1 minute connect timeout
          request.setReadTimeout(60000); // 1 minute read timeout
        };

    // Build the client for interacting with the service.
    return new CloudHealthcare.Builder(HTTP_TRANSPORT, JSON_FACTORY, requestInitializer)
        .setApplicationName("your-application-name")
        .build();
  }

  private static String getAccessToken() throws IOException {
    GoogleCredentials credential =
        GoogleCredentials.getApplicationDefault()
            .createScoped(Collections.singleton(CloudHealthcareScopes.CLOUD_PLATFORM));

    return credential.refreshAccessToken().getTokenValue();
  }
}

Node.js

const {google} = require('googleapis');
const healthcare = google.healthcare('v1');

const searchFhirResourcesPost = async () => {
  const auth = await google.auth.getClient({
    scopes: ['https://www.googleapis.com/auth/cloud-platform'],
  });
  google.options({auth, method: 'POST'});

  // TODO(developer): uncomment these lines before running the sample
  // const cloudRegion = 'us-central1';
  // const projectId = 'adjective-noun-123';
  // const datasetId = 'my-dataset';
  // const fhirStoreId = 'my-fhir-store';
  // const resourceType = 'Patient';
  const parent = `projects/${projectId}/locations/${cloudRegion}/datasets/${datasetId}/fhirStores/${fhirStoreId}/fhir`;
  const request = {parent, resourceType};

  const response = await healthcare.projects.locations.datasets.fhirStores.fhir.search(
    request
  );
  const resources = response.data.entry;
  console.log(`Resources found: ${resources.length}`);
  console.log(JSON.stringify(resources, null, 2));
};

searchFhirResourcesPost();

Python

def search_resources_post(
    base_url, project_id, cloud_region, dataset_id, fhir_store_id
):
    """
    Searches resources in the given FHIR store.

    It uses the
    _search POST method and a query string containing the
    information to search for. In this sample, the search criteria is
    'family:exact=Smith' on a Patient resource.
    """
    url = "{}/projects/{}/locations/{}".format(base_url, project_id, cloud_region)

    fhir_store_path = "{}/datasets/{}/fhirStores/{}/fhir".format(
        url, dataset_id, fhir_store_id
    )

    resource_path = "{}/Patient/_search?family:exact=Smith".format(fhir_store_path)

    # Make an authenticated API request
    session = get_session()

    headers = {"Content-Type": "application/fhir+json;charset=utf-8"}

    response = session.post(resource_path, headers=headers)
    response.raise_for_status()

    resources = response.json()
    print(
        "Using POST request, found a total of {} Patient resources:".format(
            resources["total"]
        )
    )

    print(json.dumps(resources, indent=2))

    return resources

构建搜索查询

查询字符串是一系列以网址形式编码的 name=value 对。搜索将所有对与逻辑 AND 组合。每个值都可以是逗号分隔列表中的值,这些值会被视为这些值的逻辑 OR。例如:

Patient?key1=value1&key2=value2,value3

按条件搜索 Patient 资源:

(key1 = value1) AND (key2 = value2 OR key2 = value3)

没有语法可执行两个“名称=值”对的 OR 运算。

每种 FHIR 资源类型都会在每个版本的 FHIR 中定义自己的搜索参数。可用的参数记录在每个资源的 FHIR 规范(例如 FHIR R4 患者)中,并且可以通过功能语句以编程方式检索。Cloud Healthcare API 支持大多数搜索参数;可以通过功能语句或 FHIR 合规性声明找到排除项。

分页和排序

搜索方法返回的最大资源数量由 _count 参数控制,例如 _count=10 将返回最多 10 个与查询匹配的资源。默认值为 100,允许的最大值为 1000。

如果搜索在一个网页上找到的资源超出适合的数量,则响应将在 Bundle.link 字段中包含分页网址。此字段可能返回了多个值;带有 Bundle.link.relation = next 的值表示相应的 Bundle.link.url 可用于检索下一页。Bundle.total 的值表示匹配资源的总数;如果结果完全适合一个网页,但由于结果数量远多于一页的大致估算值,则此值将是准确的。只有通过重复跟踪分页链接直到结果用尽,才能获得与大量结果相匹配的精确匹配总数。

结果可通过 _sort 参数进行排序,该参数接受优先级顺序的逗号分隔搜索参数名称列表(可选择使用 - 前缀表示降序)。例如:

_sort=status,-date,category

将按状态升序排序、按日期降序排列以及按类别断开任何剩余关系。

索引延迟

FHIR 资源会以异步方式编入索引,因此资源的创建或更改时间与更改反映在搜索结果中的时间可能会略有延迟。

搜索所有资源类型

某些搜索参数(通过 _id 等前导下划线区分)适用于所有资源类型。这些全资源参数在 Resource 类型的 FHIR 规范中列出。

使用这些搜索参数时,您可以通过从请求路径中省略资源类型,跨多个资源类型执行搜索。例如,使用 GET .../fhir?_id=1234 而不是 GET .../fhir/Patient?_id=1234 来搜索所有资源,而不仅仅是搜索“患者”。特殊参数 _type 可以与此类请求一起使用,以将结果限制为以逗号分隔的资源类型列表,例如:

GET .../fhir?_tag=active&_type=Observation,Condition

只会返回 ObservationCondition 资源的匹配结果。

数据类型

由 FHIR 定义的每个搜索参数都有一个数据类型,其中包括字符串、数字和日期等原始类型,以及令牌、引用和数量等复杂类型。每种数据类型都有自己的语法,用于指定值并支持用于改变搜索方式的修饰符。

以下是关于数据类型使用方式的简单示例:

  • 数字用于搜索整数或浮点值。该值可以带有前缀,例如 ne, lt, le, gt, ge 来更改比较器、[parameter]=100 表示相等,[parameter]=ge100 表示大于或等于 100。
  • 日期:搜索任何类型的日期、时间或时间段。日期参数的格式为 yyyy-mm-ddThh:mm:ss[Z|(+|-)hh:mm],并且用于数字的前缀修饰符也适用于此处。
  • 字符串默认为不区分大小写和重音符号或其他变音符号的前缀搜索。
  • 令牌会搜索“code”的完全匹配字符串,您可以选择将其范围限定为“system”的 URI,表示代码集使用 [parameter]=[system]|[code] 格式获取的值。例如,code=http://hl7.org/fhir/ValueSet/observation-codes|10738-3 会匹配 10738-3 的代码,但仅在具有指定 URI 的编码系统中的值符合条件时才匹配。
  • 数量使用与数字相同的前缀修饰符搜索数字值,可以选择使用特定的系统和代码来表示该值的格式 [parameter]=[prefix][number]|[system]|[code]。例如,value-quantity=lt9.1|http://unitsofmeasure.org|mg 使用指定的单位制和代码搜索小于 9.1 的定性值。
  • 引用 在资源之间搜索引用,可以通过 [parameter]=[id][parameter]=[type]/[id] 指定对 FHIR 存储区中资源的引用,或 [parameter]=[url] 通过网址引用 FHIR 存储区。

如需详细了解其他数据类型、值语法和修饰符,请参阅高级 FHIR 搜索功能

搜索参数处理

默认情况下,搜索方法会应用“宽松”处理,该处理将忽略它无法识别的参数,并使用请求中的任何剩余参数执行搜索,这些参数可能会返回超出预期的资源。

响应将包含 Bundle.link 中的一个值(值为 Bundle.link.relation = self)和网址中的 Bundle.link.url(仅包含已成功应用于搜索的参数)。系统可以检查此值以确定是否忽略了任何参数。

或者,在搜索请求中设置 HTTP 标头Prefer: handling=strict将导致 FHIR 存储针对任何无法识别的参数返回错误。