Skip to content

Commit f54e6a7

Browse files
committed
feat(converter): fix issue with target_version wrongly initialised
1 parent f424346 commit f54e6a7

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

converter/converter/cisu/cisu_converter.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
class CISUConverterV3:
1515
# Todo: revert change when all editors use the new CISU nomenclature or are in V3 or above
16-
target_version=""
1716
def __init__(self, target_version: str):
1817
self.target_version = target_version
1918

@@ -67,7 +66,7 @@ def __init__(self, target_version: str):
6766
DEFAULT_WHATS_HAPPEN = {"code": "C11.06.00", "label":"Autre nature de fait"}
6867

6968
@classmethod
70-
def from_cisu(cls, input_json: Dict[str, Any]) -> Dict[str, Any]:
69+
def from_cisu(cls, input_json: Dict[str, Any], target_version: str) -> Dict[str, Any]:
7170
"""
7271
Convert from CISU to Health format
7372
@@ -148,8 +147,7 @@ def add_object_to_medical_notes(json_data: Dict[str, Any], note_text: str, sende
148147

149148
# - Updates
150149
output_use_case_json['owner'] = get_recipient(input_json)
151-
152-
if cls.target_version != Constants.V3_VERSION:
150+
if target_version != Constants.V3_VERSION:
153151
# /!\ it must be done before copying qualification
154152
update_health_motive_code(output_use_case_json, True)
155153

converter/converter/conversion_strategy/cisu_conversion_strategy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def cisu_conversion_strategy(edxl_json, source_version, target_version):
3030
if source_version != MAINTAINED_CISU_VERSION:
3131
raise ValueError(f"Unknown source version {source_version}. Must be: {MAINTAINED_CISU_VERSION}")
3232

33-
rc_json_message = CISUConverterV3(target_version).from_cisu(edxl_json)
33+
rc_json_message = CISUConverterV3.from_cisu(edxl_json, target_version)
3434
return health_conversion_strategy(rc_json_message, MAINTAINED_CISU_VERSION, target_version)
3535
else:
3636
raise ValueError('Invalid direction parameter')

0 commit comments

Comments
 (0)