Closed Andrzej-Pietrzak closed 7 years ago
SELECT fhir_truncate_storage('{"resourceType": "Patient"}'); SELECT fhir_create_resource('{"resource": {"resourceType": "Patient", "name": [{"family": ["asdf"]}] }}'); SELECT fhir_create_resource('{"resource": {"resourceType": "Patient", "name": [{"family": ["asdf"]}] }}'); SELECT fhir_create_resource('{"resource": {"resourceType": "Patient", "name": [{"family": ["asdf"]}] }}'); SELECT fhir_create_resource('{"resource": {"resourceType": "Patient", "name": [{"family": ["asdf"]}] }}'); SELECT fhir_create_resource('{"resource": {"resourceType": "Patient", "name": [{"family": ["asdf"]}] }}'); SELECT fhir_create_resource('{"allowId": true, "resource": {"resourceType": "Patient", "id": "id1", "name": [{"family": ["First"]}] }}'); SELECT fhir_update_resource('{"resource": {"resourceType": "Patient", "id": "id1", "name": [{"family": ["Second"]}] }}'); SELECT fhir_update_resource('{"resource": {"resourceType": "Patient", "id": "id1", "name": [{"family": ["Third"]}] }}'); SELECT fhir_create_resource('{"allowId": true, "resource": {"resourceType": "Patient", "id": "id2", "name": [{"family": ["Alfa"]}] }}'); SELECT fhir_update_resource('{"resource": {"resourceType": "Patient", "id": "id2", "name": [{"family": ["Beta"]}] }}'); SELECT fhir_update_resource('{"resource": {"resourceType": "Patient", "id": "id2", "name": [{"family": ["Gamma"]}] }}'); SELECT fhir_resource_history('{"resourceType": "Patient", "id": "id1", "queryString": "_since=2015-07-15"}'); -- nok, got 11 results, expected 3
Instance history works fine:
SELECT fhir_resource_history('{"resourceType": "Patient", "id": "id1"}'); -- ok, 3 results
for extracted last updated dates for id1: '0' => "2016-07-18T08:45:38.890Z" '1' => "2016-07-18T08:45:32.488Z" '2' => "2016-07-18T08:45:26.118Z"
Unfortunately when providing _since param the id is ignored:
SELECT fhir_resource_history('{"resourceType": "Patient", "id": "id1", "queryString": "_since=2016-07-18T08:45:32.488Z"}'); -- nok, 4 results - id1, id2, id2, id2 SELECT fhir_resource_history('{"resourceType": "Patient", "id": "id1", "queryString": "_since=2016-07-17"}'); -- nok, 11 results
patient history queries return other patients history if someone adds a _since parameter
Instance history works fine:
for extracted last updated dates for id1: '0' => "2016-07-18T08:45:38.890Z" '1' => "2016-07-18T08:45:32.488Z" '2' => "2016-07-18T08:45:26.118Z"
Unfortunately when providing _since param the id is ignored: