ExposuresProvider / icees-api

MIT License
2 stars 8 forks source link

Operator issue at Features endpoint #305

Closed karafecho closed 4 months ago

karafecho commented 6 months ago

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 commented 5 months ago

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 commented 4 months ago

Bug fixed and tested, so closing ticket ...