You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

特定PACS执行C-Find(工作列表请求)返回‘Optional Keys Not Supported’且无数据

Fixing "Optional Keys Not Supported" in fo-dicom C-Find Worklist Queries

Hey there, let's dig into why your C-FIND request is failing on that specific PACS while working elsewhere. From what you've shared, the core issue is that the target PACS is stricter about which query keys it accepts for Modality Worklist (MWL) requests.

What's Causing the Error?

When you use DicomCFindRequest.CreateWorklistQuery() out of the box, fo-dicom populates the request with a set of optional DICOM attributes that many PACS support—but not this one. Even if those optional keys are empty (like your empty patient ID string), this particular PACS rejects the query because it doesn't recognize or support those keys.

Your logs confirm the association is set up perfectly (the PACS accepts the connection and presentation context), so the problem is definitely in the query parameters you're sending, not the connection itself.

How to Fix It

Let's adjust your code to send only the attributes this PACS actually supports:

1. Build a Minimal, Custom Query

Instead of relying on the default worklist query, create a stripped-down request with only the mandatory (or explicitly supported) keys. For MWL, the non-negotiable key is QueryRetrieveLevel set to WORKLIST. You can add other keys only if you know the PACS accepts them:

// Create a minimal C-FIND request with only essential attributes
var cfind = new DicomCFindRequest(DicomQueryRetrieveLevel.Worklist);

// Add only keys the target PACS supports (check their docs first!)
// Example: If you need to filter by modality, add this; otherwise omit
cfind.Dataset.Add(DicomTag.Modality, "CT");

List<DicomDataset> dslist = new List<DicomDataset>();
cfind.OnResponseReceived = (DicomCFindRequest rq, DicomCFindResponse rp) => {
    if (rp.Status != DicomStatus.Pending) {
        return;
    }
    dslist.Add(rp.Dataset);
};

var client = new DicomClient();
client.AddRequest(cfind);
try {
    await client.SendAsync(destip, port, useTLS, callingAE, calledAE);
} catch (Exception e) {
    logger.Error(e);
}

2. Get the PACS's Conformance Statement

Reach out to the PACS vendor or check their official DICOM conformance document. It will list exactly which query attributes are supported for MWL FIND requests. Stick strictly to that list—don't include any optional keys not mentioned.

3. Inspect Your Query Dataset

Add a log to see exactly what attributes fo-dicom is sending. This will help you spot which optional key is triggering the error:

// Log the full query dataset before sending
logger.Info($"C-FIND Query Attributes: {string.Join(", ", cfind.Dataset.Select(tag => tag.ToString()))}");

4. Avoid Empty Optional Keys

If you do need to include an optional key (like PatientID), set it to null instead of an empty string, or better yet, omit it entirely if you don't need to filter by that attribute. Some PACS interpret empty strings as invalid optional keys.

Quick Takeaway from Your Logs

The PACS you're targeting uses implementation WIMWLSCP_20_1 (UID 1.2.752.24.3.3.25.7). This is likely a vendor-specific MWL SCP, so their documentation will be the most reliable source for supported query keys.

内容的提问来源于stack exchange,提问作者Hans

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.11 09:28:17