We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Concepts should not be imported implicitly.
https://github.com/ddionrails/ddionrails/blob/68139838febdba24fdffaf4ef72e040801e94970/ddionrails/instruments/imports.py#L227-L232

---

###### This issue was generated by [todo](https://todo.jasonet.co) based on a `TODO` comment in 68139838febdba24fdffaf4ef72e040801e94970 when #1324 was merged. cc @ddionrails.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `ddionrails/instruments/imports.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 
3 """ Importer classes for ddionrails.instruments app """
4 
5 import json
6 import logging
7 from collections import OrderedDict
8 from pathlib import Path
9 from typing import Dict, Optional
10 
11 from django.db.transaction import atomic
12 
13 from ddionrails.concepts.models import AnalysisUnit, Concept, Period
14 from ddionrails.data.models import Variable
15 from ddionrails.imports import imports
16 from ddionrails.imports.helpers import download_image, store_image
17 
18 from .models import ConceptQuestion, Instrument, Question, QuestionImage, QuestionVariable
19 
20 logging.config.fileConfig("logging.conf")  # type: ignore
21 logger = logging.getLogger(__name__)
22 
23 
24 class InstrumentImport(imports.Import):
25 
26     content: str
27 
28     def execute_import(self):
29         self.content = json.JSONDecoder(object_pairs_hook=OrderedDict).decode(
30             self.content
31         )
32         self._import_instrument(self.name, self.content)
33 
34     def _import_instrument(self, name, content):
35         instrument, _ = Instrument.objects.get_or_create(study=self.study, name=name)
36 
37         # add period relation to instrument
38         period_name = content.get("period", "none")
39         # Workaround for two ways to name period: period, period_name
40         # => period_name
41         if period_name == "none":
42             period_name = content.get("period_name", "none")
43 
44         # Workaround for periods coming in as float, w.g. 2001.0
45         try:
46             period_name = str(int(period_name))
47         except ValueError:
48             period_name = str(period_name)
49         period = Period.objects.get_or_create(name=period_name, study=self.study)[0]
50         instrument.period = period
51 
52         # add analysis_unit relation to instrument
53         analysis_unit_name = content.get("analysis_unit", "none")
54         if analysis_unit_name == "none":
55             analysis_unit_name = content.get("analysis_unit_name", "none")
56         analysis_unit = AnalysisUnit.objects.get_or_create(
57             name=analysis_unit_name, study=self.study
58         )[0]
59         instrument.analysis_unit = analysis_unit
60 
61         for _name, _question in content["questions"].items():
62             question, _ = Question.objects.get_or_create(
63                 name=_question["question"], instrument=instrument
64             )
65             question.sort_id = int(_question.get("sn", 0))
66             question.label = _question.get("label", _question.get("text", _name))
67             question.label_de = _question.get("label_de", _question.get("text_de", ""))
68             question.description = _question.get("description", "")
69             question.description_de = _question.get("description_de", "")
70             question.items = _question.get("items", list)
71             question.save()
72             image_data = _question.get("image", None)
73             if image_data:
74                 self.question_image_import(question, image_data)
75 
76         instrument.label = content.get("label", "")
77         instrument.label_de = content.get("label_de", "")
78         instrument.description = content.get("description", "")
79         instrument.description_de = content.get("description_de", "")
80         instrument.save()
81 
82     def question_image_import(self, question: Question, image_data: Dict[str, str]):
83         """Load and save the images of a Question
84 
85         Loads and saves up to two image files given their location by url.
86 
87         Args:
88             question: The associated Question Object
89             image_data: Contains "url" and/or "url_de" keys to locate image files.
90                         Optionally contains "label" and/or "label_de" to add a label
91                         to the corresponding images.
92         """
93 
94         images = list()
95 
96         if "url" in image_data:
97             images.append(
98                 self._question_image_import_helper(
99                     question,
100                     url=image_data["url"],
101                     label=image_data.get("label", None),
102                     language="en",
103                 )
104             )
105         if "url_de" in image_data:
106             images.append(
107                 self._question_image_import_helper(
108                     question,
109                     url=image_data["url_de"],
110                     label=image_data.get("label_de", None),
111                     language="de",
112                 )
113             )
114 
115         for image in images:
116             if image is not None:
117                 image.save()
118 
119     @staticmethod
120     def _question_image_import_helper(
121         question: Question, url: str, label: Optional[str], language: str
122     ) -> Optional[QuestionImage]:
123         """Create a QuestionImage Object, load and store Image file inside it
124 
125         Args:
126             question: The associated Question Object
127             url: Location of the image to be loaded
128             label: Is stored in the QuestionImage label field
129             language: Is stored in the QuestionImage language field
130         Returns:
131             The QuestionImage created with loaded image.
132             If the image could not be loaded, this will return None.
133             QuestionImage is not written to the database here.
134         """
135         question_image = QuestionImage()
136         instrument = question.instrument
137         path = [instrument.study.name, instrument.name, question.name]
138         _image = download_image(url)
139         suffix = Path(url).suffix
140         if label is None:
141             label = "Screenshot"
142         if _image is None:
143             return None
144         image, _ = store_image(file=_image, name=label + suffix, path=path)
145         question_image.question = question
146         question_image.image = image
147         question_image.label = label
148         question_image.language = language
149         return question_image
150 
151 
152 class QuestionVariableImport(imports.CSVImport):
153     def execute_import(self):
154         for link in self.content:
155             self._import_link(link)
156 
157     def _import_link(self, link):
158         try:
159             question = self._get_question(link)
160             variable = self._get_variable(link)
161             QuestionVariable.objects.get_or_create(question=question, variable=variable)
162         except BaseException as error:
163             raise type(error)(f"Could not import QuestionVariable: {link}")
164 
165     @staticmethod
166     def _get_question(link):
167         question = (
168             Question.objects.filter(
169                 instrument__study__name=link.get("study", link.get("study_name"))
170             )
171             .filter(instrument__name=link.get("instrument", link.get("instrument_name")))
172             .get(name=link.get("question", link.get("question_name")))
173         )
174         return question
175 
176     @staticmethod
177     def _get_variable(link):
178         variable = (
179             Variable.objects.filter(
180                 dataset__study__name=link.get("study", link.get("study_name"))
181             )
182             .filter(dataset__name=link.get("dataset", link.get("dataset_name")))
183             .filter(name=link.get("variable", link.get("variable_name")))
184             .first()
185         )
186         return variable
187 
188 
189 class ConceptQuestionImport(imports.CSVImport):
190     @atomic
191     def execute_import(self):
192         for link in self.content:
193             self._import_link(link)
194 
195     def _import_link(self, link):
196         try:
197             question = self._get_question(link)
198             concept = self._get_concept(link)
199         except BaseException as error:
200             raise type(error)(f"Could not import ConceptQuestion: {link}")
201         ConceptQuestion.objects.get_or_create(question=question, concept=concept)
202 
203     @staticmethod
204     def _get_question(element):
205         study = element.get("study", element.get("study_name"))
206         instrument = element.get("instrument", element.get("instrument_name"))
207         question = element.get("question", element.get("question_name"))
208 
209         question = Question.objects.get(
210             instrument__study__name=study, instrument__name=instrument, name=question
211         )
212         return question
213 
214     @staticmethod
215     def _get_concept(element):
216         # TODO: Concepts should not be imported implicitly.
217         concept = Concept.objects.get_or_create(
218             name=element.get("concept", element.get("concept_name"))
219         )[0]
220 
221         return concept
222
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/ddionrails/instruments/imports.py b/ddionrails/instruments/imports.py
--- a/ddionrails/instruments/imports.py
+++ b/ddionrails/instruments/imports.py
@@ -195,7 +195,9 @@
     def _import_link(self, link):
         try:
             question = self._get_question(link)
-            concept = self._get_concept(link)
+            concept = Concept.objects.get(
+                name=link.get("concept", link.get("concept_name"))
+            )
         except BaseException as error:
             raise type(error)(f"Could not import ConceptQuestion: {link}")
         ConceptQuestion.objects.get_or_create(question=question, concept=concept)
@@ -210,12 +212,3 @@
             instrument__study__name=study, instrument__name=instrument, name=question
         )
         return question
-
-    @staticmethod
-    def _get_concept(element):
-        # TODO: Concepts should not be imported implicitly.
-        concept = Concept.objects.get_or_create(
-            name=element.get("concept", element.get("concept_name"))
-        )[0]
-
-        return concept

{"golden_diff": "diff --git a/ddionrails/instruments/imports.py b/ddionrails/instruments/imports.py\n--- a/ddionrails/instruments/imports.py\n+++ b/ddionrails/instruments/imports.py\n@@ -195,7 +195,9 @@\n     def _import_link(self, link):\n         try:\n             question = self._get_question(link)\n-            concept = self._get_concept(link)\n+            concept = Concept.objects.get(\n+                name=link.get(\"concept\", link.get(\"concept_name\"))\n+            )\n         except BaseException as error:\n             raise type(error)(f\"Could not import ConceptQuestion: {link}\")\n         ConceptQuestion.objects.get_or_create(question=question, concept=concept)\n@@ -210,12 +212,3 @@\n             instrument__study__name=study, instrument__name=instrument, name=question\n         )\n         return question\n-\n-    @staticmethod\n-    def _get_concept(element):\n-        # TODO: Concepts should not be imported implicitly.\n-        concept = Concept.objects.get_or_create(\n-            name=element.get(\"concept\", element.get(\"concept_name\"))\n-        )[0]\n-\n-        return concept\n", "issue": "Concepts should not be imported implicitly.\nhttps://github.com/ddionrails/ddionrails/blob/68139838febdba24fdffaf4ef72e040801e94970/ddionrails/instruments/imports.py#L227-L232\n\n---\n\n###### This issue was generated by [todo](https://todo.jasonet.co) based on a `TODO` comment in 68139838febdba24fdffaf4ef72e040801e94970 when #1324 was merged. cc @ddionrails.\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\n\"\"\" Importer classes for ddionrails.instruments app \"\"\"\n\nimport json\nimport logging\nfrom collections import OrderedDict\nfrom pathlib import Path\nfrom typing import Dict, Optional\n\nfrom django.db.transaction import atomic\n\nfrom ddionrails.concepts.models import AnalysisUnit, Concept, Period\nfrom ddionrails.data.models import Variable\nfrom ddionrails.imports import imports\nfrom ddionrails.imports.helpers import download_image, store_image\n\nfrom .models import ConceptQuestion, Instrument, Question, QuestionImage, QuestionVariable\n\nlogging.config.fileConfig(\"logging.conf\")  # type: ignore\nlogger = logging.getLogger(__name__)\n\n\nclass InstrumentImport(imports.Import):\n\n    content: str\n\n    def execute_import(self):\n        self.content = json.JSONDecoder(object_pairs_hook=OrderedDict).decode(\n            self.content\n        )\n        self._import_instrument(self.name, self.content)\n\n    def _import_instrument(self, name, content):\n        instrument, _ = Instrument.objects.get_or_create(study=self.study, name=name)\n\n        # add period relation to instrument\n        period_name = content.get(\"period\", \"none\")\n        # Workaround for two ways to name period: period, period_name\n        # => period_name\n        if period_name == \"none\":\n            period_name = content.get(\"period_name\", \"none\")\n\n        # Workaround for periods coming in as float, w.g. 2001.0\n        try:\n            period_name = str(int(period_name))\n        except ValueError:\n            period_name = str(period_name)\n        period = Period.objects.get_or_create(name=period_name, study=self.study)[0]\n        instrument.period = period\n\n        # add analysis_unit relation to instrument\n        analysis_unit_name = content.get(\"analysis_unit\", \"none\")\n        if analysis_unit_name == \"none\":\n            analysis_unit_name = content.get(\"analysis_unit_name\", \"none\")\n        analysis_unit = AnalysisUnit.objects.get_or_create(\n            name=analysis_unit_name, study=self.study\n        )[0]\n        instrument.analysis_unit = analysis_unit\n\n        for _name, _question in content[\"questions\"].items():\n            question, _ = Question.objects.get_or_create(\n                name=_question[\"question\"], instrument=instrument\n            )\n            question.sort_id = int(_question.get(\"sn\", 0))\n            question.label = _question.get(\"label\", _question.get(\"text\", _name))\n            question.label_de = _question.get(\"label_de\", _question.get(\"text_de\", \"\"))\n            question.description = _question.get(\"description\", \"\")\n            question.description_de = _question.get(\"description_de\", \"\")\n            question.items = _question.get(\"items\", list)\n            question.save()\n            image_data = _question.get(\"image\", None)\n            if image_data:\n                self.question_image_import(question, image_data)\n\n        instrument.label = content.get(\"label\", \"\")\n        instrument.label_de = content.get(\"label_de\", \"\")\n        instrument.description = content.get(\"description\", \"\")\n        instrument.description_de = content.get(\"description_de\", \"\")\n        instrument.save()\n\n    def question_image_import(self, question: Question, image_data: Dict[str, str]):\n        \"\"\"Load and save the images of a Question\n\n        Loads and saves up to two image files given their location by url.\n\n        Args:\n            question: The associated Question Object\n            image_data: Contains \"url\" and/or \"url_de\" keys to locate image files.\n                        Optionally contains \"label\" and/or \"label_de\" to add a label\n                        to the corresponding images.\n        \"\"\"\n\n        images = list()\n\n        if \"url\" in image_data:\n            images.append(\n                self._question_image_import_helper(\n                    question,\n                    url=image_data[\"url\"],\n                    label=image_data.get(\"label\", None),\n                    language=\"en\",\n                )\n            )\n        if \"url_de\" in image_data:\n            images.append(\n                self._question_image_import_helper(\n                    question,\n                    url=image_data[\"url_de\"],\n                    label=image_data.get(\"label_de\", None),\n                    language=\"de\",\n                )\n            )\n\n        for image in images:\n            if image is not None:\n                image.save()\n\n    @staticmethod\n    def _question_image_import_helper(\n        question: Question, url: str, label: Optional[str], language: str\n    ) -> Optional[QuestionImage]:\n        \"\"\"Create a QuestionImage Object, load and store Image file inside it\n\n        Args:\n            question: The associated Question Object\n            url: Location of the image to be loaded\n            label: Is stored in the QuestionImage label field\n            language: Is stored in the QuestionImage language field\n        Returns:\n            The QuestionImage created with loaded image.\n            If the image could not be loaded, this will return None.\n            QuestionImage is not written to the database here.\n        \"\"\"\n        question_image = QuestionImage()\n        instrument = question.instrument\n        path = [instrument.study.name, instrument.name, question.name]\n        _image = download_image(url)\n        suffix = Path(url).suffix\n        if label is None:\n            label = \"Screenshot\"\n        if _image is None:\n            return None\n        image, _ = store_image(file=_image, name=label + suffix, path=path)\n        question_image.question = question\n        question_image.image = image\n        question_image.label = label\n        question_image.language = language\n        return question_image\n\n\nclass QuestionVariableImport(imports.CSVImport):\n    def execute_import(self):\n        for link in self.content:\n            self._import_link(link)\n\n    def _import_link(self, link):\n        try:\n            question = self._get_question(link)\n            variable = self._get_variable(link)\n            QuestionVariable.objects.get_or_create(question=question, variable=variable)\n        except BaseException as error:\n            raise type(error)(f\"Could not import QuestionVariable: {link}\")\n\n    @staticmethod\n    def _get_question(link):\n        question = (\n            Question.objects.filter(\n                instrument__study__name=link.get(\"study\", link.get(\"study_name\"))\n            )\n            .filter(instrument__name=link.get(\"instrument\", link.get(\"instrument_name\")))\n            .get(name=link.get(\"question\", link.get(\"question_name\")))\n        )\n        return question\n\n    @staticmethod\n    def _get_variable(link):\n        variable = (\n            Variable.objects.filter(\n                dataset__study__name=link.get(\"study\", link.get(\"study_name\"))\n            )\n            .filter(dataset__name=link.get(\"dataset\", link.get(\"dataset_name\")))\n            .filter(name=link.get(\"variable\", link.get(\"variable_name\")))\n            .first()\n        )\n        return variable\n\n\nclass ConceptQuestionImport(imports.CSVImport):\n    @atomic\n    def execute_import(self):\n        for link in self.content:\n            self._import_link(link)\n\n    def _import_link(self, link):\n        try:\n            question = self._get_question(link)\n            concept = self._get_concept(link)\n        except BaseException as error:\n            raise type(error)(f\"Could not import ConceptQuestion: {link}\")\n        ConceptQuestion.objects.get_or_create(question=question, concept=concept)\n\n    @staticmethod\n    def _get_question(element):\n        study = element.get(\"study\", element.get(\"study_name\"))\n        instrument = element.get(\"instrument\", element.get(\"instrument_name\"))\n        question = element.get(\"question\", element.get(\"question_name\"))\n\n        question = Question.objects.get(\n            instrument__study__name=study, instrument__name=instrument, name=question\n        )\n        return question\n\n    @staticmethod\n    def _get_concept(element):\n        # TODO: Concepts should not be imported implicitly.\n        concept = Concept.objects.get_or_create(\n            name=element.get(\"concept\", element.get(\"concept_name\"))\n        )[0]\n\n        return concept\n", "path": "ddionrails/instruments/imports.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n\n\"\"\" Importer classes for ddionrails.instruments app \"\"\"\n\nimport json\nimport logging\nfrom collections import OrderedDict\nfrom pathlib import Path\nfrom typing import Dict, Optional\n\nfrom django.db.transaction import atomic\n\nfrom ddionrails.concepts.models import AnalysisUnit, Concept, Period\nfrom ddionrails.data.models import Variable\nfrom ddionrails.imports import imports\nfrom ddionrails.imports.helpers import download_image, store_image\n\nfrom .models import ConceptQuestion, Instrument, Question, QuestionImage, QuestionVariable\n\nlogging.config.fileConfig(\"logging.conf\")  # type: ignore\nlogger = logging.getLogger(__name__)\n\n\nclass InstrumentImport(imports.Import):\n\n    content: str\n\n    def execute_import(self):\n        self.content = json.JSONDecoder(object_pairs_hook=OrderedDict).decode(\n            self.content\n        )\n        self._import_instrument(self.name, self.content)\n\n    def _import_instrument(self, name, content):\n        instrument, _ = Instrument.objects.get_or_create(study=self.study, name=name)\n\n        # add period relation to instrument\n        period_name = content.get(\"period\", \"none\")\n        # Workaround for two ways to name period: period, period_name\n        # => period_name\n        if period_name == \"none\":\n            period_name = content.get(\"period_name\", \"none\")\n\n        # Workaround for periods coming in as float, w.g. 2001.0\n        try:\n            period_name = str(int(period_name))\n        except ValueError:\n            period_name = str(period_name)\n        period = Period.objects.get_or_create(name=period_name, study=self.study)[0]\n        instrument.period = period\n\n        # add analysis_unit relation to instrument\n        analysis_unit_name = content.get(\"analysis_unit\", \"none\")\n        if analysis_unit_name == \"none\":\n            analysis_unit_name = content.get(\"analysis_unit_name\", \"none\")\n        analysis_unit = AnalysisUnit.objects.get_or_create(\n            name=analysis_unit_name, study=self.study\n        )[0]\n        instrument.analysis_unit = analysis_unit\n\n        for _name, _question in content[\"questions\"].items():\n            question, _ = Question.objects.get_or_create(\n                name=_question[\"question\"], instrument=instrument\n            )\n            question.sort_id = int(_question.get(\"sn\", 0))\n            question.label = _question.get(\"label\", _question.get(\"text\", _name))\n            question.label_de = _question.get(\"label_de\", _question.get(\"text_de\", \"\"))\n            question.description = _question.get(\"description\", \"\")\n            question.description_de = _question.get(\"description_de\", \"\")\n            question.items = _question.get(\"items\", list)\n            question.save()\n            image_data = _question.get(\"image\", None)\n            if image_data:\n                self.question_image_import(question, image_data)\n\n        instrument.label = content.get(\"label\", \"\")\n        instrument.label_de = content.get(\"label_de\", \"\")\n        instrument.description = content.get(\"description\", \"\")\n        instrument.description_de = content.get(\"description_de\", \"\")\n        instrument.save()\n\n    def question_image_import(self, question: Question, image_data: Dict[str, str]):\n        \"\"\"Load and save the images of a Question\n\n        Loads and saves up to two image files given their location by url.\n\n        Args:\n            question: The associated Question Object\n            image_data: Contains \"url\" and/or \"url_de\" keys to locate image files.\n                        Optionally contains \"label\" and/or \"label_de\" to add a label\n                        to the corresponding images.\n        \"\"\"\n\n        images = list()\n\n        if \"url\" in image_data:\n            images.append(\n                self._question_image_import_helper(\n                    question,\n                    url=image_data[\"url\"],\n                    label=image_data.get(\"label\", None),\n                    language=\"en\",\n                )\n            )\n        if \"url_de\" in image_data:\n            images.append(\n                self._question_image_import_helper(\n                    question,\n                    url=image_data[\"url_de\"],\n                    label=image_data.get(\"label_de\", None),\n                    language=\"de\",\n                )\n            )\n\n        for image in images:\n            if image is not None:\n                image.save()\n\n    @staticmethod\n    def _question_image_import_helper(\n        question: Question, url: str, label: Optional[str], language: str\n    ) -> Optional[QuestionImage]:\n        \"\"\"Create a QuestionImage Object, load and store Image file inside it\n\n        Args:\n            question: The associated Question Object\n            url: Location of the image to be loaded\n            label: Is stored in the QuestionImage label field\n            language: Is stored in the QuestionImage language field\n        Returns:\n            The QuestionImage created with loaded image.\n            If the image could not be loaded, this will return None.\n            QuestionImage is not written to the database here.\n        \"\"\"\n        question_image = QuestionImage()\n        instrument = question.instrument\n        path = [instrument.study.name, instrument.name, question.name]\n        _image = download_image(url)\n        suffix = Path(url).suffix\n        if label is None:\n            label = \"Screenshot\"\n        if _image is None:\n            return None\n        image, _ = store_image(file=_image, name=label + suffix, path=path)\n        question_image.question = question\n        question_image.image = image\n        question_image.label = label\n        question_image.language = language\n        return question_image\n\n\nclass QuestionVariableImport(imports.CSVImport):\n    def execute_import(self):\n        for link in self.content:\n            self._import_link(link)\n\n    def _import_link(self, link):\n        try:\n            question = self._get_question(link)\n            variable = self._get_variable(link)\n            QuestionVariable.objects.get_or_create(question=question, variable=variable)\n        except BaseException as error:\n            raise type(error)(f\"Could not import QuestionVariable: {link}\")\n\n    @staticmethod\n    def _get_question(link):\n        question = (\n            Question.objects.filter(\n                instrument__study__name=link.get(\"study\", link.get(\"study_name\"))\n            )\n            .filter(instrument__name=link.get(\"instrument\", link.get(\"instrument_name\")))\n            .get(name=link.get(\"question\", link.get(\"question_name\")))\n        )\n        return question\n\n    @staticmethod\n    def _get_variable(link):\n        variable = (\n            Variable.objects.filter(\n                dataset__study__name=link.get(\"study\", link.get(\"study_name\"))\n            )\n            .filter(dataset__name=link.get(\"dataset\", link.get(\"dataset_name\")))\n            .filter(name=link.get(\"variable\", link.get(\"variable_name\")))\n            .first()\n        )\n        return variable\n\n\nclass ConceptQuestionImport(imports.CSVImport):\n    @atomic\n    def execute_import(self):\n        for link in self.content:\n            self._import_link(link)\n\n    def _import_link(self, link):\n        try:\n            question = self._get_question(link)\n            concept = Concept.objects.get(\n                name=link.get(\"concept\", link.get(\"concept_name\"))\n            )\n        except BaseException as error:\n            raise type(error)(f\"Could not import ConceptQuestion: {link}\")\n        ConceptQuestion.objects.get_or_create(question=question, concept=concept)\n\n    @staticmethod\n    def _get_question(element):\n        study = element.get(\"study\", element.get(\"study_name\"))\n        instrument = element.get(\"instrument\", element.get(\"instrument_name\"))\n        question = element.get(\"question\", element.get(\"question_name\"))\n\n        question = Question.objects.get(\n            instrument__study__name=study, instrument__name=instrument, name=question\n        )\n        return question\n", "path": "ddionrails/instruments/imports.py"}]}