PHPackages                             opencoreemr/oce-cli-import-codes - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. opencoreemr/oce-cli-import-codes

ActiveLibrary[CLI &amp; Console](/categories/cli)

opencoreemr/oce-cli-import-codes
================================

OpenEMR CLI tool for importing standardized code tables (RXNORM, SNOMED, ICD, CQM\_VALUESET), by OpenCoreEMR Inc

2025.09.26(9mo ago)03[2 issues](https://github.com/openCoreEMR/oce-cli-import-codes/issues)GPL-3.0-or-laterPHPPHP &gt;=8.2.0CI passing

Since Sep 26Pushed 3w agoCompare

[ Source](https://github.com/openCoreEMR/oce-cli-import-codes)[ Packagist](https://packagist.org/packages/opencoreemr/oce-cli-import-codes)[ Docs](https://opencoreemr.com)[ RSS](/packages/opencoreemr-oce-cli-import-codes/feed)WikiDiscussions main Synced today

READMEChangelog (7)Dependencies (5)Versions (29)Used By (0)

OpenCoreEMR Codes Import CLI
============================

[](#opencoreemr-codes-import-cli)

A standalone CLI tool for importing standardized medical code tables (RXNORM, SNOMED, ICD, CQM\_VALUESET) into OpenEMR. Designed for Docker/Kubernetes deployments with efficient file mounting and reuse across multiple installations.

[![License: GPL v3](https://camo.githubusercontent.com/48bf9b56d44f38db53ce21294cf0b9487d0a3734ab3ba1fe4c69858ae20db2c1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d47504c76332d626c75652e737667)](https://www.gnu.org/licenses/gpl-3.0)[![PHP Version](https://camo.githubusercontent.com/5fe05c705bf034839bda7651781e4d0a9d42f4a840478ca5e343873a0361bb89/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322b2d626c75652e737667)](https://php.net)

Features
--------

[](#features)

- ✅ **Standalone CLI tool** - No need to modify OpenEMR core files
- ✅ **Composer installable** - Easy installation and updates
- ✅ **Auto-detection** - Automatically detects code type from filename
- ✅ **Non-interactive** - Runs without user prompts for automation
- ✅ **Progress feedback** - Real-time progress bars and status updates
- ✅ **Docker/Kubernetes optimized** - Perfect for containerized deployments
- ✅ **Multi-site support** - Import codes across multiple OpenEMR sites
- ✅ **Dry-run capability** - Test imports without database changes
- ✅ **Comprehensive logging** - Track imports with revision/version info
- ✅ **Error handling** - Automatic cleanup on failures

Supported Code Types
--------------------

[](#supported-code-types)

Code TypeDescriptionSource**RXNORM**RxNorm drug terminology[NLM](https://www.nlm.nih.gov/research/umls/rxnorm/)**SNOMED**SNOMED CT clinical terminology (RF1)[NLM](https://www.nlm.nih.gov/healthit/snomedct/)**SNOMED\_RF2**SNOMED CT clinical terminology (RF2)[NLM](https://www.nlm.nih.gov/healthit/snomedct/)**ICD9**ICD-9-CM diagnosis codes[CMS](https://www.cms.gov/)**ICD10**ICD-10-CM/PCS codes[CMS](https://www.cms.gov/medicare/icd-10/)**CQM\_VALUESET**Clinical Quality Measures value sets[eCQI](https://ecqi.healthit.gov/)Installation
------------

[](#installation)

### Download PHAR (Recommended)

[](#download-phar-recommended)

Download the latest PHAR release:

```
# Download the PHAR
curl -L -o oce-import-codes.phar https://github.com/opencoreemr/oce-cli-import-codes/releases/latest/download/oce-import-codes.phar

# Make executable
chmod +x oce-import-codes.phar

# Optional: Move to PATH
sudo mv oce-import-codes.phar /usr/local/bin/oce-import-codes
```

### Via Composer

[](#via-composer)

```
composer require opencoreemr/oce-cli-import-codes
```

### Build from Source

[](#build-from-source)

```
git clone https://github.com/opencoreemr/oce-cli-import-codes.git
cd oce-cli-import-codes
composer install
php -d phar.readonly=0 build.php
```

Quick Start
-----------

[](#quick-start)

```
# Using PHAR (recommended) - auto-detects RXNORM from filename
./oce-import-codes.phar /path/to/RxNorm_full_01012024.zip --openemr-path=/var/www/openemr

# Or if installed to PATH
oce-import-codes /path/to/SnomedCT_USEditionRF2_PRODUCTION_20240301T120000Z.zip --openemr-path=/var/www/openemr

# Override auto-detection if needed
oce-import-codes /path/to/custom-name.zip --code-type=SNOMED --openemr-path=/var/www/openemr

# ICD10 with cleanup - auto-detects from filename
oce-import-codes /path/to/icd10cm_order_2024.txt.zip \
  --openemr-path=/var/www/openemr \
  --cleanup

# Dry run to test
oce-import-codes /path/to/RxNorm_full_01012024.zip --openemr-path=/var/www/openemr --dry-run

# Force import even if already loaded
oce-import-codes /path/to/RxNorm_full_01012024.zip --openemr-path=/var/www/openemr --force
```

Usage
-----

[](#usage)

### Command Syntax

[](#command-syntax)

```
oce-import-codes [OPTIONS]
```

**Auto-Detection**: The tool automatically detects the code type from the filename. If detection fails, you can manually specify the code type using `--code-type`.

**Skip Behavior**: By default, the tool checks if a code package with the same type, version, revision date, and file checksum has already been imported. If found, it will skip the import to avoid duplicates. Use `--force` to override this behavior and import anyway.

### Arguments

[](#arguments)

ArgumentDescriptionRequired`file-path`Path to the code archive fileYes### Options

[](#options)

OptionDescriptionDefault`--code-type`Override auto-detected code type (RXNORM|SNOMED|SNOMED\_RF2|ICD9|ICD10|CQM\_VALUESET)Auto-detect`--openemr-path`Path to OpenEMR installation`/var/www/localhost/htdocs/openemr``--site`OpenEMR site name`default``--windows`Use Windows processing (RXNORM only)`false``--us-extension`Import as US extension (SNOMED only)`false``--revision`Revision date (YYYY-MM-DD format)Auto-detect`--code-version`Version string for trackingAuto-detect`--dry-run`Test without database changes`false``--cleanup`Remove temp files after import`false``--temp-dir`Custom temporary directory-`--force`Force import even if same version appears loaded`false`Docker/Kubernetes Deployment
----------------------------

[](#dockerkubernetes-deployment)

### Docker Example

[](#docker-example)

```
FROM openemr/openemr:latest

# Install the CLI tool
RUN composer global require opencoreemr/oce-cli-import-codes

# Mount point for code files
VOLUME ["/var/lib/openemr/codes"]

# Import script
COPY import-codes.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/import-codes.sh
```

File Requirements
-----------------

[](#file-requirements)

### Directory Structure

[](#directory-structure)

Mount your code files to a consistent location:

```
/var/lib/openemr/codes/
├── rxnorm/
│   └── RxNorm_full_MMDDYYYY.zip
├── snomed/
│   ├── SnomedCT_InternationalRF2_PRODUCTION_YYYYMMDD.zip
│   └── SnomedCT_RF1Release_INT_YYYYMMDD.zip
├── icd10/
│   ├── icd10cm_order_YYYY.txt.zip
│   └── icd10pcs_order_YYYY.txt.zip
└── cqm/
    └── EP_EC_AH_CMS_ValueSets_v*.xml.zip

```

### File Sizes &amp; Update Frequency

[](#file-sizes--update-frequency)

Code TypeCompressed SizeExtracted SizeUpdate FrequencyRXNORM~200MB~2GBMonthlySNOMED~300MB~1.5GBBiannualICD-10~15MB~50MBAnnualCQM ValueSets~50MB~200MBAnnualMulti-Site Import
-----------------

[](#multi-site-import)

Troubleshooting
---------------

[](#troubleshooting)

### Common Issues

[](#common-issues)

1. **OpenEMR not found**

    ```
    Error: OpenEMR globals.php not found

    ```

    - Verify `--openemr-path` points to correct installation
    - Ensure OpenEMR is properly installed
2. **Permission errors**

    ```
    Error: Temporary directory is not writable

    ```

    - Check write permissions on temp directory
    - Use `--temp-dir` to specify writable location
3. **Database connection failed**

    ```
    Error: OpenEMR database configuration not found

    ```

    - Verify OpenEMR database configuration
    - Ensure site configuration is correct
4. **Import function not found**

    ```
    Error: OpenEMR rxnorm_import function not available

    ```

    - Verify OpenEMR version compatibility
    - Check that `library/standard_tables_capture.inc.php` exists

### Debug Mode

[](#debug-mode)

Run with verbose output to see detailed information:

```
oce-import-codes RXNORM /path/to/file.zip --openemr-path=/var/www/openemr -v
```

### Log Files

[](#log-files)

Check OpenEMR logs for detailed error information:

- OpenEMR logs: `/var/log/openemr/`
- PHP error logs: Usually in `/var/log/php/`
- Apache/Nginx error logs

Contributing
------------

[](#contributing)

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

License
-------

[](#license)

This project is licensed under the GPL-3.0-or-later License - see the [LICENSE](LICENSE) file for details.

Support
-------

[](#support)

- **Issues**: [GitHub Issues](https://github.com/opencoreemr/oce-cli-import-codes/issues)
- **Email**:
- **Documentation**: [OpenEMR Wiki](https://www.open-emr.org/wiki/)

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for version history.

---

Made with ❤️ by [OpenCoreEMR Inc](https://opencoreemr.com)

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance79

Regular maintenance activity

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~51 days

Recently: every ~36 days

Total

6

Last Release

22d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e3711ec05d536a75786ee9918fef942a50379ca1c5e241a3755c097153a6e89?d=identicon)[michael@opencoreemr.com](/maintainers/michael@opencoreemr.com)

---

Top Contributors

[![kojiromike](https://avatars.githubusercontent.com/u/1566303?v=4)](https://github.com/kojiromike "kojiromike (31 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (30 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

clihealthcarecodesmedicalopenemrICDrxnormsnomedcqm

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/opencoreemr-oce-cli-import-codes/health.svg)

```
[![Health](https://phpackages.com/badges/opencoreemr-oce-cli-import-codes/health.svg)](https://phpackages.com/packages/opencoreemr-oce-cli-import-codes)
```

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

54743.1k4](/packages/jolicode-castor)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M421](/packages/drupal-core-recommended)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136406.3k14](/packages/rector-rector-src)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
