After discussing this with Amol, we decided to revert to the previous version of n_routine_bloodwork, which excludes any blood tests that don't have valid results. The reason for this is that tests without valid results can be tests that were cancelled/not performed/not ordered at certain sites, so if we include those tests, we may be overcounting tests at certain hospitals (depending on whether they send us non-performed tests or not).
In the previous version of the code, the following code was use to extract valid numeric results:
For the developer: The previous code likely needs to be updated! Please carefully double check which entries in result_value can be converted to valid numeric results for sodium and hemoglobin tests. For hemoglobin tests, this code is used in n_rbc_transfusions:
Please check if this also works for sodium tests, or if this would miss certain entries that can be converted to numeric results with additional clean up.
New Feature Request
After discussing this with Amol, we decided to revert to the previous version of
n_routine_bloodwork
, which excludes any blood tests that don't have valid results. The reason for this is that tests without valid results can be tests that were cancelled/not performed/not ordered at certain sites, so if we include those tests, we may be overcounting tests at certain hospitals (depending on whether they send us non-performed tests or not).In the previous version of the code, the following code was use to extract valid numeric results:
For the developer: The previous code likely needs to be updated! Please carefully double check which entries in
result_value
can be converted to valid numeric results for sodium and hemoglobin tests. For hemoglobin tests, this code is used inn_rbc_transfusions
:Please check if this also works for sodium tests, or if this would miss certain entries that can be converted to numeric results with additional clean up.