I am using Postman to test the connectivity with the Hapi FHIR server and have have been testing different queries but nothing is working...
The expected result is to get all the observations that match a certain patient identifier but, at this point, I could only get information by searching for the patient ID.
This is the base query:
http://hapi.fhir.org/baseR4/Observation
I tried lots of different parameters, including:
?identifier:of-type={identifier.system OR identifier.type.coding.system}|MR|1234
?patient.identifier=1234 OR {full url from above}
?identifier={full url OR 1234}
?subject=1234
?_has:Observation:patient:identifier=1234
and so many others. They either respond with a 500, 400 or a 200OK but with nothing in the Bundle. I checked if I had the patient itself as well as the observations and they are all there, if I search using their ID.
If you have an Observation that is correctly linked to a Patient, you can search for the Observations using the Patient's identifier.
My comment was to try and check if the Observation(s) is/are correctly linked to the Patient. So if you have a Patient with technical id 234567 and identifier 1234, does the Observation.subject field show [base]/Patient/234567? If so, this search will work on HAPI:
GET [base]/Observation?patient.identifier=1234
Also, these searches will work, but they use the technical id instead of the identifier:
GET [base]/Observation?patient=234567
GET [base]/Observation?subject=Patient/234567
Related
We are using google places API to autocomplete state, city or region searches. The issue is when one searches for a state, Places API gives two results one for the state and the other for the city/region. For eg, if we search Maine we get Maine, USA and Maine, ME, USA both in the response. Would anyone please provide a way to avoid this duplication?
Do you use "types" parameter?
https://developers.google.com/maps/documentation/places/web-service/autocomplete#types
"cities" type might give the result you want.
We have Logstash receiving syslog files and then storing these in an Elasticsearch index.
We are trying to query this index with Kibana to find some particular information but we cannot get the regex queries to work.
The log date we are trying to search within is below.
Field name = message
Field type = keyword
<14>1 2018-05-02T13:53:48.079000Z snrvro04 vco - - [liagent#6876
anctoken="" component="WorkflowManagementServiceImpl" context=""
filepath="/var/log/vco/app-server/integration-server.log"
instanceid="6a6dbf1d-2f72-45db-ab57-04b84aa97b90"
log_message="Workflow 'Get ID of
Workflow/8f59ca66-7472-4efa-ac5f-dfc34059c5f1' updated (with
content)." priority="INFO" product="vro" token="" user="" wfid=""
wfname="" wfstack=""] 2018-05-02 13:53:48.079+0000 vco:
[component="WorkflowManagementServiceImpl" priority="INFO"
thread="https-jsse-nio-0.0.0.0-8281-exec-7" user="" context=""
token="" wfid="" wfname="" anctoken="" wfstack=""
instanceid="6a6dbf1d-2f72-45db-ab57-04b84aa97b90"] Workflow 'Get ID of
Workflow/8f59ca66-7472-4efa-ac5f-dfc34059c5f1' updated (with content).
The information we are trying to search for is:
component="WorkflowManagementServiceImpl"
AND more importantly:
Workflow 'Get ID of Workflow/8f59ca66-7472-4efa-ac5f-dfc34059c5f1'
The top criteria should always be the same, but the Workflow name and ID will change. The only part that remains the same within this bit of text is Workflow ' and the final '
We are currently trying our queries against the Workflow name and ID to see if we can match on that, but our queries return no results.
The regex we currently have is as follows, and we have tried numerous alternatives.
/(?<=Workflow '.*\/)(.*')/
If we run the search * Workflow * (wildcard, without the spaces) - it returns everything with the word Workflow as expected.
If we run the search Workflow we get no results.
If anyone can provide pointers towards where we are going wrong, or getting confused, that would be great!
Thanks
We resolved this by using Grok filters in Logstash to organise/clean the data before it hits the Elasticsearch Indexes, then we were able to search successfully within Kibana.
I am working with Facebook graph api for few days. I am trying to extract user's status and the information of reshared if any. I can easily find status of a user using fields=id,name,statuses query. But I could not find any information about re-sharing. I found a field of status sharedposts. But could not understand what it actually does. Can anyone enlighten me about how can I collect information about resharing (who reshared,when reshared,resharing location). I used user_status access token.
The sharedposts field applies to a status id. For example, the status id 10151794781777494 is from a status update by the TheKrazyCouponLady which has been shared 4 times. This query:
/10151794781777494?fields=sharedposts
Will return all the information about the users that have shared it. If you want to limit the returned fields to the name and id of the sharer, and the time and location it was shared, you could do this:
/10151794781777494?fields=sharedposts.fields(from,created_time,place)
Although I expect there won't be any location data most of the time.
To find the status id in the first place, you could just query the statuses field for a particular user. Again, using TheKrazyCouponLady (uid 255919387493) as an example:
/255919387493?fields=statuses
To get just the ids:
/255919387493?fields=statuses.fields(id)
As an alternative to that, you may want to consider querying the user's posts instead. The advantage to using posts, is that you can get back the share count for each post in that query.
/255919387493?fields=posts.fields(id,shares)
If the share count on a post is zero, then there is obviously no need to run another query to retrieve the users that have shared that post.
The downside of using posts is that the post id is slightly different from a status id. You'll see ids that look like this:
255919387493_10151794781777494
The first half of that string is the user id of the post owner. The second half is the actual status id. If you want to query the sharedposts field for the post, you first have to extract the second half (the status id) and use that for the query.
Having said that, it occurs to me that you could actually retrieve all the information you need in one go if you chain the statuses query and the sharedposts query together. For example, something like this:
/255919387493?fields=statuses.fields(id,message,sharedposts.fields(from,created_time,place))
That will return the status id and message text for each status from that user, and the user details, create time and location for each person that shared each of those statuses.
Even with paging, though, that is likely to be a fairly slow query, so I'm not sure if that's such a good idea. It's worth considering though.
According new version of API 2.1 and documentation from here
https://developers.facebook.com/docs/graph-api/reference/v2.1/post
there is a new edge called "sharedposts"
As described here https://developers.facebook.com/docs/graph-api/reference/v2.1/object/sharedposts
This reference describes the /sharedposts edge that is common to
multiple Graph API nodes. The structure and operations are the same
for each node.
This edge represents any posts where the original object was shared on
Facebook.
If the post type is photo sharedposts will return empty as the object is different to the postID
/317380948302131_847979698575584 => Object : 847979378575616
/317380948302131_847979698575584/sharedposts?fields=from,via
ObjectID will work as expected
/847979378575616//sharedposts?fields=from,via
The only problem if the object is a shared_post it will show all shares from the original post object too and no via node is present .
Just struggle around some time why the APi only sometimes return sharedposts
I'm currently trying to query the facebook api to retrieve some data via batch-requests with two fql queries.
One of the queries fetches a set of album ids in the form of:
Select aid FROM album WHERE ...
While the other one tries to retrieve photos for the found albums:
SELECT ... FROM photo WHERE aid IN ({result=album_ids:$.*.aid})
Where 'album_ids' is the name of the first query.
Most of the time this works perfectly but sometimes a album comes along with an aid containing a '_' - Which would be perfectly fine since the documentation specifies the aid as string.
However the jsonpath in the second query does not quote the ids according to the facebook api:
Parser error: unexpected '_xxxxx' at position xx
...
SELECT ... FROM photo WHERE aid IN (10000xxxxxxxxxx_xxxxx)
The json result for the first query clearly has them quoted:
[{\"aid\":\"xxxxxxxxxxxxxxxxxxx\"},{\"aid\":\"10000xxxxxxxxxx_xxxxx\"},...]
Am i missing something here or does facebook wrongly skip to quote the ids in the second query even though they are clearly strings.
As far as i see in the facebook-api and jsonpath specs this should be working.
Or is there a work-around to get this to behave as expected? (Except of doing the quoting client-side and with two seperate requests).
Right now i'm trying to change my query as suggested here: Quoting/escaping jsonpath elements for in clause of dependent fql queries
But maybe there is a way without completely re-structuring the queries itself.
I am querying Amazon's Product Advertising API for Instant Video (streaming) results. Everything is working fine -- except that there is some missing information:
Descriptions are not included in results. For example, on Amazon's website the movie "Food, Inc" (http://www.amazon.com/Food-Inc/dp/B002VRZEYM) has the description "An unflattering look inside America's corporate controlled food industry.". When queried via the API, however, no description is returned at all.
Titles of TV shows are not included in results. For example, if you search for the 2nd episode of season 1 of Arrested Development (called "Top Banana") on Amazon's website (http://www.amazon.com/gp/product/B000N2VRJ8), you will get the full name of the TV show, season #, episode #, and episode name. When queried by the API, however, only the episode name is returned.
Does anyone know of a solution to these problems? FYI, the nodeId I am using for my search is 2858778011.
In order to get more details, you'll need to set the ResponseGroup parameter in your request. See the ResponseGroup section of the ItemLookup documentation to see the different Response Groups that you can use.
For example, setting the ResponseGroup parameter to Large or Medium or Small or even ItemAttributes will give you the description:
An unflattering look inside America's corporate controlled food industry.
for Food, Inc (B002VRZEYM) and the Title:
Top Banana
for Arrested Development season 1 episode 2 (B000N2VRJ8).
I had the same problem, while trying to query the Amazon API for Prime Instant Video content. Although this question is kinda old, there are probably some people like me who are interested in a detailed answer, especially for the second part (2.).
Like Jonathan Spooner already said, you have to set a response group
that returns the data you're interested in. Official documentation: Response Groups - Product Advertising API.
In your case, I think, the ResponseGroup Small should do.
If you want to get the title of a TV show, which contains a certain episode, you have to set the response group RelatedItems in your request, too (you can set multiple response groups in one request). You will also have to name a RelationshipType, otherwise the request will fail. For Episode -- Season - Relationships you choose Episode.
With RelatedItems, the result will contain a node named <RelatedItems>. You will find the season item in there, which's title should be something like " Arrested Development - Season 1 [HD]".
Note: If you really just want the TV show title, you could either parse the season name for it or you could make another ItemLookup with the seasons ASIN: set the response group RelatedItems again, but this time with RelationshipType=Season. This will return Season - TV Series - Relationships. The related item will contain the TV Show in general. (But the title could have a suffix like [HD] anyway)
Here you have a list with all relationship types: Relationship Types - Product Advertising API