Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
648 commits
Select commit Hold shift + click to select a range
896f8e9
Adjust DX_ORIGIN insertion
bconnolly Jun 22, 2017
58f4bbd
Determine `dx_type` based on concept code, not icd10 transition date …
Jun 22, 2017
9560dec
Keep the same cardinality for diagnosis facts when converting from i2…
Jun 22, 2017
68786f0
Updated field length for v3.1
Jun 26, 2017
3c7d2c2
Update field length in accordance with CDM v3.1
Jun 26, 2017
284af2d
Merge pull request #93 from kumc-bmi/schema_updates_4745
Jun 26, 2017
24f00b2
Remove bad NDC code if present
Jun 27, 2017
09246b3
Merge pull request #94 from kumc-bmi/bad_ndc_v3_1
Jun 27, 2017
ba7964a
_TIME fields were switched to using 24 hour clock
Jun 27, 2017
44c50b9
Merge pull request #95 from kumc-bmi/hh24
Jun 27, 2017
d479a93
Merge pull request #92 from kumc-bmi/mislabeled_dx_type_4749
Jun 27, 2017
f13ad94
Merge pull request #91 from bconnolly/dx_origin_insertion_4718
Jun 27, 2017
7cfe7be
Hotfix to remove mapping call in update dimensions script
Jun 28, 2017
31b2eaa
Fix to exclude LAB_RESULT_CM.RESULT_NUM values which exceed the spec …
Jul 10, 2017
7b1df37
Added Observational Stay `OS` to the encounter_type merge.
Jul 10, 2017
2a76942
Merge pull request #96 from kumc-bmi/os_encounter_merge_4710
Jul 10, 2017
5cdc712
In case something is getting rounded up to 10000000
Jul 10, 2017
8cd2a05
Added missing parathesis
Jul 11, 2017
c2cbde0
Removed RESULT_NUM field type mapping which was causing an issue with…
Jul 11, 2017
0616f5f
Replace SCILHS lab normal ranges with KUMC normal ranges
Jul 12, 2017
9e14676
Merge pull request #97 from kumc-bmi/result_num_fix
Jul 12, 2017
bfbccad
Merge branch 'master' of github.com:kumc-bmi/i2p-transform into lab_n…
Jul 12, 2017
e3ef88f
Break out result of enc_type coalesce before merging to `visit_dimens…
Jul 13, 2017
00e8d7b
Merge pull request #99 from kumc-bmi/speedup_encounter_merge
Jul 13, 2017
180b8a5
Corrected lab normal range modifier values to align with CDM v3.1 spec
Jul 13, 2017
c79c97c
Fixed normal range modifiers
Sep 26, 2017
2772a0d
Fixed AGE_UPPER to 100 years in days
Sep 26, 2017
0ab8c93
Merge pull request #98 from kumc-bmi/lab_normal_4746
Sep 27, 2017
2d75dfd
Baseline Luigi implementation in i2p-transform. Directory structure …
jgaupp Jan 22, 2018
f08bd2b
import heron_tasks luigi support
dckc Jan 22, 2018
56fce4d
Merge branch 'luigi-integration-4715' into history-redo-4715
jgaupp Jan 22, 2018
29d59e8
import heron_tasks luigi support
jgaupp Jan 25, 2018
733d6b2
Adde Oracle loader and Med_Admin table creation to the Luigi task list.
jgaupp Jan 29, 2018
74b21a8
Added additional modifier codes and pcornet_med data to med_admin ins…
jgaupp Jan 31, 2018
f705b82
Added additional modifier codes and pcornet_med data to med_admin ins…
jgaupp Feb 14, 2018
b2a9ff0
Updates to support Luigi task in dev environment.
jgaupp Feb 14, 2018
d1ae1a9
Updates to support Luigi task in dev environment.
jgaupp Feb 14, 2018
b6d32d2
Updates to support Luigi task in dev environment.
jgaupp Feb 14, 2018
ea87d12
Updates to support Luigi task in dev environment.
jgaupp Feb 14, 2018
be89494
Added luigi return codes to configuration
jgaupp Feb 15, 2018
7784738
CDM as separate Luigi tasks (in progress). Med_Admin stand alone.
jgaupp Feb 19, 2018
fd31b9a
Restored Init and Loader sql to original state.
jgaupp Feb 19, 2018
ff872f8
cite GPC
dckc Feb 21, 2018
3b38c5a
restore KUMC copyright
dckc Feb 21, 2018
e92dd69
README: put i2p-transform in context
dckc Feb 21, 2018
b12d886
README: update basic usage
dckc Feb 21, 2018
fb605c9
script_lib: title, statements tests for med_admin
dckc Feb 21, 2018
e3f4f75
Increased size of raw name and route fields.
jgaupp Feb 22, 2018
7fc8ea4
Dynamically typed SqlScriptTask dependencies for visualization
jgaupp Mar 1, 2018
af01510
Luigi CDM full build with table create but not populate
jgaupp Mar 2, 2018
990fa15
Luigi CDM full build with table create and populate
jgaupp Mar 5, 2018
4fc9880
Added missing operations to pcornet_init
jgaupp Mar 6, 2018
19967d0
Updated Harvest to CDM 4, added counts to status table.
jgaupp Mar 9, 2018
0740ccb
Add patient_chunks_survey.sql
jgaupp Mar 9, 2018
f33e2ad
All PATID and ENCOUNTERID columns to number
jgaupp Mar 28, 2018
7eef8f7
Adding commits and parallel execution hints to reduce TEMP space
jgaupp Mar 28, 2018
1d04f97
Prescribing using temporary table
jgaupp Mar 30, 2018
80a1256
Added nested loop hint
jgaupp Mar 30, 2018
b5355ee
Testing insert into prescribing only
jgaupp Mar 30, 2018
e3de6c2
Production version building all tables
jgaupp Apr 2, 2018
911cea3
Added csv loader
jgaupp Apr 10, 2018
cb77d35
Added path to csv name
jgaupp Apr 10, 2018
e42709e
Use cdm_status table to complete harvest
jgaupp Apr 10, 2018
4c9ad5e
Correcting typo in HARVEST_LOCAL
jgaupp Apr 10, 2018
e72e20b
Correcting typo in DEATH_DATE_MGMT
jgaupp Apr 10, 2018
964cabf
Fix for ticket 5197.
jgaupp Apr 11, 2018
3e67873
Fix for ticket 5085
jgaupp Apr 11, 2018
706f2d8
Added CDM 4 tables to backup configuration
jgaupp Apr 12, 2018
628c779
Create CDM_STATUS table during initialization
jgaupp Apr 12, 2018
19cec07
Added distinct modifier and comment on death unknown flag.
jgaupp Apr 13, 2018
fde2e44
Added post processing procedure to pcornet_loader
jgaupp Apr 17, 2018
3d186d2
Set default enrollment months to 42.
jgaupp Apr 18, 2018
5f8aa56
Change prescribing_transfer to a real table, drop parallel inserts.
jgaupp Apr 23, 2018
b28539c
Update demographic language and diagnosis pdx
jgaupp Apr 26, 2018
70a5f22
Fix utf-8 decode error
jgaupp Apr 26, 2018
77d78bd
Fix utf-8 decode errors
jgaupp Apr 26, 2018
3eb6c9e
Capitalizing table column names
jgaupp Apr 26, 2018
e359a56
Merge pull request #101 from jgaupp/luigi-integration-4715
dckc Apr 26, 2018
4228a85
Optimized prescribing build
jgaupp Apr 30, 2018
4271b1c
Fixing EDC data model error.
jgaupp May 1, 2018
521fc83
Fixing EDC data model errors.
jgaupp May 1, 2018
4e25f11
Fixing EDC data model errors.
jgaupp May 1, 2018
7dadd9a
Fixing EDC data model errors.
jgaupp May 1, 2018
13399a0
Merge pull request #102 from kumc-bmi/luigi-prescribing
jgaupp May 1, 2018
67e11af
luigi-integration-4715: Merge jg into dckc
dckc May 7, 2018
c182261
script_lib: restore doctests to working order
dckc May 7, 2018
fe01cd6
code style fixes: whitespace etc.
dckc May 7, 2018
5ef3d85
type hints work again; organize imports
dckc May 7, 2018
a22017c
Merge branch 'luigi-integration-4715'
dckc May 7, 2018
20ba36a
Merge branch 'master'
dckc May 7, 2018
b1ef59c
NPI loader and end_time update for all tables.
jgaupp May 10, 2018
e0c2b31
Adding init dependencies
jgaupp May 10, 2018
4260ce8
Adding init dependencies
jgaupp May 10, 2018
470917a
Adding init dependencies
jgaupp May 10, 2018
ab6343b
Adding init dependencies
jgaupp May 10, 2018
3d61dc2
Fixing CDM_STATUS error
jgaupp May 10, 2018
c5c8dd4
Debugging STAGEDEV
jgaupp May 10, 2018
5e774c6
Allow nulls in status table
jgaupp May 10, 2018
a5a4284
Fixing CDM_STATUS update
jgaupp May 10, 2018
a3b72cf
Replacing status with task in cdm_status update op.
jgaupp May 10, 2018
8087dbe
Debugging STAGEDEV
jgaupp May 10, 2018
71e7466
Debugging STAGEDEV
jgaupp May 10, 2018
e0f8ca9
Debugging NPI loader
jgaupp May 10, 2018
33d2c12
Debugging NPI upload
jgaupp May 10, 2018
b793b33
Debugging NPI upload
jgaupp May 10, 2018
8e07419
Debuggin NPI upload
jgaupp May 10, 2018
9545c45
Debugging NPI upload
jgaupp May 10, 2018
0f2877d
Debugging Harvest
jgaupp May 10, 2018
04e36c4
Correcting type in pcornet_trial reference
jgaupp May 10, 2018
bb9327f
Add specialty to provider and create curated file directory
jgaupp May 10, 2018
e50f66d
Add provider_specialty_code file
jgaupp May 10, 2018
227947c
Replace ZipFile with subprocess call
jgaupp May 10, 2018
605c06a
Correcting syntax of subprocess call and scrubbing specialty csv
jgaupp May 10, 2018
2b207db
Fixing typo in csv name
jgaupp May 10, 2018
13c8304
Removing unicode characters
jgaupp May 11, 2018
b29fb1b
Adding init dependencies
jgaupp May 11, 2018
44f1dc3
Substring on raw provider specialty
jgaupp May 11, 2018
d89d0ed
Cod test configuration
jgaupp May 11, 2018
d361f1c
Cod test configuration
jgaupp May 11, 2018
e6606f1
Cod test configuration
jgaupp May 11, 2018
e8fc1fe
Provider relies on provider_dimension rather than clarity@id reads
jgaupp May 14, 2018
139cb5d
Merge remote-tracking branch 'kumc-bmi/master' into luigi-integration…
jgaupp May 18, 2018
2645b6f
Correcting bad merge
jgaupp May 18, 2018
527e61c
Adding type hints
jgaupp May 18, 2018
b4c990a
Optimize Luigi ops, optimize prescribing table creation, basic provid…
jgaupp May 30, 2018
e57b26a
Cleanup prescribing_w_dose table
jgaupp May 30, 2018
31bb355
Merge luigi-integration-4715
dckc Jun 20, 2018
097abc0
Map specimen source to pcornet values and add to lab_results_cm
jgaupp Jun 20, 2018
c0ae907
Merge branch 'master' of https://github.com/kumc-bmi/i2p-transform in…
jgaupp Jun 20, 2018
6e678c0
Adding payer mapping and payer data to encounter table
jgaupp Jul 2, 2018
6f57286
Adding specimen source map.
jgaupp Jul 2, 2018
3abf678
Adding payer map load op to i2p_task and tweaking map name.
jgaupp Jul 2, 2018
4038b7a
Matching payer concepts codes to changes made in Heron.
jgaupp Jul 5, 2018
a096980
Adding comments to clarify the construction of specimen source map.
jgaupp Jul 5, 2018
8e6b3ce
Changing concept codes to match work in Heron.
jgaupp Jul 5, 2018
bf191f7
Merge pull request #104 from kumc-bmi/insurance_and_payer_4687
jgaupp Jul 11, 2018
05f0162
Merge pull request #105 from kumc-bmi/lab_specimen_source_4815
jgaupp Jul 11, 2018
36fcb19
First draft of changes to support CDM 4.1 fields.
jgaupp Jul 11, 2018
b41ffc9
Adding raw language spoken to demographic table.
jgaupp Jul 12, 2018
8339b1c
Adding present on admission (POA) to diagnosis.
jgaupp Jul 12, 2018
b2722c8
Adding PRN flag to prescribing.
jgaupp Jul 13, 2018
50ebac2
Removing unnecessary obs fact meds check.
jgaupp Jul 16, 2018
d7d5c43
Correcting syntax errors in lab and prescribing scripts.
jgaupp Jul 16, 2018
e3ba479
Adding drop statement for new prn table to prescribing script.
jgaupp Jul 16, 2018
29e9f50
Route map for dispensing and prescrbing plus various bug fixes.
jgaupp Jul 16, 2018
2e90574
Adding unit map, plus join on dispensing and prescribing.
jgaupp Jul 17, 2018
c35e4c6
Fixing alter table after changing provider_id column alias.
jgaupp Jul 17, 2018
6a94473
Add drop for new route table, remove drop for elminated dose table.
jgaupp Jul 18, 2018
62dfde7
Correcting flubbed identification of dose columns.
jgaupp Jul 18, 2018
90f74f8
Restoring luigi return code values to configuration.
jgaupp Jul 18, 2018
e088d75
Another typo. Correct name for rx_dose_ordered_units column.
jgaupp Jul 18, 2018
3979885
Correcting name of rx_dose_ordered_unit column.
jgaupp Jul 18, 2018
c26e758
Untested data_step for 4.1, med_admin minus days supply, unit_map twe…
jgaupp Jul 18, 2018
bf6af2c
med_admin minus days supply modifiers and unit_map tweak
jgaupp Jul 18, 2018
a415b07
Making downloadNPI dependent on pcornet_int, plus comments.
jgaupp Jul 18, 2018
984b8ed
Adding map load tasks to dependent tables, plus minor fixes.
jgaupp Jul 19, 2018
8ad8b25
Incorporated POA values not supplied by observation_fact.
jgaupp Jul 19, 2018
467676a
Updating blueherondata references to &&i2b2_data_schema variable.
jgaupp Jul 20, 2018
a2f6a96
IDX payer data in encounter, dispense as written in prescribing.
jgaupp Jul 20, 2018
6fd25f5
Temporarily disabling IDX payer for troubleshooting.
jgaupp Jul 20, 2018
e6554cf
Adding drop to cleanup old prescribing_w_daw table.
jgaupp Jul 20, 2018
7db3ac6
Optimization of encouter query, create enctype table.
jgaupp Jul 20, 2018
edd8d59
Too many commas.
jgaupp Jul 20, 2018
f15668f
Too many underscores.
jgaupp Jul 20, 2018
2a694b4
Temporary rollback of encounter to establish baseline on B2.
jgaupp Jul 23, 2018
a592cc1
Test code for performance on B2.
jgaupp Jul 23, 2018
7d00878
A desperate attemtp to isolate performance issues on B2.
jgaupp Jul 23, 2018
7eab670
Optimized encounter script.
jgaupp Jul 24, 2018
0357a4a
Adding encounter_w_fin to drop statements.
jgaupp Jul 24, 2018
9a18f1f
Minor syntax cleanup of encounter.
jgaupp Jul 26, 2018
a63d28e
Fix for all red line items in the CDM 4.1 EDC report.
jgaupp Jul 27, 2018
bcf826e
Fixing discrepancies in facility highlighted in EDC report.
jgaupp Jul 27, 2018
60893d0
Adding column alias for admitting source.
jgaupp Jul 27, 2018
acf89ff
Fixing join on unit map to recover lost prescrbing data.
jgaupp Jul 30, 2018
b349843
Adding gather stats for supplemental_fact to init.
jgaupp Jul 30, 2018
260431d
Fix for orphaned encounterids in med_admin table.
jgaupp Jul 31, 2018
018e6b7
Hack job to restore blood pressure facts to vitals
jgaupp Jul 31, 2018
c37324f
Rollback of hack, solved in H2P and SCILHS instead.
jgaupp Jul 31, 2018
d792cf0
Adding encounter dependency to med_admin.
jgaupp Jul 31, 2018
e50d28f
11th hour fixes for multiple payers mapping to the same encounter.
jgaupp Aug 1, 2018
e043324
Restoring lost create table statement.
jgaupp Aug 1, 2018
7814922
Optimized med_admin by eliminating encounter join.
jgaupp Aug 2, 2018
ec10183
Updating cdm version in harvest insert.
jgaupp Aug 2, 2018
12e3a00
Removing trigger from provider build (botched provid on insert).
jgaupp Aug 3, 2018
1e19887
Merge pull request #107 from kumc-bmi/dispensing_5266
jgaupp Aug 3, 2018
8f1340a
Update encounter.sql
sravanichandakameka Oct 9, 2018
e6c7b2c
Merge pull request #108 from kumc-bmi/payer_idx_dups_5263
sravanichandakameka Oct 9, 2018
c821477
Fixed the medicaid out of state duplicate row
sravanichandakameka Oct 9, 2018
1c705a5
Removed duplicate entries for 'AGENCY'
sravanichandakameka Oct 9, 2018
a37ad70
Merge pull request #109 from kumc-bmi/payer_mapping_dups_5263
sravanichandakameka Oct 9, 2018
56d17fa
Removed duplicated Medicaid OOS
sravanichandakameka Oct 10, 2018
76f15af
Merge pull request #110 from kumc-bmi/payer_mapping_dups_5263
sravanichandakameka Oct 10, 2018
b50b846
Fixed missing egfr loinc codes issue
sravanichandakameka Nov 27, 2018
5d6a3e4
Added code to load the result unit manual curation csv
sravanichandakameka Nov 27, 2018
5486ebd
Adding resultunit manualcuration file
sravanichandakameka Nov 27, 2018
c2b35b9
Merge pull request #111 from kumc-bmi/cdm_runitspec_5496
sravanichandakameka Nov 27, 2018
54bcf7d
Update lab_result_cm.sql
sravanichandakameka Nov 27, 2018
2a6637c
Merge pull request #112 from kumc-bmi/cdm_runitspec_5496
sravanichandakameka Nov 27, 2018
e50ce38
Removed unnecessary indentation the file
sravanichandakameka Dec 7, 2018
63a3783
SQL not properly ended
sravanichandakameka Dec 17, 2018
cbad55b
SQL not ended properly
sravanichandakameka Dec 19, 2018
cce49c2
Made changes to get the schema names from the variables
sravanichandakameka Feb 17, 2019
a715c67
Fixed incorrect variable name
sravanichandakameka Feb 17, 2019
18b169e
Updated the schema name to the relevant string parameter
sravanichandakameka Feb 19, 2019
3677704
using the 'cdm' provider table to match with the deid provider table
sravanichandakameka Mar 11, 2019
db7cf88
Removed specialty_map task
sravanichandakameka Mar 13, 2019
16bbe84
Changed the hard coded schema reference to 'BLUEHERONDATA'
sravanichandakameka Mar 14, 2019
c3eafaf
Removed the error table creation for condition
sravanichandakameka Mar 14, 2019
6c81ba3
Added code to remove lab outliers (convert mg/dL to gm/dL)
sravanichandakameka Apr 23, 2019
9a75535
sravanichandakameka Jul 31, 2019
c43e32f
Added lab_loinc_source
sravanichandakameka Aug 21, 2019
3a1a667
Added lab_result_source column
sravanichandakameka Aug 21, 2019
156eefc
code to populate obs_clin table
sravanichandakameka Sep 6, 2019
3edce66
added obs_clin create table statement
sravanichandakameka Sep 6, 2019
52449ea
Updates to the egfr lab components and the result unit values has bee…
sravanichandakameka Sep 6, 2019
a3af080
Added new harvest table columns as per CDM V5
sravanichandakameka Sep 6, 2019
becbf68
removed address history and immunization table columns for now
sravanichandakameka Sep 6, 2019
7797dbc
Added code to populate obs_gen table with naaccr data
sravanichandakameka Sep 6, 2019
ad95408
Added create table statement for hash_token
sravanichandakameka Sep 10, 2019
2a91e78
Added facility columns to the encounter table
sravanichandakameka Sep 10, 2019
97be436
Made changes to the script to modify the source column to FACILITYTYPE
sravanichandakameka Sep 19, 2019
2ad0f1e
Added drop table statements for the intermediate encounter tables
sravanichandakameka Sep 20, 2019
56ef920
Merge pull request #118 from kumc-bmi/hash_token_5884
sravanichandakameka Sep 20, 2019
f8e1604
Merge pull request #117 from kumc-bmi/obs_gen_5874
sravanichandakameka Sep 20, 2019
c22862c
Merge pull request #116 from kumc-bmi/harvest_updates_5885
sravanichandakameka Sep 20, 2019
f33c4e0
Merge pull request #119 from kumc-bmi/encounter_facility_5886
sravanichandakameka Sep 20, 2019
7981a3b
Removed the select statements from the cdm_status table as hash_token…
sravanichandakameka Sep 20, 2019
f17dce7
Added missing space after comma
sravanichandakameka Sep 20, 2019
621a160
Added ; after select
sravanichandakameka Sep 20, 2019
d0b1e20
Changed the indent
sravanichandakameka Sep 20, 2019
7175b1d
Merge pull request #113 from kumc-bmi/cdm_dx_date_diagnosis_5877
sravanichandakameka Sep 20, 2019
8c37ccb
Merge pull request #120 from kumc-bmi/hash_token_5884
sravanichandakameka Sep 20, 2019
003cde6
Merge pull request #115 from kumc-bmi/cdm_lab_result_cm_v5_updates-5876
sravanichandakameka Sep 20, 2019
6b0d335
Merge pull request #114 from kumc-bmi/obs_clin_5875
sravanichandakameka Sep 20, 2019
3cb4fe7
Song consolidated a new payer_map.csv file to include IDX payers
sravanichandakameka Sep 20, 2019
a2bd642
Merge pull request #121 from kumc-bmi/payer_map_update_5516
sravanichandakameka Sep 20, 2019
dafd45e
Update obs_clin.sql
sravanichandakameka Sep 23, 2019
dcffa1d
Added missing '/'
sravanichandakameka Sep 23, 2019
c77b4f2
Added missing '/'
sravanichandakameka Sep 23, 2019
3f3f4ed
Added missing ','
sravanichandakameka Sep 24, 2019
6361037
script_lib: update tests w.r.t. med_admin.sql
dckc Apr 8, 2020
4d1a76d
lint: flake8 style check
dckc Apr 8, 2020
b61dff4
static typing lint (mypy 0.720)
dckc Apr 8, 2020
e608314
CDMStatusTask.setTaskStart: prune failed attempts
dckc Apr 8, 2020
4dd4bac
curated harvest_local: prune empty column
dckc Apr 8, 2020
105a031
payer_map: convert to utf-8
dckc Apr 8, 2020
a1fd9de
obs_gen, obs_clin, ...: use lights-out style
dckc Apr 8, 2020
81d9305
Merge pull request #123 from kumc-bmi/covid-stagedev
dckc Apr 9, 2020
d179648
add pcornet_init dependency to pcornet_loader to clear cdm_status
nihr43 Jun 3, 2020
4299f27
Added dispense_source column to the dispensing table
sravanichandakameka Jul 9, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.exe
*.o
*.so
*.pyc

# Temporary files #
###################
Expand Down
958 changes: 958 additions & 0 deletions 2015-06-01-PCORnet-Common-Data-Model-v3dot0-parseable-fields.csv

Large diffs are not rendered by default.

132 changes: 132 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
## Design: ETL Tasks and SQL Scripts

The main tasks are in:

- *epic_flowsheets* -- ETL tasks for Epic Flowsheets to i2b2

which is based on a design in:

- *etl_tasks* -- Source-agnostic Luigi ETL Task support
- *script_lib* -- library of SQL scripts
- *sql_syntax* -- break SQL scripts into statements, etc.

Tasks such as `epic_flowsheets.FlowsheetViews` are based on SQL
scripts such as `sql_scripts/epic_flowsheets_transform.sql` wrapped in
a `etl_tasks.SqlScriptTask`.


### SQL Script Library Design, Style and Conventions

Each script should start with a header comment and some
dependency-checking queries. See `script_lib.py` for details.

SQL should be written in lowercase, indented 2 spaces, 120 maximum line
length. More details are in the evolving `sql-style.xml` sqldeveloper
style profile.

- *ISSUE*: sqldeveloper 3 vs. 4 style files?

See also notes on value enumerations in the header of `sql_scripts/cms_keys.pls`.
*TODO*: port those notes from GROUSE.


## Python doctest for story telling and unit testing

Each python module header should tell a story using [doctest][],
i.e. examples that are also unit tests.

You can run them one module at a time:

(luigi)$ python -m doctest script_lib.py -v
Trying:
Script.migrate_fact_upload.title
Expecting:
'append data from a workspace table.'
...
22 tests in 13 items.
22 passed and 0 failed.
Test passed.

Or install [nose][] and run all modules at once:

(grouse-etl)% nosetests --with-doctest
......................
----------------------------------------------------------------------
Ran 22 tests in 0.658s

OK

[doctest]: http://docs.python.org/2/library/doctest.html
[nose]: https://pypi.python.org/pypi/nose/


## Python code style

We appreciate object capability discipline and the "don't call us,
we'll call you" style that facilitates unit testing with mocks.

- *ISSUE*: Luigi's design doesn't seem to support this idiom.
Constructors are implict and tasks parameters have to be
serializable, which works against the usual closure
object pattern. Also, the task cache is global mutable
state.

We avoid mutable state, preferring functional style.

- *NOTE*: PEP8 tools warn against assinging a lambda to a name,
suggesting `def` instead. We're fine with it; hence
`ignore = E731` in `setup.cfg`.


We follow PEP8. The first line of a module or function docstring
should be a short description; if it is blank, either the item is in
an early stage of development or the name and doctests are supposed to
make the purpose obvious.

- *NOTE*: with static type annotations, the 79 character line
length limit is awkward; hence we use 99 in `setup.cfg`.

- *ISSUE*: Dan didn't realize until recently that PEP8 recommends
triple double quotes over triple single quotes for
docstrings. He's in the habit of using single quotes
to minimize use of the shift key.


## Checking the code

Once dependencies in `requirements.txt` are satisfied, code should
pass tests, style checks, and static type checking:

$ nosetests && flake8 . && mypy .

_tested with mypy-0.720_

### Checking in emacs

To check with `M-x compile` in emacs, first use `M-x pyvenv-activate`
from the [pyvenv][] package.

To check continuously as you edit, use [flycheck][] and activate
likewise.

[pyvenv]: https://melpa.org/#/pyvenv
[pyvent]: https://melpa.org/#/flycheck


## Luigi Troubleshooting

**ISSUE**: why won't luigi find modules in the current directory?
Use `PYTHONPATH=. luigi ...` if necessary.

Most diagnostics are self-explanatory; `etl_tasks` includes
`SQLScriptError` and `ConnectionProblem` exception classes intended to
improve diagnostics

One challenging diagnostic is:

RuntimeError: Unfulfilled dependency at run time: DiagnosesLoad_oracle___dconnol_CMS_DEID_SAMPLE_1438246788671_bd6231c982

It seems to indicate that the `.complete()` test on a required task
fails even after that task has been `.run()`. For example, the `select
count(*)` completion test in a load script might have failed because
of incorrect join constraints.
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
Copyright (c) 2014-2018 Univeristy of Kansas Medical Center

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


i2b2 Software License (“Software License”)
Version 2.1

Expand Down
50 changes: 0 additions & 50 deletions Oracle/PCORI_MEDS_SCHEMA_CHANGE_ora.sql

This file was deleted.

40 changes: 40 additions & 0 deletions Oracle/PCORNetDrop.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
BEGIN
PMN_DROPSQL('DROP TABLE demographic');
END;
/
BEGIN
PMN_DROPSQL('DROP TABLE enrollment');
END;
/
BEGIN
PMN_DROPSQL('DROP TABLE encounter');
END;
/
BEGIN
PMN_DROPSQL('DROP TABLE drg');
END;
/
BEGIN
PMN_DROPSQL('DROP TABLE diagnosis');
END;
/
BEGIN
PMN_DROPSQL('DROP TABLE sourcefact');
END;
/
BEGIN
PMN_DROPSQL('DROP TABLE pdxfact');
END;
/
BEGIN
PMN_DROPSQL('DROP TABLE originfact');
END;
/
BEGIN
PMN_DROPSQL('DROP TABLE procedures');
END;
/
BEGIN
PMN_DROPSQL('DROP TABLE vital');
END;
/
Loading