Connecting Ocean eReferrals
Send eReferrals from NextEMR through the Ocean Healthmap Provider Network
Connect NextEMR to the Ocean Healthmap Provider Network to send eReferrals directly from a patient chart — and to receive status updates, bookings, and reply messages back. Setup has three parts — two in NextEMR and Ocean setup, plus the referral integration that delivers updates back to you — and all three are required before referrals will send and before status updates will come back. Plan for about 45 minutes plus any waiting time on Ocean support.
You don't need to contact anyone for credentials: everything below comes from your own Ocean site, which you control as Site Admin.
What you'll need
- A NextEMR account with an admin role for your clinic.
- An Ocean user account with Site Admin access (and two-factor authentication enabled) for your Ocean site.
- Your Ocean site number (e.g.
21619). - Five credential values issued for your site — request these from
Ocean support if you don't have them yet:
- OAuth Client ID
- OAuth Client Secret
- Open API Key (Ocean calls this the siteKey)
- Open API Credential (Ocean calls this the siteCredential)
- Shared Encryption Key
Keep these values private. NextEMR stores them encrypted and never shows them again after you save — if you lose them, request a new set from Ocean support.
Part 1 — Save your Ocean credentials in NextEMR
- Log in to NextEMR at app.nextemr.com.
- Open Clinic Settings → Integration Settings.
- On the Ocean eReferral card, click Configure.
- Enter your Ocean Site Number and check Enabled.
- Under Clinic Ocean secrets, paste the five values listed above into the matching fields.
- Click Save Secrets. You should see a success message.
- If saving fails with an error, stop and contact support — do not keep clicking: a failed save means nothing was stored.
- Click Save Configuration.
- Under Inbound webhook, copy the Webhook URL — you will
paste it into Ocean in Part 3. (If no URL is shown, save the
site number first, then reopen this panel.) It ends with
/$process-messages?site=<your-site-number>. - Mint the key Ocean will present on that URL: open Clinic
Settings → Security → API keys, click New API key, name it
(e.g.
Ocean prod webhook), and click Create key. Copy the raw key now — it is shown once and never again. You will paste it into Ocean in Part 3.
Your credentials are now stored encrypted. The secret fields will appear blank if you reopen this screen — that is expected and does not mean they were lost. The API key is also never shown again; if you lose it, revoke it under Security → API keys and mint a new one (rotation needs no downtime: create the new key, update Ocean, then revoke the old one).
Part 2 — Register your encryption key in Ocean Cloud Connect
Ocean keeps its own copy of your site's Shared Encryption Key in Ocean Cloud Connect. Ocean support cannot do this step for you — it must be done by someone with Site Admin access to your Ocean site.
- Go to Ocean Cloud Connect and log in with your Ocean user account (the same one you use for the Ocean Portal — note this is a separate login).
- Click Store my Encryption Key.
- Enter your site's Shared Encryption Key — the exact same value you saved in NextEMR in Part 1 — and click Save.
- Log in to the Ocean Portal, open the Menu → Admin → Site Features, check Enable Ocean Cloud Connect, and click Save Changes.
Part 3 — Register the referral integration in Ocean
Without this part, referrals will send but no status updates, appointment bookings, or reply messages will ever come back to NextEMR — referrals will sit at "sent" forever. This must be done by someone with Site Admin access to your Ocean site.
- Log in to the Ocean Portal, open the Menu → Admin → Integrations.
- Click Register an Integration and choose type eReferrals. (Ocean requires two-factor authentication on your account to edit integrations.)
- Fill in the form exactly as below (see the screenshot for the
finished result):
- Integration Name:
NextEMR Sender - Webhook Endpoint → Request URL: paste the Webhook URL you copied from NextEMR in Part 1.
- Payload Type:
FHIR v0.11.1(not Open API, not eReC Beta). - Authentication:
API Key Authentication, Header NameAuthorization, Key: paste the API key you minted under Security → API keys in Part 1 (it starts withnxm_). - Under Email Notifications, check "Notify sender when a referral's status has been updated" and "Notify sender when a referral is completed".
- Under Submission Settings, leave unchecked: "Prevent senders from including attachments".
- Under Permissions, check everything except forwarding: Ocean users may update statuses, send messages, add attachments and notes, update demographics, and cancel; senders may cancel the referral and update the referral form summary. Leave "Forward the referral to another site in the Ocean Portal" unchecked.
- Under API Behaviour, check ONLY: "Post a copy of the referral (all integrations) and all subsequent status updates (FHIR v0.11 only)". Leave "Use this integration for API-created directory listings" unchecked.
- Integration Name:
- Click Save. The status icon next to the integration name must stay green. Yellow or red means Ocean cannot reach NextEMR — hover the icon for the error, then recheck the URL and Key for typos (the most common cause is a truncated paste).

Part 4 — Verify with a test launch and a status update
- In NextEMR, open a test chart and create a referral.
- Click Send via Ocean. Ocean should open and accept the launch without errors.
- In Ocean, accept the test referral. Within a minute or two, the referral in NextEMR should move from "sent" to "acknowledged". If it stays "sent", Part 3 is incomplete — see the troubleshooting table.
- Send a test message on the referral in Ocean and confirm it appears in NextEMR.
Troubleshooting
| What you see | What it means | What to do |
|---|---|---|
SmartLaunchFailed: The access token request failed | NextEMR refused the launch handshake — usually credentials not saved or not yet saved correctly. | Recheck Part 1: site number, Enabled, all five values, Save Secrets returned success. Then contact support. |
SEK is null for site <number> from CloudConnect | Part 2 was skipped: no encryption key stored in Cloud Connect for this site. | Complete Part 2 above. Only a Site Admin for the site can do this. |
| Launch fails right after storing keys on both sides | The two stored copies of the Shared Encryption Key differ. | Re-enter the same key value in both NextEMR (Part 1) and Cloud Connect (Part 2). |
| Save Secrets returns an error in NextEMR | Nothing was stored. | Note the exact error message and contact support before retrying. |
| Referral stays "sent" in NextEMR after accepting/messaging in Ocean | The Part 3 integration is missing, the status-updates checkbox is off, or the wrong site's URL/Key was pasted. | Complete Part 3: confirm an eReferral integration exists for your site, the FHIR status-updates box is checked, and the URL ends with ?site=<your-site-number>. |
| Yellow/red icon next to the integration name in Ocean | Ocean cannot reach the NextEMR webhook (wrong URL or Key). | Hover the icon for the error code. Re-copy the Webhook URL from the Ocean card in NextEMR and re-paste; if the key is suspect, mint a fresh one under Security → API keys, update Ocean, then revoke the old one — pastes often get truncated. |
Getting help
- NextEMR side (saving credentials, launch errors mentioning NextEMR or "access token"): contact NextEMR support with the exact error text and the time it happened (including your timezone).
- Ocean side (CloudConnect errors, directory listings, Ocean Portal access): contact OceanMD Support. When reporting a launch failure, always include the exact date and time of the attempt — that lets them find it in their logs.
Reference
- Ocean's official guide: Setting Up your Ocean Site with a FHIR eReferral Integration
- Ocean Cloud Connect setup: Setting Up Ocean Cloud Connect