> ## Documentation Index
> Fetch the complete documentation index at: https://hmis-docs.derrickmugabwa.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshooting

> Diagnose the OIE, Orthanc, DICOM worklist, and OHIF issues found during setup.

| Symptom                                                                                  | Likely cause                                                                                                  | Resolution                                                                                                     |
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| OIE transformer reports `Unexpected token in object literal`                             | The received Raw message contains escaped or malformed JSON, often from an incorrectly quoted Windows command | Inspect Raw data. Send valid JSON on one CMD line or use PowerShell's correct continuation syntax.             |
| OIE receives `{\\` or backslashes around every quote                                     | Shell quoting inserted literal escape characters                                                              | Use `curl.exe` from Windows CMD as a single line and escape JSON quotes only once.                             |
| OIE table values disappear after Save                                                    | The active cell was not committed                                                                             | Press `Enter` or `Tab` after every query parameter or header value before saving.                              |
| HMIS worklist response is `not_available`                                                | Accession is unknown or requisition is not `open`                                                             | Confirm billing completed, accession matches exactly, and the requisition status is `open`.                    |
| HMIS response is `pacs_unavailable`                                                      | PACS code is unknown or inactive                                                                              | Enable the PACS endpoint and ensure `OIE_RADIOLOGY_PACS_CODE` matches.                                         |
| Modality MWL query is rejected                                                           | Calling AE Title is not authorized in the PACS                                                                | Add `HMIS_MODALITY` to Orthanc `DicomModalities` and restart Orthanc.                                          |
| Study exists in PACS but not HMIS                                                        | Study is not stable yet, poller is stopped, accession is absent, or examination is still `open`               | Wait 60–90 seconds, inspect both OIE channels, verify the DICOM accession, and mark the examination `pending`. |
| Poller throws `IllegalAccessException` for `sun.net.www.protocol.http.HttpURLConnection` | Rhino on Java 17 cannot access the internal URL connection implementation                                     | Use the documented Apache Commons HttpClient poller script.                                                    |
| OHIF says the data source is not configured or running                                   | DICOMweb URL or proxy is incorrect                                                                            | Verify `http://localhost:3000/dicom-web/studies` and the same-origin OHIF configuration.                       |
| OHIF shows a white page                                                                  | Compressed static assets are not being served                                                                 | Ensure the custom Nginx config contains `gzip_static on;`, then recreate the OHIF container and hard-refresh.  |
| Orthanc study appears but OHIF does not list it                                          | QIDO-RS is unavailable or OHIF is pointed at a different DICOMweb root                                        | Confirm Orthanc DICOMweb is enabled and OHIF uses `/dicom-web` through its own origin.                         |
| HMIS viewer action opens but no image loads                                              | Viewer template or Study Instance UID is wrong                                                                | Confirm the PACS endpoint template contains `{study_instance_uid}` and the linked study UID matches PACS.      |

## Useful checks

```powershell theme={null}
docker compose -f docker-compose.yml -f docker-compose.local.yml ps
docker compose -f docker-compose.yml -f docker-compose.local.yml logs --tail 200 oie
docker compose -f docker-compose.yml -f docker-compose.local.yml logs --tail 200 orthanc
docker compose -f docker-compose.yml -f docker-compose.local.yml logs --tail 200 ohif
```

Check DICOMweb from the browser:

```text theme={null}
http://localhost:3000/dicom-web/studies
```

## Replaying a quarantined event

Correct the underlying workflow or mapping issue first. Then replay the PACS event with a new `message_id`. Reusing the original message identity with modified content correctly produces a conflict.
