Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
588 commits
Select commit Hold shift + click to select a range
ef84a0c
Merge branch 'cycle_2_refresh_2' into med_curate
dckc Apr 14, 2017
4297101
Merge pull request #75 from dckc/med_curate
Apr 14, 2017
c413bf5
oops: fix med id type (#76)
dckc Apr 14, 2017
8066920
don't add blank lines; sqlplus doesn't grok
dckc Apr 17, 2017
26d47db
pcornet_mapping: optimize LOINC mapping
dckc Apr 17, 2017
8485cac
oops: can't just leave c_metadataxml out
dckc Apr 17, 2017
bc008ce
Remove rows from PRESCRIBING where all RX_* fields are blank.
Apr 19, 2017
aa9455c
Revert "pcornet_mapping: optimize LOINC mapping"
dckc Apr 20, 2017
3ebbf1c
Merge pull request #81 from kumc-bmi/cycle_2_refresh_2
May 9, 2017
cd33048
Removed mapping pieces and drop tables statments from shell/sqlplus s…
May 11, 2017
e22589b
Made PATID and ENCOUNTERID fields numeric for more performant joins.
May 16, 2017
49ddf1a
Undoing PATID and ENCOUNTERID field types as this belongs on another …
May 18, 2017
722962c
Seperate transform procedure definition and transform prep into seper…
May 18, 2017
aab5d4f
Updated PCORNetLoader procedure with param used to declare starting p…
May 18, 2017
d4aa672
Updated run shell script to reflect changes to PCORNetLoader and PCOR…
May 18, 2017
0d72f17
A couple bug fixes
May 18, 2017
307766a
Added TRUNCATE TABLE statements to make transform procedures idempotent
May 23, 2017
1619102
Added intermediate table for DRGs in ENCOUNTER transform in attempt t…
May 23, 2017
212c86c
Fixed two small errors in transform procedures.
May 24, 2017
ecce0dc
Fix typo in PCORNetEncounter DRG intermediary table creation
May 24, 2017
a283279
Moved creation of intermediary tables to PCORNetInit.sql
May 24, 2017
89aba65
SQL to create logging table, task sequence, and procedures for manipu…
May 25, 2017
573eb6c
Updated transform to use logging transform.
May 25, 2017
0d47d97
Handful of small fixes
May 25, 2017
2ece65f
Misplaced quote
May 25, 2017
2dc151b
Moved post proc tasks into a procedure to better control execution flow.
Jun 1, 2017
9314233
Make sure that intermediary transform tables exist before transform i…
Jun 6, 2017
4b0b8e0
Replaced drop/create statements with truncate/insert, and updated ind…
Jun 6, 2017
ccc4b1c
Removing ontology mapping from this repo and moving to h2p-mapping repo
Jun 6, 2017
511aa15
Fixed errors in LogTaskComplete logging calls in PCORNetLoader
Jun 6, 2017
5ab2166
Merge pull request #83 from kumc-bmi/remove-mapping
Jun 6, 2017
7864c49
Merge pull request #84 from kumc-bmi/breakup_sql_4714
Jun 6, 2017
1f4a85f
Removed CSV upload now handled in h2p-mapping
Jun 6, 2017
6442090
Fixed SQL quoting and insert into syntax
Jun 6, 2017
f0b316c
Removed unclosed parenthesis
Jun 6, 2017
6fa57ef
Missed removing one of the old drop table statements
Jun 7, 2017
d3933a5
Fixed issue with adding index to the wrong table
Jun 7, 2017
4a2eb3b
Fixed typo in logging procedure call
Jun 7, 2017
e00cd1d
Field additions and updates required by PCORNet CDM v3.1
Jun 8, 2017
5eac271
Fixed quoting error and improved indexes
Jun 8, 2017
e27f079
Added missing semicolon
Jun 8, 2017
76d9be6
Mislabeled index on procedures
Jun 12, 2017
f05f286
Merge pull request #87 from kumc-bmi/logging_4713
Jun 12, 2017
3cddd76
Update PCORNetLoader procedure to make it more readable and easier to…
Jun 12, 2017
ace702f
Added header comments to PCORNetInit.sql
Jun 12, 2017
b920a41
Remove unused PCORNetReport
Jun 12, 2017
feb979e
Further improvements on PCORNetLoader proc
Jun 12, 2017
abec530
Merged upstream changes
Jun 12, 2017
c7714cc
Removed uneeded statements
Jun 12, 2017
a78a38c
Merge branch 'logging_4713' into schema_updates_4745
Jun 12, 2017
26b31b3
Merge breakup_sql_4714
dckc Jun 12, 2017
95aa74f
Merge logging_4713
dckc Jun 12, 2017
73a1f12
Error in SQL
Jun 12, 2017
cd48889
Added accidentally removed PCORNetLoader parameters
Jun 12, 2017
3410354
Using wrong inequality
Jun 12, 2017
121f525
Port SCILHS Code for incorporating DX_ORIGIN into the transform
bconnolly Jun 20, 2017
b62bed0
Merge pull request #89 from bconnolly/schema_updates_4745
Jun 20, 2017
e86d071
Re-ordered inner join for better execution plan
Jun 21, 2017
067ae8c
Corrected table name
Jun 21, 2017
fc93a5c
Merge pull request #90 from kumc-bmi/schema_updates_4745
Jun 22, 2017
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
56d17fa
Removed duplicated Medicaid OOS
sravanichandakameka Oct 10, 2018
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.521_

### 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