LTHTR-DST / hdruk_avoidable_admissions

HDRUK Data Science Collaboration on Avoidable Admissions in the NHS.
https://lthtr-dst.github.io/hdruk_avoidable_admissions/
MIT License
6 stars 5 forks source link

feat: ed validation #21

Closed ccarenzoIC closed 1 year ago

ccarenzoIC commented 1 year ago

-Fixed url that was generating wrong snomed members for diagnosis and acuity -Rewrote nhsdd_snomed.py -Added validation of snomed codes to ed schema from ecds refset -Added acsc diagnosis feature for ed schema

vvcb commented 1 year ago

@ccarenzoIC , thank you once again for this. I have been looking at this in the context of the feature engineering step.

Most of the SNOMED codes that have to be validated in the first step will then have to be assigned to various categories as described by Sheffield in https://docs.google.com/document/d/1vysTKmvELK-5Rr7Dib3zDp8mCe_lUVr2e5EES23ShbQ/edit.

I have done this for the acute admits dataset in features.feature_maps.py. But, I didn't finish this for the ed dataset as many of the codes in the google document were not SNOMED codes. Once they are validated, it will be good to move these codes from nhsdd_snomed.py into feature_maps.py.

The way feature_maps.py works is quite simple. There are dictionaries assigned to column names. We use these as follows:

  1. In the first validation step, we use the keys in these dicts to validate the contents of the columns using Check.isin.
  2. In the feature engineering step, we use the entire dictionary to do a df.colname.replace(<dict>)
  3. In the second validation step, we use the values in the dicts to validate the contents of the new feature column.

Hope that makes sense. We can then maintain all SNOMED codes and how should they be categorised within feature_maps.py. Welcome your thoughts on this.

ccarenzoIC commented 1 year ago

Hi @vvcb. It makes sense to me to move these data dictionary codes from nhsdd_snomed.py into feature_maps.py, once they are validated, with their corresponding categories. Thanks for working on this!!

Let me know if any assistance is needed.