

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# FHIR 的`$inquire`手术 HealthLake
<a name="reference-fhir-operations-inquire"></a>

该`$inquire`操作使您可以检查先前提交的先前授权请求的状态。该操作实施了《[达芬奇事先授权支持 (PAS) 实施指南》](https://hl7.org/fhir/us/davinci-pas/)，提供了一个基于 FHIR 的标准化工作流程来检索当前的授权决策。

## 工作原理
<a name="inquire-how-it-works"></a>
+ **提交查询**：您发送了一份 FHIR 捆绑包，其中包含您要查看的索赔和支持信息
+ ** HealthLake 搜索**： ClaimResponse 在您的数据存储中搜索相应的内容
+ **检索**：已检索到最新的授权状态
+ **回应**：您会立即收到包含当前授权状态（已排队、已批准、已拒绝等）的回复

**注意**  
`$inquire`是一个**只读操作**，用于检索现有授权状态。它不会修改或更新您的数据存储中的任何资源。

## API 端点
<a name="inquire-api-endpoint"></a>

```
POST /datastore/{datastoreId}/r4/Claim/$inquire  
Content-Type: application/fhir+json
```

## 请求结构
<a name="inquire-request-structure"></a>

### 捆绑包要求
<a name="inquire-bundle-requirements"></a>

您的请求必须是 FHIR 捆绑包资源，其中包含以下内容：
+ **Bundle.type：必须是** `"collection"`
+ **Bundle.entry**：必须恰好包含**一个索赔资源，其中**包含：
  + `use = "preauthorization"`
  + `status = "active"`
+ **参考资源**：声明中引用的所有资源都必须包含在捆绑包中

**按示例查询**  
您的输入 Bundle 中的资源可用作搜索模板。 HealthLake 使用提供的信息来查找相应的 ClaimResponse。

### 所需的资源
<a name="inquire-required-resources"></a>


| 资源 | 基数 | 配置文件 | 说明 | 
| --- | --- | --- | --- | 
| 索赔 | 1 | PAS 索赔查询 | 您要询问的事先授权 | 
| 病人 | 1 | PAS 受益患者 | 患者人口统计信息 | 
| 组织（保险公司） | 1 | PAS 保险公司组织 | 保险公司 | 
| 组织（提供商） | 1 | PAS 申请组织 | 提交申请的医疗保健提供者 | 

### 重要的搜索条件
<a name="inquire-search-criteria"></a>

HealthLake 搜索 ClaimResponse 使用：
+ 索赔中的@@ **患者推荐**信
+ 索赔中的@@ **保险公司推荐**信
+ 索赔中的@@ **提供者参考**信息
+ 索赔的@@ **创建日期**（作为时间筛选器）

**仅针对患者的查询**  
所有查询都必须针对特定的患者。不允许在没有患者身份的情况下进行全系统查询。

## 示例请求
<a name="inquire-example-request"></a>

```
POST /datastore/example-datastore/r4/Claim/$inquire  
Content-Type: application/fhir+json  
Authorization: Bearer <your-token>  
  
{  
  "resourceType": "Bundle",  
  "id": "PASClaimInquiryBundleExample",  
  "meta": {  
    "profile": ["http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-pas-inquiry-request-bundle"]  
  },  
  "identifier": {  
    "system": "http://example.org/SUBMITTER_TRANSACTION_IDENTIFIER",  
    "value": "5269368"  
  },  
  "type": "collection",  
  "timestamp": "2005-05-02T14:30:00+05:00",  
  "entry": [  
    {  
      "fullUrl": "http://example.org/fhir/Claim/MedicalServicesAuthorizationExample",  
      "resource": {  
        "resourceType": "Claim",  
        "id": "MedicalServicesAuthorizationExample",  
        "meta": {  
          "profile": ["http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-claim-inquiry"]  
        },  
        "status": "active",  
        "type": {  
          "coding": [{  
            "system": "http://terminology.hl7.org/CodeSystem/claim-type",  
            "code": "professional"  
          }]  
        },  
        "use": "preauthorization",  
        "patient": {  
          "reference": "Patient/SubscriberExample"  
        },  
        "created": "2005-05-02T11:01:00+05:00",  
        "insurer": {  
          "reference": "Organization/InsurerExample"  
        },  
        "provider": {  
          "reference": "Organization/UMOExample"  
        }  
      }  
    },  
    {  
      "fullUrl": "http://example.org/fhir/Patient/SubscriberExample",  
      "resource": {  
        "resourceType": "Patient",  
        "id": "SubscriberExample",  
        "meta": {  
          "profile": ["http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-beneficiary"]  
        },  
        "name": [{  
          "family": "SMITH",  
          "given": ["JOE"]  
        }],  
        "gender": "male"  
      }  
    },  
    {  
      "fullUrl": "http://example.org/fhir/Organization/UMOExample",  
      "resource": {  
        "resourceType": "Organization",  
        "id": "UMOExample",  
        "meta": {  
          "profile": ["http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-requestor"]  
        },  
        "name": "Provider Organization"  
      }  
    },  
    {  
      "fullUrl": "http://example.org/fhir/Organization/InsurerExample",  
      "resource": {  
        "resourceType": "Organization",  
        "id": "InsurerExample",  
        "meta": {  
          "profile": ["http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-insurer"]  
        },  
        "name": "Insurance Company"  
      }  
    }  
  ]  
}
```

## 响应格式
<a name="inquire-response-format"></a>

### 成功响应 (200 OK)
<a name="inquire-success-response"></a>

您将收到一个 PAS 查询回复包，其中包含：
+ **ClaimResponse**当前授权状态；**ClaimResponse**如果符合搜索条件，则为多个
+ 您请求中的所有原始资源（回显）
+ 收集响应的时间戳

**可能的 ClaimResponse 结果**  



| 结果 | 说明 | 
| --- | --- | 
| queued | 授权请求仍在等待审核 | 
| complete | 已做出授权决定（检查是否已批准 disposition /拒绝） | 
| error | 处理过程中出错 | 
| partial | 已授予部分授权 | 

```
{  
  "resourceType": "Bundle",  
  "identifier": {  
        "system": "http://example.org/SUBMITTER_TRANSACTION_IDENTIFIER",  
        "value": "5269367"  
  },  
  "type": "collection",  
  "timestamp": "2005-05-02T14:30:15+05:00",  
  "entry": [  
    {  
      "fullUrl": "http://example.org/fhir/ClaimResponse/InquiryResponseExample",  
      "resource": {  
        "resourceType": "ClaimResponse",  
        "id": "InquiryResponseExample",  
        "meta": {  
          "profile": ["http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-claimresponse-inquiry"]  
        },  
        "status": "active",  
        "type": {  
          "coding": [{  
            "system": "http://terminology.hl7.org/CodeSystem/claim-type",  
            "code": "professional"  
          }]  
        },  
        "use": "preauthorization",  
        "patient": {  
          "reference": "Patient/SubscriberExample"  
        },  
        "created": "2005-05-02T11:05:00+05:00",  
        "insurer": {  
          "reference": "Organization/InsurerExample"  
        },  
        "request": {  
          "reference": "Claim/MedicalServicesAuthorizationExample"  
        },  
        "outcome": "complete",  
        "disposition": "Approved",  
        "preAuthRef": "AUTH12345"  
      }  
    },  
    {  
      "fullUrl": "http://example.org/fhir/Claim/MedicalServicesAuthorizationExample",  
      "resource": {  
        "resourceType": "Claim",  
        "id": "MedicalServicesAuthorizationExample",  
        "meta": {  
          "profile": ["http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-claim-inquiry"]  
        },  
        "status": "active",  
        "type": {  
          "coding": [{  
            "system": "http://terminology.hl7.org/CodeSystem/claim-type",  
            "code": "professional"  
          }]  
        },  
        "use": "preauthorization",  
        "patient": {  
          "reference": "Patient/SubscriberExample"  
        },  
        "created": "2005-05-02T11:01:00+05:00",  
        "insurer": {  
          "reference": "Organization/InsurerExample"  
        },  
        "provider": {  
          "reference": "Organization/UMOExample"  
        }  
      }  
    },  
    {  
      "fullUrl": "http://example.org/fhir/Patient/SubscriberExample",  
      "resource": {  
        "resourceType": "Patient",  
        "id": "SubscriberExample",  
        "meta": {  
          "profile": ["http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-beneficiary"]  
        },  
        "name": [{  
          "family": "SMITH",  
          "given": ["JOE"]  
        }],  
        "gender": "male"  
      }  
    },  
    {  
      "fullUrl": "http://example.org/fhir/Organization/UMOExample",  
      "resource": {  
        "resourceType": "Organization",  
        "id": "UMOExample",  
        "meta": {  
          "profile": ["http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-requestor"]  
        },  
        "name": "Provider Organization"  
      }  
    },  
    {  
      "fullUrl": "http://example.org/fhir/Organization/InsurerExample",  
      "resource": {  
        "resourceType": "Organization",  
        "id": "InsurerExample",  
        "meta": {  
          "profile": ["http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-insurer"]  
        },  
        "name": "Insurance Company"  
      }  
    }  
  ]  
}
```

## 错误响应
<a name="inquire-error-responses"></a>

### 400 错误请求
<a name="inquire-400-error"></a>

当请求格式无效或验证失败时返回。

```
{  
    "resourceType": "OperationOutcome",  
    "issue": [  
        {  
            "severity": "error",  
            "code": "required",  
            "diagnostics": "Reference 'Patient/SubscriberExample' at path 'patient' for 'CLAIM' resource not found(at Bundle.entry[0].resource)"  
        }  
    ]  
}
```

### 401 未经授权
<a name="inquire-401-error"></a>

当身份验证凭证缺失或无效时返回。

```
{  
    "resourceType": "OperationOutcome",  
    "issue": [  
        {  
            "severity": "error",  
            "code": "forbidden",  
            "diagnostics": "Invalid authorization header"  
        }  
    ]  
}
```

### 403 禁止访问
<a name="inquire-403-error"></a>

当经过身份验证的用户无权访问所请求的资源时返回。

```
{  
    "resourceType": "OperationOutcome",  
    "issue": [  
        {  
            "severity": "error",  
            "code": "exception",  
            "diagnostics": "Insufficient SMART scope permissions."  
        }  
    ]  
}
```

### 400 当没有找到时
<a name="inquire-400-none-found"></a>

未找到与查询 ClaimResponse 相匹配的内容时返回。

```
{  
  "resourceType": "OperationOutcome",
  "issue": [{
    "severity": "error",
    "code": "not-found",
    "diagnostics": "Resource not found. No ClaimResponse found from the input Claim that matches the specified Claim properties patient, insurer, provider, and created(at Bundle.entry[0].resource)"
  }]
}
```

### 415 不支持的媒体类型
<a name="inquire-415-error"></a>

当内容类型标头不是 application/fhir\$1json 时返回。

```
{  
  "resourceType": "OperationOutcome",  
  "issue": [{  
    "severity": "error",  
    "code": "value",  
    "diagnostics": "Incorrect MIME-type. Update request Content-Type header."  
  }]  
}
```

### 429 请求过多
<a name="inquire-429-error"></a>

超过速率限制时返回。

```
{  
  "resourceType": "OperationOutcome",  
  "issue": [{  
    "severity": "error",  
    "code": "throttled",  
    "diagnostics": "Rate limit exceeded. Please retry after some time."  
  }]  
}
```

## 验证规则
<a name="inquire-validation-rules"></a>

HealthLake 对您的询问进行全面验证：

### 捆绑包验证
<a name="inquire-bundle-validation"></a>
+ 必须符合 PAS 查询请求捆绑包配置文件
+ `Bundle.type`必须是 `"collection"`
+ 必须恰好包含一个 Claim 资源
+ 所有引用的资源都必须包含在捆绑包中

### 索赔验证
<a name="inquire-claim-validation"></a>
+ 必须符合 PAS 索赔查询资料
+ `Claim.use`必须是 `"preauthorization"`
+ `Claim.status`必须是 `"active"`
+ 必填字段：`patient`、`insurer`、`provider`、`created`

### 资源验证
<a name="inquire-resource-validation"></a>
+ 所有资源都必须符合各自的 PAS 查询资料
+ 必须有所需的支持资源（患者、保险公司组织、提供者组织）
+ 交叉引用必须有效且可在 Bundle 中解析

## 性能规格
<a name="inquire-performance-specs"></a>


| 指标 |  规范 | 
| --- | --- | 
| 资源数量限制 | 每个捆绑包 500 个资源 | 
| 捆绑包大小限制 | 最大 5 MB | 

## 所需的权限
<a name="inquire-required-permissions"></a>

要使用该`$inquire`操作，请确保您的 IAM 角色具有：
+ `healthlake:InquirePreAuthClaim`-调用该操作

**在 FHIR 瞄准镜上使用 S**  
**所需的最低范围：**
+ **SMART v1：**`user/ClaimResponse.read`
+ **SMART v2：**`user/ClaimResponse.s`

## 重要的实施说明
<a name="inquire-implementation-notes"></a>

### 搜索行为
<a name="inquire-search-behavior"></a>

当您提交查询时， ClaimResponse 使用以下方式进行 HealthLake 搜索：
+ 输入索赔中的@@ **患者参考**信息
+ 输入索赔中的@@ **保险公司参考**信息
+ 来自输入索赔的@@ **提供者参考**
+ 根据输入的 Claim **创建日期**（作为时间筛选器）

**多个匹配项**：如果多个 ClaimResponses 匹配您的搜索条件，则 HealthLake 返回所有匹配的结果。您应该使用最新的`ClaimResponse.created`时间戳来识别最新状态。

### 更新的索赔
<a name="inquire-updated-claims"></a>

如果您已向相同的先前授权（例如，Claim v1.1、v1.2、v1.3）提交了多个更新，则该`$inquire`操作将根据提供的搜索条件检索与**最新版本 ClaimResponse **关联的更新。

### 只读操作
<a name="inquire-read-only"></a>

该`$inquire`操作：
+ **是否**检索现有的授权状态
+ **是否会**返回最新的 ClaimResponse
+ **不**修改或更新任何资源
+ **不**创建新资源
+ **不会**触发新的授权处理

## 工作流程示例
<a name="inquire-workflow-example"></a>

**典型的事先授权查询工作流程**  


```
1. Provider submits PA request  
   POST /Claim/$submit  
   → Returns ClaimResponse with outcome="queued"  
  
2. Payer reviews request (asynchronous)  
   → Updates ClaimResponse status internally  
  
3. Provider checks status  
   POST /Claim/$inquire  
   → Returns ClaimResponse with outcome="queued" (still pending)  
  
4. Provider checks status again later  
   POST /Claim/$inquire  
   → Returns ClaimResponse with outcome="complete", disposition="Approved"
```

## 相关 操作
<a name="inquire-related-operations"></a>
+ `Claim/$submit`-提交新的事先授权请求或更新现有的事先授权申请
+ `Patient/$everything`-检索全面的患者数据以获取事先授权的上下文