Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run generate.py without error #39

Closed
dadocsis opened this issue Apr 15, 2020 · 1 comment
Closed

Unable to run generate.py without error #39

dadocsis opened this issue Apr 15, 2020 · 1 comment

Comments

@dadocsis
Copy link

Similar to #33

"Out of the box"

  1. clone and cd into fresh repo, pip install -r requirements
  2. copy ./Defaults/settings.py & mappings.py to ../
  3. cd into ./Samples
  4. run ./generate.py

Got.. Exception: Unable to create a member name for enum '!=' in http://hl7.org/fhir/questionnaire-enable-operator. You may need to add '!=' to mappings.enum_map

So I went ahead and added '!=': 'ne" to mappings.enum (actually had to change both ./Default/mappings.py and ../mappings.py

Now I run generate and it appears to create all the models but fails during unit test creation:
Traceback (most recent call last):
File "./generate.py", line 31, in
spec.write()
File "/root/fhir-parser/fhirspec.py", line 277, in write
self.parse_unit_tests()
File "/root/fhir-parser/fhirspec.py", line 245, in parse_unit_tests
controller.find_and_parse_tests(self.directory)
File "/root/fhir-parser/fhirunittest.py", line 31, in find_and_parse_tests
test = self.unittest_for_resource(resource)
File "/root/fhir-parser/fhirunittest.py", line 63, in unittest_for_resource
return FHIRUnitTest(self, resource.filepath, resource.content, klass)
File "/root/fhir-parser/fhirunittest.py", line 102, in init
self.expand()
File "/root/fhir-parser/fhirunittest.py", line 137, in expand
tests.extend(item.create_tests(self.controller))
File "/root/fhir-parser/fhirunittest.py", line 174, in create_tests
test = FHIRUnitTest(controller, self.filepath, self.value, self.klass, prefix)
File "/root/fhir-parser/fhirunittest.py", line 102, in init
self.expand()
File "/root/fhir-parser/fhirunittest.py", line 136, in expand
item = FHIRUnitTestItem(self.filepath, path, val, propclass, False, prop.enum)
File "/root/fhir-parser/fhirunittest.py", line 157, in init
self.enum = enum_item['name'] if enum_item is not None else None
TypeError: 'FHIRValueSetEnum' object is not subscriptable

Any ideas what I am doing wrong? My guess is it has something to with me adding '!=': 'ne'

@palfrey palfrey mentioned this issue Jul 3, 2020
@mikix
Copy link
Contributor

mikix commented Jul 12, 2024

Should be fixed by the PR above - (and fixed even more by #48)

@mikix mikix closed this as completed Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants