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

$submit-data operation fails #3064

Closed
kmbarton423 opened this issue Dec 1, 2021 · 1 comment
Closed

$submit-data operation fails #3064

kmbarton423 opened this issue Dec 1, 2021 · 1 comment
Labels
bug Something isn't working cql

Comments

@kmbarton423
Copy link
Contributor

kmbarton423 commented Dec 1, 2021

Running IBM FHIR Server 4.10.0 with CPG and CQF operations.
Executed $submit-data operation for an existing MeasureReport:
POST {{local1}}{{context1}}/Measure/$submit-data
(see attached requestBody.txt)

Status 200 received yet operation fails:

  "resourceType": "OperationOutcome",
  "id": "ac-11-0-3-cde64786-f73c-408f-a87b-3b1a174101be",
  "issue": [
    {
      "severity": "fatal",
      "code": "exception",
      "details": {
        "text": "FHIROperationException: Operation failed"
      }
    }
  ]
}

Logs indicate "PSQLException: ERROR: Concurrent update - mismatch of version in JSON"
(see attached out.log)

The core issue is related to MeasureSubmitDataOperation.java on line 80.
The switch between PUT/POST depends on a VERSION.
On the second submission of the same data element, the version is passed into the persistence layer, and the persistence layer sees a violation of the stored version (v1) violates the incoming version (v1).

Options, remove the version in that code, or use ifNoneMatch and handle the response.

Additional context

@kmbarton423 kmbarton423 added bug Something isn't working cql labels Dec 1, 2021
csandersdev added a commit that referenced this issue Dec 7, 2021
* The primary change here is to remove the meta.versionId from any
resources that are posted with the meta section intact. This provides
some improvement to the function.
* The next thing I did was to improve the error handling such that a
FHIROperationException from the underlying bundle persistence is bubbled
up to the end user vs. being wrapped and obscured.
* Lastly, I added additional unit and server tests to prove behavior
including with the real-world example provided by QA.

Signed-off-by: Corey Sanders <corey.thecolonel@gmail.com>
@kmbarton423
Copy link
Contributor Author

Receive the following after the fix:

Status 409 Conflict

{ "resourceType": "OperationOutcome", "id": "ac-11-0-3-e8b4cd0e-8ba2-494c-af1d-b34a53d711c0", "issue": [ { "severity": "fatal", "code": "conflict", "details": { "text": "Encountered version id mismatch while inserting Resource" }, "expression": [ "<empty>", "Bundle.entry[1]" ] } ] }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cql
Projects
None yet
Development

No branches or pull requests

1 participant