|
| 1 | +--- |
| 2 | +title: Store external metadata in the DICOM service in Azure Health Data Services |
| 3 | +description: Learn how to store, retrieve and query external metadata that are not part of the DICOM files in the DICOM service |
| 4 | +author: kabalas |
| 5 | +ms.service: azure-health-data-services |
| 6 | +ms.subservice: dicom-service |
| 7 | +ms.topic: how-to |
| 8 | +ms.date: 12/30/2024 |
| 9 | +ms.author: kabalas |
| 10 | +--- |
| 11 | + |
| 12 | +# External metadata |
| 13 | + |
| 14 | +The external metadata feature allows to store the metadata or additional information about the DICOM files that is not part of the DICOM file. For e.g, using the same (STOW-RS), you can store the metadata by passing the additional information in the header. |
| 15 | + |
| 16 | +## Limiations |
| 17 | + |
| 18 | +- External metadata is only supported in latest api version. i.e Version 2 or above |
| 19 | +- Only private dicom tags are supported to be as external metadata. |
| 20 | +- Only study level tags are supported. |
| 21 | +- External metadata tags cannot be updated or deleted. |
| 22 | +- The following VR types are supported: |
| 23 | + |
| 24 | + | VR | Description | Single Value Matching | Range Matching | Fuzzy Matching | |
| 25 | + | ---- | --------------------- | --------------------- | -------------- | -------------- | |
| 26 | + | AE | Application Entity | X | | | |
| 27 | + | AS | Age String | X | | | |
| 28 | + | CS | Code String | X | | | |
| 29 | + | DA | Date | X | X | | |
| 30 | + | DT | Date Time | X | X | | |
| 31 | + | FD | Floating Point Double | X | | | |
| 32 | + | FL | Floating Point Single | X | | | |
| 33 | + | IS | Integer String | X | | | |
| 34 | + | LO | Long String | X | | | |
| 35 | + | PN | Person Name | X | | X | |
| 36 | + | SH | Short String | X | | | |
| 37 | + | SL | Signed Long | X | | | |
| 38 | + | SS | Signed Short | X | | | |
| 39 | + | TM | Time | X | X | | |
| 40 | + | UI | Unique Identifier | X | | | |
| 41 | + | UL | Unsigned Long | X | | | |
| 42 | + | US | Unsigned Short | X | | | |
| 43 | + |
| 44 | + > [!NOTE] |
| 45 | + > Sequential tags, which are tags under a tag of type Sequence of Items (SQ), are currently not supported. |
| 46 | + > We do not index external metadata tags if the value is null or empty. |
| 47 | + > There is no ability to add private creator as part of external metadata tags. |
| 48 | +
|
| 49 | +### Store (STOW-RS) |
| 50 | + |
| 51 | +The [Store (STOW-RS)](dicom-services-conformance-statement-v2.md#store-stow-rs) transaction allows storing external metadata as customer headers. |
| 52 | +In order to store external metadata as part of the store transaction, specify the tag key in the format `msdicom-meta-{VR}-{TagPath}`. An example request follows. |
| 53 | + |
| 54 | +```http |
| 55 | +POST {dicom-service-url}/{version}/studies |
| 56 | +Accept: multipart/related; type="application/dicom+json"; |
| 57 | +msdicom-meta-CS-001912FF: CS |
| 58 | +msdicom-meta-PN-00191100: PersonName |
| 59 | +msdicom-meta-DA-001900FF: 20241231 |
| 60 | +
|
| 61 | +Body: |
| 62 | +{DICOM FILE} |
| 63 | +``` |
| 64 | + |
| 65 | +> [!NOTE] |
| 66 | +> Only study level tags are supported. |
| 67 | +> If the tag already exists, it will update the value of the existing tag for the study. |
| 68 | +> If the tag already exists with different VR, then it will results in an error. |
| 69 | +> All the tag values must follow the standard for their respective VR. If there is an issue with one of the tags, then it will fail the whole transaction. |
| 70 | +
|
| 71 | +### Retrieve metadata (for study, series, or instance) |
| 72 | + |
| 73 | +The [Retrieve metadata (for study, series, or instance)](dicom-services-conformance-statement-v2.md#retrieve-metadata-for-study-series-or-instance) transaction allows to retrieve the external metadata along with other metadata. The external metadata is retrieved along with other tags by setting the `msdicom-request-meta` header to `true`. An example request follows. |
| 74 | + |
| 75 | +```http |
| 76 | +GET {dicom-service-url}/{version}/studies/{study}/series/{series}/instances/{instance}/metadata |
| 77 | +Accept: multipart/related; type="application/dicom"; transfer-syntax=* |
| 78 | +msdicom-request-meta: true |
| 79 | +Content-Type: application/dicom |
| 80 | + ``` |
| 81 | + |
| 82 | +> [!NOTE] |
| 83 | +> The `json` response will include a standard private creator tag that follows the [DICOM standard](https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_7.8.html). |
| 84 | +> The default value of the private creator tag will be `Microsoft`. |
| 85 | +> For e.g if the private tag is `001910FF` then the private creator tag will be `00190010`. |
| 86 | +
|
| 87 | +### Search (QIDO-RS) |
| 88 | + |
| 89 | +The [Search (QIDO-RS)](dicom-services-conformance-statement-v2.md#search-qido-rs) transaction allows to query external metadata similar to other tags. The external metadata can be queried by setting the `msdicom-request-meta` header to `true`. An example request follows. |
| 90 | + |
| 91 | +```http |
| 92 | +GET {dicom-service-url}/{version}/studies?00191100=PersonName |
| 93 | +msdicom-request-meta: true |
| 94 | +Content-Type: application/dicom |
| 95 | + ``` |
| 96 | + |
| 97 | +> [!NOTE] |
| 98 | +> Only study level tags are supported. |
| 99 | +> If there is an extended query tag with the same tagPath, but if the header `msdicom-request-meta` is set to `true`, then value from the external metadata is used to filter or to included as part of response data. |
| 100 | +
|
| 101 | +## Other Transaction |
| 102 | + |
| 103 | +There are no changes to other transactions like WADO-RS, Delete, ChangeFeed and Update. |
| 104 | + |
| 105 | +[!INCLUDE [DICOM trademark statements](../includes/healthcare-apis-dicom-trademark.md)] |
0 commit comments