Setup
1. Create hidden fields
verify_patientmorf_token
2. Set morf_token in your Environment logic rule
Add morf_token to your existing Set Environment Variables logic rule. Reach out to your Morf POC to generate the token values.
View code
View code
3. Create logic rule: Existing Patient Check
- Trigger: when DOB or email fields are changed
View code
View code
4. Create an API Connector
Add an API connector forhttps://api.morf.healthcare/v1/profiles/verify with method GET.
5. Add step logic based on verify_patient
On the step where DOB and email are entered, create a connection based on whether verify_patient is filled or empty. The specifics depend on your use case.
Example: if you want to prevent existing patients from booking through a sign-up form, navigate them to a step indicating they already have an account.
Testing
Test both as a new lead and as an existing patient. Test as a new lead- Start a new form (use an incognito window or clear cookies).
- Enter a new email and DOB.
- Validate you are directed through the form as a new lead.
- Find a patient profile in the Morf dashboard. Confirm the profile has both a DOB and email.
- Start a new form (use an incognito window or clear cookies).
- Enter the email and DOB from that patient profile.
- Validate you are directed through the form as an existing patient.
