Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 50 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,64 @@ Open source offering of the CDISC Rules Engine, a tool designed for validating c
1. Download the latest executable for your operating system from [Releases](https://github.com/cdisc-org/cdisc-rules-engine/releases)
2. Unzip the downloaded file
3. Open a terminal in the unzipped directory
4. Run validation using the commands for your OS as suggested below:
4. **Verify the installation** (optional but recommended):

**Windows (PowerShell):**

**Windows (PowerShell):**
```bash
.\core.exe validate -s sdtmig -v 3-4 -d C:\path\to\datasets
.\core.exe --help
```

> **Note for Windows users:** The Windows commands provided in this README are written for PowerShell. While most commands are compatible with both PowerShell and Command Prompt, some adjustments may be necessary when using Command Prompt. If you encounter any issues running these commands in Command Prompt, try using PowerShell or consult the Command Prompt documentation for equivalent commands.
**Linux/Mac:**

**Linux:**
```bash
# First, make it executable (one-time setup)
chmod +x ./core
# First, make it executable (one-time setup)
chmod +x ./core

# Then run validation
./core validate -s sdtmig -v 3-4 -d /path/to/datasets
# Then verify
./core --help
```

**Mac:**
This displays all available commands and confirms the executable is working properly.

**Mac users:** If you encounter security warnings, you may need to remove the quarantine attribute first:

```bash
# First, remove quarantine and make executable (one-time setup)
xattr -rd com.apple.quarantine .
chmod +x ./core
xattr -rd com.apple.quarantine .
```

5. **Run a test validation** (optional):

CORE includes built-in test commands to verify core functionality:

# Then run validation
./core validate -s sdtmig -v 3-4 -d /path/to/datasets
```bash
# Windows
.\core.exe test-validate json

# Linux/Mac
./core test-validate json
```

This confirms the executable is working correctly. Test results are automatically cleaned up after completion and cannot be accessed by the user.

6. **Run your first validation:**

**Windows (PowerShell):**

```bash
.\core.exe validate -s sdtmig -v 3-4 -d C:\path\to\datasets
```

**Linux:**

```bash
./core validate -s sdtmig -v 3-4 -d /path/to/datasets
```

**Mac:**

```bash
./core validate -s sdtmig -v 3-4 -d /path/to/datasets
```

---
Expand All @@ -58,12 +90,14 @@ chmod +x ./core
**Prerequisites:** Python 3.12 installed on your system.

1. Clone the repository:

```bash
git clone https://github.com/cdisc-org/cdisc-rules-engine.git
cd cdisc-rules-engine
```

2. Install dependencies:

```bash
python -m pip install -r requirements-dev.txt
```
Expand All @@ -78,6 +112,7 @@ chmod +x ./core
## Command-line Interface

All examples below use `python core.py` for source code users. **If you're using the executable**, replace `python core.py` with:

- **Windows:** `.\core.exe`
- **Linux/Mac:** `./core`

Expand Down
8 changes: 6 additions & 2 deletions core.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,9 +857,13 @@ def list_ct(cache_path: str, subsets: set[str]):
@click.command()
@click.argument("filetype", type=click.Choice(["json", "xpt"], case_sensitive=False))
def test_validate(filetype):
"""**Release Test** validate command for executable."""
"""
Verify CORE with a test validation.
Requires FILETYPE argument: 'json' or 'xpt'.
Report file is confirmed and automatically cleaned up. For actual validation, use 'validate' command.
"""
try:
base_path = os.path.join("tests", "resources", "datasets")
base_path = os.path.join("resources", "datasets")
if filetype.lower() == "json":
test_file = os.path.join(base_path, "TS.json")
output_name = "json_validation_output"
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/QARegressionTests/test_Issues/test_CoreIssue208.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def setUpClass(cls):
"-v",
"3.4",
"-dp",
os.path.join("tests", "resources", "datasets", "ae.xpt"),
os.path.join("resources", "datasets", "ae.xpt"),
"-of",
"JSON",
]
Expand Down
2 changes: 1 addition & 1 deletion tests/QARegressionTests/test_Issues/test_CoreIssue324.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def setUpClass(cls):
"-v",
"3.4",
"-dp",
os.path.join("tests", "resources", "datasets", "ae.xpt"),
os.path.join("resources", "datasets", "ae.xpt"),
]
subprocess.run(command, check=True)

Expand Down
6 changes: 3 additions & 3 deletions tests/QARegressionTests/test_core/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def test_validate_local_rule(self):
"-v",
"3.4",
"-dp",
os.path.join("tests", "resources", "datasets", "ae.xpt"),
os.path.join("resources", "datasets", "ae.xpt"),
"-lr",
os.path.join("tests", "resources", "rules"),
"-r",
Expand All @@ -203,7 +203,7 @@ def test_validate_local_exclude_rule(self):
"-v",
"3.4",
"-dp",
os.path.join("tests", "resources", "datasets", "ae.xpt"),
os.path.join("resources", "datasets", "ae.xpt"),
"-lr",
os.path.join("tests", "resources", "rules"),
"-er",
Expand All @@ -226,7 +226,7 @@ def test_validate_include_exclude(self):
"-v",
"3.4",
"-dp",
os.path.join("tests", "resources", "datasets", "ae.xpt"),
os.path.join("resources", "datasets", "ae.xpt"),
"-lr",
os.path.join("tests", "resources", "rules"),
"-r",
Expand Down
Loading