https://github.com/abhisheksinghdhadwal/cql-cli
A helper CLI aimed at supporting CQL (Clinical Quality Language) operations on HAPI-FHIR servers.
https://github.com/abhisheksinghdhadwal/cql-cli
Last synced: 2 months ago
JSON representation
A helper CLI aimed at supporting CQL (Clinical Quality Language) operations on HAPI-FHIR servers.
- Host: GitHub
- URL: https://github.com/abhisheksinghdhadwal/cql-cli
- Owner: AbhishekSinghDhadwal
- License: apache-2.0
- Created: 2024-10-25T00:09:16.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-11-06T00:44:09.000Z (7 months ago)
- Last Synced: 2025-01-26T07:14:19.925Z (4 months ago)
- Language: JavaScript
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cql-cli
A helper CLI aimed at supporting CQL (Clinical Quality Language) operations on HAPI-FHIR servers. Uses [Commander](https://www.npmjs.com/package/commander).## Commands
### 1. `convert [outputPath]`
Converts a `.cql` file to a base64 encoded string.- **Arguments:**
- ``: Path to the `.cql` file.
- `[outputPath]` (optional): Path to save the base64 encoded output.
- **Usage:**
```bash
ts-node index.ts convert myfile.cql output.txt
```
- If `outputPath` is omitted, it outputs the base64 string to the console.### 2. `createFHIRBundle [ipUrl]`
Creates a FHIR bundle from a `.cql` file and saves it as a JSON file.- **Arguments:**
- ``: Path to the `.cql` file.
- ``: Path to save the generated FHIR bundle JSON file.
- ``: Description of the library.
- `[ipUrl]` (optional): Base URL for the FHIR Library (default is `http://localhost:8080/fhir/Library/`).
- **Usage:**
```bash
ts-node index.ts createFHIRBundle myfile.cql bundle.json "Description of the CQL library"
```### 3. `POSTtoHAPI `
Posts a FHIR bundle JSON file to a specified HAPI-FHIR server.- **Arguments:**
- ``: Path to the JSON file containing the FHIR bundle.
- ``: URL of the HAPI-FHIR server.- **Usage:**
```bash
ts-node index.ts POSTtoHAPI bundle.json http://localhost:8080/fhir
```### 4. `CreateAndPOST `
Creates a FHIR bundle from a `.cql` file, saves it as a JSON file, and posts it to a specified URL.- **Arguments:**
- ``: Path to the `.cql` file.
- ``: Path to save the generated FHIR bundle JSON file.
- ``: Description of the library.
- ``: URL of the server to post the FHIR bundle.- **Usage:**
```bash
ts-node index.ts CreateAndPOST myfile.cql bundle.json "Description of the CQL library" http://localhost:8080/fhir
```## Dependencies
- commander: Command-line argument parsing.
- fs: File system operations.
- axios: Making HTTP requests.