E.g. patient.phone path should filter by Patient.telecom(system=phone),
so basically it should be roughly the same as search for patient.telecom=phone|value
Atm it does not discriminate by the system
SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id1","telecom":[{"system":"phone","value":"(03) 5555 6473","use":"work"},{"system":"email","value":"person1@example.org","use":"work"}],"active":true,"resourceType":"Patient"}}');
SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id2","telecom":[{"value":"(03) 6666 6473","use":"work"},{"system":"other","value":"asdf@asdf.com","use":"home"}],"active":true,"resourceType":"Patient"}}');
SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id3","telecom":[{"system":"phone","value":"(03) 5555 6473","use":"home"},{"system":"other","value":"same phone as id1 but with other use","use":"work"}],"active":true,"resourceType":"Patient"}}');
SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id4","telecom":[{"system":"fax","value":"(03) 5555 6473","use":"work"},{"system":"other","value":"same phone as id1 but with other system","use":"work"}],"active":true,"resourceType":"Patient"}}');
SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id5","telecom":[{"system":"email","value":"asdf@asdf.com","use":"work"}],"active":true,"resourceType":"Patient"}}');
SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id6","telecom":[{"system":"phone","value":"12341234"}],"active":true,"resourceType":"Patient"}}');
SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id7","active":true,"resourceType":"Patient"}}');
SELECT fhir_search('{"resourceType": "Patient", "queryString": "phone=6666"}'); -- ok, 0 res
SELECT fhir_search('{"resourceType": "Patient", "queryString": "phone=12341234"}'); -- ok, 1 res
SELECT fhir_search('{"resourceType": "Patient", "queryString": "phone=(03) 5555 6473"}'); -- nok, got 3 results instead of 2, the system seems to be not enforced
SELECT fhir_search('{"resourceType": "Patient", "queryString": "phone=phone|(03) 5555 6473"}'); -- ok,2 res but the system should be enforced by default
SELECT fhir_search('{"resourceType": "Patient", "queryString": "phone=nonexisting"}'); -- ok, 0 res
SELECT fhir_search('{"resourceType": "Patient", "queryString": "phone:missing=true"}'); -- nok, got id7 only
SELECT fhir_search('{"resourceType": "Patient", "queryString": "phone:missing=phone|true"}'); -- nok, got id7 only
SELECT fhir_search('{"resourceType": "Patient", "queryString": "telecom:missing=phone|true"}'); -- nok, got id7 only
SELECT fhir_search('{"resourceType": "Patient", "queryString": "email=nonexisting"}'); -- ok, 0 res
SELECT fhir_search('{"resourceType": "Patient", "queryString": "email:missing=true"}'); -- nok, only id7 retrieved
SELECT fhir_search('{"resourceType": "Patient", "queryString": "email:missing=email|true"}'); -- nok, got 1 res, id7 only, expected id7, id6, id4, id3, id2
SELECT fhir_search('{"resourceType": "Patient", "queryString": "telecom:missing=email|true"}'); -- nok
SELECT fhir_search('{"resourceType": "Patient", "queryString": "email=asdf"}'); -- ok, 0 res
SELECT fhir_search('{"resourceType": "Patient", "queryString": "email=person1@example.org"}'); -- ok, 1 res
SELECT fhir_search('{"resourceType": "Patient", "queryString": "email=asdf@asdf.com"}'); -- nok, got id2, id5 when expected only id5
SELECT fhir_search('{"resourceType": "Patient", "queryString": "email=email|asdf@asdf.com"}'); -- ok, 1 res but system should be enforced by default
E.g. patient.phone path should filter by Patient.telecom(system=phone), so basically it should be roughly the same as search for patient.telecom=phone|value Atm it does not discriminate by the system SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id1","telecom":[{"system":"phone","value":"(03) 5555 6473","use":"work"},{"system":"email","value":"person1@example.org","use":"work"}],"active":true,"resourceType":"Patient"}}'); SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id2","telecom":[{"value":"(03) 6666 6473","use":"work"},{"system":"other","value":"asdf@asdf.com","use":"home"}],"active":true,"resourceType":"Patient"}}'); SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id3","telecom":[{"system":"phone","value":"(03) 5555 6473","use":"home"},{"system":"other","value":"same phone as id1 but with other use","use":"work"}],"active":true,"resourceType":"Patient"}}'); SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id4","telecom":[{"system":"fax","value":"(03) 5555 6473","use":"work"},{"system":"other","value":"same phone as id1 but with other system","use":"work"}],"active":true,"resourceType":"Patient"}}'); SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id5","telecom":[{"system":"email","value":"asdf@asdf.com","use":"work"}],"active":true,"resourceType":"Patient"}}'); SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id6","telecom":[{"system":"phone","value":"12341234"}],"active":true,"resourceType":"Patient"}}'); SELECT fhir_create_resource('{"allowId": true, "resource": {"id":"id7","active":true,"resourceType":"Patient"}}');