Dan,

Thanks for looking into that, also that makes sense. When I pull the ones that 
have numbers, I am missing 00 though. I only have 4 different codes for 380 in 
my table. Do you think you can export your t-code table and send to me, so I 
can compare?


Todd McNeeley
Senior Software Engineer, Information Management Team Development
mcneele...@health.missouri.edu<mailto:mcneele...@health.missouri.edu>  | 
573-884-3297 direct | 573-219-8341 mobile
Tiger Institute for Health Innovation | 
www.tiger-institute.org<http://www.tiger-institute.org/>
P PLEASE CONSIDER THE ENVIRONMENT BEFORE PRINTING THIS EMAIL

From: Dan Connolly [mailto:dconno...@kumc.edu]
Sent: Thursday, December 7, 2017 3:14 PM
To: McNeeley, Todd Alexander <mcneele...@health.missouri.edu>
Cc: , <gpc-dev@listserv.kumc.edu>
Subject: NAACCR sequence number: excluding junk metadata from T_CODE

Todd,

I took a look, and yes, there's junk like <b>Neoplasm</b> in the codenbr column 
of T_CODE corresponding to itemnbr = 380.

There's special HERON code to exclude it:
  -- exclude description of codes; we just want codes
  and tc.codenbr not like '% %'
  and tc.codenbr not like '%<%'
  and tc.codenbr not in ('..', '*', 'User-defined', 'nn')
-- naaccr_concepts_load.sql lines 
237-L240<https://github.com/kumc-bmi/heron/blob/master/heron_load/naaccr_concepts_load.sql#L237-L240>
linked from 
NAACCR_ETL<https://informatics.gpcnetwork.org/trac/Project/wiki/NAACCR_ETL>

To verify the technique above, I used this postgres query on babel, translated 
from Oracle-ese:


with i as (
select cast("ItemID" as numeric) itemid, cast("ItemNbr" as numeric) itemnbr
from t_item
)
,
c as (
select "ITEMID" itemid, "CODENBR" codenbr, "CODEDCRP" codedcrp
from t_code
)

select * from i join c on i.itemid=c.itemid
where codenbr not like '% %'
  and codenbr not like '%<%'
  and codenbr not in ('..', '*', 'User-defined', 'nn')
  -- and i.itemnbr in (380, 560)
order by itemnbr, codenbr


--
Dan
_______________________________________________
Gpc-dev mailing list
Gpc-dev@listserv.kumc.edu
http://listserv.kumc.edu/mailman/listinfo/gpc-dev

Reply via email to