Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poor handling when observation_code does not exist in inpatient_investigations #80

Closed
peterdutey opened this issue Jan 5, 2022 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@peterdutey
Copy link
Collaborator

peterdutey commented Jan 5, 2022

clinical_feature_*() functions produce hard to read error messages.
When chaining several functions the message become very long and truncates the useful part.

Current behaviour

> clinical_feature_last(
+     TherapyEpisode(conSQLite, "4d611fc8886c23ab047ad5f74e5080d7"),
+     observation_code = "doesnotexist",
+     hours = 24
+ )
Error in .clinical_investigation_code_validate(conn = x@conn, observation_code = observation_code,  : 
  Some `observation_code` were not found in the database: 'doesnotexist'

chaining:

>   clinical_feature_last(
+     TherapyEpisode(conSQLite, "4d611fc8886c23ab047ad5f74e5080d7"),
+     observation_code = "doesnotexist",
+     hours = 24
+   ) %>% 
+     clinical_feature_last(
+       TherapyEpisode(conSQLite, "4d611fc8886c23ab047ad5f74e5080d7"),
+       observation_code = "8310-5",
+       hours = 24
+     )
Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 'clinical_feature_last': Some `observation_code` were not found in the database: 'doesnotexist'

Desired behaviour

> clinical_feature_last(
+     TherapyEpisode(conSQLite, "4d611fc8886c23ab047ad5f74e5080d7"),
+     observation_code = "doesnotexist",
+     hours = 24
+ )
Error: Some `observation_code` were not found in the database: 'doesnotexist'

chaining:

>   clinical_feature_last(
+     TherapyEpisode(conSQLite, "4d611fc8886c23ab047ad5f74e5080d7"),
+     observation_code = "doesnotexist",
+     hours = 24
+   ) %>% 
+     clinical_feature_last(
+       TherapyEpisode(conSQLite, "4d611fc8886c23ab047ad5f74e5080d7"),
+       observation_code = "8310-5",
+       hours = 24
+     )
Error: Some `observation_code` were not found in the database: 'doesnotexist'
@peterdutey peterdutey added the bug Something isn't working label Jan 5, 2022
@peterdutey peterdutey added this to the v0.4.2 milestone Jan 5, 2022
@peterdutey peterdutey added this to To do in Ramses development via automation Jan 5, 2022
@peterdutey peterdutey modified the milestones: v0.4.2, v0.5.0 Jan 28, 2022
@peterdutey
Copy link
Collaborator Author

peterdutey added a commit that referenced this issue Jan 28, 2022
@peterdutey peterdutey modified the milestones: v0.5.0, v0.4.2 Jan 28, 2022
Ramses development automation moved this from To do to Done Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

1 participant