Sample limit initialization: batch job versus automatic initialization for new accounts
Key Takeaway
Automatic initialization covers only newly created HCP and HCO accounts. Accounts that already exist, including any created while the trigger handlers were off, need the Assign Sample Limit Templates to Accounts batch job.
Initializing sample limits creates a provider sample limit record for each combination of account, product and assigned sample limit template, based on that template and its rules. Life Sciences Cloud offers two ways to do this. You can run the Assign Sample Limit Templates to Accounts batch job on demand. You can also turn on trigger handlers so templates apply automatically when new healthcare professional (HCP) and healthcare organization (HCO) accounts are created. Because the two paths cover different moments, a consultant typically configures both.
Two ways to initialize sample limits
Sample limits use dedicated batch jobs and trigger handlers to process data at scale. For initialization, each path covers a different moment.
| Assign Sample Limit Templates to Accounts job | Automatic initialization | |
|---|---|---|
| When it runs | On demand, to initialize assigned templates for accounts for the first time | A hook that fires when a new HCP or HCO account is created |
| Accounts it covers | The accounts you choose for the run | Only newly created accounts |
| Handles | Existing accounts at rollout | Ongoing account creation |
| Where you set it up | Admin Console > Sample Limits > Sample Limit Jobs | Trigger Handler Administration |
Which path initializes an account depends on when the account was created.
If an HCP or HCO account is created while both new-account trigger handlers are on...
The trigger handlers initialize sample limits for that account automatically.
If an account already existed when the trigger handlers were turned on, or was created while they were off...
The trigger handlers do not initialize that account, because automatic initialization covers only newly created accounts. Run the Assign Sample Limit Templates to Accounts job to initialize it.
Both paths need the "Life Sciences Commercial Admin" permission set, because running sample limit jobs and turning on the trigger handlers each require it.