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

Sort search parameter of Observations does not changes result order #90

Closed
androBermudez opened this issue May 2, 2019 · 1 comment
Closed

Comments

@androBermudez
Copy link

When retrieving all observations with the same code the result is not sorted.

GET /Patient/pat1/Observation?_count=10&_totalMethod=count&code=29463-7&_sort=-date
GET /Patient/pat1/Observation?_count=10&_totalMethod=count&code=29463-7&_sort=date
GET /Observation?_count=10&_totalMethod=count&subject=pat1&code=29463-7&_sort=-date
GET /Observation?_count=10&_totalMethod=count&subject=pat1&code=29463-7&_sort=date

this is the result:

{
  "resourceType": "Bundle",
  "type": "search",
  "entry": [
    {
      "resource": {
        "category": [
          {
            "coding": [
              {
                "code": "vital-signs",
                "system": "http://hl7.org/fhir/observation-category",
                "display": "Vital Signs"
              }
            ]
          }
        ],
        "meta": {
          "lastUpdated": "2019-04-26T13:53:11.630Z",
          "versionId": "1797"
        },
        "value": {
          "Quantity": {
            "code": "[lb_av]",
            "unit": "lbs",
            "value": 183,
            "system": "http://unitsofmeasure.org"
          }
        },
        "resourceType": "Observation",
        "status": "final",
        "effective": {
          "dateTime": "2018-02-01T14:10:00Z"
        },
        "id": "weight2",
        "code": {
          "coding": [
            {
              "code": "29463-7",
              "system": "http://loinc.org",
              "display": "Body Weight"
            }
          ]
        },
        "subject": {
          "id": "pat1",
          "resourceType": "Patient"
        }
      }
    },
    {
      "resource": {
        "category": [
          {
            "coding": [
              {
                "code": "vital-signs",
                "system": "http://hl7.org/fhir/observation-category",
                "display": "Vital Signs"
              }
            ]
          }
        ],
        "meta": {
          "lastUpdated": "2019-04-26T13:53:11.632Z",
          "versionId": "1798"
        },
        "value": {
          "Quantity": {
            "code": "[lb_av]",
            "unit": "lbs",
            "value": 181,
            "system": "http://unitsofmeasure.org"
          }
        },
        "resourceType": "Observation",
        "status": "final",
        "effective": {
          "dateTime": "2018-05-05T14:10:00Z"
        },
        "id": "weight3",
        "code": {
          "coding": [
            {
              "code": "29463-7",
              "system": "http://loinc.org",
              "display": "Body Weight"
            }
          ]
        },
        "subject": {
          "id": "pat1",
          "resourceType": "Patient"
        }
      }
    },
    {
      "resource": {
        "category": [
          {
            "coding": [
              {
                "code": "vital-signs",
                "system": "http://hl7.org/fhir/observation-category",
                "display": "Vital Signs"
              }
            ]
          }
        ],
        "meta": {
          "lastUpdated": "2019-04-26T13:53:11.520Z",
          "versionId": "1796"
        },
        "value": {
          "Quantity": {
            "code": "[lb_av]",
            "unit": "lbs",
            "value": 173,
            "system": "http://unitsofmeasure.org"
          }
        },
        "resourceType": "Observation",
        "status": "final",
        "effective": {
          "dateTime": "2018-05-03T10:10:00Z"
        },
        "id": "weight",
        "code": {
          "coding": [
            {
              "code": "29463-7",
              "system": "http://loinc.org",
              "display": "Body Weight"
            }
          ]
        },
        "subject": {
          "id": "pat1",
          "resourceType": "Patient"
        }
      }
    }
  ],
  "total": 3
}

The same with /fhir/... endpoint.

@niquola
Copy link
Member

niquola commented May 7, 2019

will be fixed in 0.4.3

@niquola niquola closed this as completed May 7, 2019
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

2 participants