Skip to content

Commit f124ec6

Browse files
authored
Merge pull request #571 from HDRUK/merge_test_to_prod_2.0.9
Merge test to prod 2.0.9
2 parents 77d1e39 + 6db1694 commit f124ec6

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
Please append a line to the changelog for each change made.
44

5+
## v2.0.9
6+
### New features
7+
8+
### Improvements
9+
- Removed duplicated ScanReportConcepts which are produced when non-standard codes are mapped via multiple routes to the same standard code.
10+
11+
### Bugfixes
12+
13+
514
## v2.0.8
615
### New features
716

shared_code/omop_helpers.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import time
33
import requests
44
import logging
5-
from collections import defaultdict
5+
from collections import defaultdict, OrderedDict
66
from ProcessQueue import helpers
77

88
api_url = os.environ.get("APP_URL") + "api/"
@@ -93,6 +93,12 @@ def find_standard_concept_batch(source_concepts: list):
9393
relationship["concept_id_2"]
9494
)
9595

96+
# Remove duplicates from within each entry, by converting each to an Ordered Dict
97+
# (the keys of which must be unique, and will preserve the order if that's
98+
# important) and then back to a list.
99+
for pair in combined_pairs:
100+
combined_pairs[pair] = list(OrderedDict.fromkeys(combined_pairs[pair]))
101+
96102
return combined_pairs
97103

98104

0 commit comments

Comments
 (0)