# Troubleshooting HL7 connections

Canonical page: https://docs.ovok.com/guides/connect-your-ehr/troubleshooting

Find the symptom, then follow the fix.

| Symptom | Likely cause | Fix |
| --- | --- | --- |
| [The agent shows disconnected](#the-agent-shows-disconnected) | The agent is stopped, or the host cannot reach Ovok. | Restart the agent. Check outbound HTTPS (443) to `api.sandbox.ovok.com`. |
| [Nothing arrives for a patient](#nothing-arrives-for-a-patient) | The patient has no MRN in the hospital's system. | Add the identifier, then resend. |
| [The hospital rejects messages](#the-hospital-rejects-messages) | The hospital answers `AE` or `AR`. | Read the reason with their analyst and fix the mapping. |
| [Duplicates](#duplicates) | A retry after a lost acknowledgement. | Drop a repeated control id. |

## The agent shows disconnected [#the-agent-shows-disconnected]

1. Check that the agent is running on the hospital's host, and restart it.
2. Check that the four values match the connection: `baseUrl`, `clientId`, `clientSecret`, `agentId`.
3. Check that the host reaches `api.sandbox.ovok.com` on port 443, and that no proxy blocks WebSockets.
4. If the connection was deleted or remade, use the new credentials. Old ones stop working.
5. If the receiver is unreachable from the agent, read the agent's own log on the host.

## Nothing arrives for a patient [#nothing-arrives-for-a-patient]

The Patient needs an identifier whose `system` is the MRN system of the connection. Add it, then [resend](/guides/connect-your-ehr/message-reference#resend-after-a-long-outage) the missed Observations.

Also check that the Observation has a numeric value coded in MDC, LOINC or SNOMED CT, and that it matches the connection's `criteria`.

## The hospital rejects messages [#the-hospital-rejects-messages]

An `AE` or `AR` answer means the hospital's system refused the message. A retry gets the same answer.

1. Ask the hospital's analyst for the reason.
2. Compare the message with the [reference](/guides/connect-your-ehr/message-reference): codes, units, identifiers.
3. Send a test reading again after the hospital changes its side.

## Duplicates [#duplicates]

A retry after a lost acknowledgement resends the same message. `MSH-10` is the Observation id and stays the same, so ask the hospital to drop a message with a control id it has already accepted.

## See also [#see-also]

- [Connect over HL7 v2](/guides/connect-your-ehr/connect-over-hl7)
- [HL7 message reference](/guides/connect-your-ehr/message-reference)
