Skip to content

Commit

Permalink
PDX is "relevant only on IP and IS encounters" (#4147)
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Nov 1, 2016
1 parent 3dfe70f commit ed12985
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Oracle/PCORNetLoader_ora.sql
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,8 @@ sqltext := 'insert into diagnosis (patid, encounterid, enc_type, admit_date, p
'select distinct factline.patient_num, factline.encounter_num encounterid, enc_type, factline.start_date, factline.provider_id, diag.pcori_basecode, '||
'SUBSTR(diag.c_fullname,18,2) dxtype, '||
' CASE WHEN enc_type=''AV'' THEN ''FI'' ELSE nvl(SUBSTR(dxsource,INSTR(dxsource,'':'')+1,2) ,''NI'')END, '||
' nvl(SUBSTR(pdxsource,INSTR(pdxsource, '':'')+1,2),''NI'') '|| -- jgk bugfix 9/28/15
' CASE WHEN enc_type in (''ED'', ''AV'', ''OA'') THEN ''X'' -- PDX is "relevant only on IP and IS encounters"
ELSE nvl(SUBSTR(pdxsource,INSTR(pdxsource, '':'')+1,2),''NI'') END '||
'from i2b2fact factline '||
'inner join encounter enc on enc.patid = factline.patient_num and enc.encounterid = factline.encounter_Num '||
' left outer join sourcefact '||
Expand Down

0 comments on commit ed12985

Please sign in to comment.