Skip to content

Commit 41515b4

Browse files
kojiromikeclaude
andauthored
fix(ImportCodesCommand): only check supported_external_dataloads for ICD types (#26)
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 <[email protected]>
1 parent 2046317 commit 41515b4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Command/ImportCodesCommand.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
232232
$this->logJson('warning', 'DRY RUN MODE - No database changes will be made');
233233
}
234234

235-
if (!$metadata['from_database']) {
235+
// Only ICD code types use the supported_external_dataloads table for validation.
236+
// Other types (RXNORM, SNOMED, CQM_VALUESET) are validated by filename patterns only.
237+
$usesExternalDataloads = in_array($codeType, ['ICD9', 'ICD10'], true);
238+
239+
if ($usesExternalDataloads && !$metadata['from_database']) {
236240
if (!$allowUnsupported) {
237241
$this->logJson('error', 'File not in supported_external_dataloads table', [
238242
'filename' => basename($filePath),

0 commit comments

Comments
 (0)