From 3f837f86f248e9902871b22a9389f7b6c01de482 Mon Sep 17 00:00:00 2001 From: "Michael A. Smith" Date: Sun, 18 Jan 2026 20:34:09 -0500 Subject: [PATCH] fix(ImportCodesCommand): only check supported_external_dataloads for ICD types The --allow-unsupported feature was incorrectly requiring all code types to be found in the supported_external_dataloads table. However, only ICD9 and ICD10 use that table for validation. Other types (RXNORM, SNOMED, CQM_VALUESET) are validated purely by filename pattern matching and never populate from_database=true. This caused supported files like CQM valuesets to fail with "File not in supported_external_dataloads table" unless --allow-unsupported was used. Co-Authored-By: Claude Opus 4.5 --- src/Command/ImportCodesCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Command/ImportCodesCommand.php b/src/Command/ImportCodesCommand.php index af00024..e2f56b9 100644 --- a/src/Command/ImportCodesCommand.php +++ b/src/Command/ImportCodesCommand.php @@ -232,7 +232,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->logJson('warning', 'DRY RUN MODE - No database changes will be made'); } - if (!$metadata['from_database']) { + // Only ICD code types use the supported_external_dataloads table for validation. + // Other types (RXNORM, SNOMED, CQM_VALUESET) are validated by filename patterns only. + $usesExternalDataloads = in_array($codeType, ['ICD9', 'ICD10'], true); + + if ($usesExternalDataloads && !$metadata['from_database']) { if (!$allowUnsupported) { $this->logJson('error', 'File not in supported_external_dataloads table', [ 'filename' => basename($filePath),