Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions codelists/scripts/ad_hoc_old_style_snomed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"comment": "Ad-hoc load of codelist as old-style",
"force_old_style": true,
"organisation": "user/pchavez",
"coding_systems": {
"snomedct": {
"id": "snomedct",
"release": "snomedct_4000_20250416"
}
},
"delimiter":"\t"
}
9 changes: 7 additions & 2 deletions codelists/scripts/bulk_import_codelists.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ def update_name(name):

# Remove extraneous whitespace from all columns of interest
for column in relevant_df_columns:
codelist_df[column] = codelist_df[column].str.strip()
try:
codelist_df[column] = codelist_df[column].str.strip()
except AttributeError:
pass

return codelist_df

Expand All @@ -237,7 +240,9 @@ def get_post_data(config, codelist_df, create_new_codelist, force_new_version):
description = config["description_template"] % description

post_data = {"coding_system_database_alias": release_db_alias, "tag": tag}
if coding_system_id in CODING_SYSTEMS_WITH_OLD_STYLE_CODELISTS:
if coding_system_id in CODING_SYSTEMS_WITH_OLD_STYLE_CODELISTS or config.get(
"force_old_style"
):
# create an old-style codelist/version with csv_data
post_data["csv_data"] = codelist_df[["code", "term"]].to_csv()
else:
Expand Down