An open API service indexing awesome lists of open source software.

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.

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.