Skip to content

fix: load paths, imports, transpile, and CI permissions - #2124

Closed
Chessing234 wants to merge 48 commits into
MIT-LCP:mainfrom
Chessing234:fix/uo-rate-sqlite-create-user
Closed

Chessing234 wants to merge 48 commits into
MIT-LCP:mainfrom
Chessing234:fix/uo-rate-sqlite-create-user

Conversation

@Chessing234

@Chessing234 Chessing234 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • pytest tests/test_transpile.py
  • smoke import_duckdb.sh / sqlite import with a spaced datadir

Chessing234 and others added 4 commits July 23, 2026 12:22
Match kdigo_uo so BigQuery truncation and Postgres fractional
diffs no longer diverge on the 6/12h rate windows (MIT-LCP#1549).

Co-authored-by: Cursor <cursoragent@cursor.com>
Passwords with quotes and unusual user/db names broke the CREATE
USER / DATABASE statements.

Co-authored-by: Cursor <cursoragent@cursor.com>
Stop pandas DtypeWarning on chartevents/datetimeevents/
inputevents_cv/noteevents during chunked import (MIT-LCP#1237).

Co-authored-by: Cursor <cursoragent@cursor.com>
sqlglot rejects 'D/C''d' as adjacent string literals, breaking
BigQuery→postgres/duckdb transpile of this concept.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Chessing234

Copy link
Copy Markdown
Contributor Author

sqlfluff lint step itself passed; the job fail is the annotate action (permissions on fork PRs).

BigQuery rejects timestamp subtraction with interval compares;
use DATETIME_DIFF(..., HOUR) like the rest of the concepts.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Chessing234

Copy link
Copy Markdown
Contributor Author

also folded in the neuroblock DATETIME_DIFF gap check from #2079.

@Chessing234 Chessing234 changed the title fix: urine output rate parity, sqlite dtypes, create_user escaping fix: urine output rate parity, sqlite dtypes, create_user, neuroblock Jul 23, 2026
$$1 expands to the shell PID, so the version arg was never validated.

Co-authored-by: Cursor <cursoragent@cursor.com>
Lint already ran; fork tokens cannot create check runs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Chessing234

Copy link
Copy Markdown
Contributor Author

CI green on syntax/equivalence/sqlfluff/transpile.

Chessing234 and others added 2 commits July 23, 2026 13:35
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@Chessing234

Copy link
Copy Markdown
Contributor Author

also: duckdb .csv load + SOFA rate>0 for CV score 3.

@Chessing234 Chessing234 changed the title fix: urine output rate parity, sqlite dtypes, create_user, neuroblock fix: UO rate, sqlite dtypes, duckdb csv, SOFA CV, create_user Jul 23, 2026
Chessing234 and others added 4 commits July 23, 2026 13:54
check already handles spaces (MIT-LCP#481/MIT-LCP#2068); load still used unquoted
datadir and \cd without quoting, so paths with spaces broke at import.

Co-authored-by: Cursor <cursoragent@cursor.com>
C4A (Merkel) sits in the C45–C58 string range; Quan 2005 uses WHO
ICD-10 and excludes skin malignancy (MIT-LCP#2017).

Co-authored-by: Cursor <cursoragent@cursor.com>
@Chessing234 Chessing234 changed the title fix: UO rate, sqlite dtypes, duckdb csv, SOFA CV, create_user fix: UO rate, charlson C4A, sqlite/duckdb load, SOFA CV Jul 23, 2026
@Chessing234

Copy link
Copy Markdown
Contributor Author

also: charlson C4A (#2017), datadir quotes (#481), utf-8 transpile writes, validate_concepts exact names.

Padded codes break exact and prefix matches the same way as AHRQ (MIT-LCP#1077).

Co-authored-by: Cursor <cursoragent@cursor.com>
@Chessing234

Copy link
Copy Markdown
Contributor Author

Also fixed Elixhauser: exclude primary in no_drg, include all diagnoses for DRG version, and RTRIM ICD-9 codes (#1077).

Chessing234 and others added 3 commits July 23, 2026 15:24
That cutpoint is mmol/L; on MIMIC BUN (mg/dL) it scored normal values as 1 (MIT-LCP#1065).

Co-authored-by: Cursor <cursoragent@cursor.com>
Pretty-format column cutting mis-parses table names when rebuilding derived.

Co-authored-by: Cursor <cursoragent@cursor.com>
PARSE_DATETIME on a NULL-concatenated string failed rows without a time.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Chessing234

Copy link
Copy Markdown
Contributor Author

Also fixed LODS BUN 7.50 mg/dL band (#1065), make_concepts drop via bq CSV ls, and null-safe echo charttime parse.

Chessing234 and others added 3 commits July 23, 2026 15:35
MONTH previously KeyError'd in _SECONDS_PER_UNIT; emit year*12+month.

Co-authored-by: Cursor <cursoragent@cursor.com>
Same itemids as IV vitalsign (MIT-LCP#1358): 226329, 227632, 227634.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@Chessing234

Copy link
Copy Markdown
Contributor Author

added: DATETIME_DIFF MONTH transpile, CCO/Arctic Sun temps in III vitals + aline_vitals.

Chessing234 and others added 3 commits July 23, 2026 15:46
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
SAPS 1984 publishes mmol/L cutpoints; MIMIC labs are mg/dL.
Apply PhysioNet Challenge 2012 conversions (glucose x18, BUN x2.8).

Co-authored-by: Cursor <cursoragent@cursor.com>
@Chessing234

Copy link
Copy Markdown
Contributor Author

added: echo height PARSE null-guard, aline-aws CCO/Arctic temps, SAPS glucose/BUN mg/dL conversion.

pivoted_oasis reads mimiciii_derived.icustay_hours; make-concepts
never created it (or its icustay_times dependency).

Co-authored-by: Cursor <cursoragent@cursor.com>
@Chessing234

Copy link
Copy Markdown
Contributor Author

also: make-concepts now builds icustay_times/hours (for pivoted_oasis), arterial/central line durations, and neuroblock_dose.

Chessing234 and others added 2 commits July 24, 2026 09:25
SQL existed but make scripts never ran it (MIT-LCP#830).

Co-authored-by: Cursor <cursoragent@cursor.com>
@Chessing234

Copy link
Copy Markdown
Contributor Author

Also wires pivoted_oasis into postgres/duckdb make-concepts (#830).

@alistairewj

Copy link
Copy Markdown
Member

there is too much here for one PR - I'm OK with combining together misc doc and syntax fixes into one PR but concept changes are best kept to individual PRs with evidence supporting them

@Chessing234

Copy link
Copy Markdown
Contributor Author

Agreed — I’ll split this. Keeping load-path/syntax/transpile fixes here; concept changes (UO rate, vaso pauses, line durations, Elixhauser, vitals, scores, etc.) will go out as separate PRs with the linked issue evidence.

1 similar comment
@Chessing234

Copy link
Copy Markdown
Contributor Author

Agreed — I’ll split this. Keeping load-path/syntax/transpile fixes here; concept changes (UO rate, vaso pauses, line durations, Elixhauser, vitals, scores, etc.) will go out as separate PRs with the linked issue evidence.

Chessing234 added a commit to Chessing234/mimic-code that referenced this pull request Jul 25, 2026
Per maintainer feedback on MIT-LCP#2124, keep load-path / transpile / CI fixes here and move concept logic to individual PRs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Chessing234 Chessing234 changed the title fix: UO rate, vaso pause gaps, line durations, load paths fix: load paths, imports, transpile, and CI permissions Jul 25, 2026
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.

2 participants