How to search on FHIR using the field on reference resource - hapi-fhir

I want to return search results of medicationRequest using the episodeOfCare id. An episodeOfCare is available on on encounter resource which is a reference on medicationRequest resource. Would anyone help me on how to to search for medication requests using the episode of care ID? Thanks

You would use chain searching for querying the medicationRequest by EpisodeOfCare.id: {base}/MedicationRequest?encounter.episode-of-care._id=123

Related

Mailchimp API: How to get members in a list who have selected a particular interest

I am new to the Mailchimp API. I want to get a list of members from a list who have selected an interest (checkbox type) in an interest category. I don't know how to form the query statement for the members or search-members API method.
I did a web search for a Mailchimp API query example but couldn't find one pertaining to Groups.
I'm using Postman for now as part of my research. Here is an example of what I've tried (c133bd0ba3 is the ID of the Interest I want to check):
https://usX.api.mailchimp.com/3.0/search-members?query=c133bd0ba3=true,list_id=nnnxyz
I want the query to return a list of members who have selected the interest (value = true).
Any help is greatly appreciated.
Update: I found a way to get the information with the members API method call:
https://usX.api.mailchimp.com/3.0/lists/24b8bd6114/members?interest_category_id=2dd67a99be&interest_ids=8114c6945b&interest_match=all&fields=members.id,members.email_address
Curious if anyone knows how to create a query for the search-members API method to get this same result?
The search-members API endpoint only functions the way it does in app where you can only search specific strings like names, email addresses, but not ids as those aren't visible in app.
However using the query string ?interest_ids=X attached to the end of GET lists/list_id/members will pull up anyone with that specific Interest ID. But that is what you allready figured out!

How to get a list of all documents in a Firebase Cloud Firestore database using the API?

I need to query my Cloud Firestore database periodically for maintenance. I'm new to REST and I've spent way too long trying to solve this myself, so I figured I could use some advice.
My Firestore is set up like so:
users > {uid} > uploaded-files > {file-hash}
{file-hash} is a document that contains several fields such as filename, source, and size
All I'm trying to do is get a list of every single filename from every single uploaded-file, including from multiple {uid}'s.
I've managed to send a successful request and get a single filename using the firestore.projects.databases.documents.get method using the API explorer, but I can't seem to get any other methods to work, namely firestore.projects.databases.documents.list
This is the successful request using firestore.projects.databases.documents.get:
GET https://firestore.googleapis.com/v1beta1/projects/{project-id}/databases/(default)/documents/users/7eGfdgGfaG0HSXdfmxMN2/uploaded-files/WGtcJBX9fdGdhdtjB?mask.fieldPaths=filename&key={YOUR_API_KEY}
Part of my issue is that I can't figure out how to get requests to work without hard-linking document names - in other words, I don't know how to to replace {uid}, or any other collection, with a wild-card so that the request returns documents from all uid's.
Really any help is greatly appreciated.
The Use the Cloud Firestore REST API documentation has instructions on getting started. The Firestore REST API documentation shows how to fetch documents.
In your case you would need to list the user-uid documents then go after the uploaded-files for each one, or iterate over the results of the list.

FHIR - Searching ALL resources

Is it possible to search for a parameter in all the resources on a FHIR based server (currently using HAPI)?
{{url}}/Basic?_id=1
Returns the correct Basic resource but I want to be able to search through all resource types (Basic, Patient, Observation, etc.). I was hoping that there would be a way to do something like this:
{{url}}/ALL?_id=1
Thanks,
Stephen
You can search system wide by performing a search with this syntax
GET [base]?[parameters]{&_format=[mime-type]}
so in your case that would be
GET [base]?_id=1
Note that this only works for parameters defined on all resources, like _id.
See http://hl7.org/fhir/DSTU2/search.html for more search syntax and explanation/examples.

What saying good practice about GET resource

I wonder what saying good practices create REST API. Should or not I create URI which will allow get e.g. several specific users?
For example I mean:
/usermanagement/users/{j_goldman,wafik,morder}
And this uri will be returns 3 objects users for j_goldman, wafik and morder.
You can do this but it won't be restful IMHO. If you really need to do this you should think about remodeling your resource selections say, all three users you want to get belong to a particular group with id 111. Then you can do something like /groups/111 GET. If you cannot then I guess you should stick with restful solution and use three API calls to get users separately.
What you are doing is searching for a specific set of users. With a query parameter within your URL, you can achieve this.
To return a single user (id is 5):
/usermanagement/users/5
To return all users:
/usermanagement/users
To return a set of users based on search:
/usermanagement/users?username=
That way, your API is open to searching by a specified criteria which can also be extended.
Say, you wish to search by location:
/usermanagement/users?location=
Say, you wish to combine these:
/usermanagement/users?username={criteria}&location={criteria}
You may also want to expose a search endpoint itself:
/usermanagement/search
You might find other options here too:
RESTful URL design for search

Naming resources prior to creation using Neo4j Restful API

This is for people with knowledge on REST and Neo4j.
Is it possible to name a node before creating it in Neo4j ?
Typical Restful thing, you create a URI "XXX/db/data/node/mynode" and you want to create a node with this identifier if it is not existent in the moment.
For all that I have been researching (and testing) to the present moment, the answer is : "no it is not possible, neo4j will just always automatically give ids to the created nodes and the attempt to do create a URI and use POST to cause its creation will result in 405"
Thanks in advance.
That's correct, you can't set the id of a node. What you can do is to add some other kind of id as a property, see create node with properties. Just make sure it's indexed automatically and then you can query that index for exact matches.