Does chained searching work ?

69 views
Skip to first unread message

ren...@gmail.com

unread,
Jul 27, 2016, 3:52:31 AM7/27/16
to FHIRbase
I have a patient resource as below ( i.e the Patient's name is rtest782322)

{"id": "8084481F-1A3E-4335-40BC-E88419", "meta": {"extension": [{"url": "fhir-request-method", "valueString": "POST"}, {"url": "fhir-request-uri", "valueUri": "Patient"}], "versionId": "63522952-5670-4e89-823c-5bcc7f4d1762", "lastUpdated": "2016-07-08T06:33:33.946Z"}, "name": [{"use": "official", "given": ["rtest782322"], "family": [" "], "prefix": ["Mr"]}], "active": true, "gender": "Male", "address": [{"city": "North", "line": ["Bedok", "SG"], "country": "SGP"}], "telecom": [{"use": "mobile", "value": "", "system": "phone"}], "birthDate": "1955-04-03T00:00:00+08:00", "extension": [{"url": "race", "valueInteger": "0"}, {"url": "nationality", "valueInteger": "0"}, {"url": "birthCountry", "valueInteger": "0"}, {"url": "residencyStatus", "valueInteger": "0"}, {"url": "http://aquilahealth.com/fhir/metadata#logicalId", "valueString": "8084481F-1A3E-4335-40BC-E88419"}], "identifier": [{"use": "official", "value": "34242354", "system": "NationalID"}], "resourceType": "Patient", "maritalStatus": {"text": "{\"insname\":\"\",\"inspkg\":\"\",\"insaccnum\":\"\",\"inslimit\":\"\",\"insremarks\":\"\"}"}, "deceasedBoolean": false, "managingOrganization": {"display": "Acme University Medical Centre", "reference": "Organization/1000"}, "multipleBirthBoolean": false}

and an encounter with the patient

{
    "id": "f724ab2d-3004-4aba-866b-dd491fc0e369",
    "meta": {
        "extension": [{
            "url": "fhir-request-method",
            "valueString": "PUT"
        },
        {
            "url": "fhir-request-uri",
            "valueUri": "Encounter"
        }],
        "versionId": "827ef700-fb05-42e3-91b5-83e367a8bf4e",
        "lastUpdated": "2016-07-26T02:53:52.760Z"
    },
    "type": [{
        "coding": [{
            "code": "270427003",
            "system": "http://snomed.info/sct",
            "display": "Patient-initiated encounter"
        }]
    }],
    "class": "private",
    "period": {
        "end": "2016-07-26 10:53",
        "start": "2016-07-26T02:22"
    },
    "reason": {
        "coding": [{
            "code": 11429006,
            "system": "http://snomed.info/sct",
            "display": "Consultation (procedure)"
        }]
    },
    "status": "finished",
    "patient": [{"reference": "Patient/8084481F-1A3E-4335-40BC-E88419",
        "display": "rtest"}],
    "editable": false, "location": [{"period": [], "status": "", "location": {"display": "SouthWing,secondfloor", "reference": "Location/1"}, "extension": [{"url": "http: //www.aquilahealth.com/fhir-ext/movementReason"}], "modifierExtension": []}], "priority": {"text": "", "coding": [{"code": "", "system": "", "display": ""}]}, "extension": [{"url": "http: //www.aquilahealth.com/fhir-ext/serviceSpecialty"}, {"url": "http: //www.aquilahealth.com/fhir-ext/arrivalMode"}], "identifier": [{"value": 1469499736, "system": "SGH"}], "participant": [{"type": [{"text": "", "coding": [{"code": "", "system": "", "display": ""}]}], "extension": [{"url": "http://www.aquilahealth.com/fhir-ext/period"}], "individual": {"display": "Doctor1LimMD(874635264)", "reference": "Practitioner/1000"}, "modifierExtension": []}], "resourceType": "Encounter", "hospitalization": {"diet": {"text": "", "coding": [{"code": "", "system": "", "display": ""}]}, "origin": [], "period": [], "extension": [], "admitSource": {"text": "", "coding": [{"code": "", "system": "", "display": ""}]}, "destination": [], "reAdmission": "", "accomodation": [], "specialCourtesy": [{"text": "", "coding": [{"code": "", "system": "", "display": ""}]}], "modifierExtension": [], "specialArrangement": [{"text": "", "coding": [{"code": "", "system": "", "display": ""}]}], "dischargeDisposition": {"text": "", "coding": [{"code": "", "system": "", "display": ""}]}, "dischargeDiagnosisCode": {"text": "", "coding": [{"code": "", "system": "", "display": ""}]}, "preAdmissionIdentifier": [], "dischargeSecDiagnosisCode": [{"text": "", "coding": [{"code": "", "system": "", "display": ""}]}]}, "serviceProvider": {"reference": "Organization/1000"}}

I tried searching for the encounter using

select fhir_search('{"resourceType": "Encounter", "queryString": "patient:Patient.name:contains=rtest"}')

but couldn't get any results from the search.

Николай Рыжиков

unread,
Jul 27, 2016, 6:58:31 AM7/27/16
to Ramarajulu Naidu, FHIRbase
Hi,
Should work, here is how it's done in tests - https://github.com/fhirbase/fhirbase-plv8/blob/master/test/fhir/search/chained_search.yaml

Try without :contains, i.e. ```select fhir_search('{"resourceType": "Encounter", "queryString": "patient:Patient.name=rtest"}')```

73's nicola

--
You received this message because you are subscribed to the Google Groups "FHIRbase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fhirbase+u...@googlegroups.com.
To post to this group, send email to fhir...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fhirbase/deb7849a-97d3-468c-879c-2f1ccced219d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ren...@gmail.com

unread,
Jul 28, 2016, 2:57:44 AM7/28/16
to FHIRbase, ren...@gmail.com

 Ok.. I found the problem, my Patient Id UUID was uppercase, the search worked after I converted it to lower case.

Rama.

Николай Рыжиков

unread,
Jul 28, 2016, 3:48:13 AM7/28/16
to Ramarajulu Naidu, FHIRbase
Reply all
Reply to author
Forward
0 new messages