Events
Events represent important milestones in a patient’s care plan and are managed by the Event (mvn__PJN_Event__c
) custom object.
Event creation
Events can be created in several ways:
Manually by users. For example, recording therapy access when updating a coverage investigation in the
PJNCoverageInvestigationUpdateQuickAction
Lightning Component creates an Event record ofPJN_Therapy_Access
record type. All other manual event creations are ofPJN_Therapy_Status_Update
record type.Automatically when records related to the care plan are created or updated. For example, out of the box, updating the
mvn__PJN_Physician__c
field on the Care Plan (Case
) record creates an Event record of the Physician Change (PJN_Physician_Change
) record type via thePJN_EventCreation
Apex class. Additional automation can be configured such that events are also created when a patient reaches a certain milestone. For more information, reference the Milestone event automation section below.Via third-party vendors. For example, out of the box, receiving a pharmacy status update via an integration creates an Event record of
PJN_Pharmacy_Status_Update
record type.
Milestone event automation
Events can be automatically created based on key milestones in a patient's program journey. A trigger for a milestone can be set either on the Trigger Handler Setting (mvn__PJN_Trigger_Handler_Setting__mdt
) custom metadata type or via a custom implementation, but it must call the Event Automation Handler (PJN_EventAutomationHdlr
) global Apex class to retrieve a list of Event Configuration (mvn__PJN_Event_Configuration__mdt
) metadata records for the triggered object. The Event Automation Handler class then checks the criteria that is defined on each event configuration to determine whether or not the criteria is met and therefore whether or not an event should be created. If so, then an Event record of the specified record type is created with the status and sub-status values specified on the event configuration.
To define a trigger on an object for a specific milestone and then configure an event to be subsequently created:
(Prerequisite) Ensure that records of the object are related to a Care Plan (
Case
) record and a patient Account record.(Prerequisite) Determine if the trigger should be set and managed by the Trigger Handler Setting custom metadata type, which will call Komodo Care Connect's out-of-the-box milestone event automation trigger handler, or by a custom implementation.
If choosing the former, create a Trigger Handler Setting (
mvn__PJN_Trigger_Handler_Setting__mdt
) metadata record for the object that will trigger the automation and set the Class (mvn__PJN_Class__c
) field tomvn.PJN_EventAutomationHdlr
.If choosing the latter, implement the custom trigger and call the Event Automation Handler (
PJN_EventAutomationHdlr
) class.
Create an Event Configuration (
mvn__PJN_Event_Configuration__mdt
) metadata record. Check the Automation (mvn__PJN_Automation__c
) field according to step 2 above.If the former was chosen, check the Automation field (i.e., set to
true
).If the latter was chosen, uncheck the Automation field (i.e., leave as
false
).
For additional guidance on how to configure a milestone event automation, reference the Example 4, “Create a therapy status update event when a patient is eligible for PAP” below.
This example configuration creates an Event record of the Therapy Status Update record type when a patient in a fictitious care program called Kalytex (KTX) is deemed eligible for a Patient Assistance Program (PAP). The configuration uses a Trigger Handler Setting metadata record to call the Event Automation Handler class when an Assistance Program (mvn__PJN_Assistance_Program__c
) record is updated. The Event Automation Handler then retrieves the Event Configuration metadata record to check that the Assistance Program record is of the Patient Assistance Program (PJN_Patient_Assistance_Program
) record type and has an Outcome (mvn__PJN_Outcome__c
) value of Eligible
.
If the Assistance Program record that had triggered the milestone event automation feature meets the given criteria on the Event Configuration metadata record, a new Event record of the Therapy Status Update record type will be created with a Pending
status and a PAP Complete
sub-status.
Field label | Sample value |
---|---|
Active |
|
Class |
|
Event |
|
SObject API Name |
|
Field label | Sample value |
---|---|
Automation |
|
Care Plan Id Field |
|
Entry Criteria | { "AllTrue": [ { "path": "mvn__PJN_Record_Type__c", "operator": "Equals", "value": "Patient Assistance Program" }, { "path": "mvn__PJN_Outcome__c", "operator": "Equals", "value": "Eligible" } ] } |
Patient Id Field |
|
Record Type |
|
sObject Name |
|
Status Field |
|
Status Value |
|
Sub-Status Field |
|
Sub-Status Value |
|
Event rollup
Events such as therapy status updates and pharmacy status updates can be rolled up to their parent care plans via the Event Rollup (mvn__PJN_Event_Rollup__mdt
) and Event Rollup Mapping (mvn__PJN_Event_Rollup_Mapping__mdt
) custom metadata types. Once configured, the PJN_After_Insert_Event
Trigger Handler Setting (mvn__PJN_Trigger_Handler_Setting__mdt
) metadata record will subsequently call the PJN_EventHdlr
class to roll up the values from the defined Event record types to the parent Case records.
Note
The last record inserted of each defined Event record type is what gets mapped to the parent Case record.
To configure an event rollup for a specific Event record type:
Create an Event Rollup (
mvn__PJN_Event_Rollup__mdt
) metadata record.Create an Event Rollup Mapping (
mvn__PJN_Event_Rollup_Mapping__mdt
) metadata record and relate it to the Event Rollup metadata record created in step 1.
The following metadata records are an example of how therapy status update events can be configured to roll up to their parent care plans.
Field label | Sample value |
---|---|
Event Record Type |
|
Field label | Sample value |
---|---|
Event Rollup | The Event Rollup ( |
Source Event Field |
|
Target Case Field |
|
The following metadata records are an example of how pharmacy status update events can be configured to roll up to their parent care plans.
Field label | Sample value |
---|---|
Event Record Type |
|
Field label | Sample value |
---|---|
Event Rollup | The Event Rollup ( |
Source Event Field |
|
Target Case Field |
|