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

Operator issue at Features endpoint #305

Closed
karafecho opened this issue Feb 29, 2024 · 2 comments
Closed

Operator issue at Features endpoint #305

karafecho opened this issue Feb 29, 2024 · 2 comments
Assignees

Comments

@karafecho
Copy link
Contributor

This issue is to report an apparent operator issue at the Features endpoint. Specifically, in the example below, COHORT:11 is defined as TotalEDInpatientVisits>=9 in all patients (not those in year=2020, for example).

    {
      "cohort_id": "COHORT:11",
      "size": 767,
      "features": {
        "TotalEDInpatientVisits": {
          "operator": ">=",
          "value": "9"
        }
      }
    },

As such, the Features endpoint should be returning results for TotalEDInpatientVisits>9 only. But this is what I'm seeing when restricting the query to year=2020.

curl -X 'GET' \
  'https://icees-pcd.renci.org/patient/cohort/COHORT%3A11/features?year=2020' \
  -H 'accept: text/tabular'
+----------------------------+---------+
| feature                    | count   |
+============================+=========+
| TotalEDInpatientVisits = 0 | 125     |
|                            | 11.15%  |
+----------------------------+---------+
| TotalEDInpatientVisits = 1 | 64      |
|                            | 5.71%   |
+----------------------------+---------+
| TotalEDInpatientVisits = 2 | 64      |
|                            | 5.71%   |
+----------------------------+---------+
| TotalEDInpatientVisits = 3 | 59      |
|                            | 5.26%   |
+----------------------------+---------+
| TotalEDInpatientVisits = 4 | 33      |
|                            | 2.94%   |
+----------------------------+---------+
| TotalEDInpatientVisits = 5 | 38      |
|                            | 3.39%   |
+----------------------------+---------+
| TotalEDInpatientVisits = 6 | 43      |
|                            | 3.84%   |
+----------------------------+---------+
| TotalEDInpatientVisits = 7 | 35      |
|                            | 3.12%   |
+----------------------------+---------+
| TotalEDInpatientVisits = 8 | 49      |
|                            | 4.37%   |
+----------------------------+---------+
| TotalEDInpatientVisits = 9 | 74      |
|                            | 6.60%   |
+----------------------------+---------+
| TotalEDInpatientVisits > 9 | 537     |
|                            | 47.90%  |
+----------------------------+---------+
@karafecho
Copy link
Contributor Author

All bugs have been fixed in the code supporting the PCD and DILI instances, deployed to DEV, tested, deployed to PROD, and retested. Note that the asthma and COVID instances will need to be updated at some point in the future.

karafecho pushed a commit that referenced this issue Mar 27, 2024
…in features endpoint (#305) (#309)

* fixed the in operator

* addressed issue #305 with cohort constraint for features endpoint

* fixing test

* fixed test

* revert previous syntax in test

* addressed a couple of more issues discovered from bug fix testing
@karafecho
Copy link
Contributor Author

Bug fixed and tested, so closing ticket ...

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