Skip to main content

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 of PJN_Therapy_Access record type. All other manual event creations are of PJN_Therapy_Status_Update record type.

  • Automatically when records related to the care plan are updated. For example, updating the mvn__PJN_Physician__c field on the Care Plan (Case) record creates an Event record of PJN_Physician_Change record type via the PJN_EventCreation Apex class.

  • Via third-party vendors. For example, receiving a pharmacy status update via an integration creates an Event record of PJN_Pharmacy_Status_Update record type.

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_EventTrigger 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:

  1. Create an Event Rollup (mvn__PJN_Event_Rollup__mdt) metadata record.

  2. 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.

Example: Therapy status update

The following metadata records are an example of how therapy status update events can be configured to roll up to their parent care plans.

Table 112. Sample therapy status update mvn__PJN_Event_Rollup__mdt metadata record

Field label

Sample value

Event Record Type

PJN_Therapy_Status_Update



Table 113. Sample therapy status update mvn__PJN_Event_Rollup_Mapping__mdt metadata record

Field label

Sample value

Event Rollup

The Event Rollup (mvn__PJN_Event_Rollup__mdt) metadata record created above.

Source Event Field

mvn__PJN_New_Therapy_Status__c

Target Case Field

mvn__PJN_Therapy_Status__c



Example: Pharmacy status update

The following metadata records are an example of how pharmacy status update events can be configured to roll up to their parent care plans.

Table 114. Sample pharmacy status update mvn__PJN_Event_Rollup__mdt metadata record

Field label

Sample value

Event Record Type

PJN_Pharmacy_Status_Update



Table 115. Sample pharmacy status update mvn__PJN_Event_Rollup_Mapping__mdt metadata record

Field label

Sample value

Event Rollup

The Event Rollup (mvn__PJN_Event_Rollup__mdt) metadata record created above.

Source Event Field

mvn__PJN_New_Pharmacy_Status__c

Target Case Field

mvn__PJN_Pharmacy_Status__c