Newer Version Available

This content describes an older version of this product. View Latest

Add Your Job to the Patient Creation Job Flow

Create a JobFlowSetting custom metadata record for every job that you want executed. Whether you have chosen to add a job to the existing patient creation job flow, or have defined an entirely new patient creation job flow, create a new record.

JobFlowSetting Custom Metadata

Job flows for Health Cloud consist of one or more jobs, each represented by a JobFlowSetting__mdt custom metadata record. Each record points to an Apex class that implements that job.

The settings for each job are defined as one row. You can insert custom metadata records the same way you'd create an instance of another sObject. You can also override any of the jobs within the Patient Create job flow by deselecting the Active field on the job. The jobs that make up the default patient creation job flow are represented by these custom metadata records.

Table 1. Default Patient Create Job Flow
Label Job Flow Name Job Name Job Order Active Custom
Patient Create defaultPatientCreate HcCreatePatientDefaultJobs.CreateIndividualJob 1 true false
Care Plan Create defaultPatientCreate HcCreatePatientDefaultJobs.CreateCarePlanJob 2 true false

The default Patient Create flow defines the steps for creating a patient record. The jobs in this flow create one Account record and one Contact record, and a Case record for the patient’s care plan. This flow uses the JobFlowDataMapping__mdt custom metadata object to define the field mapping from the source CandidatePatient__c to the Account, Contact, and Case records.

The following are descriptions of the fields in the JobFlowSetting__mdt custom metadata type.

Master Label
The friendly name for the job flow entry.
Object Name
The API name of the job flow entry.
Job Flow Name
The name of the job flow. All jobs in the same flow share the job flow name.
Job Name
The name of the Apex class that implements the job. This class extends the HealthCloudGA.MoiJobFlowFactory.MoiJobBase class and overrides its processJob() method.
Job Order
An integer number that specifies the order of the job in the job flow. Jobs in a job flow must have unique job order numbers, and their order must be linear.
Active
Indicates whether the job is used (true) or not (false).
Custom
False if provided by default in the Health Cloud package; otherwise true.
Protected Component
Specifies whether this Job Flow Setting component is hidden outside a managed package. This field is unchecked (false) in the Health Cloud package as the component is accessible outside the package.

To register your custom integration job, insert a record to the JobFlowSetting__mdt custom metadata. To do so in the user interface:

  1. From Setup, enter Custom Metadata Types in the Quick Find box, then select Custom Metadata Types.
  2. Click Job Flow Setting, then click Manage Job Flows Settings.
  3. Click New, and fill out the information for your custom job and Apex class, including the job flow name, job name, and order in which it runs.
  4. Ensure that the Active and Custom checkboxes are checked.
  5. Click Save.

For example, to register the sample class that’s provided, enter the following information.

  1. For Master Label, enter Create Patient: Invoke Integration.
  2. For Object Name, enter CreatePatientInvokeIntegration.
  3. For Job Flow Name, enter defaultPatientCreate to append your job to the existing job flow.
  4. For Job Name, enter the class name InvokePatientDataMigrate.
  5. For Job Order, enter 3 to ensure that Health Cloud invokes this job after the second default job for patient creation.
  6. Ensure that the Active and Custom checkboxes are checked.
  7. Click Save.