Skip to content

Commit 2464e4e

Browse files
committed
Removed fstrings
1 parent 68d79af commit 2464e4e

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

reproschema/cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,9 @@ def reproschema_to_fhir(reproschema_questionnaire, output):
264264
][0]
265265
reproschema_schema = reproschema_content[schema_name]
266266

267-
if (f"schema:version" in reproschema_schema and
267+
if ("schema:version" in reproschema_schema and
268268
reproschema_schema["schema:version"] not in ("0.0.1", "1.0.0-rc1", "1.0.0")
269-
) or f"schemaVersion" in reproschema_schema and reproschema_schema[
269+
) or "schemaVersion" in reproschema_schema and reproschema_schema[
270270
"schemaVersion"] not in ("0.0.1", "1.0.0-rc1", "1.0.0-rc4", "1.0.0"):
271271
raise ValueError(
272272
'Unable to work with reproschema versions other than 0.0.1, 1.0.0-rc1, and 1.0.0-rc4'
@@ -278,15 +278,15 @@ def reproschema_to_fhir(reproschema_questionnaire, output):
278278

279279
# validate the json using fhir resources
280280
try:
281-
questionnaire_json = Questionnaire.model_validate(fhir_questionnaire)
281+
Questionnaire.model_validate(fhir_questionnaire)
282282
except Exception:
283283
raise Exception("Fhir Questionnaire is not valid")
284284

285285
# get filename from the reproschema_folder name provided
286286

287287
file_name = reproschema_folder.parts[-1]
288288

289-
dirpath = Path(output_path / f"{file_name}")
289+
dirpath = Path(output_path / file_name)
290290
if dirpath.exists() and dirpath.is_dir():
291291
shutil.rmtree(dirpath)
292292

reproschema/reproschema2fhir.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ def add_options(options_json) -> list:
5757
Helper function to extract all answer choices to a list
5858
"""
5959
options = []
60-
for j in options_json[f"choices"]:
60+
for j in options_json["choices"]:
6161
if "schema:name" in j and j["schema:name"] != "":
6262
choice = j["schema:name"]
6363
elif "name" in j and j["name"] != "":
64-
choice = j[f"name"]
64+
choice = j["name"]
6565
if "en" in j["name"] and isinstance(["name"], dict):
6666
choice = choice["en"]
6767
else:
@@ -161,10 +161,10 @@ def parse_reproschema_items(self, reproschema_items: OrderedDict,
161161
curr_item["text"] = preamble + str(
162162
item_json["question"]["en"])
163163

164-
elif f"prefLabel" in item_json:
164+
elif "prefLabel" in item_json:
165165
curr_item["text"] = str(item_json["prefLabel"])
166166
else:
167-
curr_item[f"text"] = curr_item[f"linkId"]
167+
curr_item["text"] = curr_item["linkId"]
168168

169169
id_str: str = var_name
170170
id_str = id_str.replace("_", "-")
@@ -200,7 +200,7 @@ def parse_reproschema_items(self, reproschema_items: OrderedDict,
200200
if "valueType" in item_json[
201201
"responseOptions"] and "int" in item_json[
202202
"responseOptions"]["valueType"]:
203-
curr_item[f"type"] = f"integer"
203+
curr_item["type"] = "integer"
204204
elif "valueType" in item_json[
205205
"responseOptions"] and "date" in item_json[
206206
"responseOptions"]["valueType"]:
@@ -283,7 +283,7 @@ def convert_to_fhir(self, reproschema_content: dict):
283283
])
284284

285285
question_order = [("items/" + sub.replace("items/", ""))
286-
for sub in reproschema_schema[f"ui"][f"order"]]
286+
for sub in reproschema_schema["ui"]["order"]]
287287

288288
reproschema_items = OrderedDict(
289289
(key, reproschema_items[key]) for key in question_order)

0 commit comments

Comments
 (0)