-
Notifications
You must be signed in to change notification settings - Fork 2
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
Lab test cleanup 2 #772
Lab test cleanup 2 #772
Conversation
…lready used by the lab test summary)
…rrently causing our lab tests to break. Changes the regex to account for it
…eck multiple times
2a46207
to
975fec6
Compare
…s on the front end
…ns we get a string that looks like -2 - 4 so regex is the best way to cut it
…with dictionaries all the way down
…time series we may aswell only send a single value
…t observations method to make the super loop simpler
…s that can be properly tested
…bservation is pending look for the next one with a real value and use that. If there is no other value, show 'pending'
… type/date in the api
elcid/api.py
Outdated
observations = sorted( | ||
observations, key=lambda x: x.observation_datetime | ||
) | ||
observations.reverse() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't providing your own sorting function only to reverse it on the next line seem odd?
- ....to_timestamp()
or similar ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we were doing
observations = sorted(
observations, key=lambda x:- x.observation_datetime.toordinal()
)
I think this is the new way is more readable. I think I prefer this way but I'm happy with either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much better idea... use the reverse=True
argument...
… it actually does
…t a wrapper around observation. This fixes it for long form lab tests
…were in fact never showing in tabule form. So this fixes that
So this means we use the same method for both the lab test summary api end point and the results view end point.
It also fixes the bug where observations of a form such as 22.08.2019 cause the lab tests to fail