

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 搭配 HealthImaging 使用 Amazon EventBridge
<a name="event-notifications"></a>

Amazon EventBridge 是一種無伺服器服務，該服務使用事件將應用程式元件連接在一起，讓您更輕鬆地建置可擴展的事件驅動型應用程式。EventBridge 的基礎是建立將[事件](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html)路由到[目標](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-targets.html)的[規則](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-rules.html)。AWS HealthImaging 為 EventBridge 提供持久的狀態變更交付。如需詳細資訊，請參閱《Amazon EventBridge 使用者指南》**中的[什麼是 Amazon EventBridge？](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-what-is.html)

**Topics**
+ [HealthImaging 事件傳送至 EventBridge](#event-notifications-listing)
+ [HealthImaging 事件結構和範例](#event-notifications-structure-examples)

## HealthImaging 事件傳送至 EventBridge
<a name="event-notifications-listing"></a>

下表列出傳送至 EventBridge 處理的所有 HealthImaging 事件。

<a name="event-notifications-table"></a>[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/healthimaging/latest/devguide/event-notifications.html)

## HealthImaging 事件結構和範例
<a name="event-notifications-structure-examples"></a>

HealthImaging 事件是具有 JSON 結構的物件，也包含中繼資料詳細資訊。您可以使用中繼資料做為輸入，以重新建立事件或了解詳細資訊。所有相關聯的中繼資料欄位都會列在下表程式碼範例下的資料表中。如需詳細資訊，請參閱《*Amazon EventBridge 使用者指南*》中的[事件結構參考](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events-structure.html)。

**注意**  
HealthImaging 事件結構的`source`屬性為 `aws.medical-imaging`。

### 資料存放區事件
<a name="event-notifications-data-store"></a>

------
#### [ Data Store Creating ]

**狀態 - `CREATING`**

```
{
    "version": "0",
    "id": "7cf0fb1c-8720-4d48-baa3-6eb97b35a10e",
    "detail-type": "Data Store Creating",
    "source": "aws.medical-imaging",
    "account": "111122223333",
    "time": "2024-03-14T00:01:00Z",
    "region": "us-west-2",
    "resources": ["arn:aws:medical-imaging:us-west-2:111122223333:datastore/bbc4f3cccbae4095a34170fddc19b13d"],
    "detail": {
        "imagingVersion": "1.0",
        "datastoreId" : "bbc4f3cccbae4095a34170fddc19b13d",
        "datastoreName": "test",
        "datastoreStatus": "CREATING"     
    }
}
```

------
#### [ Data Store Creation Failed ]

**狀態 - `CREATE_FAILED`**

```
{
    "version": "0",
    "id": "7cf0fb1c-8720-4d48-baa3-6eb97b35a10e",
    "detail-type": "Data Store Creation Failed",
    "source": "aws.medical-imaging",
    "account": "111122223333",
    "time": "2024-03-14T00:01:00Z",
    "region": "us-west-2",
    "resources": ["arn:aws:medical-imaging:us-west-2:111122223333:datastore/bbc4f3cccbae4095a34170fddc19b13d"],
    "detail": {
        "imagingVersion": "1.0",
        "datastoreId" : "bbc4f3cccbae4095a34170fddc19b13d",
        "datastoreName": "test",
        "datastoreStatus": "CREATE_FAILED"      
    }
}
```

------
#### [ Data Store Created ]

**狀態 - `ACTIVE`**

```
{
    "version": "0",
    "id": "7cf0fb1c-8720-4d48-baa3-6eb97b35a10e",
    "detail-type": "Data Store Created",
    "source": "aws.medical-imaging",
    "account": "111122223333",
    "time": "2024-03-14T00:01:00Z",
    "region": "us-west-2",
    "resources": ["arn:aws:medical-imaging:us-west-2:111122223333:datastore/bbc4f3cccbae4095a34170fddc19b13d"],
    "detail": {
        "imagingVersion": "1.0",
        "datastoreId" : "bbc4f3cccbae4095a34170fddc19b13d",
        "datastoreName": "test",
        "datastoreStatus": "ACTIVE"     
    }
}
```

------
#### [ Data Store Deleting ]

**狀態 - `DELETING`**

```
{
    "version": "0",
    "id": "7cf0fb1c-8720-4d48-baa3-6eb97b35a10e",
    "detail-type": "Data Store Deleting",
    "source": "aws.medical-imaging",
    "account": "111122223333",
    "time": "2024-03-14T00:01:00Z",
    "region": "us-west-2",
    "resources": ["arn:aws:medical-imaging:us-west-2:111122223333:datastore/bbc4f3cccbae4095a34170fddc19b13d"],
    "detail": {
        "imagingVersion": "1.0",
        "datastoreId" : "bbc4f3cccbae4095a34170fddc19b13d",
        "datastoreName": "test",
        "datastoreStatus": "DELETING"       
    }
}
```

------
#### [ Data Store Deleted ]

**狀態 - `DELETED`**

```
{
    "version": "0",
    "id": "7cf0fb1c-8720-4d48-baa3-6eb97b35a10e",
    "detail-type": "Data Store Deleted",
    "source": "aws.medical-imaging",
    "account": "111122223333",
    "time": "2024-03-14T00:01:00Z",
    "region": "us-west-2",
    "resources": ["arn:aws:medical-imaging:us-west-2:111122223333:datastore/bbc4f3cccbae4095a34170fddc19b13d"],
    "detail": {
        "imagingVersion": "1.0",
        "datastoreId" : "bbc4f3cccbae4095a34170fddc19b13d",
        "datastoreName": "test",
        "datastoreStatus": "DELETED"  
    }
}
```

------


**資料存放區事件 - 中繼資料描述**  

| 名稱 | 類型 | Description | 
| --- | --- | --- | 
| version | string | EventBridge 事件結構描述版本。 | 
| id | string | 為每個事件產生的第 4 版 UUID。 | 
| detail-type | string | 正在傳送的事件類型。 | 
| source | string | 識別產生事件的服務。 | 
| account | string | 資料存放區擁有者的 12 位數 AWS 帳戶 ID。 | 
| time | string | 事件發生的時間。 | 
| region | string | 識別資料存放區的 AWS 區域。 | 
| resources | 陣列 （字串） | 包含資料存放區 ARN 的 JSON 陣列。 | 
| detail | object | 包含事件相關資訊的 JSON 物件。 | 
| detail.imagingVersion | string | 追蹤 HealthImaging 事件詳細資訊結構描述變更的版本 ID。 | 
| detail.datastoreId | string | 與狀態變更事件相關聯的資料存放區 ID。 | 
| detail.datastoreName | string | 資料存放區名稱。 | 
| detail.datastoreStatus | string | 目前的資料存放區狀態。 | 

### 匯入任務事件
<a name="event-notifications-import-jobs"></a>

------
#### [ Import Job Submitted ]

**狀態 - `SUBMITTED`**

```
{
    "version": "0",
    "id": "7cf0fb1c-8720-4d48-baa3-6eb97b35a10e",
    "detail-type": "Import Job Submitted",
    "source": "aws.medical-imaging",
    "account": "111122223333",
    "time": "2024-03-14T00:01:00Z",
    "region": "us-west-2",
    "resources": ["arn:aws:medical-imaging:us-west-2:111122223333:datastore/bbc4f3cccbae4095a34170fddc19b13d"],
    "detail": {
        "imagingVersion": "1.0",
        "datastoreId" : "bbc4f3cccbae4095a34170fddc19b13d",
        "jobId": "a6a1d220f152e7aab6d8925d995d8b76",
        "jobName": "test_only_1",
        "jobStatus": "SUBMITTED",
        "inputS3Uri": "s3://healthimaging-test-bucket/input/",
        "outputS3Uri": "s3://healthimaging-test-bucket/output/"
    }
}
```

------
#### [ Import Job In Progress ]

**狀態 - `IN_PROGRESS`**

```
{
    "version": "0",
    "id": "7cf0fb1c-8720-4d48-baa3-6eb97b35a10e",
    "detail-type": "Import Job In Progress",
    "source": "aws.medical-imaging",
    "account": "111122223333",
    "time": "2024-03-14T00:01:00Z",
    "region": "us-west-2",
    "resources": ["arn:aws:medical-imaging:us-west-2:111122223333:datastore/bbc4f3cccbae4095a34170fddc19b13d"],
    "detail": {
        "imagingVersion": "1.0",
        "datastoreId" : "bbc4f3cccbae4095a34170fddc19b13d",
        "jobId": "a6a1d220f152e7aab6d8925d995d8b76",
        "jobName": "test_only_1",
        "jobStatus": "IN_PROGRESS",
        "inputS3Uri": "s3://healthimaging-test-bucket/input/",
        "outputS3Uri": "s3://healthimaging-test-bucket/output/"
    }
}
```

------
#### [ Import Job Completed ]

**狀態 - `COMPLETED`**

```
{
    "version": "0",
    "id": "7cf0fb1c-8720-4d48-baa3-6eb97b35a10e",
    "detail-type": "Import Job Completed",
    "source": "aws.medical-imaging",
    "account": "111122223333",
    "time": "2024-03-14T00:01:00Z",
    "region": "us-west-2",
    "resources": ["arn:aws:medical-imaging:us-west-2:111122223333:datastore/bbc4f3cccbae4095a34170fddc19b13d"],
    "detail": {
        "imagingVersion": "1.0",
        "datastoreId" : "bbc4f3cccbae4095a34170fddc19b13d",
        "jobId": "a6a1d220f152e7aab6d8925d995d8b76",
        "jobName": "test_only_1",
        "jobStatus": "COMPLETED",
        "inputS3Uri": "s3://healthimaging-test-bucket/input/",
        "outputS3Uri": "s3://healthimaging-test-bucket/output/"
    }
}
```

------
#### [ Import Job Failed ]

**狀態 - `FAILED`**

```
{
    "version": "0",
    "id": "7cf0fb1c-8720-4d48-baa3-6eb97b35a10e",
    "detail-type": "Import Job Failed",
    "source": "aws.medical-imaging",
    "account": "111122223333",
    "time": "2024-03-14T00:01:00Z",
    "region": "us-west-2",
    "resources": ["arn:aws:medical-imaging:us-west-2:111122223333:datastore/bbc4f3cccbae4095a34170fddc19b13d"],
    "detail": {
        "imagingVersion": "1.0",
        "datastoreId" : "bbc4f3cccbae4095a34170fddc19b13d",
        "jobId": "a6a1d220f152e7aab6d8925d995d8b76",
        "jobName": "test_only_1",
        "jobStatus": "FAILED",
        "inputS3Uri": "s3://healthimaging-test-bucket/input/",
        "outputS3Uri": "s3://healthimaging-test-bucket/output/"
    }
}
```

------


**匯入任務事件 - 中繼資料描述**  

| 名稱 | 類型 | Description | 
| --- | --- | --- | 
| version | string | EventBridge 事件結構描述版本。 | 
| id | string | 為每個事件產生的第 4 版 UUID。 | 
| detail-type | string | 正在傳送的事件類型。 | 
| source | string | 識別產生事件的服務。 | 
| account | string | 資料存放區擁有者的 12 位數 AWS 帳戶 ID。 | 
| time | string | 事件發生的時間。 | 
| region | string | 識別資料存放區的 AWS 區域。 | 
| resources | 陣列 （字串） | 包含資料存放區 ARN 的 JSON 陣列。 | 
| detail | object | 包含事件相關資訊的 JSON 物件。 | 
| detail.imagingVersion | string | 追蹤 HealthImaging 事件詳細資訊結構描述變更的版本 ID。 | 
| detail.datastoreId | string | 產生狀態變更事件的資料存放區。 | 
| detail.jobId | string | 與狀態變更事件相關聯的匯入任務 ID。 | 
| detail.jobName | string | 匯入任務名稱。 | 
| detail.jobStatus | string | 目前的任務狀態。 | 
| detail.inputS3Uri | string | S3 儲存貯體的輸入字首路徑，其中包含要匯入的 DICOM 檔案。 | 
| detail.outputS3Uri | string | S3 儲存貯體的輸出字首，其中會上傳 DICOM 匯入任務的結果。 | 

### 影像集事件
<a name="event-notifications-image-sets"></a>

------
#### [ Image Set Created ]

**狀態 - `CREATED`**

```
{
   "version": "0",
   "id": "7cf0fb1c-8720-4d48-baa3-6eb97b35a10e",
   "detail-type": "Image Set Created",
   "source": "aws.medical-imaging",
   "account": "111122223333",
   "time": "2024-03-14T00:01:00Z",
   "region": "us-west-2",
   "resources": ["arn:aws:medical-imaging:us-west-2:846006145877:datastore/bbc4f3cccbae4095a34170fddc19b13d/imageset/207284eef860ac01c4b2a8de27a6fc11"],
   "detail": {
      "imagingVersion": "1.0",
      "isPrimary": true,
      "imageSetVersion": "1",
      "datastoreId": "bbc4f3cccbae4095a34170fddc19b13d",
      "imagesetId": "5b3a711878c34d40e888253319388649",
      "imageSetState": "ACTIVE",
      "imageSetWorkflowStatus": "CREATED"
   }
}
```

------
#### [ Image Set Copying ]

**狀態 - `COPYING`**

```
{
   "version": "0",
   "id": "7cf0fb1c-8720-4d48-baa3-6eb97b35a10e",
   "detail-type": "Image Set Copying",
   "source": "aws.medical-imaging",
   "account": "111122223333",
   "time": "2024-03-14T00:01:00Z",
   "region": "us-west-2",
   "resources": ["arn:aws:medical-imaging:us-west-2:846006145877:datastore/bbc4f3cccbae4095a34170fddc19b13d/imageset/207284eef860ac01c4b2a8de27a6fc11"],
   "detail": {
      "imagingVersion": "1.0",
      "isPrimary": true,
      "imageSetVersion": "1",
      "datastoreId": "bbc4f3cccbae4095a34170fddc19b13d",
      "imagesetId": "5b3a711878c34d40e888253319388649",
      "imageSetState": "LOCKED",
      "imageSetWorkflowStatus": "COPYING",
      "sourceImageSetArn": "arn:aws:medical-imaging:us-west-2:147997158357:datastore/c381ee9b9ef34902a45b476dd7be068b/imageset/0309de3674fd551fa7ddd2880b21f990"
   }
}
```

------
#### [ Image Set Copying With Read Only Access ]

**狀態 - `COPYING_WITH_READ_ONLY_ACCESS`**

```
{
   "version": "0",
   "id": "7cf0fb1c-8720-4d48-baa3-6eb97b35a10e",
   "detail-type": "Image Set Copying With Read Only Access",
   "source": "aws.medical-imaging",
   "account": "111122223333",
   "time": "2024-03-14T00:01:00Z",
   "region": "us-west-2",
   "resources": ["arn:aws:medical-imaging:us-west-2:846006145877:datastore/bbc4f3cccbae4095a34170fddc19b13d/imageset/207284eef860ac01c4b2a8de27a6fc11"],
   "detail": {
      "imagingVersion": "1.0",
      "isPrimary": true,
      "imageSetVersion": "1",
      "datastoreId": "bbc4f3cccbae4095a34170fddc19b13d",
      "imagesetId": "5b3a711878c34d40e888253319388649",
      "imageSetState": "LOCKED",
      "imageSetWorkflowStatus": "COPYING_WITH_READ_ONLY_ACCESS"
   }
}
```

------
#### [ Image Set Copied ]

**狀態 - `COPIED`**

```
{
   "version": "0",
   "id": "7cf0fb1c-8720-4d48-baa3-6eb97b35a10e",
   "detail-type": "Image Set Copied",
   "source": "aws.medical-imaging",
   "account": "111122223333",
   "time": "2024-03-14T00:01:00Z",
   "region": "us-west-2",
   "resources": ["arn:aws:medical-imaging:us-west-2:846006145877:datastore/bbc4f3cccbae4095a34170fddc19b13d/imageset/207284eef860ac01c4b2a8de27a6fc11"],
   "detail": {
      "imagingVersion": "1.0",
      "isPrimary": true,
      "imageSetVersion": "1",
      "datastoreId": "bbc4f3cccbae4095a34170fddc19b13d",
      "imagesetId": "5b3a711878c34d40e888253319388649",
      "imageSetState": "ACTIVE",
      "imageSetWorkflowStatus": "COPIED"
   }
}
```

------
#### [ Image Set Copy Failed ]

**狀態 - `COPY_FAILED`**

```
{
   "version": "0",
   "id": "7cf0fb1c-8720-4d48-baa3-6eb97b35a10e",
   "detail-type": "Image Set Copy Failed",
   "source": "aws.medical-imaging",
   "account": "111122223333",
   "time": "2024-03-14T00:01:00Z",
   "region": "us-west-2",
   "resources": ["arn:aws:medical-imaging:us-west-2:846006145877:datastore/bbc4f3cccbae4095a34170fddc19b13d/imageset/207284eef860ac01c4b2a8de27a6fc11"],
   "detail": {
      "imagingVersion": "1.0",
      "isPrimary": true,
      "imageSetVersion": "1",
      "datastoreId": "bbc4f3cccbae4095a34170fddc19b13d",
      "imagesetId": "5b3a711878c34d40e888253319388649",
      "imageSetState": "ACTIVE",
      "imageSetWorkflowStatus": "COPY_FAILED"
   }
}
```

------
#### [ Image Set Updating ]

**狀態 - `UPDATING`**

```
{
   "version": "0",
   "id": "7cf0fb1c-8720-4d48-baa3-6eb97b35a10e",
   "detail-type": "Image Set Updating",
   "source": "aws.medical-imaging",
   "account": "111122223333",
   "time": "2024-03-14T00:01:00Z",
   "region": "us-west-2",
   "resources": ["arn:aws:medical-imaging:us-west-2:846006145877:datastore/bbc4f3cccbae4095a34170fddc19b13d/imageset/207284eef860ac01c4b2a8de27a6fc11"],
   "detail": {
      "imagingVersion": "1.0",
      "isPrimary": true,
      "imageSetVersion": "1",
      "datastoreId": "bbc4f3cccbae4095a34170fddc19b13d",
      "imagesetId": "5b3a711878c34d40e888253319388649",
      "imageSetState": "LOCKED",
      "imageSetWorkflowStatus": "UPDATING"
   }
}
```

------
#### [ Image Set Updated ]

**狀態 - `UPDATED`**

```
{
   "version": "0",
   "id": "7cf0fb1c-8720-4d48-baa3-6eb97b35a10e",
   "detail-type": "Image Set Updated",
   "source": "aws.medical-imaging",
   "account": "111122223333",
   "time": "2024-03-14T00:01:00Z",
   "region": "us-west-2",
   "resources": ["arn:aws:medical-imaging:us-west-2:846006145877:datastore/bbc4f3cccbae4095a34170fddc19b13d/imageset/207284eef860ac01c4b2a8de27a6fc11"],
   "detail": {
      "imagingVersion": "1.0",
      "isPrimary": true,
      "imageSetVersion": "1",
      "datastoreId": "bbc4f3cccbae4095a34170fddc19b13d",
      "imagesetId": "5b3a711878c34d40e888253319388649",
      "imageSetState": "ACTIVE",
      "imageSetWorkflowStatus": "UPDATED"
   }
}
```

------
#### [ Image Set Update Failed ]

**狀態 - `UPDATE_FAILED`**

```
{
   "version": "0",
   "id": "7cf0fb1c-8720-4d48-baa3-6eb97b35a10e",
   "detail-type": "Image Set Update Failed",
   "source": "aws.medical-imaging",
   "account": "111122223333",
   "time": "2024-03-14T00:01:00Z",
   "region": "us-west-2",
   "resources": ["arn:aws:medical-imaging:us-west-2:846006145877:datastore/bbc4f3cccbae4095a34170fddc19b13d/imageset/207284eef860ac01c4b2a8de27a6fc11"],
   "detail": {
      "imagingVersion": "1.0",
      "isPrimary": true,
      "imageSetVersion": "1",
      "datastoreId": "bbc4f3cccbae4095a34170fddc19b13d",
      "imagesetId": "5b3a711878c34d40e888253319388649",
      "imageSetState": "ACTIVE",
      "imageSetWorkflowStatus": "UPDATE_FAILED"
   }
}
```

------
#### [ Image Set Deleting ]

**狀態 - `DELETING`**

```
{
   "version": "0",
   "id": "7cf0fb1c-8720-4d48-baa3-6eb97b35a10e",
   "detail-type": "Image Set Deleting",
   "source": "aws.medical-imaging",
   "account": "111122223333",
   "time": "2024-03-14T00:01:00Z",
   "region": "us-west-2",
   "resources": ["arn:aws:medical-imaging:us-west-2:846006145877:datastore/bbc4f3cccbae4095a34170fddc19b13d/imageset/207284eef860ac01c4b2a8de27a6fc11"],
   "detail": {
      "imagingVersion": "1.0",
      "isPrimary": true,
      "imageSetVersion": "1",
      "datastoreId": "bbc4f3cccbae4095a34170fddc19b13d",
      "imagesetId": "5b3a711878c34d40e888253319388649",
      "imageSetState": "LOCKED",
      "imageSetWorkflowStatus": "DELETING"
   }
}
```

------
#### [ Image Set Deleted ]

**狀態 - `DELETED`**

```
{
   "version": "0",
   "id": "7cf0fb1c-8720-4d48-baa3-6eb97b35a10e",
   "detail-type": "Image Set Deleted",
   "source": "aws.medical-imaging",
   "account": "111122223333",
   "time": "2024-03-14T00:01:00Z",
   "region": "us-west-2",
   "resources": ["arn:aws:medical-imaging:us-west-2:846006145877:datastore/bbc4f3cccbae4095a34170fddc19b13d/imageset/207284eef860ac01c4b2a8de27a6fc11"],
   "detail": {
      "imagingVersion": "1.0",
      "isPrimary": true,
      "imageSetVersion": "1",
      "datastoreId": "bbc4f3cccbae4095a34170fddc19b13d",
      "imagesetId": "5b3a711878c34d40e888253319388649",
      "imageSetState": "DELETED",
      "imageSetWorkflowStatus": "DELETED"
   }
}
```

------


**影像集事件 - 中繼資料描述**  

| 名稱 | 類型 | Description | 
| --- | --- | --- | 
| version | string | EventBridge 事件結構描述版本。 | 
| id | string | 為每個事件產生的第 4 版 UUID。 | 
| detail-type | string | 正在傳送的事件類型。 | 
| source | string | 識別產生事件的服務。 | 
| account | string | 資料存放區擁有者的 12 位數 AWS 帳戶 ID。 | 
| time | string | 事件發生的時間。 | 
| region | string | 識別資料存放區的 AWS 區域。 | 
| resources | 陣列 （字串） | 包含影像集 ARN 的 JSON 陣列。 | 
| detail | object | 包含事件相關資訊的 JSON 物件。 | 
| detail.imagingVersion | string | 追蹤 HealthImaging 事件詳細資訊結構描述變更的版本 ID。 | 
| detail.isPrimary | boolean | 指出匯入的資料是否已成功組織到受管階層，或是否有中繼資料衝突需要解決。 | 
| detail.imageSetVersion | string | 匯入執行個體多次時，影像集版本會遞增。最新版本會覆寫存放在主要映像集中的任何較舊版本。 | 
| detail.datastoreId | string | 產生狀態變更事件的資料存放區 ID。 | 
| detail.imagesetId | string | 與狀態變更事件相關聯的影像集 ID。 | 
| detail.imageSetState | string | 目前的映像集狀態。 | 
| detail.imageSetWorkflowStatus | string | 目前的影像集工作流程狀態。 | 