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

FHIRNotificationService should emit event for patch update #2692

Closed
fsa1803 opened this issue Aug 17, 2021 · 4 comments
Closed

FHIRNotificationService should emit event for patch update #2692

fsa1803 opened this issue Aug 17, 2021 · 4 comments
Assignees
Labels
bug Something isn't working fhir-notification

Comments

@fsa1803
Copy link

fsa1803 commented Aug 17, 2021

Describe the bug
When patch a Patient resource no websocket event is triggered.

Environment
IBM FHIR Server : 4.9
Windows: 10
JVM: JRE 1.8.0_251

To Reproduce
Steps to reproduce the behavior:

  1. Enable websocket notification
  2. Open ws channel, I use Chrome Extension: "Web Socket Client"
  3. Insert Patient resource
  4. WS console show me the event:
    {"lastUpdated":"2021-08-17T11:01:15.307Z","location":"Patient/MPI0000000017/_history/1","operationType":"create","resourceId":"MPI0000000017","datasourceId":"default","tenantId":"default"}
  5. Update gender:
    curl -s -H "Content-Type: application/json-patch+json;charset=UTF-8" -XPATCH https://localhost:9443/fhir-server/api/v4/Patient/MPI0000000017 -u fhiruser:fhiruser --insecure -d '
    [{ "op": "replace", "path": "/gender", "value": "male" }]
    '

Expected behavior
A notification for Patient update

@fsa1803 fsa1803 added the bug Something isn't working label Aug 17, 2021
@prb112
Copy link
Contributor

prb112 commented Aug 17, 2021

Thank you for opening this @fsa1803

The default behavior is to do nothing with this notification.

    /**
     * This method is called during the processing of an 'patch' REST API invocation, immediately after the updated
     * resource has been stored by the persistence layer.
     * 
     * @param event
     *            information about the 'patch' event
     * @throws FHIRPersistenceInterceptorException
     */
    default void afterPatch(FHIRPersistenceEvent event) throws FHIRPersistenceInterceptorException {
    }

If this helps your use case, we'll implement these in the corresponding classes as outlined below.

image

FYI - this is a one pointer and needs minor updates. after the development team agrees to the appropriate behavior

@lmsurpre lmsurpre changed the title FHIRNotificationService should emit event for update FHIRNotificationService should emit event for patch update Aug 17, 2021
@fsa1803
Copy link
Author

fsa1803 commented Aug 17, 2021

Fine, this help my use case.

Thanks

@prb112
Copy link
Contributor

prb112 commented Aug 17, 2021

Fine, this help my use case.

Thanks

OK, thanks, just testing the change now and will review with Lee

prb112 added a commit that referenced this issue Aug 17, 2021
Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
@prb112 prb112 added this to the Sprint 2021-11 milestone Aug 17, 2021
prb112 added a commit that referenced this issue Aug 17, 2021
FHIRNotificationService should emit event for patch update #2692
@prb112 prb112 self-assigned this Aug 19, 2021
@d0roppe
Copy link
Collaborator

d0roppe commented Aug 24, 2021

Tested this fully with the FHIRPath Patch path and seems to be issuing the correct notifications.

@d0roppe d0roppe closed this as completed Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fhir-notification
Projects
None yet
Development

No branches or pull requests

3 participants