Hopefully on a roll here . I've made the following edits, grateful if someone could check/ approve:
1) create_smr_data.R - Added in location names for the updated HB codes as these aren't in the National Ref File HB lookup file and were getting dropped. - Tested and works.
2) create_trends_data.R - Same as above.
3) sql_smr.R - We were still pulling in old_tadm for prev_emerg, have updated this to pull in current admission type variable.
4) smr_pmorbs.R - Have amended to reference new admission type instead of old_tadm variable and select out emergency admission codes related to this updated variable when calculating n_emerg.
Not tested amendments 3 & 4 work yet so hopefully I haven't broken anything!
Hopefully on a roll here . I've made the following edits, grateful if someone could check/ approve:
1) create_smr_data.R - Added in location names for the updated HB codes as these aren't in the National Ref File HB lookup file and were getting dropped. - Tested and works. 2) create_trends_data.R - Same as above. 3) sql_smr.R - We were still pulling in old_tadm for prev_emerg, have updated this to pull in current admission type variable. 4) smr_pmorbs.R - Have amended to reference new admission type instead of old_tadm variable and select out emergency admission codes related to this updated variable when calculating n_emerg.
Not tested amendments 3 & 4 work yet so hopefully I haven't broken anything!