Giter Site home page Giter Site logo

itcr-uni-luebeck / fhir-populator Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 2.0 50 KB

A tool to load a lot of FHIR resources from the Simplifier into a "naked" FHIR server and rewrite the version corresponding to the package.json!

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
fhir simplifier

fhir-populator's People

Contributors

alexanderkiel avatar geloro94 avatar jpwiedekopf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fhir-populator's Issues

Offline workflow when no internet connection is available

Some users may require a "sneaker-net" based approach for getting FHIR packages on the machine the FHIR Populator is running on, and can't use proxies. Support that use case by allowing retrieval of FHIR packages from a directory instead of downloading from a registry.

Don't include a Null ID into Resources

While uploading resources without an ID, using POST, the resource send to the FHIR server includes a JSON null value for the id property. Blaze complains about this, which it shouldn't, but nevertheless you shouldn't send such resources in the first place. I'll fix this in samply/blaze#370.

Illegal Byte Sequence Error on macOS

I'm on Catalina and have installed Python 3.9.5 using Homebrew. I created the venv as described in the README. The output is:

(.venv) fhir-populator $ python -m fhir_populator --endpoint http://localhost:8080/fhir --get-dependencies --package de.gecco
[20:49:45] INFO      - endpoint : http://localhost:8080/fhir                                                                                                         populator.py:181
           INFO      - authorization_header : None                                                                                                                   populator.py:181
           INFO      - log_file : None                                                                                                                               populator.py:181
           INFO      - get_dependencies : True                                                                                                                       populator.py:181
           INFO      - non_interactive : False                                                                                                                       populator.py:181
           INFO      - include_examples : False                                                                                                                      populator.py:181
           INFO      - log_level : INFO                                                                                                                              populator.py:181
           INFO      - rewrite_versions : False                                                                                                                      populator.py:181
           INFO      - only_put : False                                                                                                                              populator.py:181
           INFO      - versioned_ids : False                                                                                                                         populator.py:181
           INFO      - exclude_resource_type : None                                                                                                                  populator.py:181
           INFO      - registry_url : https://packages.simplifier.net                                                                                                populator.py:181
           INFO      - packages : ['de.gecco']                                                                                                                       populator.py:181
           INFO     Downloading package with spec [email protected]                                                                                                     populator.py:288
[20:49:46] INFO     Downloading package with spec [email protected]                                                      populator.py:288
           INFO     Downloading package with spec [email protected]                                                        populator.py:288
[20:49:47] INFO     Downloading package with spec [email protected]                                                     populator.py:288
[20:49:48] INFO     Downloading package with spec [email protected]                                                        populator.py:288
[20:49:49] INFO     Downloading package with spec [email protected]                                                                                              populator.py:288
           INFO     Downloading package with spec [email protected]                                                            populator.py:288
           INFO     Downloading package with spec [email protected]                                                                                           populator.py:288
           INFO     Downloading package with spec [email protected]                                                                                                    populator.py:288
Traceback (most recent call last):
  File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/akiel/fhir-populator/.venv/lib/python3.9/site-packages/fhir_populator/__main__.py", line 4, in <module>
    Populator().populate()
  File "/Users/akiel/fhir-populator/.venv/lib/python3.9/site-packages/fhir_populator/populator.py", line 351, in populate
    dependency_graph = self.download_packages(packages)
  File "/Users/akiel/fhir-populator/.venv/lib/python3.9/site-packages/fhir_populator/populator.py", line 289, in download_packages
    package_path = self.download_untar_package(package_name=package)
  File "/Users/akiel/fhir-populator/.venv/lib/python3.9/site-packages/fhir_populator/populator.py", line 332, in download_untar_package
    download_tar_fs.extractall(extract_path)
  File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tarfile.py", line 2036, in extractall
    self.extract(tarinfo, path, set_attrs=not tarinfo.isdir(),
  File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tarfile.py", line 2077, in extract
    self._extract_member(tarinfo, os.path.join(path, tarinfo.name),
  File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tarfile.py", line 2150, in _extract_member
    self.makefile(tarinfo, targetpath)
  File "/usr/local/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tarfile.py", line 2191, in makefile
    with bltn_open(targetpath, "wb") as target:
OSError: [Errno 92] Illegal byte sequence: '/var/folders/gg/_48t_zj16b53c2vl04s52cjr0000gn/T/fhir-populator0j0pw0l2/extract/kbv.basis_1.1.3/package/examples/Patient - Ludger K\udcfdnigstein.json'

The FHIR server is Blaze but it didn't receive any request.

Remove varargs as command line variables

The varargs of the program i.e. for --package, cause https://github.com/koalaman/shellcheck/wiki/SC2086 when setting the args in bash:
python -m fhir_populator --endpoint "${BLAZE_SERVER_URL}" --get-dependencies --non-interactive --only-put --package ${PACKAGES}

Quoting ${PACKAGES} to resolve the issue is not possible, as the arguments are no longer interpreted as:
arg1 arg2 arg3
but instead as
'arg1 arg2 arg3'
which causes the application to crash.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.