对具有大量患者的 Fhir 服务器执行条件删除操作失败

Operation failure doing conditional delete against Fhir server with large number of patients

我正在尝试执行涉及很多记录的条件删除。在尝试删除符合条件的患者时,我在使用 .NET FHIR 客户端 (Hl7.Fhir.Rest) 时收到以下异常。我感觉可能是由于某些默认的批量大小,但我不知道如何更改 IFhirClient 以删除它找到的任何内容。

Failed to DELETE resource with match URL "Patient?identifier= because this search matched 450 resources. 412 - PreCondition Failed

_fhirClient.Delete("Patient", criteria);

这与FhirClient无关,与服务端的实现有关。请参阅 http://hl7.org/fhir/R4/http.html#3.1.0.7.1:

处的 FHIR 规范

Multiple matches: A server may choose to delete all the matching resources, or it may choose to return a 412 Precondition Failed error indicating the client's criteria were not selective enough.

例如Vonk FHIR Server 具有一次可以执行的最大删除数设置。你问题上的 hapi-fhir 标签表明你需要查阅 hapi 文档以获得类似的设置。