Skip to content
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

[MINT-2720] Data Exchange Approach #1380

Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
742589f
feat: added feature migration, data models, gql
OddTomBrooks Jul 2, 2024
eed69df
chore: updated sql queries
OddTomBrooks Jul 2, 2024
729ce45
feat: several major improvements to first semi-functional data exchan…
OddTomBrooks Jul 3, 2024
343a984
chore: updated postman collection to get all notifications
OddTomBrooks Jul 3, 2024
58ab8f4
chore: updated frontend gql and backend gql for user notification pre…
OddTomBrooks Jul 3, 2024
0706fae
chore: added simple resolver helper to dispatch emails and email test…
OddTomBrooks Jul 3, 2024
95f07f9
chore: removed resolved question
OddTomBrooks Jul 5, 2024
54daae0
chore: Reset all frontend files to main branch as we split the fronte…
OddTomBrooks Jul 5, 2024
d113b08
chore: reran gql gen
OddTomBrooks Jul 5, 2024
6395210
fix: forcing a commit for rebasing purposes
OddTomBrooks Jul 5, 2024
9d4d41c
chore: removed tmp file
OddTomBrooks Jul 5, 2024
3d4e8b1
[EASI-4473] Notification: Data Exchange Approach Completed (#1209)
OddTomBrooks Jul 16, 2024
c1412b7
Merge branch 'main' into feature/MINT-2720_data_exchange_approach
OddTomBrooks Sep 17, 2024
2c829f4
chore: updated migration version
OddTomBrooks Sep 19, 2024
e02d09c
Merge branch 'NOREF/data_exchange_approach' into feature/MINT-2720_da…
OddTomBrooks Sep 20, 2024
6c72a54
wip: data exchange approach
OddTomBrooks Sep 24, 2024
6084f0a
wip: data exchange approach gql, store, and resolvers
OddTomBrooks Sep 25, 2024
ade1e73
feat: working data exchange approach creation and updates
OddTomBrooks Sep 26, 2024
7ec9c2a
feat: several feedback elements implemented
OddTomBrooks Sep 26, 2024
1b03e5f
chore: implementing PR feedback
OddTomBrooks Sep 27, 2024
5bc49a9
chore: implementing PR feedback
OddTomBrooks Sep 27, 2024
13ebcf1
wip: marked complete by user account and dts tracking
OddTomBrooks Sep 27, 2024
ae1095d
feat: first working version of plan data exchange approach
OddTomBrooks Sep 27, 2024
6297312
Merge branch 'main' into feature/MINT-2720_data_exchange_approach
OddTomBrooks Sep 30, 2024
5b11b33
chore: ran linter and fixed cache helper reference
OddTomBrooks Sep 30, 2024
e6ce2e5
run eslint
ClayBenson94 Sep 30, 2024
058e8aa
fix: corrected cyclic dependency and several linter guidances
OddTomBrooks Sep 30, 2024
a53d106
Merge branch 'feature/MINT-2720_data_exchange_approach' of github.com…
OddTomBrooks Sep 30, 2024
0b9ad42
merging changes
OddTomBrooks Sep 30, 2024
b3a1c47
ran sql fluff linter on migrations
StevenWadeOddball Sep 30, 2024
779970a
Merge branch 'feature/MINT-2720_data_exchange_approach' of https://gi…
StevenWadeOddball Sep 30, 2024
70c8856
run lint
ClayBenson94 Sep 30, 2024
ba212c3
fix: restructed logic for is marked complete to utilize null state of…
OddTomBrooks Sep 30, 2024
d4d3adb
Merge branch 'feature/MINT-2720_data_exchange_approach' of github.com…
OddTomBrooks Sep 30, 2024
5051a64
feat: added status handling
OddTomBrooks Oct 1, 2024
e0c358e
chore: corrected file name
OddTomBrooks Oct 1, 2024
a8c58d6
chore: removed old debug print
OddTomBrooks Oct 1, 2024
a3ab8fb
fix: fixed lagging status
OddTomBrooks Oct 1, 2024
7920d75
fix: added status to sql queries
OddTomBrooks Oct 1, 2024
5ffbb51
fix: corrected enum references from COMPLETE to COMPELETED
OddTomBrooks Oct 1, 2024
4a71ec1
chore: removed delete logic for dea
OddTomBrooks Oct 1, 2024
dfe0f74
chore: refactored IsDataExchangeApproachComplete resolver
OddTomBrooks Oct 2, 2024
1c369a7
chore: updated enum to READY to conform more closely with other task …
OddTomBrooks Oct 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MINT.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -2193,7 +2193,7 @@
"body": {
"mode": "graphql",
"graphql": {
"query": "query currentUser {\n currentUser {\n notifications {\n numUnreadNotifications\n notifications {\n __typename\n id\n isRead\n inAppSent\n emailSent\n activity {\n activityType\n entityID\n actorID\n metaData {\n __typename\n ... on TaggedInPlanDiscussionActivityMeta{\n version\n type\n modelPlanID\n modelPlan{\n modelName\n } \n discussionID\n content\n }\n ... on TaggedInDiscussionReplyActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n } \n discussionID\n replyID\n content\n }\n ... on ModelPlanSharedActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n }\n optionalMessage\n }\n ... on NewDiscussionRepliedActivityMeta {\n version\n type\n discussionID\n replyID\n content\n } \n ... on DailyDigestCompleteActivityMeta{\n version\n type\n modelPlanIDs\n date\n analyzedAudits{\n id\n modelPlanID\n modelName\n date\n changes{\n modelPlan{\n oldName\n statusChanges\n }\n documents{\n count\n }\n crTdls{\n activity\n }\n planSections{\n updated\n readyForReview\n readyForClearance\n }\n modelLeads{\n added{\n id\n commonName\n # userAccount{\n # id\n # email\n # }\n }\n }\n planDiscussions{\n activity\n }\n }\n\n }\n\n }\n ... on NewModelPlanActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n }\n }\n ... on DatesChangedActivityMeta {\n version\n type\n modelPlanID\n modelPlan {\n id\n }\n dateChanges {\n isChanged\n field\n isRange\n oldDate\n newDate\n oldRangeStart\n oldRangeEnd\n newRangeStart\n newRangeEnd\n }\n } \n }\n createdByUserAccount {\n commonName\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n }\n }\n}\n",
"query": "query currentUser {\n currentUser {\n notifications {\n numUnreadNotifications\n notifications {\n __typename\n id\n isRead\n inAppSent\n emailSent\n activity {\n activityType\n entityID\n actorID\n metaData {\n __typename\n ... on TaggedInPlanDiscussionActivityMeta{\n version\n type\n modelPlanID\n modelPlan{\n modelName\n } \n discussionID\n content\n }\n ... on TaggedInDiscussionReplyActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n } \n discussionID\n replyID\n content\n }\n ... on ModelPlanSharedActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n }\n optionalMessage\n }\n ... on NewDiscussionRepliedActivityMeta {\n version\n type\n discussionID\n replyID\n content\n } \n ... on DailyDigestCompleteActivityMeta{\n version\n type\n modelPlanIDs\n date\n analyzedAudits{\n id\n modelPlanID\n modelName\n date\n changes{\n modelPlan{\n oldName\n statusChanges\n }\n documents{\n count\n }\n crTdls{\n activity\n }\n planSections{\n updated\n readyForReview\n readyForClearance\n }\n modelLeads{\n added{\n id\n commonName\n # userAccount{\n # id\n # email\n # }\n }\n }\n planDiscussions{\n activity\n }\n }\n\n }\n\n }\n ... on NewModelPlanActivityMeta {\n version\n type\n modelPlanID\n modelPlan{\n modelName\n }\n }\n ... on DatesChangedActivityMeta {\n version\n type\n modelPlanID\n modelPlan {\n id\n }\n dateChanges {\n isChanged\n field\n isRange\n oldDate\n newDate\n oldRangeStart\n oldRangeEnd\n newRangeStart\n newRangeEnd\n }\n }\n ... on DataExchangeApproachCompletedActivityMeta {\n version\n type\n dataExchangeApproach {\n id\n name\n }\n markedCompletedBy\n } \n }\n createdByUserAccount {\n commonName\n }\n }\n createdByUserAccount {\n commonName\n }\n }\n }\n }\n}\n",
"variables": ""
}
},
Expand Down
40 changes: 39 additions & 1 deletion cmd/dbseed/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,48 @@ func (s *Seeder) SeedData() {
"cmmiGroups": []string{"PATIENT_CARE_MODELS_GROUP", "SEAMLESS_CARE_MODELS_GROUP"},
"completeICIP": "2020-05-13T20:47:50.12Z",
"phasedIn": true,
"clearanceStarts": now.AddDate(0, 3, 0),
"clearanceStarts": time.Now().AddDate(0, 3, 0),
"highLevelNote": "Some high level note",
},
)

// Send a notification for Data Exchange Approach Completed
dataExchangeApproach := models.NewPlanDataExchangeApproach(
models.NewBaseTaskListSection(
planWithDocuments.CreatedBy,
planWithDocuments.ID,
),
)

dataExchangeApproach.ID = uuid.MustParse("01020304-0506-0708-090a-0b0c0d0e0f10")

// create an actor principal for testing notifications

actorPrincipal := s.getTestPrincipalByUsername("MINT")

// Use a test user to mark the data exchange approach as complete
testUser := s.getTestPrincipalByUsername("BTAL")

err = resolvers.SendDataExchangeApproachCompletedNotification(
s.Config.Context,
s.Config.EmailService,
s.Config.EmailTemplateService,
s.Config.AddressBook,
actorPrincipal.UserAccount.ID,
s.Config.Store,
[]*models.UserAccountAndNotificationPreferences{
{
UserAccount: *testUser.UserAccount,
PreferenceFlags: models.DefaultUserNotificationPreferencesFlags(),
},
},
planWithDocuments,
dataExchangeApproach,
testUser.UserAccount.ID,
)
if err != nil {
panic(fmt.Errorf("failed to send data exchange approach completed notification: %w", err))
}
}

func (s *Seeder) SetDefaultUserViews() {
Expand Down
26 changes: 26 additions & 0 deletions cmd/test_email/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ func main() {
//DiscussionReply email
sendDiscussionReplyOriginatorTestEmail(emailService, templateService, addressBook)

// Model plan emails
sendModelPlanShareTest(emailService, templateService, addressBook)
sendDateChangedEmailsTest(emailService, templateService, addressBook)
sendCollaboratorAddedEmailTest(emailService, templateService, addressBook)
sendDataExchangeApproachCompletedEmailNotificationTest(emailService, templateService, addressBook)
sendFeedbackEmail(emailService, templateService, addressBook)
reportAProblemEmail(emailService, templateService, addressBook)

Expand Down Expand Up @@ -395,6 +397,30 @@ func sendCollaboratorAddedEmailTest(
noErr(err)
}

func sendDataExchangeApproachCompletedEmailNotificationTest(
emailService oddmail.EmailService,
templateService email.TemplateService,
addressBook email.AddressBook,
) {

modelPlan := models.NewModelPlan(
uuid.Nil,
"Retcon Plan",
)

err := resolvers.SendDataExchangeApproachCompletedEmailNotification(
emailService,
templateService,
addressBook,
modelPlan,
"marty.mcfly@delorean.88",
"Doc Brown",
true,
)

noErr(err)
}

func sendFeedbackEmail(
emailService oddmail.EmailService,
templateService email.TemplateService,
Expand Down
116 changes: 116 additions & 0 deletions migrations/V175__Add_Data_Exchange_Approach.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
CREATE TYPE DEA_DATA_TO_COLLECT_FROM_PARTICIPANTS AS ENUM (
'BANKING_INFORMATION_TO_MAKE_NON_CLAIMS_BASED_PAYMENTS',
'CLINICAL_DATA',
'COLLECT_BIDS_AND_PLAN_INFORMATION',
'COOPERATIVE_AGREEMENT_APPLICATION',
'DECARBONIZATION_DATA',
'EXPANDED_DEMOGRAPHICS_DATA',
'FEE_FOR_SERVICE_CLAIMS_AND_APPLY_MODEL_RULES',
'LEARNING_SYSTEM_METRICS',
'PARTICIPANT_AGREEMENT',
'PARTICIPANT_AGREEMENT_LETTER_OF_INTENT',
'PARTICIPANT_AGREEMENT_REQUEST_FOR_APPLICATION',
'PARTICIPANT_REPORTED_DATA',
'PARTICIPANT_REPORTED_QUALITY_MEASURES',
'PROVIDER_PARTICIPANT_ROSTER',
'REPORTS_FROM_PARTICIPANTS',
'SOCIAL_DETERMINANTS_OF_HEALTH',
'SURVEY',
'OTHER'
);

CREATE TYPE DEA_DATA_TO_SEND_TO_PARTICIPANTS AS ENUM (
'DATA_FEEDBACK_DASHBOARD',
'NON_CLAIMS_BASED_PAYMENTS',
'OPERATIONS_DATA',
'PARTIALLY_ADJUSTED_CLAIMS_DATA',
'RAW_CLAIMS_DATA',
'DATA_WILL_NOT_BE_SENT_TO_PARTICIPANTS'
);

CREATE TYPE DEA_ANTICIPATED_MULTI_PAYER_DATA_AVAILABILITY_USE_CASE AS ENUM (
'MORE_COMPETENT_ALERT_DISCHARGE_TRANSFER_NOTIFICATION',
'SUPPLY_MULTI_PAYER_CLAIMS_COST_UTIL_AND_QUALITY_REPORTING',
'FILL_GAPS_IN_CARE_ALERTING_AND_REPORTS'
);

CREATE TYPE DEA_MULTI_SOURCE_DATA_TO_COLLECT AS ENUM (
'COMMERCIAL_CLAIMS',
'LAB_DATA',
'MANUFACTURER',
'MEDICAID_CLAIMS',
'MEDICARE_CLAIMS',
'PATIENT_REGISTRY',
'OTHER'
);

CREATE TABLE plan_data_exchange_approach (
id UUID PRIMARY KEY NOT NULL,
model_plan_id UUID NOT NULL REFERENCES model_plan(id),

-- page 2
data_to_collect_from_participants DEA_DATA_TO_COLLECT_FROM_PARTICIPANTS[] NOT NULL,
data_to_collect_from_participants_reports_details ZERO_STRING,
data_to_collect_from_participants_other ZERO_STRING,
data_will_not_be_collected_from_participants BOOLEAN NOT NULL DEFAULT FALSE,
data_to_collect_from_participants_note ZERO_STRING,

data_to_send_to_participants DEA_DATA_TO_SEND_TO_PARTICIPANTS DEFAULT NULL,
data_to_send_to_participants_note ZERO_STRING,

-- page 3
does_need_to_make_multi_payer_data_available YES_NO_TYPE DEFAULT NULL,
anticipated_multi_payer_data_availability_use_case DEA_ANTICIPATED_MULTI_PAYER_DATA_AVAILABILITY_USE_CASE DEFAULT NULL,
does_need_to_make_multi_payer_data_available_other ZERO_STRING,
does_need_to_make_multi_payer_data_available_note ZERO_STRING,

does_need_to_collect_and_aggregate_multi_source_data YES_NO_TYPE DEFAULT NULL,
multi_source_data_to_collect DEA_MULTI_SOURCE_DATA_TO_COLLECT DEFAULT NULL,
multi_source_data_to_collect_other ZERO_STRING,
does_need_to_collect_and_aggregate_multi_source_data_note ZERO_STRING,

-- page 4
will_implement_new_data_exchange_methods YES_NO_TYPE DEFAULT NULL,
new_data_exchange_methods_description ZERO_STRING,
new_data_exchange_methods_note ZERO_STRING,

is_data_exchange_approach_complete BOOLEAN NOT NULL DEFAULT FALSE,

-- META DATA
created_by UUID REFERENCES public.user_account (id) MATCH SIMPLE NOT NULL,
created_dts TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP,
modified_by UUID REFERENCES public.user_account (id) MATCH SIMPLE,
modified_dts TIMESTAMP WITH TIME ZONE,
ready_for_review_by UUID REFERENCES public.user_account (id) MATCH SIMPLE,
ready_for_review_dts TIMESTAMP WITH TIME ZONE,
ready_for_clearance_by UUID REFERENCES public.user_account (id) MATCH SIMPLE,
ready_for_clearance_dts TIMESTAMP WITH TIME ZONE,
status TASK_STATUS NOT NULL DEFAULT 'READY'
);

COMMENT ON COLUMN plan_data_exchange_approach.data_to_collect_from_participants IS 'Data to collect from participants';
COMMENT ON COLUMN plan_data_exchange_approach.data_to_collect_from_participants_reports_details IS 'Data to collect from participants - Reports details';
COMMENT ON COLUMN plan_data_exchange_approach.data_to_collect_from_participants_other IS 'Data to collect from participants - Other';
COMMENT ON COLUMN plan_data_exchange_approach.data_will_not_be_collected_from_participants IS 'Data will not be collected from participants';
COMMENT ON COLUMN plan_data_exchange_approach.data_to_collect_from_participants_note IS 'Data to collect from participants - Note';

COMMENT ON COLUMN plan_data_exchange_approach.data_to_send_to_participants IS 'Data to send to participants';
COMMENT ON COLUMN plan_data_exchange_approach.data_to_send_to_participants_note IS 'Data to send to participants - Note';

COMMENT ON COLUMN plan_data_exchange_approach.does_need_to_make_multi_payer_data_available IS 'Does need to make multi-payer data available';
COMMENT ON COLUMN plan_data_exchange_approach.anticipated_multi_payer_data_availability_use_case IS 'Anticipated multi-payer data availability use case';
COMMENT ON COLUMN plan_data_exchange_approach.does_need_to_make_multi_payer_data_available_other IS 'Does need to make multi-payer data available - Other';
COMMENT ON COLUMN plan_data_exchange_approach.does_need_to_make_multi_payer_data_available_note IS 'Does need to make multi-payer data available - Note';

COMMENT ON COLUMN plan_data_exchange_approach.does_need_to_collect_and_aggregate_multi_source_data IS 'Does need to collect and aggregate multi-source data';
COMMENT ON COLUMN plan_data_exchange_approach.multi_source_data_to_collect IS 'Multi-source data to collect';
COMMENT ON COLUMN plan_data_exchange_approach.multi_source_data_to_collect_other IS 'Multi-source data to collect - Other';
COMMENT ON COLUMN plan_data_exchange_approach.does_need_to_collect_and_aggregate_multi_source_data_note IS 'Does need to collect and aggregate multi-source data - Note';

COMMENT ON COLUMN plan_data_exchange_approach.will_implement_new_data_exchange_methods IS 'Will implement new data exchange methods';
COMMENT ON COLUMN plan_data_exchange_approach.new_data_exchange_methods_description IS 'New data exchange methods description';
COMMENT ON COLUMN plan_data_exchange_approach.new_data_exchange_methods_note IS 'New data exchange methods - Note';

COMMENT ON COLUMN plan_data_exchange_approach.is_data_exchange_approach_complete IS 'Is data exchange approach complete';

COMMENT ON TABLE plan_data_exchange_approach IS 'Data Exchange Approach';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ALTER TYPE ACTIVITY_TYPE
ADD VALUE 'DATA_EXCHANGE_APPROACH_COMPLETED' AFTER 'NEW_MODEL_PLAN';

ALTER TABLE user_notification_preferences
ADD COLUMN data_exchange_approach_completed user_notification_preference_flag[] DEFAULT '{}'::user_notification_preference_flag[];

COMMENT ON COLUMN user_notification_preferences.data_exchange_approach_completed IS 'Notification preference for when a data exchange approach is completed';
15 changes: 15 additions & 0 deletions pkg/email/data_exchange_approach_completed.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package email

// DataExchangeApproachCompletedSubjectContent defines the parameters necessary for the corresponding email subject
type DataExchangeApproachCompletedSubjectContent struct {
ModelName string
}

// DataExchangeApproachCompletedBodyContent defines the parameters necessary for the corresponding email body
type DataExchangeApproachCompletedBodyContent struct {
ClientAddress string
ModelName string
ModelID string
MarkedCompletedByUserCommonName string
ShowFooter bool
}
Loading