Skip to content

Commit

Permalink
Merge pull request #1 from michaelbontyes/dev
Browse files Browse the repository at this point in the history
factored in updates to a collection
  • Loading branch information
michaelbontyes authored Jul 9, 2024
2 parents ef063c0 + 80e14bf commit d1b832a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion update_uuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

OCL_API_URL = config['OCL_API_URL']
SOURCE_ID = config['SOURCE_ID']
COLLECTION_ID = config['COLLECTION_ID']
OCL_TOKEN = config['OCL_TOKEN']
ORG_ID = config['ORG_ID']

Expand Down Expand Up @@ -116,7 +117,10 @@ def get_all_concepts(url):
return all_concepts

# Get the list of concepts in the source
concepts_url = f"{OCL_API_URL}/orgs/{ORG_ID}/sources/{SOURCE_ID}/concepts/"
if not SOURCE_ID:
concepts_url = f"{OCL_API_URL}/orgs/{ORG_ID}/collections/{COLLECTION_ID}/concepts/"
else:
concepts_url = f"{OCL_API_URL}/orgs/{ORG_ID}/sources/{SOURCE_ID}/concepts/"
concepts = get_all_concepts(concepts_url)
TOTAL_CONCEPTS = len(concepts)
PROCESSED_CONCEPTS_COUNT = 0
Expand Down Expand Up @@ -145,6 +149,7 @@ def get_all_concepts(url):
# Print the results
if DRY_RUN:
print("DRY RUN MODE: No changes will be made to the OCL source.")
print(f"TOTAL CONCEPTS ARE {TOTAL_CONCEPTS} AND PROCESSED CONCEPTS ARE {PROCESSED_CONCEPTS_COUNT}")
print(f"Number of concepts updated because they were empty: {COUNTERS['UPDATED_EMPTY']}")
print(f"Number of concepts updated because they started with 'MSF-': {COUNTERS['UPDATED_MSF']}")
print(f"Number of concepts updated because ID was <36 characters: {COUNTERS['UPDATED_INVALID']}")
Expand Down

0 comments on commit d1b832a

Please sign in to comment.