From a2f3e2621b09d34876f962f9d4b7f223a96e606b Mon Sep 17 00:00:00 2001 From: Taksh Date: Fri, 31 Jul 2026 14:22:53 +0300 Subject: [PATCH 1/3] =?UTF-8?q?docs:=20correct=20LODS=20scorecomp=20commen?= =?UTF-8?q?t=20(SAPS=20=E2=86=92=20LODS)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The scorecomp CTE comment was copied from SAPS scripts; rename it so LODS concepts are not mislabeled during review. Co-authored-by: Cursor --- mimic-iii/concepts/severityscores/lods.sql | 2 +- mimic-iii/concepts_postgres/severityscores/lods.sql | 2 +- mimic-iv/concepts/score/lods.sql | 2 +- mimic-iv/concepts_postgres/score/lods.sql | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mimic-iii/concepts/severityscores/lods.sql b/mimic-iii/concepts/severityscores/lods.sql index b5c3a7cbb..bdb640cad 100644 --- a/mimic-iii/concepts/severityscores/lods.sql +++ b/mimic-iii/concepts/severityscores/lods.sql @@ -134,7 +134,7 @@ left join `physionet-data.mimiciii_derived.labs_first_day` labs ( select cohort.* - -- Below code calculates the component scores needed for SAPS + -- Below code calculates the component scores needed for LODS -- neurologic , case diff --git a/mimic-iii/concepts_postgres/severityscores/lods.sql b/mimic-iii/concepts_postgres/severityscores/lods.sql index 55422d676..a879dfdb0 100644 --- a/mimic-iii/concepts_postgres/severityscores/lods.sql +++ b/mimic-iii/concepts_postgres/severityscores/lods.sql @@ -102,7 +102,7 @@ WITH cpap AS ( ON ie.icustay_id = labs.icustay_id ), scorecomp AS ( SELECT - cohort.*, /* Below code calculates the component scores needed for SAPS */ /* neurologic */ + cohort.*, /* Below code calculates the component scores needed for LODS */ /* neurologic */ CASE WHEN mingcs IS NULL THEN NULL diff --git a/mimic-iv/concepts/score/lods.sql b/mimic-iv/concepts/score/lods.sql index bc1054023..f6c74ba33 100644 --- a/mimic-iv/concepts/score/lods.sql +++ b/mimic-iv/concepts/score/lods.sql @@ -128,7 +128,7 @@ WITH cpap AS ( , scorecomp AS ( SELECT cohort.* - -- Below code calculates the component scores needed for SAPS + -- Below code calculates the component scores needed for LODS -- neurologic , CASE diff --git a/mimic-iv/concepts_postgres/score/lods.sql b/mimic-iv/concepts_postgres/score/lods.sql index db27acc26..edaa0c740 100644 --- a/mimic-iv/concepts_postgres/score/lods.sql +++ b/mimic-iv/concepts_postgres/score/lods.sql @@ -101,7 +101,7 @@ WITH cpap AS ( ON ie.stay_id = labs.stay_id ), scorecomp AS ( SELECT - cohort.*, /* Below code calculates the component scores needed for SAPS */ /* neurologic */ + cohort.*, /* Below code calculates the component scores needed for LODS */ /* neurologic */ CASE WHEN gcs_min IS NULL THEN NULL From 396a00fa9e0dd72d18b11d68454cb721ab83d30b Mon Sep 17 00:00:00 2001 From: Taksh Date: Sat, 1 Aug 2026 15:14:10 +0300 Subject: [PATCH 2/3] ci: ignore SQLFluff annotate failures on fork PRs Fork tokens cannot create check runs; keep lint green with ignore-unauthorized-error and skip annotate when no concept SQL changed. Co-authored-by: Cursor --- .github/workflows/lint_sqlfluff.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint_sqlfluff.yml b/.github/workflows/lint_sqlfluff.yml index 0986785bf..71f08fca2 100644 --- a/.github/workflows/lint_sqlfluff.yml +++ b/.github/workflows/lint_sqlfluff.yml @@ -1,11 +1,16 @@ name: SQLFluff +# Lints changed mimic-iv/concepts/*.sql on pull requests and posts GitHub +# annotations. permissions + ignore-unauthorized-error keep fork PRs usable. on: - pull_request jobs: lint-mimic-iv: runs-on: ubuntu-latest + permissions: + contents: read + checks: write steps: - name: checkout uses: actions/checkout@v7 @@ -35,8 +40,10 @@ jobs: shell: bash run: sqlfluff lint --format github-annotation --annotation-level failure --nofail ${{ steps.get_files_to_lint.outputs.lintees }} > annotations.json - name: Annotate + if: steps.get_files_to_lint.outputs.lintees != '' uses: yuzutech/annotations-action@v0.6.0 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" title: "SQLFluff Lint" - input: "./annotations.json" \ No newline at end of file + input: "./annotations.json" + ignore-unauthorized-error: true From f6d60c14545c44e97393827e8bf386bd9fa98c3c Mon Sep 17 00:00:00 2001 From: Taksh Date: Sat, 1 Aug 2026 15:16:14 +0300 Subject: [PATCH 3/3] ci: skip SQLFluff Annotate on fork PRs ignore-unauthorized-error does not catch the fork 403 (Resource not accessible by integration). Skip Annotate when head.repo != base repo so lint-mimic-iv can stay green. --- .github/workflows/lint_sqlfluff.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint_sqlfluff.yml b/.github/workflows/lint_sqlfluff.yml index 71f08fca2..d6e1c3f0b 100644 --- a/.github/workflows/lint_sqlfluff.yml +++ b/.github/workflows/lint_sqlfluff.yml @@ -1,7 +1,8 @@ name: SQLFluff # Lints changed mimic-iv/concepts/*.sql on pull requests and posts GitHub -# annotations. permissions + ignore-unauthorized-error keep fork PRs usable. +# annotations. Fork PRs skip Annotate — GITHUB_TOKEN cannot create check runs +# from forks (Resource not accessible by integration / 403). on: - pull_request @@ -40,7 +41,11 @@ jobs: shell: bash run: sqlfluff lint --format github-annotation --annotation-level failure --nofail ${{ steps.get_files_to_lint.outputs.lintees }} > annotations.json - name: Annotate - if: steps.get_files_to_lint.outputs.lintees != '' + # Same-repo PRs only: fork tokens get 403 creating check runs, and + # ignore-unauthorized-error does not treat that as unauthorized. + if: > + steps.get_files_to_lint.outputs.lintees != '' && + github.event.pull_request.head.repo.full_name == github.repository uses: yuzutech/annotations-action@v0.6.0 with: repo-token: "${{ secrets.GITHUB_TOKEN }}"