Last active
July 23, 2021 21:01
-
-
Save eduardojunio/fc634a1e6f916b73f78e0268dce94075 to your computer and use it in GitHub Desktop.
Proof of concept on how we could implement the new metrics on the Flow::Statistics class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Flow::Statistics | |
def patients_messaged | |
CacheCounter.get_fast_count_for(Flow::FlowPatient, flow.provider_id, :patients) - | |
pre_filtered_flow_patients.where.not(state: %w(duplicated incomplete)).count | |
end | |
def need_review | |
pre_filtered_flow_patients.last_response_flagged("invalid").count | |
end | |
def opt_out_rate | |
pre_filtered_flow_patients.opted_out.count / patients_messaged | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment