Fix matching GCS with previous GCS #1248
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
I believe there is a minor error in the GCS concept. When looking for previous GCS measurements, it currently looks in the previous row
where b.rn = b2.rn+1
but then requires the previous row to be recorded more than 6 hours after the following row. Since rows are ordered by time, this is impossible and no previous measurements are found (this can be verified with running the adapted reproducible example below).Solution
Change
DATETIME_ADD
toDATETIME_SUB
in order to obtain the intended behaviour.Additional question
While looking at GCS, I was also wondering why GCS is replaced with
15
when the patient is intubated and verbal is missing. This does not seem an appropriate imputation and also --- contra to what the ascertation in the notes --- does not seemMaybe the code's creator could comment on this choice?
Reprex
Current behaviour
Click to expand
New behaviour
Click to expand
Edits: typos