Hi <@296965290338811911> -- I just ran a quick te...
# general
c
Hi @ahmedsakri -- I just ran a quick test, and this should work:
Communication?sender={patient},{practitioner}&recipient={patient},{practitioner}
Note the commas between the references. The commas behave as an "or". So it translates to: "communications where the sender is [patient or practitioner] and the recipient is [patient or practitioner]"
a
Thanks @cody !
@cody It worked with the above solution. I have 2 sites namely the patient site and the provider/practitioner site. I am building a chat-like feature between a patient and a practitioner. Using the above help I am able to see a chat-history in one go. The issue happening now is: 1. Once a patient sends a msg to a practitioner unless I reload the page or do an API call at some interval. I will not receive the new text message or vice-versa. 2. To solve this: what do you suggest should i do? As soon as a patient sends a message. It should pop the msg in practitioner site and same if practitioner does. Appreciate the help!
Also, DMing you the file, that i working on
r
@ahmedsakri - this is currently the way the search works. We have opened a discussion on Websockets as they have many use cases, including this one, would appreciate you weighing in on the discussion https://github.com/medplum/medplum/discussions/1490
c
Hi @ahmed - In the absence of the Webockets proposal, your best bet is a timer using
setInterval
or something similar. You may also need to specify
cache: 'reload'
to force bypass the cache:
medplum.searchResources('Communication', '...', { cache: 'reload' });
183 Views