-
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
issue #3576 - remove unnecessary guard against null resourceId #3580
Conversation
Now that our persistence layer requires resources to have proper metadata prior to calling create/update/delete, I thought that resources will always have an id before we call the persistence interceptors. However, it turns out that we call the beforeCreate from the REST layer BEFORE setting this metadata on the resource. After a brief discussion, we decided to leave that as-is and update the interceptor to allow a null id. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
@@ -195,7 +195,7 @@ public FHIRRestHelper(FHIRPersistence persistence, SearchHelper searchHelper) { | |||
|
|||
@Override | |||
public FHIRRestOperationResponse doCreate(String type, Resource resource, String ifNoneExist, | |||
boolean doValidation) throws Exception { | |||
boolean doValidation) throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated formatting changes i had in my workspace
@@ -954,7 +957,7 @@ private boolean isInCompartment(String resourceType, String resourceId, Resource | |||
for (String searchParmCode : inclusionCriteria) { | |||
try { | |||
SearchParameter inclusionParm = searchHelper.getSearchParameter(resourceType, searchParmCode); | |||
if (inclusionParm != null & inclusionParm.getExpression() != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ouch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Now that our persistence layer requires resources to have proper
metadata (id, versionId, and lastUpdated) prior to calling create/update/delete, I thought that resources
will always have an id before we call the persistence interceptors.
However, it turns out that we call the beforeCreate from the REST layer
BEFORE setting this metadata on the resource.
After a brief discussion, we decided to leave that as-is and update the
interceptor to allow a null resourceId.
Signed-off-by: Lee Surprenant lmsurpre@us.ibm.com