path-reporting 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/lib/path/reporting/analytics.rb +4 -4
- data/lib/path/reporting/types/trigger.rb +15 -15
- data/lib/path/reporting/types/user_type.rb +14 -14
- data/lib/path/reporting/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 134152ef7ea6fed2b3b09883f364a31ebb1e21ef6b5f6cd3db8108ddc750de8a
|
4
|
+
data.tar.gz: f059d45004af1ba04ae2b8af2838de5a7fbbaa4575f53873123204546f1190fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9634c2cf01eeaa497d1b3df429568f40bb6d714235aa8f0922b9196376301679c72d5d58f48e8f942f852553712f72a6577edb96e4dfd8e3ccfd5473e5acb36
|
7
|
+
data.tar.gz: aeb9e1f444090af5ed104917b222327d3fe8dd95147964b7f8297065252b8d10feb19445cf5df4eb74724aa7807824e67a6939ca82c9aa23793d124e18e886f0
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -42,8 +42,8 @@ Path::Reporting.analytics.record(
|
|
42
42
|
product_area: Constants::ANALYTICS_PRODUCT_AREA_MATCHING,
|
43
43
|
name: 'Preferred provider multiple valid matches',
|
44
44
|
user: @contact.analytics_friendly_hash,
|
45
|
-
user_type: Path::Reporting::UserType
|
46
|
-
trigger: Path::Reporting::Trigger
|
45
|
+
user_type: Path::Reporting::UserType::PATIENT,
|
46
|
+
trigger: Path::Reporting::Trigger::PAGE_VIEW,
|
47
47
|
metadata: analytics_metadata,
|
48
48
|
)
|
49
49
|
```
|
@@ -122,7 +122,7 @@ module Path
|
|
122
122
|
# product_area: Constants::ANALYTICS_PRODUCT_AREA_MATCHING,
|
123
123
|
# name: 'Preferred provider multiple valid matches',
|
124
124
|
# user: @contact.analytics_friendly_hash,
|
125
|
-
# user_type: PathReporting::UserType
|
125
|
+
# user_type: PathReporting::UserType::PATIENT,
|
126
126
|
# trigger: PathReporting::Trigger.PAGE_VIEW,
|
127
127
|
# metadata: analytics_metadata,
|
128
128
|
# )
|
@@ -132,7 +132,7 @@ module Path
|
|
132
132
|
# product_area: Constants::ANALYTICS_PRODUCT_AREA_MATCHING,
|
133
133
|
# name: 'No preferred provider',
|
134
134
|
# user: @contact.analytics_friendly_hash,
|
135
|
-
# user_type: PathReporting::UserType
|
135
|
+
# user_type: PathReporting::UserType::PATIENT,
|
136
136
|
# trigger: PathReporting::Trigger.PAGE_VIEW,
|
137
137
|
# )
|
138
138
|
#
|
@@ -158,8 +158,8 @@ module Path
|
|
158
158
|
product_area:,
|
159
159
|
name:,
|
160
160
|
user:,
|
161
|
-
user_type: UserType
|
162
|
-
trigger: Trigger
|
161
|
+
user_type: UserType::PATIENT,
|
162
|
+
trigger: Trigger::INTERACTION,
|
163
163
|
metadata: {}
|
164
164
|
)
|
165
165
|
throw Error("No user provided when reporting analytics") if !user || !user[:id]
|
@@ -4,22 +4,22 @@ module Path
|
|
4
4
|
module Reporting
|
5
5
|
# The trigger or cause of reporting events
|
6
6
|
class Trigger
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
AUTOMATION = "Automation"
|
7
|
+
# Interaction: When a direct intentional user action is the cause of
|
8
|
+
# this event that is not a simple navigation. E.g. Submitted form or
|
9
|
+
# changed password
|
10
|
+
INTERACTION = "Interaction"
|
11
|
+
# Page view: When the event was an indirect result of viewing something.
|
12
|
+
# E.g. auto-assigning a provider or appointment because the user has an
|
13
|
+
# existing provider already
|
14
|
+
# @note Because of usage limits, we do not want to record page views
|
15
|
+
# as a separate action, this is only for indirect consequences that
|
16
|
+
# result in a change in something either for the user or for our
|
17
|
+
# systems
|
18
|
+
PAGE_VIEW = "Page view"
|
19
|
+
# Automation: Some automation or tool was the cause of this event
|
20
|
+
AUTOMATION = "Automation"
|
22
21
|
|
22
|
+
class << self
|
23
23
|
# @private
|
24
24
|
def triggers
|
25
25
|
[
|
@@ -4,20 +4,20 @@ module Path
|
|
4
4
|
module Reporting
|
5
5
|
# User types that data may be recorded for or on
|
6
6
|
class UserType
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
SYSTEM = "System"
|
7
|
+
# Patient or potential patient
|
8
|
+
PATIENT = "Patient"
|
9
|
+
# Provider, which can be any sub-type (e.g. therapist)
|
10
|
+
PROVIDER = "Provider"
|
11
|
+
# Insurer, not currently in-use
|
12
|
+
INSURER = "Insurer"
|
13
|
+
# Operator or any internal non-developer
|
14
|
+
OPERATOR = "Operator"
|
15
|
+
# Developer; mostly relevant for backfills or manual intervention
|
16
|
+
DEVELOPER = "Developer"
|
17
|
+
# System, either first-party or third-party
|
18
|
+
SYSTEM = "System"
|
20
19
|
|
20
|
+
class << self
|
21
21
|
# @private
|
22
22
|
def types
|
23
23
|
[
|
@@ -33,7 +33,7 @@ module Path
|
|
33
33
|
# Check if a given item is a valid UserType
|
34
34
|
# @param maybe_type [Any] item to check
|
35
35
|
def valid?(maybe_type)
|
36
|
-
types.
|
36
|
+
types.include? maybe_type
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|