Skip to content

Commit

Permalink
Cast census tract as string in clinical parse-kp2023
Browse files Browse the repository at this point in the history
  • Loading branch information
sallybg committed Dec 4, 2023
1 parent ff603d1 commit 46ed98b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/seattleflu/id3c/cli/command/clinical.py
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,10 @@ def parse_kp2023(kp2023_filename: str) -> None:
for col in date_cols:
clinical_records[col] = pd.to_datetime(clinical_records[col]).dt.strftime('%Y-%m-%d')

# convert census_tract to string
# do this here rather than upon import with dtype, because the latter would require assuming capitalization of column name from KP
clinical_records['census_tract'] = clinical_records['census_tract'].astype('Int64').astype('str')

# ensure there are no unintended columns being kept
columns_to_keep = [
'_provenance',
Expand Down

0 comments on commit 46ed98b

Please sign in to comment.