ExposuresProvider / icees-api

MIT License
2 stars 8 forks source link

Multivariate endpoint does not work with new enumeration of TotalEDInpatientVisits, TotalEDVisits, TotalInpatientVisits #294

Closed karafecho closed 10 months ago

karafecho commented 10 months ago

This issue is to report that the multivariate endpoint no longer works for TotalEDInpatientVisits, TotalEDVisits, and TotalInpatientVisits after we changed the enumeration, e.g.,

  TotalEDInpatientVisits:
    categories:
    - biolink:ClinicalIntervention
    enum:
    - 0
    - 1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    - '>9'
    name_lookup:
    - limit: 4
      search_term: hospitalization
    type: integer

For example, this runs:

curl -X 'POST' \
  'https://icees-pcd-dev.apps.renci.org/cohort/COHORT%3A1/multivariate_feature_analysis?year=2020' \
  -H 'accept: text/tabular' \
  -H 'Content-Type: application/json' \
  -d '[
  "Race",
  "Sex2",
  "PrednisoneRx"
]'

But this doesn't:

curl -X 'POST' \
  'https://icees-pcd-dev.apps.renci.org/cohort/COHORT%3A1/multivariate_feature_analysis' \
  -H 'accept: text/tabular' \
  -H 'Content-Type: application/json' \
  -d '[
  "TotalEDInpatientVisits",
  "Sex2",
  "PrednisoneRx"
]'
+------------------------------+
| error                        |
+==============================+
| 'int' object is not iterable |
+------------------------------+

The other endpoints appear to be fine.

For instance, this works:

curl -X 'POST' \
  'https://icees-pcd-dev.apps.renci.org/patient/cohort' \
  -H 'accept: text/tabular' \
  -H 'Content-Type: application/json' \
  -d '{"TotalEDInpatientVisits":{"operator":"=","value":9}}
'

As does this:

curl -X 'POST' \
  'https://icees-pcd-dev.apps.renci.org/patient/cohort' \
  -H 'accept: text/tabular' \
  -H 'Content-Type: application/json' \
  -d '{"TotalEDInpatientVisits":{"operator":">","value":9}}
'

And this:

curl -X 'POST' \
  'https://icees-pcd-dev.apps.renci.org/patient/cohort/COHORT%3A1/feature_association' \
  -H 'accept: text/tabular' \
  -H 'Content-Type: application/json' \
  -d '{
  "feature_a": {
    "TotalEDInpatientVisits": {
      "operator": ">",
      "value": "9"
    }
  },
  "feature_b": {
    "PrednisoneRx": {
      "operator": "=",
      "value": "0"
    }
  }
}'

This query also runs fine:


curl -X 'POST' \
  'https://icees-pcd-dev.apps.renci.org/patient/cohort/COHORT%3A1/associations_to_all_features' \
  -H 'accept: text/tabular' \
  -H 'Content-Type: application/json' \
  -d '{
  "feature": {
    "TotalEDInpatientVisits": {
      "operator": ">",
      "value": 9
    }
  },
  "maximum_p_value": 1,
  "correction": {
    "method": "bonferroni"
  }
}
```'
karafecho commented 10 months ago

Closing ticket, as a fix was put in place and tested ...