medizininformatik-initiative / Projectathon6-miracum1

5 stars 4 forks source link

Script stops unexpectedtly with empty table df.conditions #8

Closed mw-uke closed 2 years ago

mw-uke commented 2 years ago

Hi all, the script stops unexpectedly after retrieving Medication resources with the following log output:

projectathon6-miracum1_1  | Warning message:
projectathon6-miracum1_1  | Problem while computing `rank_indicator = min(rank)`.
projectathon6-miracum1_1  | ℹ no non-missing arguments, returning NA
projectathon6-miracum1_1  | Error in `summarise()`:
projectathon6-miracum1_1  | ! Problem while computing `percent_encounters = paste0(...)`.
projectathon6-miracum1_1  | ℹ The error occurred in group 1: procedures = "Admission to stroke unit".
projectathon6-miracum1_1  | Caused by error in `unique()`:
projectathon6-miracum1_1  | ! object 'df.cohort.trunc' not found
projectathon6-miracum1_1  | Backtrace:
projectathon6-miracum1_1  |      ▆
projectathon6-miracum1_1  |   1. ├─df.procedure %>% group_by(procedures = features) %>% ...
projectathon6-miracum1_1  |   2. ├─dplyr::summarise(...)
projectathon6-miracum1_1  |   3. ├─dplyr:::summarise.grouped_df(...)
projectathon6-miracum1_1  |   4. │ └─dplyr:::summarise_cols(.data, dplyr_quosures(...), caller_env = caller_env())
projectathon6-miracum1_1  |   5. │   ├─base::withCallingHandlers(...)
projectathon6-miracum1_1  |   6. │   └─dplyr:::map(quosures, summarise_eval_one, mask = mask)
projectathon6-miracum1_1  |   7. │     └─base::lapply(.x, .f, ...)
projectathon6-miracum1_1  |   8. │       └─dplyr FUN(X[[i]], ...)
projectathon6-miracum1_1  |   9. │         └─mask$eval_all_summarise(quo)
projectathon6-miracum1_1  |  10. ├─base::paste0(...)
projectathon6-miracum1_1  |  11. ├─base::unique(df.cohort.trunc$encounter_id)
projectathon6-miracum1_1  |  12. └─base::.handleSimpleError(...)
projectathon6-miracum1_1  |  13.   └─dplyr h(simpleError(msg, call))
projectathon6-miracum1_1  |  14.     └─rlang::abort(bullets, call = error_call, parent = skip_internal_condition(e))
projectathon6-miracum1_1  | Execution halted
projectathon6_projectathon6-miracum1_1 exited with code 1

Using nandhinis08/projectathon6-miracum1 from dockerhub with docker-compose.

After some initial debugging I can say that:

Any ideas?

NandhiniS08 commented 2 years ago

May I ask if you have condition resources in your FHIR server? Do you have the possibility of running the code in Rstudio?

mw-uke commented 2 years ago

Hi @NandhiniS08, yes we do have Condition resources, but there was indeed an issue with an incorrect code system in our resources which led to an empty df.conditions table, which then crashed the script. This is now resolved and the script runs fine.

Thanks for looking into this and sorry for any inconvenience.

NandhiniS08 commented 2 years ago

Thanks for the update! No problem. I am glad it's running fine.