How to open .CQL files on Linux
To open .CQL files on Linux, open the .cql file in a text editor to view and edit it (it is typically plain text).
Step-by-step instructions
- Open the .cql file in a text editor to view and edit it (it is typically plain text).
- If your desktop environment does not recognize it, add an association using your system’s MIME/app settings (Linux desktops commonly rely on the freedesktop.org shared-mime-info mechanism).
- Use the appropriate CQL ecosystem tools (HL7 CQL or SRU/SRW CQL) depending on what the file contains.
Recommended software
- Microsoft 365
- LibreOffice
- Google Docs (web)
Alternative methods
- Open .CQL in a browser-based viewer if desktop apps fail.
- Try opening .CQL on Linux with a secondary app to rule out app-specific issues.
- Convert .CQL only with trusted tools when direct opening is not possible.
Common issues
The .cql file opens as gibberish or unexpected content
Most .cql files are plain text; if it looks like binary data or unreadable characters, the file may be misnamed, corrupted, or not actually CQL source.
- Verify the file was not renamed incorrectly and re-download or re-export it from the source system if possible.
- Try opening it in a different text editor that can detect encodings (UTF-8 is commonly expected for modern text).
It opens in the wrong application (or no app is associated)
File associations can be missing or incorrect, especially because .cql is used across different domains and isn’t always recognized automatically.
- Set your preferred text/code editor as the default app for .cql so you can reliably view/edit it.
- On Linux, ensure your desktop MIME associations are configured (many environments use the freedesktop.org shared-mime-info approach).
CQL tooling reports syntax/validation errors
Clinical Quality Language (HL7) and Contextual Query Language (SRU/SRW) have different syntaxes; using the wrong parser or version will produce errors.
- Open the file as text and confirm which CQL dialect it contains (HL7 Clinical Quality Language vs SRU/SRW Contextual Query Language).
- Check that your tools match the expected CQL specification/version used by the source of the file.
Security note
.cql is usually plain text, but treat it as untrusted input: CQL processors, validators, or search clients that parse CQL could have vulnerabilities, so prefer well-maintained tools and avoid running unknown tooling on sensitive systems.