|
| 1 | +--- |
| 2 | +title: Support for URL customization for the DICOM service in Azure Health Data Services |
| 3 | +description: Learn how to customize the URL of the image location that is in response object. |
| 4 | +author: varunbms |
| 5 | +ms.service: azure-health-data-services |
| 6 | +ms.subservice: fhir |
| 7 | +ms.topic: overview |
| 8 | +ms.date: 10/17/2024 |
| 9 | +ms.author: buchvarun |
| 10 | +--- |
| 11 | + |
| 12 | +# What is URL manipulation |
| 13 | +Using URL manipulation allows you to customize the URL of the image location that is in the response object. |
| 14 | + |
| 15 | +For the following API operations the DICOM service returns the fully qualified URL of the image location in the response object under a DICOM tag (UR) in the response object. |
| 16 | +- Retrieve Instance |
| 17 | +- Retrieve WorkItems |
| 18 | +- Retrieve OperationStatus |
| 19 | +- Resolve QueryTag |
| 20 | +- Resolve QueryTagError |
| 21 | + |
| 22 | +Here's an example of a fully qualified image location URL. The URL could be found in the standard response for a STOW operation for a DICOM service that has data partition enabled, with partition name "foo". |
| 23 | + |
| 24 | +`https://localhost:63838/v2/partitions/foo/studies/1.2.826.0.1.3680043.8.498.13230779778012324449356534479549187420/series/1.2.826.0.1.3680043.8.498.77033797676425927098669402985243398207/instances/1.2.826.0.1.3680043.8.498.13273713909719068980354078852867170114` |
| 25 | + |
| 26 | + The preceding URL consists of three parts: |
| 27 | + - hostname -> `https://localhost:63838` (the hostname of DICOM service) |
| 28 | + - path -> `v2/partitions/foo` (the path that represents the version of DICOM service being used and the datapartition name, if enabled) |
| 29 | + - The DICOM web standard path -> `studies/1.2.826.0.1.3680043.8.498.13230779778012324449356534479549187420/series/1.2.826.0.1.3680043.8.498.77033797676425927098669402985243398207/instances/1.2.826.0.1.3680043.8.498.13273713909719068980354078852867170114` |
| 30 | + |
| 31 | + This feature allows you to customize the path of the image URL, if directed by the client, based on the request headers provided. |
| 32 | + |
| 33 | +## How it works |
| 34 | +The modified URL is based on following two headers. |
| 35 | +- X-Forwarded-Host: The domain name of the original host (the one the client requested before the proxy or load balancer handled the request). For example: `X-Forwarded-Host: www.example.com` |
| 36 | + |
| 37 | +- X-Forwarded-Prefix: the original URL path or prefix that was part of the client’s request before the proxy forwarded or changed the request. For example: `X-Forwarded-Prefix: /prefix` |
| 38 | + |
| 39 | +These headers are a part of .NET core standard forwarded headers. |
| 40 | + |
| 41 | +If `x-forwarded-host` header is present in the request object, it replaces the host name with the value provided. |
| 42 | + |
| 43 | +If `x-forwarded-prefix` header is present in the request object, it replaces the path with the value provided. |
| 44 | + |
| 45 | +## List of services that can use forwarded headers for URL manipulation |
| 46 | + |
| 47 | + - Store(STOW-RS): Upload DICOM objects to the server. |
| 48 | + - Retrieve(WADO-RS): Download DICOM objects from the server. |
| 49 | + - Worklist Service (UPS Push and Pull SOPs): Manage and track medical imaging workflows. |
| 50 | + - Extended query tags: Define custom tags for querying DICOM data. |
| 51 | + - Operation Status |
| 52 | + |
| 53 | +Here are the details of a request header for a STOW operation with the forwarded headers: |
| 54 | +* Path: ../studies/{study} |
| 55 | +* Method: POST |
| 56 | +* Headers: |
| 57 | + * Accept: application/DICOM+json |
| 58 | + * Content-Type: multipart/related; type="application/DICOM" |
| 59 | + * Authorization: Bearer {token value} |
| 60 | + * X-Forwarded-Host: {Domain name of the original host} |
| 61 | + * X-Forwarded-Prefix: {the original URL path} |
| 62 | +* Body: |
| 63 | + * Content-Type: application/DICOM for each file uploaded, separated by a boundary value |
| 64 | + |
| 65 | +### Example: |
| 66 | +An example of a DICOM tag with VR = UR for a STOW operation when the forwarded headers aren't provided is shown below. |
| 67 | + |
| 68 | +`https://localhost:63838/v2/partitions/foo/studies/1.2.826.0.1.3680043.8.498.13230779778012324449356534479549187420/series/1.2.826.0.1.3680043.8.498.77033797676425927098669402985243398207/instances/1.2.826.0.1.3680043.8.498.13273713909719068980354078852867170114` |
| 69 | + |
| 70 | +An example of a DICOM tag with VR = UR for a STOW operation when the forwarded headers are provided is shown below. |
| 71 | + |
| 72 | +Sample Request object: |
| 73 | +* Path: https://localhost:63838/v2/partitions/foo/studies/studies/{study} |
| 74 | +* Method: POST |
| 75 | +* Headers: |
| 76 | + * Accept: application/DICOM+json |
| 77 | + * Content-Type: multipart/related; type="application/DICOM" |
| 78 | + * Authorization: Bearer {token value} |
| 79 | + * X-Forwarded-Host: API.powershare.com |
| 80 | + * X-Forwarded-Prefix: /newbasePath |
| 81 | +* Body: |
| 82 | + * Content-Type: application/DICOM for each file uploaded, separated by a boundary value |
| 83 | + |
| 84 | + |
| 85 | +URL of image: |
| 86 | + `https://API.powershare.com/newbasePath/studies/1.2.826.0.1.3680043.8.498.13230779778012324449356534479549187420/series/1.2.826.0.1.3680043.8.498.45787841905473114233124723359129632652/instances/1.2.826.0.1.3680043.8.498.12714725698140337137334606354172323212` |
| 87 | + |
| 88 | + |
| 89 | + ## Things to remember |
| 90 | + - Forwarded headers don't have to be used together. If there's a need to, replace hostname and not path. Only the forwarded host header can be used. Similarly, if there's a need to replace the path, only the forwarded prefix header can be used. |
| 91 | + - The client is responsible for mapping the hostname and path provided in forwarded headers to the correct DICOM service hostname and pathbase. |
| 92 | + |
| 93 | + [!INCLUDE [DICOM trademark statement](../includes/healthcare-APIs-DICOM-trademark.md)] |
0 commit comments