Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaces REGEXP_CONTAINS with ~ in pivoted-gcs.sql #119

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions concepts/pivoted/pivoted-gcs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,36 @@ select
, min(case
when nursingchartcelltypevallabel = 'Glasgow coma score'
and nursingchartcelltypevalname = 'GCS Total'
and REGEXP_CONTAINS(nursingchartvalue, '^[-]?[0-9]+[.]?[0-9]*$')
and nursingchartvalue ~ '^[-]?[0-9]+[.]?[0-9]*$'
and nursingchartvalue not in ('-','.')
then cast(nursingchartvalue as numeric)
when nursingchartcelltypevallabel = 'Score (Glasgow Coma Scale)'
and nursingchartcelltypevalname = 'Value'
and REGEXP_CONTAINS(nursingchartvalue, '^[-]?[0-9]+[.]?[0-9]*$')
and nursingchartvalue ~ '^[-]?[0-9]+[.]?[0-9]*$'
and nursingchartvalue not in ('-','.')
then cast(nursingchartvalue as numeric)
else null end)
as gcs
, min(case
when nursingchartcelltypevallabel = 'Glasgow coma score'
and nursingchartcelltypevalname = 'Motor'
and REGEXP_CONTAINS(nursingchartvalue, '^[-]?[0-9]+[.]?[0-9]*$')
and nursingchartvalue ~ '^[-]?[0-9]+[.]?[0-9]*$'
and nursingchartvalue not in ('-','.')
then cast(nursingchartvalue as numeric)
else null end)
as gcsmotor
, min(case
when nursingchartcelltypevallabel = 'Glasgow coma score'
and nursingchartcelltypevalname = 'Verbal'
and REGEXP_CONTAINS(nursingchartvalue, '^[-]?[0-9]+[.]?[0-9]*$')
and nursingchartvalue ~ '^[-]?[0-9]+[.]?[0-9]*$'
and nursingchartvalue not in ('-','.')
then cast(nursingchartvalue as numeric)
else null end)
as gcsverbal
, min(case
when nursingchartcelltypevallabel = 'Glasgow coma score'
and nursingchartcelltypevalname = 'Eyes'
and REGEXP_CONTAINS(nursingchartvalue, '^[-]?[0-9]+[.]?[0-9]*$')
and nursingchartvalue ~ '^[-]?[0-9]+[.]?[0-9]*$'
and nursingchartvalue not in ('-','.')
then cast(nursingchartvalue as numeric)
else null end)
Expand Down Expand Up @@ -68,4 +68,4 @@ WHERE gcs IS NOT NULL
OR gcsmotor IS NOT NULL
OR gcsverbal IS NOT NULL
OR gcseyes IS NOT NULL
ORDER BY patientunitstayid
ORDER BY patientunitstayid