FHIR Chat · GraphQL query through SmileCDR FHIR resources · implementers

Stream: implementers

Topic: GraphQL query through SmileCDR FHIR resources


view this post on Zulip Amit Maheshwari (Mar 26 2021 at 13:38):

I hv been unsuccessful to find out a query method that returns all specific components from a bundle json.
Below shared query gives me the outcome however I have not been able to get a specific field value in the query response

Query: http://localhost:8000/$graphql?query={ObservationList { status, code
{coding { display }} valueQuantity {value, unit} encounter{ reference,
resource(type:Encounter) { status, class {display}, period{start, end}
, reasonCode{ coding{display, code} }, participant{
type{coding{display}}} } } subject{reference, resource(type:Patient){
name{use, family, given, suffix}, identifier{value}, telecom{system,
value, use}, gender, birthDate, address{ city, state, postalCode,
country}, maritalStatus{coding{display}},
communication{language{text}}}}} }} } }

What I additionally want is to pull the name of Location (resourcetype:location) available in the encounter.json encounter.fhir.json

Any help is appreciated.
FYI.. I am working on a POC through SmileCDR

view this post on Zulip Lloyd McKenzie (Mar 26 2021 at 13:48):

@Grahame Grieve

view this post on Zulip Amit Maheshwari (Mar 30 2021 at 11:32):

found the solution.. here it goes.

http://localhost:8000/$graphql?query={ObservationList { status, code{coding { display }} valueQuantity {value, unit} encounter{ reference,resource(type:Encounter) { contained( _count:5, _offset:0, mode:instance){name}, status, class {display}, period{start, end}, reasonCode{ coding{display, code} }, participant{type{coding{display}}} } } subject{reference, resource(type:Patient){ name{use, family, given, suffix}, identifier{value}, telecom{system,value, use}, gender, birthDate, address{ city, state, postalCode, country}, maritalStatus{coding{display}},communication{language{text}}}}} }} } }

Lets close the query

view this post on Zulip dsh (Apr 16 2021 at 05:46):

Does this query work with HAPI 5.3.0 ?

view this post on Zulip dsh (Apr 16 2021 at 05:47):

@Amit Maheshwari ^ seems like it works against 5.4.0 snapshot

view this post on Zulip Amit Maheshwari (Apr 19 2021 at 18:58):

@Grahame Grieve** Following query works fine to bring a full list of Observation, Encounter, Patient for all patient that exists in database.
Is there a way to run this same query for a specific patient resource or for a specific patient secondary identification??**

http://localhost:8000/$graphql?query={ObservationList{ status, code{coding { display }}valueQuantity {value, unit} encounter { reference,resource(type:Encounter) { location(_count:1, _offset:0){location{reference, resource(type:Location){name, description}}}, contained( _count:5, _offset:0, mode:instance){name}, status, class {display}, period{start, end}, reasonCode{ coding{display, code}, text }, participant{type{coding{display}}} } } subject{reference, resource(type:Patient){ name{use, family, given, suffix}, identifier{value}, telecom{system,value, use}, gender, birthDate, address{ city, state, postalCode, country}, maritalStatus{coding{display}},communication{language{text}}}}} }

view this post on Zulip Grahame Grieve (Apr 19 2021 at 23:13):

sure just extend the query. I'm not exactly sure what you're asking, actually

view this post on Zulip Amit Maheshwari (Apr 20 2021 at 05:20):

It should, if HAPI supports GraphQL query method

view this post on Zulip Amit Maheshwari (Apr 20 2021 at 05:23):

@Grahame Grieve The query above gives output with full list of observations (alongwith other defined datavalues) FOR ALL Patients that I have in SmileDB. What I want to do is run this same query for a particular Patient resource ID or Patient resource secondary ID. Is that possible ? if yes. what method. Thanks

view this post on Zulip Lloyd McKenzie (Apr 20 2021 at 13:14):

@James Agnew


Last updated: Apr 12 2022 at 19:14 UTC