Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction bundles with conditional create do not apply if-none-exist filters #520

Open
JeremiahSanders opened this issue Nov 9, 2022 · 0 comments

Comments

@JeremiahSanders
Copy link

Describe the bug
When processing a FHIR transaction Bundle which contains POST Patient entries with ifNoneExist conditions, search filters contained within ifNoneExist are not applied, which results in failed requests.

When this occurs, ResourceManipulationOperation.GetSearchInformation() specifically indicates that the parameter was unused.

To Reproduce

The following code is the simplest example I could construct. It uses an HL7-provided Bundle and targets the Spark R4 reference implementation.

Steps to reproduce the behavior:

const string xdsBundleUrl = "http://www.hl7.org/fhir/xds-example.json";
var hl7HttpClient = new HttpClient();
var hl7DocumentReferenceBundleJson = await (await hl7HttpClient.GetAsync(xdsBundleUrl)).Content.ReadAsStringAsync();
var hl7DocumentReferenceBundle = new FhirJsonParser().Parse(hl7DocumentReferenceBundleJson) as Bundle;

var fhirClient = new Hl7.Fhir.Rest.FhirClient("https://spark.incendi.no/fhir/");

var transactionResponse = await fhirClient.TransactionAsync(hl7DocumentReferenceBundle);

The example failure is caused by the following entry.request:

{
  "method": "POST",
  "url": "Patient",
  "ifNoneExist": "Patient?identifier=http://acme.org/xds/patients!89765a87b"
}

Result:

The following result was received from https://spark.incendi.no/fhir/ when tested on 2022/11/09. The error occurred at the line executing FhirClient.TransactionAsync.

FhirOperationException

Operation was unsuccessful because of a client error (PreconditionFailed). OperationOutcome: Overall result: FAILURE (1 errors and 0 warnings)
[ERROR] (no details)(further diagnostics: Multiple matches found when trying to resolve conditional create. Client's criteria were not selective enough.
Search parameters not used:Patient?identifier
Search uri used: Patient?
Number of matches found: 292).

Expected behavior
A successful, Bundle response is expected.

Spark version

  • Version: 1.5.14

Operating system + Database
Validated against reference implementation at https://spark.incendi.no/fhir/.

Additionally, validated locally in Windows 11 + Docker-hosted MongoDB.

Container service / Cloud infrastructure:
Validated against reference implementation at https://spark.incendi.no/fhir/.

Additionally, validated locally in Windows 11 + local Docker Desktop-hosted MongoDB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant