colorado-cancer-center / ecco

An interactive resource for exploring cancer data in Colorado
https://coe-ecco.org
Apache License 2.0
1 stars 2 forks source link

Cancer Incidence, Mortality not being returned for specific measures #53

Closed falquaddoomi closed 5 months ago

falquaddoomi commented 5 months ago

Some of the cancer incidence and mortality measures are returning no data, and the legend as a result displays a percentage.

Example: https://ecco.cu-dbmi.dev/?level=county&category=cancerincidence&measure=Ovary&lat=38.98302&long=-106.16467&zoom=7.8

Images from Jan's report on the Teams channel (thanks, Jan):

ovary incidence prostate incidence

vincerubinetti commented 5 months ago

As part of this, I should probably make it more explicit in the frontend when the backend is returning an empty values: {}. Maybe don't show the map and/or legend.

falquaddoomi commented 5 months ago

I think I realize now what's going on: these are sex-linked cancers, and for some reason CancerInFocus didn't decide to supply any values for gender "All".

@vincerubinetti, good ideas: hiding the legend makes sense since there's no way to construct a scale without data. I suppose technically the map is correct: there really isn't data for any geographic entity in those cases.

Still, I think we should avoid users getting into this situation where there's no data for their selection. Currently, the results returned from /stats/measures for, say, cancer mortality look like this:

{
  "label": "Cancer Mortality (age-adj per 100k)",
  "measures": {
    "All Site": {
      "label": "All Cancer Sites"
    },
    "Bladder": {
      "label": "Bladder"
    },
    "Brain & ONS": {
      "label": "Brain & ONS"
    },
    "Cervix": {
      "label": "Cervix"
    },
    "Colon & Rectum": {
      "label": "Colon & Rectum"
    },
    "Corpus Uteri & Uterus, NOS": {
      "label": "Corpus Uteri & Uterus, NOS"
    },
    "Esophagus": {
      "label": "Esophagus"
    },
    "Female Breast": {
      "label": "Female Breast"
    },
    "Kidney & Renal Pelvis": {
      "label": "Kidney & Renal Pelvis"
    },
    "Leukemia": {
      "label": "Leukemia"
    },
    "Liver & IBD": {
      "label": "Liver & IBD"
    },
    "Lung & Bronchus": {
      "label": "Lung & Bronchus"
    },
    "Melanoma of the Skin": {
      "label": "Melanoma of the Skin"
    },
    "Non-Hodgkin Lymphoma": {
      "label": "Non-Hodgkin Lymphoma"
    },
    "Oral Cavity & Pharynx": {
      "label": "Oral Cavity & Pharynx"
    },
    "Ovary": {
      "label": "Ovary"
    },
    "Pancreas": {
      "label": "Pancreas"
    },
    "Prostate": {
      "label": "Prostate"
    },
    "Stomach": {
      "label": "Stomach"
    },
    "Thyroid": {
      "label": "Thyroid"
    }
  },
  "factors": {
    "RE": {
      "label": "Race/Ethnicity",
      "default": "All",
      "values": {
        "All": "All",
        "Black NH": "Black (non-Hispanic)",
        "Hispanic": "Hispanic",
        "White NH": "White (Non-Hispanic)"
      }
    },
    "Sex": {
      "label": "Sex",
      "default": "All",
      "values": {
        "All": "All",
        "Female": "Female",
        "Male": "Male"
      }
    }
  }
}

The factor metadata is at the measure category level (e.g., "Cancer Mortality"), but we could instead move it to the measure level ("Ovary"). At that point, we could provide counts of the factor values that match that particular measure, or I could just leave out factors that have no data.

We'd probably want to rearrange the UI so that the measure selection occurs before the factor selection, since we won't have values for the factor dropdowns until they select a measure. The UI would then filter out factor values with counts of 0, if we provided counts, from the factor selection dropdowns. If I omit the factors without data, then the UI doesn't need to do anything different aside from retrieve the factors from a different location in the /stats/measures response object.

vincerubinetti commented 5 months ago

Okay so the response would instead look like:

{
  "label": "Cancer Mortality (age-adj per 100k)",
  "measures": {
    "All Site": {
      "label": "All Cancer Sites",
      "factors": {
          "RE": {
            "label": "Race/Ethnicity",
            "default": "All",
            "values": {
              "All": "All",
              "Black NH": "Black (non-Hispanic)",
              "Hispanic": "Hispanic",
              "White NH": "White (Non-Hispanic)"
            }
          },
       },
    },
}

or I could just leave out factors that have no data.

Seems like it'd be cleaner to do this on the backend, in the case of someone using the API directly wouldn't get much value out of seeing the factor listed there if it has no data associated with it? Not a big deal for me to filter it on the frontend if that is easier.