path-reporting 0.1.2 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.tool-versions +1 -0
- data/Gemfile.lock +2 -1
- data/README.md +3 -3
- data/lib/{analytics/reporters → path/reporting/analytics}/amplitude.rb +0 -0
- data/lib/{analytics → path/reporting/analytics}/configuration.rb +0 -0
- data/lib/{analytics/reporters → path/reporting/analytics}/console.rb +0 -0
- data/lib/{analytics → path/reporting}/analytics.rb +8 -8
- data/lib/{configuration.rb → path/reporting/configuration.rb} +0 -0
- data/lib/path/reporting/types/trigger.rb +40 -0
- data/lib/{types → path/reporting/types}/user_type.rb +14 -14
- data/lib/{reporting → path/reporting}/version.rb +1 -1
- data/lib/{reporting.rb → path/reporting.rb} +4 -4
- data/lib/path.rb +5 -0
- data/reporting.gemspec +1 -1
- metadata +12 -10
- data/lib/types/trigger.rb +0 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cf8b0c5159e89a7fde5da0bf0c2d4912f05f03d62fa5c66e2f5f48143916f36
|
4
|
+
data.tar.gz: ee8d74820b4f6c194813448700c0eb66c4d72b3b84d8431955c7a297c4db01f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0528361202c2f3750e68181a3203a63c43c7c731710f9bd03814da1416bd46861650337df5f56351b774e0226a4eebb83e9de13119303c6b76822e5f374747c6'
|
7
|
+
data.tar.gz: ecee15c13b20cbfbabdc9040212bd392ef28ceb8c24dd0cac7e4e7394c16f85f39e5a602543a30fe5b005ef90757c444bbe33480d5fdea3903d5b6260489a835
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.0.3
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -37,13 +37,13 @@ After initialing the module, record an analytics event with the following code.
|
|
37
37
|
|
38
38
|
```ruby
|
39
39
|
|
40
|
-
|
40
|
+
Path::Reporting.analytics.record(
|
41
41
|
product_code: Constants::ANALYTICS_PRODUCT_CODE,
|
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:
|
46
|
-
trigger:
|
45
|
+
user_type: Path::Reporting::UserType::PATIENT,
|
46
|
+
trigger: Path::Reporting::Trigger::PAGE_VIEW,
|
47
47
|
metadata: analytics_metadata,
|
48
48
|
)
|
49
49
|
```
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "
|
4
|
-
require_relative "
|
5
|
-
require_relative "
|
6
|
-
require_relative "
|
3
|
+
require_relative "analytics/amplitude"
|
4
|
+
require_relative "analytics/console"
|
5
|
+
require_relative "types/trigger"
|
6
|
+
require_relative "types/user_type"
|
7
7
|
|
8
8
|
module Path
|
9
9
|
module Reporting
|
@@ -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]
|
File without changes
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Path
|
4
|
+
module Reporting
|
5
|
+
# The trigger or cause of reporting events
|
6
|
+
class Trigger
|
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"
|
21
|
+
|
22
|
+
class << self
|
23
|
+
# @private
|
24
|
+
def triggers
|
25
|
+
[
|
26
|
+
INTERACTION,
|
27
|
+
PAGE_VIEW,
|
28
|
+
AUTOMATION
|
29
|
+
]
|
30
|
+
end
|
31
|
+
|
32
|
+
# Check if a given item is a valid Trigger
|
33
|
+
# @param maybe_trigger [Any] item to check
|
34
|
+
def valid?(maybe_trigger)
|
35
|
+
triggers.include? maybe_trigger
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -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
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "
|
4
|
-
require_relative "configuration"
|
3
|
+
require_relative "reporting/analytics"
|
4
|
+
require_relative "reporting/configuration"
|
5
5
|
require_relative "reporting/version"
|
6
6
|
|
7
7
|
# Path is just a wrapper module so we can group any path specific gems under
|
@@ -52,7 +52,7 @@ module Path
|
|
52
52
|
def analytics
|
53
53
|
raise Error, "Must call init on Path::Reporting library before using" unless @initialized
|
54
54
|
|
55
|
-
@
|
55
|
+
@analytics
|
56
56
|
end
|
57
57
|
|
58
58
|
# Resets the module to an uninitialized state. Mostly used for testing
|
@@ -60,7 +60,7 @@ module Path
|
|
60
60
|
def reset!
|
61
61
|
@initialized = false
|
62
62
|
@config = nil
|
63
|
-
@
|
63
|
+
@analytics = nil
|
64
64
|
self
|
65
65
|
end
|
66
66
|
end
|
data/lib/path.rb
ADDED
data/reporting.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: path-reporting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexis Hushbeck
|
@@ -47,21 +47,23 @@ extra_rdoc_files: []
|
|
47
47
|
files:
|
48
48
|
- ".rspec"
|
49
49
|
- ".rubocop.yml"
|
50
|
+
- ".tool-versions"
|
50
51
|
- ".yardopts"
|
51
52
|
- Gemfile
|
52
53
|
- Gemfile.lock
|
53
54
|
- LICENSE.md
|
54
55
|
- README.md
|
55
56
|
- Rakefile
|
56
|
-
- lib/
|
57
|
-
- lib/
|
58
|
-
- lib/
|
59
|
-
- lib/analytics/
|
60
|
-
- lib/configuration.rb
|
61
|
-
- lib/reporting.rb
|
62
|
-
- lib/reporting/
|
63
|
-
- lib/types/trigger.rb
|
64
|
-
- lib/types/user_type.rb
|
57
|
+
- lib/path.rb
|
58
|
+
- lib/path/reporting.rb
|
59
|
+
- lib/path/reporting/analytics.rb
|
60
|
+
- lib/path/reporting/analytics/amplitude.rb
|
61
|
+
- lib/path/reporting/analytics/configuration.rb
|
62
|
+
- lib/path/reporting/analytics/console.rb
|
63
|
+
- lib/path/reporting/configuration.rb
|
64
|
+
- lib/path/reporting/types/trigger.rb
|
65
|
+
- lib/path/reporting/types/user_type.rb
|
66
|
+
- lib/path/reporting/version.rb
|
65
67
|
- reporting.gemspec
|
66
68
|
- sig/reporting.rbs
|
67
69
|
homepage: https://github.com/pathccm/reporting
|
data/lib/types/trigger.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Path
|
4
|
-
module Reporting
|
5
|
-
# The trigger or cause of reporting events
|
6
|
-
class Trigger
|
7
|
-
class << self
|
8
|
-
# Interaction: When a direct intentional user action is the cause of
|
9
|
-
# this event
|
10
|
-
INTERACTION = "Interaction"
|
11
|
-
# Page view: When the event was an indirect result of viewing something.
|
12
|
-
# @note Because of usage limits, we do not want to record page views
|
13
|
-
# as a separate action, this is only for indirect consequences
|
14
|
-
PAGE_VIEW = "Page view"
|
15
|
-
# Automation: Some automation or tool was the cause of this event
|
16
|
-
AUTOMATION = "Automation"
|
17
|
-
|
18
|
-
# @private
|
19
|
-
def triggers
|
20
|
-
[
|
21
|
-
INTERACTION,
|
22
|
-
PAGE_VIEW,
|
23
|
-
AUTOMATION
|
24
|
-
]
|
25
|
-
end
|
26
|
-
|
27
|
-
# Check if a given item is a valid Trigger
|
28
|
-
# @param maybe_trigger [Any] item to check
|
29
|
-
def valid?(maybe_trigger)
|
30
|
-
triggers.includes? maybe_trigger
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|