-
Notifications
You must be signed in to change notification settings - Fork 157
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
Implement instance-level $validate and enforce mode binding #2964
Comments
…enforce mode binding Signed-off-by: Prasanna Hegde <prasanna.hegde1@ibm.com>
Signed-off-by: Prasanna Hegde <prasanna.hegde1@ibm.com>
Signed-off-by: Prasanna Hegde <prasanna.hegde1@ibm.com>
…peration-validate module for unit tests Signed-off-by: Prasanna Hegde <prasanna.hegde1@ibm.com>
…mock json file for unit testing Signed-off-by: Prasanna Hegde <prasanna.hegde1@ibm.com>
Signed-off-by: Prasanna Hegde <prasanna.hegde1@ibm.com>
Signed-off-by: Prasanna Hegde <prasanna.hegde1@ibm.com>
I found a couple of possible issues:
|
In addition, during team discussion we agreed that the validation should always be on the resource provided in the incoming content. |
|
@lmsurpre I think the acceptance criteria should be tweaked a little to make it clear whether an existing resource is present. This is unclear for AC3, for example. AC1: PASS AC2 FAIL With
...
|
I agree AC2 is underspecified.
should probably be split into the two cases. 2a. GIVEN fhir-server-config with updateCreateEnabled=true (the default) 2b. GIVEN fhir-server-config with updateCreateEnabled=true (the default) For AC3, I think the 2 errors is fine. |
I've updated the acceptance criteria to break things out a little more cleanly and will post the results here:
|
Is your feature request related to a problem? Please describe.
In #2905 we added partial support for the
mode
input parameter on the$validate
operation.Specifically, when this parameter is set to
create
orupdate
, we will validate the passed resource by using the corresponding fhir-server-config settings underresources/<resourceType>/profiles
.However, https://www.hl7.org/fhir/operation-resource-validate.html defines
mode
with a required binding to https://www.hl7.org/fhir/valueset-resource-validation-mode.html whereas our implementation allows any string that would be a valid code.Specifically, in addition to
create
andupdate
modes, it defines:profile
mode that it says should only apply to a resource "nominated by id, not provided as a parameter"delete
mode that only makes sense against a previously-ingested resourceBut our implementation doesn't even support validation against existing resources in the db.
If you try invoking it at this level, it fails with a 400 Bad Request error that says:
Describe the solution you'd like
[base]/[resourceType]/[id]/$validate
)delete
is only ever invoked at the resource-instance level (although I have no clue when we'd say that a given delete is "invalid"...I guess never?)profile
wouldn't be used when validating a passed resource against a particular profile. I think this matches our current behavior if the 'profile' parameter is passed in and that seems fine to me.Describe alternatives you've considered
Acceptance Criteria
AND [another precondition]
WHEN [test step]
AND [test step]
THEN [verification step]
AND [verification step]
Additional context
The text was updated successfully, but these errors were encountered: