How to open .CQL files on Windows
To open .CQL files on Windows, open the .cql file with a text/code editor (for example, use Open with and choose a text editor) to view the content.
Step-by-step instructions
- Open the .cql file with a text/code editor (for example, use Open with and choose a text editor) to view the content.
- If the file is HL7 Clinical Quality Language, use CQL-aware tooling from the HL7 CQL ecosystem to validate/translate it (refer to the HL7 CQL specification site for guidance).
- If it contains SRU/SRW Contextual Query Language, use it within the relevant SRU/SRW client or system that expects CQL queries.
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 Windows 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.