conceptql 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +454 -0
  3. data/config/vocabularies.csv +85 -87
  4. data/config/vocabulary_formats.sha +1 -0
  5. data/config/vocabulary_formats.tsv +39 -0
  6. data/doc/spec.md +207 -67
  7. data/lib/conceptql/behaviors/metadatable.rb +15 -3
  8. data/lib/conceptql/behaviors/provenanceable.rb +82 -8
  9. data/lib/conceptql/behaviors/utilizable.rb +5 -1
  10. data/lib/conceptql/data_model/base.rb +2 -4
  11. data/lib/conceptql/data_model/gdm.rb +3 -1
  12. data/lib/conceptql/database.rb +7 -2
  13. data/lib/conceptql/date_adjuster.rb +12 -5
  14. data/lib/conceptql/lexicon/lexicon_gdm.rb +4 -1
  15. data/lib/conceptql/lexicon/lexicon_ohdsi.rb +19 -1
  16. data/lib/conceptql/lexicon/lexicon_strategy.rb +35 -1
  17. data/lib/conceptql/lexicon.rb +210 -2
  18. data/lib/conceptql/nodifier.rb +7 -1
  19. data/lib/conceptql/one_query_counts.rb +120 -0
  20. data/lib/conceptql/operators/count.rb +4 -0
  21. data/lib/conceptql/operators/death.rb +1 -1
  22. data/lib/conceptql/operators/dedup.rb +1 -1
  23. data/lib/conceptql/operators/episode.rb +10 -2
  24. data/lib/conceptql/operators/ethnicity.rb +0 -4
  25. data/lib/conceptql/operators/except.rb +5 -0
  26. data/lib/conceptql/operators/filter.rb +12 -2
  27. data/lib/conceptql/operators/hospice.rb +1 -1
  28. data/lib/conceptql/operators/hospitalization.rb +1 -1
  29. data/lib/conceptql/operators/information_periods.rb +4 -1
  30. data/lib/conceptql/operators/invalid.rb +7 -1
  31. data/lib/conceptql/operators/multiple_vocabularies.rb +19 -6
  32. data/lib/conceptql/operators/numeric.rb +51 -14
  33. data/lib/conceptql/operators/occurrence.rb +16 -4
  34. data/lib/conceptql/operators/operator.rb +63 -19
  35. data/lib/conceptql/operators/person.rb +1 -1
  36. data/lib/conceptql/operators/person_filter.rb +5 -0
  37. data/lib/conceptql/operators/place_of_service_filter.rb +38 -10
  38. data/lib/conceptql/operators/provenance.rb +12 -2
  39. data/lib/conceptql/operators/provider_filter.rb +5 -1
  40. data/lib/conceptql/operators/race.rb +0 -4
  41. data/lib/conceptql/operators/recall.rb +1 -1
  42. data/lib/conceptql/operators/snf.rb +2 -2
  43. data/lib/conceptql/operators/sum.rb +46 -5
  44. data/lib/conceptql/operators/temporal_operator.rb +6 -2
  45. data/lib/conceptql/operators/trim_date.rb +52 -6
  46. data/lib/conceptql/operators/trim_date_end.rb +11 -1
  47. data/lib/conceptql/operators/trim_date_start.rb +11 -1
  48. data/lib/conceptql/operators/union.rb +45 -1
  49. data/lib/conceptql/operators/vocabulary.rb +7 -3
  50. data/lib/conceptql/paths.rb +10 -0
  51. data/lib/conceptql/query.rb +78 -24
  52. data/lib/conceptql/query_modifiers/gdm/provider_query_modifier.rb +7 -7
  53. data/lib/conceptql/rdbms/generic.rb +21 -1
  54. data/lib/conceptql/rdbms/spark.rb +12 -0
  55. data/lib/conceptql/scope.rb +187 -24
  56. data/lib/conceptql/version.rb +1 -1
  57. data/lib/conceptql/vocabularies/drg_systems.rb +118 -0
  58. data/lib/conceptql/vocabularies/dynamic_vocabularies.rb +10 -4
  59. data/lib/conceptql/vocabularies/entry.rb +15 -3
  60. data/lib/conceptql/vocabularies/formats.rb +59 -0
  61. data/lib/conceptql/vocabularies/vocabulary_class_factory.rb +6 -1
  62. data/lib/conceptql/window/table.rb +12 -3
  63. metadata +8 -4
  64. data/lib/conceptql/operators/concurrent_within.rb +0 -69
@@ -1,87 +1,85 @@
1
- id,vocabulary_full_name,vocabulary_short_name,domain,hidden,format_regexp,aliases,requires_lexicon
2
- ADMSRCE,ADMSRCE,,,,,,
3
- ADMTYPE,ADMTYPE,,,,,,
4
- ATC,WHO Anatomic Therapeutic Chemical Classification,WHO ATC,drug_exposure,,"^[ABCDGHJLMNPRSVabcdghjlmnprsv](\d{2}([A-Za-z]{1,2}(\d{2})?)?)?$",,
5
- BETOS,BETOS,,,,,,
6
- Clinical Code Type,Clinical Code Type,,,,,,
7
- Concept Class,OMOP Concept Class,,,Y,,,
8
- Condition Type,OMOP Condition Occurrence Type,,condition_occurrence,Y,,,
9
- CPT4,Current Procedural Terminology version 4 (AMA),CPT,procedure_occurrence,,"^\w\d{3}\w$",cpt,
10
- CPT4_HCPCS,CPT4 and HCPCS merged (OI supplemental),CPT4/HCPCS,procedure_occurrence,,"^\w\d{3}\w$",,Y
11
- CS_Schema,CS_Schema,,,,,,
12
- Currency,International Currency Symbol (ISO 4217),,,Y,,,
13
- Death Type,OMOP Death Type,,death,Y,,,
14
- Device Type,OMOP Device Type,,observation,Y,,,
15
- Domain,OMOP Domain,,,Y,,,
16
- DRG,Diagnosis-related group (CMS),DRG,procedure_occurrence,,"^\d{3}$",,
17
- DrugTextString,Drug Text String,Drug Text String,drug_exposure,,,,
18
- Drug Type,OMOP Drug Exposure Type,,drug_exposure,Y,,,
19
- DURATION_UNIT,DURATION_UNIT,,,,,,
20
- Ethnicity,OMOP Ethnicity,,person,Y,,,
21
- Gemscript,,Gemscript,drug_exposure,,"^\d{8}$",,
22
- Gender,OMOP Gender,,person,Y,,,
23
- HCFASPEC,HCFASPEC,,,,,,
24
- HCFATYPE,HCFATYPE,,,,,,
25
- HCPCS,Healthcare Common Procedure Coding System (CMS),HCPCS,procedure_occurrence,,"^[A-Za-z]\d{4}$",,
26
- ICD03_Morphology,ICD03_Morphology,,,,"^\d{4}/\d$",,
27
- ICD03_Topography,ICD03_Topography,,,,"^[A-Za-z]\d{2}(\.\d{1,2})?$",,
28
- ICD10,"International Classification of Diseases, Tenth Revision (WHO)",ICD-10 WHO,condition_occurrence,,"^([A-Za-z][0-9][0-9A-Za-z](\.\w{1,4})?|[A-Za-z][0-9][0-9A-Za-z]-[A-Za-z][0-9][0-9A-Za-z]|(?:I|II|III|IV|V|VI|VII|VIII|IX|X|XI|XII|XIII|XIV|XV|XVI|XVII|XVIII|XIX|XX|XXI|XXII))$",,
29
- ICD10PCS,"ICD-10 Procedure Coding System (CMS)",ICD-10 PCS,procedure_occurrence,,"^[0-9BCDFGHX][0-9A-HJ-NP-Z]{6}$",icd10_pcs,
30
- ICD10CM,"International Classification of Diseases, Tenth Revision, Clinical Modification (NCHS)",ICD-10 CM,condition_occurrence,,"^(?:QA[0-9]|[A-Za-z][0-9][0-9ABab])(\.[0-9A-Za-z]{1,4})?$",,
31
- ICD9CM,"International Classification of Diseases, Ninth Revision, Clinical Modification, Volume 1 and 2 (NCHS)",ICD-9 CM,condition_occurrence,,"^(V\d{2}(\.\d{1,2})?|\d{3}(\.\d{1,2})?|E\d{3}(\.\d)?)$",icd9,
32
- ICD9Proc,"International Classification of Diseases, Ninth Revision, Clinical Modification, Volume 3 (NCHS)",ICD-9 Proc,procedure_occurrence,,"^\d{2}(\.\d{1,2})?$",icd9_procedure,
33
- LOINC,Logical Observation Identifiers Names and Codes (Regenstrief Institute),,observation,,"^\w{3,7}-\w$",,
34
- GDM_CEN_TRACT_MEAS,Census Tract Measures from SEER,,observation,,,,
35
- SEER_YOST_ACS_06_10,SEER's Yost Index calculated from ACS 2006-2010,,observation,,,,
36
- SEER_YOST_ACS_10_14,SEER's Yost Index calculated from ACS 2010-2014,,observation,,,,
37
- SEER_YOST_ACS_13_17,SEER's Yost Index calculated from ACS 2013-2017,,observation,,,,
38
- MARCLA_OBS_TYPE,Market Clarity Observation Type,,observation,,,,
39
- Meas Type,OMOP Measurement Type,,observation,Y,,,
40
- NDC,National Drug Code (FDA and manufacturers),,drug_exposure,,"^(\d{5}\w{4}|\d{5}\w{6})$",,
41
- Note Type,OMOP Note Type,,,Y,,,
42
- NUCC,National Uniform Claim Committee Health Care Provider Taxonomy Code Set (NUCC),,,Y,,,
43
- Observation Type,OMOP Observation Type,,observation,Y,,,
44
- Obs Period Type,OMOP Observation Period Type,,observation_period,Y,,,
45
- OI_FILE_TYPE,OI_FILE_TYPE,,,,,,
46
- OI_INFORMATION_TYPE,OI_INFORMATION_TYPE,,,,,,
47
- OI_PROV,OI_PROV,,,,,,
48
- Place of Service,Place of Service Codes for Professional Claims (CMS),,visit_occurrence,Y,,,
49
- PLCSRVC,PLCSRVC,,,,,,
50
- Procedure Type,OMOP Procedure Occurrence Type,,procedure_occurrence,Y,,,
51
- PROVIDER_FACILITY_TYPE,PROVIDER_FACILITY_TYPE,,,,,,
52
- Race,Race and Ethnicity Code Set (USBC),,person,Y,,,
53
- Relationship,OMOP Relationship,,,Y,,,
54
- Revenue Code,UB04/CMS1450 Revenue Codes (CMS),Revenue Code,procedure_occurrence,,,revenue_code,
55
- RxNorm,RxNorm (NLM),,drug_exposure,,"^\d{2,8}$",,
56
- SEER_ADJAJC6M,SEER_ADJAJC6M,,,,,,
57
- SEER_ADJAJC6N,SEER_ADJAJC6N,,,,,,
58
- SEER_ADJAJC6T,SEER_ADJAJC6T,,,,,,
59
- SEER_BEH,SEER_BEH,,,,,,
60
- SEER_CENSUS_POV_IND,SEER_CENSUS_POV_IND,,,,,,
61
- SEER_DAJCC7,SEER_DAJCC7,,,,,,
62
- SEER_DAJCCSTG,SEER_DAJCCSTG,,,,,,
63
- SEER_DXCONF,SEER_DXCONF,,,,,,
64
- SEER_GRADE,SEER_GRADE,,,,,,
65
- SEER_LAT,SEER_LAT,,,,,,
66
- SEER_MARST,SEER_MARST,,,,,,
67
- SEER_MSEX,SEER_MSEX,,,,,,
68
- SEER_NHIADE,SEER_NHIADE,,,,,,
69
- SEER_NOSRG,SEER_NOSRG,,,,,,
70
- SEER_RAD,SEER_RAD,,,,,,
71
- SEER_RADSURG,SEER_RADSURG,,,,,,
72
- SEER_SEQ,SEER_SEQ,,,,,,
73
- SEER_SITERWHO,SEER_SITERWHO,,,,,,
74
- SEER_SRACE,SEER_SRACE,,,,,,
75
- SEER_SRC,SEER_SRC,,,,,,
76
- SEER_SXPRIF,SEER_SXPRIF,,,,,,
77
- SEER_SXSITF,SEER_SXSITF,,,,,,
78
- SEER_TYPEFU,SEER_TYPEFU,,,,,,
79
- SEER_URBRUR,SEER_URBRUR,,,,,,
80
- SNOMED,SNOMED-CT,SNOMED-CT,condition_occurrence,,"^\d{6,18}$",,
81
- Specialty,Medicare provider/supplier specialty codes (CMS),,provider,Y,,,
82
- STUS_CD,STUS_CD,,,,,,
83
- TYPESRVC,TYPESRVC,,,,,,
84
- UCUM,Unified Code for Units of Measure (Regenstrief Institute),,,Y,,,
85
- Visit,OMOP Visit,,visit_occurrence,Y,,,
86
- Visit Type,OMOP Visit Type,,visit_occurrence,Y,,,
87
- Vocabulary,OMOP Vocabulary,,,Y,,,
1
+ id,vocabulary_full_name,vocabulary_short_name,domain,hidden,aliases,requires_lexicon
2
+ ADMSRCE,ADMSRCE,,,,,
3
+ ADMTYPE,ADMTYPE,,,,,
4
+ ATC,WHO Anatomic Therapeutic Chemical Classification,WHO ATC,drug_exposure,,,
5
+ BETOS,BETOS,,,,,
6
+ Clinical Code Type,Clinical Code Type,,,,,
7
+ Concept Class,OMOP Concept Class,,,Y,,
8
+ Condition Type,OMOP Condition Occurrence Type,,condition_occurrence,Y,,
9
+ CPT4,Current Procedural Terminology version 4 (AMA),CPT,procedure_occurrence,,cpt,
10
+ CPT4_HCPCS,CPT4 and HCPCS merged (OI supplemental),CPT4/HCPCS,procedure_occurrence,,,Y
11
+ CS_Schema,CS_Schema,,,,,
12
+ Currency,International Currency Symbol (ISO 4217),,,Y,,
13
+ Death Type,OMOP Death Type,,death,Y,,
14
+ Device Type,OMOP Device Type,,observation,Y,,
15
+ Domain,OMOP Domain,,,Y,,
16
+ DRG,Diagnosis-related group (CMS),DRG,procedure_occurrence,,,
17
+ DrugTextString,Drug Text String,Drug Text String,drug_exposure,,,
18
+ Drug Type,OMOP Drug Exposure Type,,drug_exposure,Y,,
19
+ DURATION_UNIT,DURATION_UNIT,,,,,
20
+ Ethnicity,OMOP Ethnicity,,person,Y,,
21
+ Gemscript,,Gemscript,drug_exposure,,,
22
+ Gender,OMOP Gender,,person,Y,,
23
+ HCFASPEC,HCFASPEC,,,,,
24
+ HCFATYPE,HCFATYPE,,,,,
25
+ HCPCS,Healthcare Common Procedure Coding System (CMS),HCPCS,procedure_occurrence,,,
26
+ ICD03_Morphology,ICD03_Morphology,,,,,
27
+ ICD03_Topography,ICD03_Topography,,,,,
28
+ ICD10,"International Classification of Diseases, Tenth Revision (WHO)",ICD-10 WHO,condition_occurrence,,,
29
+ ICD10PCS,ICD-10 Procedure Coding System (CMS),ICD-10 PCS,procedure_occurrence,,icd10_pcs,
30
+ ICD10CM,"International Classification of Diseases, Tenth Revision, Clinical Modification (NCHS)",ICD-10 CM,condition_occurrence,,,
31
+ ICD9CM,"International Classification of Diseases, Ninth Revision, Clinical Modification, Volume 1 and 2 (NCHS)",ICD-9 CM,condition_occurrence,,icd9,
32
+ ICD9Proc,"International Classification of Diseases, Ninth Revision, Clinical Modification, Volume 3 (NCHS)",ICD-9 Proc,procedure_occurrence,,icd9_procedure,
33
+ LOINC,Logical Observation Identifiers Names and Codes (Regenstrief Institute),,observation,,,
34
+ GDM_CEN_TRACT_MEAS,Census Tract Measures from SEER,,observation,,,
35
+ SEER_YOST_ACS_06_10,SEER's Yost Index calculated from ACS 2006-2010,,observation,,,
36
+ SEER_YOST_ACS_10_14,SEER's Yost Index calculated from ACS 2010-2014,,observation,,,
37
+ SEER_YOST_ACS_13_17,SEER's Yost Index calculated from ACS 2013-2017,,observation,,,
38
+ MARCLA_OBS_TYPE,Market Clarity Observation Type,,observation,,,
39
+ Meas Type,OMOP Measurement Type,,observation,Y,,
40
+ NDC,National Drug Code (FDA and manufacturers),,drug_exposure,,,
41
+ Note Type,OMOP Note Type,,,Y,,
42
+ NUCC,National Uniform Claim Committee Health Care Provider Taxonomy Code Set (NUCC),,,Y,,
43
+ Observation Type,OMOP Observation Type,,observation,Y,,
44
+ Obs Period Type,OMOP Observation Period Type,,observation_period,Y,,
45
+ OI_FILE_TYPE,OI_FILE_TYPE,,,,,
46
+ OI_INFORMATION_TYPE,OI_INFORMATION_TYPE,,,,,
47
+ OI_PROV,OI_PROV,,,,,
48
+ PLCSRVC,PLCSRVC,,,,,
49
+ Procedure Type,OMOP Procedure Occurrence Type,,procedure_occurrence,Y,,
50
+ PROVIDER_FACILITY_TYPE,PROVIDER_FACILITY_TYPE,,,,,
51
+ Race,Race and Ethnicity Code Set (USBC),,person,Y,,
52
+ Relationship,OMOP Relationship,,,Y,,
53
+ Revenue Code,UB04/CMS1450 Revenue Codes (CMS),Revenue Code,procedure_occurrence,,revenue_code,
54
+ RxNorm,RxNorm (NLM),,drug_exposure,,,
55
+ SEER_ADJAJC6M,SEER_ADJAJC6M,,,,,
56
+ SEER_ADJAJC6N,SEER_ADJAJC6N,,,,,
57
+ SEER_ADJAJC6T,SEER_ADJAJC6T,,,,,
58
+ SEER_BEH,SEER_BEH,,,,,
59
+ SEER_CENSUS_POV_IND,SEER_CENSUS_POV_IND,,,,,
60
+ SEER_DAJCC7,SEER_DAJCC7,,,,,
61
+ SEER_DAJCCSTG,SEER_DAJCCSTG,,,,,
62
+ SEER_DXCONF,SEER_DXCONF,,,,,
63
+ SEER_GRADE,SEER_GRADE,,,,,
64
+ SEER_LAT,SEER_LAT,,,,,
65
+ SEER_MARST,SEER_MARST,,,,,
66
+ SEER_MSEX,SEER_MSEX,,,,,
67
+ SEER_NHIADE,SEER_NHIADE,,,,,
68
+ SEER_NOSRG,SEER_NOSRG,,,,,
69
+ SEER_RAD,SEER_RAD,,,,,
70
+ SEER_RADSURG,SEER_RADSURG,,,,,
71
+ SEER_SEQ,SEER_SEQ,,,,,
72
+ SEER_SITERWHO,SEER_SITERWHO,,,,,
73
+ SEER_SRACE,SEER_SRACE,,,,,
74
+ SEER_SRC,SEER_SRC,,,,,
75
+ SEER_SXPRIF,SEER_SXPRIF,,,,,
76
+ SEER_SXSITF,SEER_SXSITF,,,,,
77
+ SEER_TYPEFU,SEER_TYPEFU,,,,,
78
+ SEER_URBRUR,SEER_URBRUR,,,,,
79
+ SNOMED,SNOMED-CT,SNOMED-CT,condition_occurrence,,,
80
+ STUS_CD,STUS_CD,,,,,
81
+ TYPESRVC,TYPESRVC,,,,,
82
+ UCUM,Unified Code for Units of Measure (Regenstrief Institute),,,Y,,
83
+ Visit,OMOP Visit,,visit_occurrence,Y,,
84
+ Visit Type,OMOP Visit Type,,visit_occurrence,Y,,
85
+ Vocabulary,OMOP Vocabulary,,,Y,,
@@ -0,0 +1 @@
1
+ dbd670ae17be0afa3002ce40e5e327c509e62f9c
@@ -0,0 +1,39 @@
1
+ vocabulary_id regexp context use source notes
2
+ ICD9CM (V\d{2}(\.\d{1,2})?|\d{3}(\.\d{1,2})?|E\d{3}(\.\d)?) unstated validator https://stackoverflow.com/a/9573066/14450422 Validated 2026-07-27 vs 17,567 ICD9CM concept_codes: 0 FN on real codes. The 3 non-matches are vocabulary defects, not codes: 92 (deleted, leading zero stripped from 092), sd (corrupt), XX0.00 (Not Applicable, OI-minted concept_id 100000089). Prose-scored 2026-08-13 (vocabulary_formats-wir): 164 of 21,248 tabular tokens and 1,040 of 17,570 paper tokens match, ZERO of them an ordinary word - every hit is a bare number. NOT NARROWED and not narrowable: \d{3} IS a real code form (250, 042), so every 3-digit number in running text validates. Usable for detection only with context.
3
+ ICD9CM.DOTLESS (V\d{2,4}|\d{3,5}|E\d{3,4}) unstated validator Medicare claims data often reports these without the dot. Validated 2026-07-27: 0 FN (same 3 defect rows as ICD9CM). Prose-scored 2026-08-13 (vocabulary_formats-wir): 142 tabular / 1,836 paper tokens, all bare numbers - \d{3,5} is the real dotless form. Not narrowable, and weaker than ICD9CM in text: a 4-digit token in a paper is far more often a year than a code.
4
+ ICD9Proc \d{2}(\.\d{1,2})? unstated validator ICD-9-CM Volume 3 procedures. NOTE the OHDSI vocabulary_id is ICD9Proc, NOT ICD9CM - procedures are a separate vocabulary from diagnoses. Validated 2026-07-27 vs 4,657 concept_codes: 0 FN. Prose-scored 2026-08-13 (vocabulary_formats-wir): 118 tabular / 989 paper tokens, 0 ordinary words. Not narrowable - '12' and '15.99' are genuinely the code shape, so this row cannot separate a procedure code from a number in prose.
5
+ ICD9Proc.DOTLESS \d{2,4} unstated validator Papers and claims extracts print these without the dot (6662 = 66.62). Directly evidenced by litmine pilot 2026-07. Validated 2026-07-27: 0 FN. Prose-scored 2026-08-13 (vocabulary_formats-wir): 109 tabular / 1,793 paper tokens, every one a bare 2-4 digit number, years included. Deliberate and not narrowable; detection needs context.
6
+ ICD10CM (?:QA[0-9]|[A-Z][0-9][0-9AB])(\.[0-9A-Z]{1,4})? unstated validator,detector Dot is OPTIONAL. Three-character category codes (I10, E11, F10, N18) are real codes and are stored dotless. Requiring the dot rejected 1,953 real codes (regression, 2026-07-25). Validated 2026-07-27 vs 100,035 concept_codes: 0 FN. Position 1 is a LETTER: narrowed 2026-08-12 from ^\w{3}(\.\w{1,4})?$, which accepted 16,100 of 17,564 ICD9CM concept_codes (250.00, V45.81, 042) plus bare digits and _-leading junk. Validated vs 100,035 ICD10CM concept_codes in Athena 20260625: 0 FN. Positions 2-3 stay \w deliberately - FY2026 introduced QA0, a LETTER in position 2, and the permissive tail is why this row needed no edit for it. Position 2 narrowed 2026-08-12 from \w to (digit | the literal QA): measured over the FY2026 tabular corpus, \w there admitted 426 additional ordinary word-tokens (ABC, ALL, ARE, Age, Air, AST, AML) while removing ZERO cross-vocabulary false positives - ICD9CM acceptance is 1,357 either way, because V## and E### are already letter+digit. QA is enumerated because FY2026's QA0 is the only ICD-10-CM category ever to carry a letter in position 2 (FY2025: zero). ONE false negative, excluded deliberately: NOD.X ('No diagnosis', concept_id 35209512) is invalid_reason='D', retired 2009-12-31. Prose-scored 2026-08-13 (vocabulary_formats-wir) against a SECOND corpus, 20 PubMed Central papers: 119 of 17,570 tokens, none of them an ordinary word - the 2026-08-12 narrowing holds on literature prose as well as on the tabular. Position 3 narrowed 2026-08-27 from \w to [0-9ABab], and the QA branch now requires a digit: measured over all 100,035 concept_codes, position 3 is only ever a digit or A (584 codes, C4A/D3A) or B (10), and every real QA code is QA0. 0 NEW false negatives - still the single deliberate NOD.X. Removes the literature false positives H2O and T2D. Supersedes this row's own earlier note that 'positions 2-3 stay \w deliberately': position 2 was already narrowed 2026-08-12, and the FY2026 QA0 case that motivated permissiveness is now enumerated explicitly rather than covered by a wildcard. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was (?:QA[0-9]|[A-Za-z][0-9][0-9ABab])(\.[0-9A-Za-z]{1,4})?. 0 FN over 100,034 in-target codes. Tabular prose 5,907 -> 5,903 tokens, ordinary words 0 -> 0.
7
+ ICD10CM.DOTLESS (?:QA[0-9]|[A-Z][0-9][0-9AB])[0-9A-Z]{0,4} unstated validator,detector Medicare claims data often reports these without the dot. Validated 2026-07-27: 0 FN. Position 1 is a LETTER: narrowed 2026-08-12 from ^\w{3,7}$, which accepted 17,562 of 17,564 ICD9CM concept_codes - nearly the entire vocabulary. Validated vs 100,035 ICD10CM concept_codes dotted-stripped in Athena 20260625: 0 FN. Position 2 narrowed 2026-08-12 to (digit | the literal QA), matching the ICD10CM row. Validated vs 100,035 ICD10CM concept_codes dot-stripped: 1 FN, the retired NOD.X (invalid_reason='D'), excluded deliberately. Prose-scored 2026-08-13 (vocabulary_formats-wir) against the 20-paper corpus: 212 of 17,570 tokens, 0 ordinary words. Position 3 narrowed 2026-08-27 from \w to [0-9ABab], and the QA branch now requires a digit; tail narrowed from \w to [0-9A-Za-z] (no underscore). Measured over all 100,035 concept_codes dot-stripped: 0 NEW false negatives, still only the deliberate NODX. Removes the literature false positives T2DM, QALY, H2O and T2D, found 2026-08-27 in a PMC sleep-apnea paper where they were offered to a human reviewer as candidate codes. NOTE the 2026-08-13 prose score ('212 tokens, 0 ordinary words') did not catch these because they are ABBREVIATIONS, not dictionary words - the prose check counted the wrong population. T90 and P50 still match and SHOULD: both are real ICD-10-CM codes, used in that paper as a saturation measure and a blood gas value. That is shape-level ambiguity no regex can resolve. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was (?:QA[0-9]|[A-Za-z][0-9][0-9ABab])[0-9A-Za-z]{0,4}. 0 FN over 100,034 in-target codes. Tabular prose 1,350 -> 1,345 tokens, ordinary words 0 -> 0.
8
+ ICD10 ([A-Z][0-9][0-9A-Z](\.[0-9A-Z]{1,4})?|[A-Z][0-9][0-9A-Z]-[A-Z][0-9][0-9A-Z]|(?:I|II|III|IV|V|VI|VII|VIII|IX|X|XI|XII|XIII|XIV|XV|XVI|XVII|XVIII|XIX|XX|XXI|XXII)) unstated validator,detector WHO ICD-10, distinct from ICD10CM. Three branches: codes (A20, A30.8, M23.07), SubChapter ranges (A15-A19), and Chapter roman numerals (I..XXII). Validated 2026-07-27 vs 16,638 concept_codes: 0 FN on real codes; excludes 351 placeholder rows named Invalid ICD10 Concept, do not use whose concept_code is just the concept_id (e.g. 45532996). NARROWED 2026-08-13 (vocabulary_formats-wir), mirroring the ICD10CM edit of 2026-08-12 but measured on its own: position 1 to a letter and position 2 to a digit, in the code branch and in both halves of the range branch. Evidence - all 16,265 non-chapter in-target codes are letter+2 digits (13,898 ICD10 code + 2,093 ICD10 Hierarchy, shape Add) and all 274 SubChapter ranges are Add-Add. Position 3 stays [0-9A-Za-z] DELIBERATELY: ICD-10-CM's C4A proves a letter in position 3 is a real ICD-10-family shape. The chapter branch was [IVXLCDM]{1,5}, which also accepted MIX, CIVIL, DIM and LIVID; it is now the 22 WHO chapters enumerated - concepts 40474979-40475000, class ICD10 Chapter, a closed set (ICD-10 is frozen, ICD-11 is the successor) that just test re-checks against every release. Measured: 6,390 of 21,248 tabular tokens -> 5,922 (439 ordinary words -> 15) and 1,899 of 17,570 paper tokens -> 127 (674 -> 8). 0 FN over all 16,287 in-target codes. The dot tail stays \w{1,4} although every published tail is \d{1,2}: narrowing it removes a further 473 tabular tokens but NOT ONE ordinary word (they are all code-shaped ICD-10-CM extensions), so permissiveness breaks that tie. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was ([A-Za-z][0-9][0-9A-Za-z](\.\w{1,4})?|[A-Za-z][0-9][0-9A-Za-z]-[A-Za-z][0-9][0-9A-Za-z]|(?:I|II|III|IV|V|VI|VII|VIII|IX|X|XI|XII|XIII|XIV|XV|XVI|XVII|XVIII|XIX|XX|XXI|XXII)). 0 FN over 16,287 in-target codes. Tabular prose 5,922 -> 5,918 tokens, ordinary words 15 -> 15.
9
+ ICD10.DOTLESS ([A-Z][0-9][0-9A-Z][0-9A-Z]{0,4}|[A-Z][0-9][0-9A-Z]-[A-Z][0-9][0-9A-Z]|(?:I|II|III|IV|V|VI|VII|VIII|IX|X|XI|XII|XIII|XIV|XV|XVI|XVII|XVIII|XIX|XX|XXI|XXII)) unstated validator,detector Dotless form of ICD10. Upper bound 7 mirrors ICD10CM.DOTLESS for headroom; WHO ICD-10 only reaches 5 dotless today. Validated 2026-07-27: 0 FN on real codes (same 351 placeholder exclusions). NARROWED 2026-08-13 (vocabulary_formats-wir) in step with ICD10, and this is where it mattered most: \w{3,7} accepted most of the dictionary. Measured 7,022 of 21,248 tabular tokens -> 1,368 (5,565 ordinary words -> 15) and 7,967 of 17,570 paper tokens -> 220 (5,752 -> 8), at 0 FN over all 16,287 in-target codes. Chapter branch enumerated to the 22 WHO chapters; see the ICD10 note for the evidence. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was ([A-Za-z][0-9][0-9A-Za-z]\w{0,4}|[A-Za-z][0-9][0-9A-Za-z]-[A-Za-z][0-9][0-9A-Za-z]|(?:I|II|III|IV|V|VI|VII|VIII|IX|X|XI|XII|XIII|XIV|XV|XVI|XVII|XVIII|XIX|XX|XXI|XXII)). 0 FN over 16,287 in-target codes. Tabular prose 1,368 -> 1,363 tokens, ordinary words 15 -> 15.
10
+ ICD10PCS [0-9A-HJ-NP-Z]{1,7} vocabulary validator Full codes are 7 characters; 1-6 character codes are real hierarchy/partial-code concepts. Validated 2026-07-27 vs 197,098 concept_codes: 0 FN on real codes; excludes MTHU000001-3 (UMLS GEM mapping-table nodes). NARROWED 2026-08-13 (vocabulary_formats-wir) to the PCS alphabet: the ICD-10-PCS spec excludes the letters I and O from every axis so they cannot be confused with 1 and 0, and the published vocabulary confirms it exactly - the charset over all 197,095 in-target codes is 0123456789ABCDEFGHJKLMNPQRSTUVWXYZ, zero I and zero O. 0 FN. Measured 7,308 of 21,248 tabular tokens -> 3,793 (5,708 ordinary words -> 2,323) and 8,686 of 17,570 paper tokens -> 5,240 (6,274 -> 2,859). This REVERSES the earlier 'deliberately not tightened, usage-specific strictness belongs in the caller' note, which judged the same edit only as a way to tell PCS from ICD-10-CM - a cross-vocabulary question. Against prose it is the row's own alphabet and it is free. Still the LOOSEST row in the table: 2,323 ordinary words survive (any i/o-free word of 1-7 characters), so it cannot carry its own weight in a text scan. SUPERSEDED 2026-10-31 (see CASE-EXACT below): case stayed permissive here until then, so that a caller that lowercases before validating would not lose every code. Ryan ruled that such a caller must change the case itself or use a row that declares (?i:...). CORRECTED 2026-08-26: the 0-FN claim is off by three — MTHU000001/2/3 are 10 characters and cannot match {1,7}. They are UMLS Metathesaurus administrative artifacts (MTHU prefix), not ICD-10-PCS codes, so the row's BEHAVIOUR is right and only the claim was overstated. Deliberately not widened to admit them: {1,10} would buy three non-codes and cost precision on every caller. See vocabulary_formats-wsa. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was [0-9A-HJ-NP-Za-hj-np-z]{1,7}. 0 FN over 197,095 in-target codes. Tabular prose 3,795 -> 1,696 tokens, ordinary words 2,325 -> 258. The 2026-08-26 prediction of 1,695 held (corpus now 21,259 tokens, was 21,248).
11
+ ICD10PCS.BILLABLE [0-9BCDFGHX][0-9A-HJ-NP-Z]{6} literature validator,detector https://www.cms.gov/medicare/coding-billing/icd-10-codes DETECTOR variant, added 2026-08-26 (vocabulary_formats-wsa, seed vfm-6x1). The DEFAULT ICD10PCS row is a correct fullmatch VALIDATOR and must not be narrowed: {1,7} admits the vocabulary's hierarchy parents, and only 82,327 of the 197,098 concept_codes are billable 7-character codes. But bound with \b over free text that row matches 852.7 times per 10k chars of real article body text - every bare digit in every table 'is a real PCS code'. THIS row is for a caller SCANNING PROSE. Derived from the codes, not the spec: position 1 uses only 17 characters (0123456789BCDFGHX - no A/E/I/O/U and nothing in K-W except X), which is the entire win; positions 2-7 exclude I and O. Measured 0 FALSE NEGATIVES against all 82,327 billable codes, and 852.7 -> ~0.3 per 10k. Position 5's narrower alphabet (also no E/U) was measured and adds NOTHING - deliberately left out, because an unreadable row costs more than it saves here. All-digit strings are NOT excluded: 504 billable codes are pure digits (0016070...), so requiring a letter would cost real false negatives; bare 7-digit numbers are the residual noise and the price of keeping those 504. Deliberately cannot see the 1- to 6-character hierarchy parents - that is what the default row is for. Real codes found with it in the pubmed corpus: PMC12374767 lists 30233K1, 30233L1 and XW13325.
12
+ HCPCS [A-Z]\d{4} unstated validator,detector Billable HCPCS Level II codes. Validated 2026-07-27 vs 12,822 concept_codes: 0 FN on class HCPCS; excludes 385 HCPCS Modifier (see .WITHMODIFIERS), 106 HCPCS Class BETOS groupers (D1A, I1A, T1A), 151 Clinical Finding lookup values (RH, @@, @Q, bare letters) and HCPC (a deprecated LONG DESCRIPTION marker). Position 1 narrowed 2026-08-13 (vocabulary_formats-wir) from \w to a letter: all 12,178 class-HCPCS codes are letter+4 digits, the sole exception being the already-excluded HCPC marker. 0 FN. Prose: 0 tabular hits either way, 164 -> 27 paper tokens, no ordinary words in either direction. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was [A-Za-z]\d{4}. 0 FN over 12,178 in-target codes. Tabular prose 0 -> 0 tokens, ordinary words 0 -> 0.
13
+ HCPCS.WITHMODIFIERS ([A-Z]\d{4}|[0-9A-Z]{2}) unstated validator OMOP stores modifiers using the same vocabulary_id as HCPCS :-( Validated 2026-07-27: 0 FN over classes HCPCS + HCPCS Modifier. Narrowed 2026-08-13 in step with HCPCS, but the \w{2} branch dominates what this row admits: 244 tabular / 720 paper tokens, of which 111 and 506 are ordinary two-letter English words (of, in, to, at, is, be). NOT USABLE FOR DETECTION IN FREE TEXT - use it where the input is already known to be a code, or scan with the bare HCPCS row and handle modifiers from context. ⚠️ DECLARED TARGET (vocabulary_formats-mpj, 2026-08-26): 5-character CPT/HCPCS codes plus the 2-character modifiers, and DELIBERATELY NOT the 7-digit CPT chapter codes — Ryan, 2026-08-26: 'we are not concerned with CPT chapter codes, so don't worry about the 7 digit codes.' Measured: this row fails 3,853 of 18,069 CPT4 concept_codes, 3,844 of them 7-digit (1035653) and the rest V-CPT/V-SRC OHDSI-internal placeholders. That is now a STATED exclusion rather than a silent one — vfm-k2n judges a row's permissiveness against its own declared target, and this row previously had none, so nothing could judge it. Detector sibling: CPT4_HCPCS.CODEONLY. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was ([A-Za-z]\d{4}|\w{2}). 0 FN over 12,563 in-target codes. Tabular prose 244 -> 168 tokens, ordinary words 111 -> 42.
14
+ HCPCS_MODIFIER [0-9A-Z]{2} unstated validator Validated 2026-07-27 vs the 385 HCPCS Modifier concept_codes: 0 FN. Prose-scored 2026-08-13 (vocabulary_formats-wir): 244 tabular / 693 paper tokens, 111 and 506 of them ordinary two-letter English words. NOT NARROWED - that number is the honest shape, not a defect: a HCPCS modifier IS two alphanumerics, so THIS ROW CANNOT CARRY ITS OWN WEIGHT IN A PROSE SCAN and must be used with context (a modifier field, or the code it modifies). The one available narrowing was measured and declined: all 385 published modifiers are letter-first (289 AA + 96 Ad), so [A-Za-z][0-9A-Za-z] would drop 85 tabular / 152 paper tokens - but it leaves every two-letter word untouched, and CMS defines the modifier as two alphanumeric characters, so a digit-leading one is not structurally impossible. ⚠️ DECLARED TARGET (vocabulary_formats-mpj, 2026-08-26): 5-character CPT/HCPCS codes plus the 2-character modifiers, and DELIBERATELY NOT the 7-digit CPT chapter codes — Ryan, 2026-08-26: 'we are not concerned with CPT chapter codes, so don't worry about the 7 digit codes.' Measured: this row fails 3,853 of 18,069 CPT4 concept_codes, 3,844 of them 7-digit (1035653) and the rest V-CPT/V-SRC OHDSI-internal placeholders. That is now a STATED exclusion rather than a silent one — vfm-k2n judges a row's permissiveness against its own declared target, and this row previously had none, so nothing could judge it. Detector sibling: CPT4_HCPCS.CODEONLY. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was \w{2}. 0 FN over 385 in-target codes. Tabular prose 244 -> 168 tokens, ordinary words 111 -> 42.
15
+ CPT4 [0-9A-Z]\d{3}[0-9A-Z] unstated validator,detector WIDENED 2026-07-27 from ^\d{4}\w$, which rejected the real code M0201 (in-home COVID-19 vaccine administration). Every CPT4 code is 5 characters with digits in positions 2-4; the first character may be a letter. 0 FN over class CPT4; excludes 3,787 CPT4 Hierarchy groupers, 544 CPT4 Modifier (see .WITHMODIFIERS), 50 Visit, 7 Global period metadata and 9 UMLS source markers (V-CPT, V-SRC, V-HCPT, ...). Prose-scored 2026-08-13 (vocabulary_formats-wir): 1 tabular / 168 paper tokens, ZERO ordinary words - every hit is a 5-digit number, which is exactly what a CPT code is. Already as narrow as the shape allows. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was \w\d{3}\w. 0 FN over 13,671 in-target codes. Tabular prose 1 -> 0 tokens, ordinary words 0 -> 0.
16
+ CPT4.WITHMODIFIERS ([0-9A-Z]\d{3}[0-9A-Z]|[0-9A-Z]{2}) unstated validator OMOP stores modifiers using the same vocabulary_id as CPT4 :-( Widened in step with CPT4. Validated 2026-07-27: 0 FN over classes CPT4 + CPT4 Modifier. Prose-scored 2026-08-13 (vocabulary_formats-wir): 245 tabular / 861 paper tokens, 111 and 506 of them ordinary two-letter words, all via the \w{2} modifier branch. Same caveat as HCPCS.WITHMODIFIERS - not usable for detection in free text. ⚠️ DECLARED TARGET (vocabulary_formats-mpj, 2026-08-26): 5-character CPT/HCPCS codes plus the 2-character modifiers, and DELIBERATELY NOT the 7-digit CPT chapter codes — Ryan, 2026-08-26: 'we are not concerned with CPT chapter codes, so don't worry about the 7 digit codes.' Measured: this row fails 3,853 of 18,069 CPT4 concept_codes, 3,844 of them 7-digit (1035653) and the rest V-CPT/V-SRC OHDSI-internal placeholders. That is now a STATED exclusion rather than a silent one — vfm-k2n judges a row's permissiveness against its own declared target, and this row previously had none, so nothing could judge it. Detector sibling: CPT4_HCPCS.CODEONLY. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was (\w\d{3}\w|\w{2}). 0 FN over 14,215 in-target codes. Tabular prose 245 -> 168 tokens, ordinary words 111 -> 42.
17
+ CPT4_MODIFIER [0-9A-Z]{2} unstated validator Validated 2026-07-27 vs the 544 CPT4 Modifier concept_codes: 0 FN. Prose-scored 2026-08-13 (vocabulary_formats-wir): 244 tabular / 693 paper tokens, 111 and 506 ordinary two-letter words. NOT NARROWED and, unlike HCPCS_MODIFIER, not even narrowable to letter-first: the 544 CPT4 modifiers include digit-leading (124) and all-digit (40) forms, so \w{2} is the true shape. The row cannot carry its own weight in a prose scan; use it with context. ⚠️ DECLARED TARGET (vocabulary_formats-mpj, 2026-08-26): 5-character CPT/HCPCS codes plus the 2-character modifiers, and DELIBERATELY NOT the 7-digit CPT chapter codes — Ryan, 2026-08-26: 'we are not concerned with CPT chapter codes, so don't worry about the 7 digit codes.' Measured: this row fails 3,853 of 18,069 CPT4 concept_codes, 3,844 of them 7-digit (1035653) and the rest V-CPT/V-SRC OHDSI-internal placeholders. That is now a STATED exclusion rather than a silent one — vfm-k2n judges a row's permissiveness against its own declared target, and this row previously had none, so nothing could judge it. Detector sibling: CPT4_HCPCS.CODEONLY. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was \w{2}. 0 FN over 544 in-target codes. Tabular prose 244 -> 168 tokens, ordinary words 111 -> 42.
18
+ CPT4_HCPCS [0-9A-Z]\d{3}[0-9A-Z] unstated validator,detector OI hybrid procedure vocabulary (csc-171): CPT4 + HCPCS unioned and deduped, 30,357 concepts, because the digit/letter split is administrative not clinical. DELIBERATELY permissive about which SIDE a code comes from - it admits both digit-leading (CPT) and letter-leading (HCPCS) codes, which is the entire point. Validated 2026-07-27: 0 FN on billable codes; excludes V-CPT and V-SRC (UMLS source markers), 3,787 CPT4 Hierarchy, 549 modifiers (see .WITHMODIFIERS), 106 HCPCS Class, 50 Visit. NARROWED 2026-08-13 (vocabulary_formats-wir) from \w{5}, which matched every 5-letter English word: both parents already require digits in positions 2-4 (CPT4 is \w\d{3}\w, HCPCS is [A-Za-z]\d{4}, a subset of it), so \w\d{3}\w costs 0 FN over all 25,848 in-target codes and keeps position 1 open, preserving the permissiveness this row exists for. Measured 1,174 of 21,248 tabular tokens -> 1 (1,158 ordinary words -> 0) and 1,364 of 17,570 paper tokens -> 168 (1,182 -> 0). The row is now spelled identically to CPT4, which is correct and not redundant: every HCPCS code (letter + 4 digits) already fits the CPT4 shape, so the shape of the union IS the CPT4 shape. The rows stay separate because they name different targets and different lookup vocabularies - a code binds against CPT4_HCPCS in the OI build, not against CPT4. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was \w\d{3}\w. 0 FN over 26,217 in-target codes. Tabular prose 1 -> 0 tokens, ordinary words 0 -> 0.
19
+ CPT4_HCPCS.WITHMODIFIERS ([0-9A-Z]\d{3}[0-9A-Z]|[0-9A-Z]{2}) unstated validator CPT4_HCPCS plus 2-character modifiers, mirroring the CPT4/HCPCS rows. Validated 2026-07-27: 0 FN over billable codes + all 549 modifier concepts. Narrowed 2026-08-13 in step with CPT4_HCPCS: 1,418 tabular tokens -> 245 and 2,057 paper tokens -> 861, 0 FN. What remains is the \w{2} branch - 111 tabular / 506 paper ordinary two-letter words - so like the other .WITHMODIFIERS rows this one is not usable for detection in free text. ⚠️ DECLARED TARGET (vocabulary_formats-mpj, 2026-08-26): 5-character CPT/HCPCS codes plus the 2-character modifiers, and DELIBERATELY NOT the 7-digit CPT chapter codes — Ryan, 2026-08-26: 'we are not concerned with CPT chapter codes, so don't worry about the 7 digit codes.' Measured: this row fails 3,853 of 18,069 CPT4 concept_codes, 3,844 of them 7-digit (1035653) and the rest V-CPT/V-SRC OHDSI-internal placeholders. That is now a STATED exclusion rather than a silent one — vfm-k2n judges a row's permissiveness against its own declared target, and this row previously had none, so nothing could judge it. Detector sibling: CPT4_HCPCS.CODEONLY. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was (\w\d{3}\w|\w{2}). 0 FN over 26,767 in-target codes. Tabular prose 245 -> 168 tokens, ordinary words 111 -> 42.
20
+ CPT4_HCPCS.CODEONLY (\d{5}|\d{4}[A-Z]|[A-Z]\d{4}) literature validator,detector https://www.cms.gov/medicare/coding-billing/healthcare-common-procedure-system DETECTOR variant spanning both vocabularies, added 2026-08-26 (vocabulary_formats-qa5, seed vfm-6x1). CODES ONLY - modifiers are deliberately absent. Ryan, 2026-08-26: 'modifiers often are reported entirely separately from cpt codes themselves (at least in claims data they are separate columns). Perhaps we just shouldn't mix CPT and modifiers together in any regexp.' The seven *.WITHMODIFIERS / *_MODIFIER rows all carry a |\w{2} alternative for the 2-char modifier, and THAT alternative is the entire flood - it matches any two word characters, measuring 340.5 per 10k chars of real article text. Splitting the two concerns fixes both halves: this row measures 0.14 per 10k, a 2,400x reduction, with 0 FALSE NEGATIVES over all 25,848 real 5-character CPT4+HCPCS concept_codes (CORRECTED 2026-08-27 from 25,850, re-measured against the OI build when the row's target was declared; 25,848 is also what the parent CPT4_HCPCS row records, so 25,850 was the outlier). The three branches are the three real shapes: 5 digits (99213), 4 digits + letter (0226T, CPT Category III), and letter + 4 digits (G0463 HCPCS, and M0201 which is a CPT code shaped like one). MODIFIERS ARE NOT DETECTABLE in free text and no pattern fixes that: 686 distinct two-character tokens including MG, AT, AA, AP, AS, US, CT, PT - enumerating all 686 as literals STILL measures 64.2 per 10k, because they are ordinary words. A suffix form code(?:[- ]?modifier)? was proposed, measured and REJECTED: 0 occurrences of a code followed by a two-char token across 25 papers, and it scored no better than this row. Do not reintroduce it without evidence from the literature. V-CPT and V-SRC are OHDSI-internal placeholders, not real codes, and are deliberately unmatched. 7-digit CPT chapter codes are out of scope per Ryan. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was (\d{5}|\d{4}[A-Za-z]|[A-Za-z]\d{4}). 0 FN over 26,217 in-target codes. Tabular prose 0 -> 0 tokens, ordinary words 0 -> 0.
21
+ CPT4_HCPCS_MODIFIER [0-9A-Z]{2} unstated validator Validated 2026-07-27 vs the 549 modifier concept_codes in CPT4_HCPCS (385 HCPCS Modifier + 164 CPT4 Modifier): 0 FN. Prose-scored 2026-08-13 (vocabulary_formats-wir): 244 tabular / 693 paper tokens, 111 and 506 ordinary two-letter words. NOT NARROWED: the union carries CPT4's digit-leading and all-digit modifiers, so \w{2} is the true shape here even though the 385 HCPCS-side modifiers are all letter-first. The row cannot carry its own weight in a prose scan. ⚠️ DECLARED TARGET (vocabulary_formats-mpj, 2026-08-26): 5-character CPT/HCPCS codes plus the 2-character modifiers, and DELIBERATELY NOT the 7-digit CPT chapter codes — Ryan, 2026-08-26: 'we are not concerned with CPT chapter codes, so don't worry about the 7 digit codes.' Measured: this row fails 3,853 of 18,069 CPT4 concept_codes, 3,844 of them 7-digit (1035653) and the rest V-CPT/V-SRC OHDSI-internal placeholders. That is now a STATED exclusion rather than a silent one — vfm-k2n judges a row's permissiveness against its own declared target, and this row previously had none, so nothing could judge it. Detector sibling: CPT4_HCPCS.CODEONLY. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was \w{2}. 0 FN over 550 in-target codes. Tabular prose 244 -> 168 tokens, ordinary words 111 -> 42.
22
+ NDC \d{11} claims validator,detector https://health.maryland.gov/phpa/OIDEOR/IMMUN/Shared%20Documents/Handout%203%20-%20NDC%20conversion%20to%2011%20digits.pdf CLAIMS DEFAULT (vfm-k2n): the 11-digit billing form, labeler-product-package — what appears on a claim. NDC.COMPLETE carries the full vocabulary. NB ^\d{11}$ alone rejects 338,303 real 9-digit concept_codes, which is CORRECT for this row's target and a bug for NDC.COMPLETE's. Validated 2026-07-27: 0 FN vs the 964,647 eleven-digit concept_codes (25 of which are alphanumeric - use NDC.ALPHANUM). Prose-scored 2026-08-13 (vocabulary_formats-wir): ZERO hits in both corpora - no 11-digit token occurs in either. Together with RxNorm Extension the tightest row in the table.
23
+ NDC.COMPLETE (\d{9}|\d{11}) vocabulary validator,detector https://health.maryland.gov/phpa/OIDEOR/IMMUN/Shared%20Documents/Handout%203%20-%20NDC%20conversion%20to%2011%20digits.pdf The FULL vocabulary, not just the claims form: 9-digit is FDA labeler+product without the package segment (337,085 class '9-digit NDC' + 1,218 Device). Validated 2026-07-27 vs all 1,302,950 concept_codes: 0 FN on all-numeric codes; the 39 alphanumeric ones need NDC.ALPHANUM. See vfm-8l5. Prose-scored 2026-08-13 (vocabulary_formats-wir): 0 tabular / 7 paper tokens, all bare 9- or 11-digit numbers.
24
+ NDC.ALPHANUM (\d{5}[0-9A-Z]{4}|\d{5}[0-9A-Z]{6}) vocabulary validator,detector Why alphanumeric: https://forums.ohdsi.org/t/ndc-codes-with-letters/1142/2 - widened alongside NDC to admit the 9-digit form. Validated 2026-07-27 vs all 1,302,950 NDC concept_codes: 0 FN. NARROWED 2026-08-13 (vocabulary_formats-wir) from (\w{9}|\w{11}), which matched every 9- and 11-letter English word: every one of the 1,302,950 published codes begins with 5 digits (the FDA labeler segment - true of all 39 alphanumeric ones too, e.g. 00019N068, 041163NEW, 531570AS3BO), so (\d{5}\w{4}|\d{5}\w{6}) costs 0 FN and survives a future 6-digit labeler. Measured 2,899 of 21,248 tabular tokens -> 0 (all 2,899 were ordinary words) and 1,940 of 17,570 paper tokens -> 7 (1,892 -> 0). CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was (\d{5}\w{4}|\d{5}\w{6}). 0 FN over 1,302,947 in-target codes. Tabular prose 0 -> 0 tokens, ordinary words 0 -> 0.
25
+ NDC.PUBLISHED (\d{4}-\d{4}-\d{2}|\d{5}-\d{3}-\d{2}|\d{5}-\d{4}-\d{1,2}) literature validator,detector https://www.fda.gov/drugs/drug-approvals-and-databases/national-drug-code-directory "PUBLISHED/LABEL FORM, not a claims form and not an OHDSI concept_code. Papers and drug labels print NDC hyphenated in one of three 10-digit segment configurations (4-4-2, 5-3-2, 5-4-1) or the 11-digit 5-4-2 form. Added 2026-08-26 (Ryan) because code_collector's screening design (clc-0bb) names ""hyphenated NDC"" and ""a hyphenated 4-4-2 group"" as a Tier 1 distinctive shape ALWAYS scanned, and no row could express one — measured, 0002-7510-01, 00002-7510-01 and 50242-051-21 matched nothing. DELIBERATELY NOT FOLDED INTO NDC OR NDC.COMPLETE: the first targets the claims form (vfm-k2n) and the second is validated at 0 FN against all 1,302,950 concept_codes, which are 9- and 11-digit only — 10-digit is a presentation form that must be zero-padded to 11 before lookup, so admitting it there would break both rows' declared targets. Segment configurations are enumerated rather than written \d{4,5}-\d{3,4}-\d{1,2}, which would also match illegal shapes like 1234-567-1. KNOWN GAP: the 10-digit UNDASHED form (0002751001) still matches no row; it is ambiguous with ordinary numbers and needs canonicalization, not a wider regex."
26
+ RxNorm \d{2,8} unstated validator RXCUI. Observed 2-7 digits; upper bound 8 is headroom. Validated 2026-07-27 vs 315,157 concept_codes: 0 FN. Prose-scored 2026-08-13 (vocabulary_formats-wir): 109 tabular / 2,676 paper tokens, all bare numbers. NOT NARROWABLE - an RXCUI IS a bare 2-8 digit number, which makes it the loosest numeric row for literature scanning: 2,676 of the 17,570 distinct tokens in the 20-paper corpus - 15% of everything printed - validate. Use it with context.
27
+ RxNorm Extension OMOP\d{5,9} unstated validator,detector OMOP-minted extension for drugs absent from RxNorm; codes are literally OMOP followed by digits. Note the vocabulary_id contains a SPACE. Validated 2026-07-27 vs 2,171,452 concept_codes: 0 FN. Prose-scored 2026-08-13 (vocabulary_formats-wir): ZERO hits in both corpora - the literal OMOP prefix makes this the tightest row in the table.
28
+ ATC [ABCDGHJLMNPRSV](\d{2}([A-Z]{1,2}(\d{2})?)?)? unstated validator WHO ATC. Matches all five levels: A / A01 / A01A / A01AA / A01AB02. Validated 2026-07-27 vs 7,327 concept_codes: 0 FN. Not to be confused with the separate EphMRA ATC vocabulary. LEVEL 1 ENUMERATED 2026-08-13 (vocabulary_formats-wir): the 14 anatomical main groups (A B C D G H J L M N P R S V) are the complete ATC 1st level - 14 concepts, class ATC 1st - and all 7,327 codes at every level start with one of them, so [A-Za-z] was strictly wider than the vocabulary itself. 0 FN. Measured 1,384 of 21,248 tabular tokens -> 744 and 117 of 17,570 paper tokens -> 68; the single-letter branch went from 47 to 27 ordinary-word hits (before this, EVERY letter of the alphabet validated as an ATC code). Most of the rest of the gain is cross-vocabulary: E11, K21 and other ICD-10 categories fit [A-Za-z]\d{2} and no longer fit here. Enumerated rather than generalised because the set is closed - WHO has not added a main group since ATC's inception - and just test re-checks it against every release. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was [ABCDGHJLMNPRSVabcdghjlmnprsv](\d{2}([A-Za-z]{1,2}(\d{2})?)?)?. 0 FN over 7,327 in-target codes. Tabular prose 744 -> 730 tokens, ordinary words 27 -> 13.
29
+ SNOMED \d{6,18} unstated validator,detector NUMERIC ONLY (vfm-27p): every one of the 464,018 UUID-shaped SNOMED concept_codes is INVALID (invalid_reason U=367,198 / D=96,820; zero valid), so a numeric-only default rejects nothing valid. Validated 2026-07-27: 0 FN vs all VALID SNOMED concept_codes. Retired concepts need SNOMED.WITHRETIRED. Prose-scored 2026-08-13 (vocabulary_formats-wir): 0 tabular / 772 paper tokens, all bare 6-18 digit numbers, which is what a SNOMED id is. Not narrowable.
30
+ SNOMED.WITHRETIRED (\d{6,18}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) unstated validator,detector Includes the UUID form used by RETIRED/withdrawn SNOMED concepts (464,018 rows, all invalid). Named for what distinguishes them - retirement - NOT the UK drug extension: the largest class is Physical Object (194,791), not drugs. Caveat: this accepts ANY UUID as a SNOMED code. Validated 2026-07-27: 0 FN vs all 1,093,147 concept_codes. See vfm-27p. Prose-scored 2026-08-13 (vocabulary_formats-wir): 0 tabular / 772 paper tokens - identical to SNOMED, because no UUID-shaped token occurs in either corpus. The 'accepts ANY UUID' caveat above is a cross-vocabulary risk, not a prose one. CASE-EXACT 2026-10-31, LOWER-CASE HEX (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was (\d{6,18}|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}). 0 FN over 1,093,147 in-target codes. Tabular prose 0 -> 0 tokens, ordinary words 0 -> 0. All 464,018 published UUIDs are lower-case hex, so case-exact here means lower case.
31
+ DRG \d{3} claims validator CMS Diagnosis-Related Group, always 3 zero-padded digits. 1,362 rows but only 871 distinct concept_codes - the same code recurs across DRG versions, so a lookup on (code, vocabulary_id) is NOT unique here. Validated 2026-07-27: 0 FN. Prose-scored 2026-08-13 (vocabulary_formats-wir): 27 tabular / 951 paper tokens, every one a bare 3-digit number. NOT NARROWED and not narrowable - a DRG IS three digits, so THIS ROW CANNOT CARRY ITS OWN WEIGHT IN A PROSE SCAN. Run it against a DRG field, not against running text.
32
+ DRG.UNPADDED \d{1,3} claims validator Papers and claims extracts frequently drop the leading zeros (DRG 1 for 001), the same trap as .DOTLESS. Validated 2026-07-27 vs all 1,362 DRG concept_codes: 0 FN. Prose-scored 2026-08-13 (vocabulary_formats-wir): 102 tabular / 1,061 paper tokens, i.e. every 1-3 digit number in the text. Weaker still than DRG for detection, deliberately so, because papers drop the padding.
33
+ ICDO3 \s*(\d{4}/\d|[A-Z]\d{2,3}(\.\d{1,2})?|\d{3}|NULL)(-(\d{4}/\d|[A-Z]\d{2,3}(\.\d{1,2})?|\d{3}|NULL))?\s* unstated validator FIXED 2026-08-26: the topography half read [A-Za-z]\d{2} (C50) where the codes are [A-Za-z]\d{3} (C509), so 60,603 of 64,471 concept_codes FAILED THEIR OWN ROW — 94%, every morphology-topography pair. Now \d{2,3}, leaving exactly 1 miss: '9342/3 ', which carries a TRAILING SPACE in the OHDSI concept_code itself, and is why the \s* wrappers are here. Do not remove them. ⚠️ SPELLING: this row is ICDO3 with the LETTER O (ICD-O-3, Oncology), while ICD03_Morphology and ICD03_Topography use a ZERO. That is not our typo — OHDSI ships both spellings and both resolve as real vocabulary partitions. The vocabulary_id is the join key, so DO NOT normalise them. Validator only: the bare \d{3} and NULL alternatives make it match 61.5 times per 10k chars of real article text. ICDO3.CODEONLY is the detector sibling. Stock OHDSI ICD-O-3 (SEER Site/Histology). Codes are COMPOSITE histology-topography pairs (8000/0-C00.0) and either half may be the literal string NULL (8000/0-NULL). Also carries bare histology (8000/0), bare topography (C00.0), 3-digit groups (800) and ranges (801-804), plus one reversed pair (C57.9-8746/3). The leading/trailing \s* accommodates a known upstream defect: concept 36402927 has concept_code 9342/3 with a TRAILING SPACE, duplicating 44498515. Validated 2026-07-27 vs 64,471 concept_codes: 0 FN. Prose-scored 2026-08-13 (vocabulary_formats-wir): 5,433 tabular / 1,045 paper tokens, 0 ordinary words - but two branches are worth knowing about before scanning text with this row: the literal NULL matches the English word NULL, and [A-Za-z]\d{2}(\.\d{1,2})? is shape-identical to an ICD-10 category, which is where 5,406 of the tabular hits come from. Both are real code forms, so neither is narrowable. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was \s*(\d{4}/\d|[A-Za-z]\d{2,3}(\.\d{1,2})?|\d{3}|NULL)(-(\d{4}/\d|[A-Za-z]\d{2,3}(\.\d{1,2})?|\d{3}|NULL))?\s*. 0 FN over 64,471 in-target codes. Tabular prose 5,434 -> 5,432 tokens, ordinary words 0 -> 0.
34
+ ICDO3.CODEONLY \s*(\d{4}/\d|[A-Z]\d{2,3}(\.\d{1,2})?)(-(\d{4}/\d|[A-Z]\d{2,3}(\.\d{1,2})?))?\s* literature validator,detector https://www.who.int/standards/classifications/other-classifications/international-classification-of-diseases-for-oncology DETECTOR variant, added 2026-08-26 (seed vfm-6x1). Drops the bare \d{3} and NULL alternatives, which are the entire flood: the default matches 61.5 per 10k chars of real article text, this matches 0.57. Costs 1,935 false negatives of 64,471 — precisely the codes that ARE a bare 3-digit number or the literal NULL, which cannot be told from ordinary text by shape and belong in a name-directed scan instead (1,876 NULL-bearing composites, class ICDO Condition, plus 59 bare 3-digit groups and ranges, class ICDO Histology). CORRECTED 2026-08-27 from 1,936 when the row's target was declared in checks/validation_targets.json and the figure was re-measured against the 20260625 release; the row's behaviour is unchanged and only the count was off by one. The 9999/9 morphology form and the A999 topography form are both distinctive; keeping only those is what buys the 100x. \s* wrappers kept because OHDSI concept_codes carry trailing spaces. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was \s*(\d{4}/\d|[A-Za-z]\d{2,3}(\.\d{1,2})?)(-(\d{4}/\d|[A-Za-z]\d{2,3}(\.\d{1,2})?))?\s*. 0 FN over 62,536 in-target codes. Tabular prose 5,407 -> 5,405 tokens, ordinary words 0 -> 0.
35
+ ICD03_Morphology \d{4}/\d unstated validator,detector OI supplemental morphology-only split (histology/behavior). NOTE the id is ICD03 with a DIGIT ZERO, unlike stock ICDO3 with a LETTER O - they are different vocabularies. Validated 2026-07-27 vs 1,367 concept_codes: 0 FN. Prose-scored 2026-08-13 (vocabulary_formats-wir): ZERO hits in both corpora - the /behavior slash makes this row self-delimiting and it is the only ICD-O-3 row safe to run over free text unassisted.
36
+ ICD03_Morphology.NOBEHAVIOR \d{4} unstated validator ⚠️ NOT DETECTABLE, and cannot be: \d{4} is a bare four-digit number, matching 17.5 times per 10k chars of real article text. This row exists for data that has dropped the /behaviour suffix, which is exactly what makes it undetectable — ICD03_Morphology's own 9999/9 form IS detector-safe (0.0/10k). Use that one when scanning prose; use this one only to validate a string you already have. Papers routinely cite bare 4-digit histology (8140) and drop the /behavior suffix - all 5 ICD-O-3 morphology codes in the litmine 2026-07 pilot arrived this way, so an exact join on the stored form would have matched none. Same class of trap as .DOTLESS. Validated 2026-07-27 against every stored code with its behavior suffix removed: 0 FN. Prose-scored 2026-08-13 (vocabulary_formats-wir): 17 tabular / 742 paper tokens, every one a bare 4-digit number - INCLUDING YEARS (1998, 2020, 2026). That is the price of the variant and it is deliberate, since papers print bare histology. Use it only where a 4-digit token is already known to be a code.
37
+ ICD03_Topography [A-Z]\d{2}(\.\d{1,2})? unstated validator,detector OI supplemental topography-only split. Validated 2026-07-27 vs 400 concept_codes: 0 FN. Prose-scored 2026-08-13 (vocabulary_formats-wir): 5,406 tabular / 94 paper tokens, 0 ordinary words. Every hit is an ICD-10-category-shaped token (C50.9), an unavoidable collision: ICD-O-3 topography is derived from the ICD-10 C-chapter shape. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was [A-Za-z]\d{2}(\.\d{1,2})?. 0 FN over 400 in-target codes. Tabular prose 5,406 -> 5,404 tokens, ordinary words 0 -> 0.
38
+ ICD03_Topography.DOTLESS [A-Z]\d{2,3} unstated validator,detector Topography without the dot (C509 for C50.9). Validated 2026-07-27: 0 FN. Prose-scored 2026-08-13 (vocabulary_formats-wir): 1,338 tabular / 101 paper tokens, 0 ordinary words - the same ICD-10 collision, dotless. CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was [A-Za-z]\d{2,3}. 0 FN over 400 in-target codes. Tabular prose 1,338 -> 1,336 tokens, ordinary words 0 -> 0.
39
+ EDI [0-9A-Z]{3}\d{2}([0-9A-Z]{3,4})? unstated validator,detector Korean Electronic Data Interchange procedure/reimbursement code (HIRA), the code system behind Korean NHIS claims. Added because the litmine 2026-07 pilot produced 13 Korean code sets that would otherwise have been dropped as unsupported. Validated 2026-07-27 vs 442,551 concept_codes: 0 FN. NARROWED 2026-08-13 (vocabulary_formats-wir) from \w{5,9}, which matched every 5-to-9-letter English word - aspirin included - and was the loosest row in the table by ordinary words admitted. Measured position by position over all 442,551 published codes: lengths are exactly 5, 8 or 9, and positions 4 AND 5 are digits in every single code (positions 1-3 and 6-9 mix letters and digits, so they stay \w). \w{3}\d{2}(\w{3,4})? therefore costs 0 FN. Measured 7,663 of 21,248 tabular tokens -> 1 (7,637 ordinary words -> 0) and 7,852 of 17,570 paper tokens -> 887 (6,763 -> 0); what remains are bare 5- and 9-digit numbers, which are real EDI shapes (ddddd, ddddddddd). CASE-EXACT 2026-10-31 (vocabulary_formats-7a1, seed vfm-8k1: a row is case-exact unless it declares (?i:...)): was \w{3}\d{2}(\w{3,4})?. 0 FN over 442,551 in-target codes. Tabular prose 1 -> 0 tokens, ordinary words 0 -> 0.