discrete table including names, MRNs, and accession numbers
Closed this issue · 2 comments
dckc commented
one site wants a table that includes this PHI
fields.csv doesn't have any PHI fields
tumor_item_type.csv has MRN and accession number but
name is in the Patient-Confidential section, which is completely left out.
dckc commented
some progress: b9b197f I added PATIENT_ID_NUMBER_N20
, PATIENT_SYSTEM_ID_HOSP_N21
for patient mapping.
dckc commented
As of d20cb0d, you can load-layouts
and then pick out the relevant substring of the raw record from observation_blob
. For example, to get accessionNumberHosp
:
select layoutVersion, layout.naaccrItemNum, layout.name, shortLabel, startPos, length
, substr(tumor.observation_blob, startPos, length) value
from tumor
join layout on layout.layoutVersion = tumor.naaccr_record_Version_n50
where layout.name = 'accessionNumberHosp'