Newer Version Available
Add Your Job to the Patient Creation Job Flow
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.
| 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:
- From Setup, enter Custom Metadata Types in the Quick Find box, then select Custom Metadata Types.
- Click Job Flow Setting, then click Manage Job Flows Settings.
- 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.
- Ensure that the Active and Custom checkboxes are checked.
- Click Save.
For example, to register the sample class that’s provided, enter the following information.
- For Master Label, enter Create Patient: Invoke Integration.
- For Object Name, enter CreatePatientInvokeIntegration.
- For Job Flow Name, enter defaultPatientCreate to append your job to the existing job flow.
- For Job Name, enter the class name InvokePatientDataMigrate.
- For Job Order, enter 3 to ensure that Health Cloud invokes this job after the second default job for patient creation.
- Ensure that the Active and Custom checkboxes are checked.
- Click Save.