Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 1, 2025

OMOP CDM's concept_code field is VARCHAR(50). The Usagi file validator was missing a check to ensure sourceCode doesn't exceed this limit.

Changes

  • Validation rule (R/validateUsagiFile.R:100): Added SourceCode.is.more.than.50.characters = field_length(sourceCode, min = 0, max = 50) following the same pattern as the existing SourceName.is.more.than.255.characters validation

  • Test data (inst/testdata/VOCABULARIES/ICD10fi/ICD10fi_with_errors.usagi.csv): Added test case with 52-character sourceCode

  • Test assertions (tests/testthat/test-validateUsagiFile.R:91-97): Verifies validation detects oversized sourceCodes, sets error message, and flags entries appropriately

Entries with sourceCode > 50 characters will now be flagged with ERROR: SourceCode is more than 50 characters and mappingStatus set to FLAGGED.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cloud.r-project.org
    • Triggering command: /usr/lib/R/bin/exec/R /usr/lib/R/bin/exec/R --vanilla -e options(repos~+~=~+~c(CRAN~+~=~+~'REDACTED'));~+~install.packages('validate',~+~dependencies=TRUE) (dns block)
  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)
  • packagemanager.posit.co
    • Triggering command: /usr/lib/R/bin/exec/R /usr/lib/R/bin/exec/R -e options(repos~+~=~+~c(CRAN~+~=~+~'REDACTED'));~+~install.packages(c('validate',~+~'checkmate',~+~'dplyr'),~+~dependencies=TRUE) (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Missing check for large conceptCode</issue_title>
<issue_description>FinOMOP/FinOMOP_mappings#110</issue_description>

Comments on the Issue (you are @copilot in this section)

@javier-gracia-tabuenca-tuni In validateUsagiFile.R line 99 should include a validation where SourceName is more that 50 characters

also add a test in test-vlaidateUsagiFile.R
line 90

code and test should be similar to SourceName.is.more.than.255.characters


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: javier-gracia-tabuenca-tuni <54809193+javier-gracia-tabuenca-tuni@users.noreply.github.com>
Copilot AI changed the title [WIP] Add validation for SourceName exceeding 50 characters Add validation for sourceCode maximum length of 50 characters Dec 1, 2025
@javier-gracia-tabuenca-tuni javier-gracia-tabuenca-tuni marked this pull request as ready for review December 1, 2025 08:46
@javier-gracia-tabuenca-tuni javier-gracia-tabuenca-tuni merged commit 4ddea7d into main Dec 1, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing check for large conceptCode

2 participants