Leave a comment at the end of this page or email contact@krishagni.com
Automatic Survey Sending Rules Example
OpenSpecimen survey module supports sending the automatic survey invites to the participants based on the validation configured. Refer to the wiki page to set up the survey rules.
The user can set validation rules based on Participant Custom Fields, Participant Custom Form, Visit Custom Fields, and Visit Custom Form fields. The below table has some examples illustrating the same.
Common use cases:
Send survey only to consented participants
Example: use Consent Code as shown in the wiki
Send survey when a participant turns 18
Send survey based on Participant Custom Field
Example: Language = English / Spanish
Send survey based on Visit-level fields
Example: Date of Surgery → send survey 2 days before surgery
Form Level | Description | Code |
|---|---|---|
Registration Custom Field | Send English Survey based on Language Field selection | #cpr.participant.extensionDetail?.getAttrsMap()?.get('RB38') == 'English'‘RB38' is nothing but the variable name of the custom field, that is visible in forms.
|
Registration Custom Field | Send a survey to the 18-year-old patient. (used Age as a custom field) | #cpr.participant.extensionDetail?.getAttrsMap()?.get('age_of_participant') != null && T(Integer).parseInt(#cpr.participant.extensionDetail?.getAttrsMap()?.get('age_of_participant')) > 18 |
Participant Field | Send English(Custom Field) Survey based on Language Field selection and Age(DOB/Reg. Date) calculation. Can use below Date functions
| #yearsBetween(#cpr.participant.birthDate, #cpr.registrationDate) < 18 && #cpr.participant.extensionDetail?.getAttrsMap()?.get('RB38') == 'English' |
Participant Field | Send survey for 18+ age participants - based on current date and birthdate | #yearsBetween( #cpr.participant.birthDate,T(java.util.Calendar).getInstance().getTime()) >= 18 |
Registration Forms | Send invite prior two days of Surgery. Form Name ['diagnosis_date_testing'] Field Name
|
#cprForms != null && #cprForms['diagnosis_date_testing'] != null && #daysBetween(T(java.util.Calendar).getInstance().getTime(),#cprForms['diagnosis_date_testing']['date_of_surgery']) == 2 |
Consent Statement | Send Survey Invitation, when the consent statements is null for the participant. | (#consents['statement_code1'] == null)&&(#consents['statement_code2'] == null)Refer this page, to know how you can add Coded Statement |
Consent Statement | Send Survey Invitation, when the either consent statements is null for the participant. | (#consents['statement_code1'] == null)||(#consents['statement_code2'] == null) |
Visit Field | InProgress |
|
Visit Custom Field | InProgress |
|
Visit Form | InProgress |
|
|
|
|