Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sorting Appointment on location sorts on first elem in participant table instead of location #137

Open
karsiwek-kainos opened this issue Jun 21, 2016 · 0 comments

Comments

@karsiwek-kainos
Copy link
Contributor

karsiwek-kainos commented Jun 21, 2016

select fhir_search('{"resourceType":"Appointment", "queryString":"_sort=location"}');

sorts data on first element in "participant" and it should look for location type actor.

example:
having appointments:

{  
    "resourceType":"Appointment",
    "id":"1",
    ...
    "participant":[  
        {  
            "actor":{  
                "reference":"Patient/2",
                "display":"Peter James Chalmers"
            },
            "required":"information-only",
            "status":"accepted"
        },
        {  
            "actor":{  
                "reference":"Location/2",
                "display":"location B"
            },
            "required":"required",
            "status":"accepted"
        },
  ...
    ]
}
{  
    "resourceType":"Appointment",
    "id":"2",
    ...
    "participant":[  
        {  
            "actor":{  
                "reference":"Patient/3",
                "display":"Peter James Chalmers"
            },
            "required":"information-only",
            "status":"accepted"
        },
        {  
            "actor":{  
                "reference":"Location/1",
                "display":"location A"
            },
            "required":"required",
            "status":"accepted"
        },
  ...
    ]
}
{  
    "resourceType":"Appointment",
    "id":"2",
    ...
    "participant":[  
        {  
            "actor":{  
                "reference":"Patient/1",
                "display":"Peter James Chalmers"
            },
            "required":"information-only",
            "status":"accepted"
        },
        {  
            "actor":{  
                "reference":"Location/3",
                "display":"location C"
            },
            "required":"required",
            "status":"accepted"
        },
  ...
    ]
}

query : select fhir_search('{"resourceType":"Appointment", "queryString":"_sort=location"}'); should return appointments in order 2,3,1 (id's), but returns 3,1,2.

it looks like it's sorting patients and not locations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant