google / fhir-examples Goto Github PK
View Code? Open in Web Editor NEWUsage Examples for github.com/google/fhir
License: Apache License 2.0
Usage Examples for github.com/google/fhir
License: Apache License 2.0
Example error below:
~/bin/generate_definitions_and_protos.sh //proto/myprofile:myprofile
INFO: Repository fhir_bazel_pip_dependencies instantiated at:
no stack (--record_rule_instantiation_callstack not enabled)
Repository rule pip_import defined at:
/private/var/tmp/_bazel_emilylewis/6ed13ea54d141d16d801a31bd3ba8818/external/rules_python/python/pip.bzl:51:29: in <toplevel>
ERROR: An error occurred during the fetch of repository 'fhir_bazel_pip_dependencies':
pip_import failed: Collecting apache_beam>=2.14.0 (from -r /private/var/tmp/_bazel_emilylewis/6ed13ea54d141d16d801a31bd3ba8818/external/com_google_fhir/bazel/requirements.txt (line 1))
Using cached https://files.pythonhosted.org/packages/17/92/1975c3f3a880f409b1b06a600f9afab8569c9f1d65e2db56336dc0bae6a6/apache_beam-2.23.0-cp38-cp38-macosx_10_9_x86_64.whl
Saved ./apache_beam-2.23.0-cp38-cp38-macosx_10_9_x86_64.whl
Collecting funcsigs (from -r /private/var/tmp/_bazel_emilylewis/6ed13ea54d141d16d801a31bd3ba8818/external/com_google_fhir/bazel/requirements.txt (line 2))
Using cached https://files.pythonhosted.org/packages/69/cb/f5be453359271714c01b9bd06126eaf2e368f1fddfff30818754b5ac2328/funcsigs-1.0.2-py2.py3-none-any.whl
Saved ./funcsigs-1.0.2-py2.py3-none-any.whl
Collecting google-cloud-bigquery (from -r /private/var/tmp/_bazel_emilylewis/6ed13ea54d141d16d801a31bd3ba8818/external/com_google_fhir/bazel/requirements.txt (line 3))
Using cached https://files.pythonhosted.org/packages/41/2c/e4da0278a5fd8e71710cfded98c13a5ed2ecb66c704fc4feb3734e8c027d/google_cloud_bigquery-1.27.2-py2.py3-none-any.whl
Saved ./google_cloud_bigquery-1.27.2-py2.py3-none-any.whl
Collecting nose>=1.3.7 (from -r /private/var/tmp/_bazel_emilylewis/6ed13ea54d141d16d801a31bd3ba8818/external/com_google_fhir/bazel/requirements.txt (line 4))
Using cached https://files.pythonhosted.org/packages/15/d8/dd071918c040f50fa1cf80da16423af51ff8ce4a0f2399b7bf8de45ac3d9/nose-1.3.7-py3-none-any.whl
Saved ./nose-1.3.7-py3-none-any.whl
Collecting protobuf (from -r /private/var/tmp/_bazel_emilylewis/6ed13ea54d141d16d801a31bd3ba8818/external/com_google_fhir/bazel/requirements.txt (line 5))
Using cached https://files.pythonhosted.org/packages/eb/79/feb55f5a6c8bd48d79beeb80c11299eb0d378c6df8ca0f33f91d8eda637b/protobuf-3.13.0-cp38-cp38-macosx_10_9_x86_64.whl
Saved ./protobuf-3.13.0-cp38-cp38-macosx_10_9_x86_64.whl
Collecting python-dateutil>=2.8.1 (from -r /private/var/tmp/_bazel_emilylewis/6ed13ea54d141d16d801a31bd3ba8818/external/com_google_fhir/bazel/requirements.txt (line 6))
Using cached https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl
Saved ./python_dateutil-2.8.1-py2.py3-none-any.whl
Collecting request (from -r /private/var/tmp/_bazel_emilylewis/6ed13ea54d141d16d801a31bd3ba8818/external/com_google_fhir/bazel/requirements.txt (line 7))
( Could not find a version that satisfies the requirement request (from -r /private/var/tmp/_bazel_emilylewis/6ed13ea54d141d16d801a31bd3ba8818/external/com_google_fhir/bazel/requirements.txt (line 7)) (from versions: )
No matching distribution found for request (from -r /private/var/tmp/_bazel_emilylewis/6ed13ea54d141d16d801a31bd3ba8818/external/com_google_fhir/bazel/requirements.txt (line 7))
)
ERROR: no such package '@fhir_bazel_pip_dependencies//': pip_import failed: Collecting apache_beam>=2.14.0 (from -r /private/var/tmp/_bazel_emilylewis/6ed13ea54d141d16d801a31bd3ba8818/external/com_google_fhir/bazel/requirements.txt (line 1))
Using cached https://files.pythonhosted.org/packages/17/92/1975c3f3a880f409b1b06a600f9afab8569c9f1d65e2db56336dc0bae6a6/apache_beam-2.23.0-cp38-cp38-macosx_10_9_x86_64.whl
Saved ./apache_beam-2.23.0-cp38-cp38-macosx_10_9_x86_64.whl
Collecting funcsigs (from -r /private/var/tmp/_bazel_emilylewis/6ed13ea54d141d16d801a31bd3ba8818/external/com_google_fhir/bazel/requirements.txt (line 2))
Using cached https://files.pythonhosted.org/packages/69/cb/f5be453359271714c01b9bd06126eaf2e368f1fddfff30818754b5ac2328/funcsigs-1.0.2-py2.py3-none-any.whl
Saved ./funcsigs-1.0.2-py2.py3-none-any.whl
Collecting google-cloud-bigquery (from -r /private/var/tmp/_bazel_emilylewis/6ed13ea54d141d16d801a31bd3ba8818/external/com_google_fhir/bazel/requirements.txt (line 3))
Using cached https://files.pythonhosted.org/packages/41/2c/e4da0278a5fd8e71710cfded98c13a5ed2ecb66c704fc4feb3734e8c027d/google_cloud_bigquery-1.27.2-py2.py3-none-any.whl
Saved ./google_cloud_bigquery-1.27.2-py2.py3-none-any.whl
Collecting nose>=1.3.7 (from -r /private/var/tmp/_bazel_emilylewis/6ed13ea54d141d16d801a31bd3ba8818/external/com_google_fhir/bazel/requirements.txt (line 4))
Using cached https://files.pythonhosted.org/packages/15/d8/dd071918c040f50fa1cf80da16423af51ff8ce4a0f2399b7bf8de45ac3d9/nose-1.3.7-py3-none-any.whl
Saved ./nose-1.3.7-py3-none-any.whl
Collecting protobuf (from -r /private/var/tmp/_bazel_emilylewis/6ed13ea54d141d16d801a31bd3ba8818/external/com_google_fhir/bazel/requirements.txt (line 5))
Using cached https://files.pythonhosted.org/packages/eb/79/feb55f5a6c8bd48d79beeb80c11299eb0d378c6df8ca0f33f91d8eda637b/protobuf-3.13.0-cp38-cp38-macosx_10_9_x86_64.whl
Saved ./protobuf-3.13.0-cp38-cp38-macosx_10_9_x86_64.whl
Collecting python-dateutil>=2.8.1 (from -r /private/var/tmp/_bazel_emilylewis/6ed13ea54d141d16d801a31bd3ba8818/external/com_google_fhir/bazel/requirements.txt (line 6))
Using cached https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl
Saved ./python_dateutil-2.8.1-py2.py3-none-any.whl
Collecting request (from -r /private/var/tmp/_bazel_emilylewis/6ed13ea54d141d16d801a31bd3ba8818/external/com_google_fhir/bazel/requirements.txt (line 7))
( Could not find a version that satisfies the requirement request (from -r /private/var/tmp/_bazel_emilylewis/6ed13ea54d141d16d801a31bd3ba8818/external/com_google_fhir/bazel/requirements.txt (line 7)) (from versions: )
No matching distribution found for request (from -r /private/var/tmp/_bazel_emilylewis/6ed13ea54d141d16d801a31bd3ba8818/external/com_google_fhir/bazel/requirements.txt (line 7))
)
INFO: Elapsed time: 3.056s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)```
There are a lot of broken links in the user guide, e.g. https://github.com/google/fhir/blob/master/proto/profile_config.proto which does not resolve
./upload_resource.sh $WORKSPACE
Dataset 'protofhir:fhirexamples' successfully created.
Uploading ...
BigQuery error in load operation: Cannot determine table described by fhirexamples.
Gradle integration is not working.
I've downloaded latest version and can see below error:
fhir-examples ) ./gradlew build
Downloading https://services.gradle.org/distributions/gradle-7.4-bin.zip
...........10%...........20%...........30%...........40%...........50%...........60%...........70%...........80%...........90%...........100%
Welcome to Gradle 7.4!
Here are the highlights of this release:
- Aggregated test and JaCoCo reports
- Marking additional test source directories as tests in IntelliJ
- Support for Adoptium JDKs in Java toolchains
For more details see https://docs.gradle.org/7.4/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* Where:
Build file '$HOME/fhir-examples/build.gradle' line: 38
* What went wrong:
A problem occurred evaluating root project 'fhirexamples'.
> Could not find method testCompile() for arguments [{group=junit, name=junit, version=4.12}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 8s
<-------------> 0% WAITING
> IDLE
Hi, My Ubuntu 20.04 system info is as follows:
$ uname -a
Linux <hostname> 5.10.0-1038-oem #40-Ubuntu SMP Fri Jul 16 15:08:30 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ java --version
openjdk 11.0.11 2021-04-20
OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)
$ bazel --version
bazel 4.2.0
I am encountering following errors. Any pointers on how to get resolve these? Thanks.
└─ $ ▶ ./generate-synthea.sh $WORKSPACE
~/fhirdata ~/gocode/github.com/google/fhir-examples
Cloning into 'synthea'...
<redacted... lots of lines in between>
BUILD SUCCESSFUL in 1m 20s
4 actionable tasks: 4 executed
~/gocode/github.com/google/fhir-examples
Finished generating Synthea dataset. Running SplitBundle...
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
ERROR: /home/<username>/.cache/bazel/_bazel_<username>/2884ccfba9ba71fca71c9c77a412dd89/external/local_jdk/BUILD.bazel:3:10: in fail_rule rule @local_jdk//:jdk:
Traceback (most recent call last):
File "/home/<username>/.cache/bazel/_bazel_<username>/2884ccfba9ba71fca71c9c77a412dd89/external/bazel_tools/tools/jdk/fail_rule.bzl", line 19, column 13, in _fail_rule_impl
fail("%s %s" % (ctx.attr.header, ctx.attr.message))
Error in fail: Auto-Configuration Error: Cannot find Java binary bin/java in /home/<username>/.cache/bazel/_bazel_<username>/install/96e7556c3bbfa3fa31016b638fdff086/embedded_tools/tools/jdk/nosystemjdk; either correct your JAVA_HOME, PATH or specify embedded Java (e.g. --javabase=@bazel_tools//tools/jdk:remote_jdk11)
INFO: Repository rules_proto instantiated at:
/home/<username>/gocode/github.com/google/fhir-examples/WORKSPACE:14:23: in <toplevel>
/home/<username>/.cache/bazel/_bazel_<username>/2884ccfba9ba71fca71c9c77a412dd89/external/com_google_fhir/bazel/dependencies.bzl:37:17: in fhirproto_dependencies
Repository rule http_archive defined at:
/home/<username>/.cache/bazel/_bazel_<username>/2884ccfba9ba71fca71c9c77a412dd89/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
INFO: Repository remote_java_tools_linux instantiated at:
/DEFAULT.WORKSPACE.SUFFIX:223:6: in <toplevel>
/home/<username>/.cache/bazel/_bazel_<username>/2884ccfba9ba71fca71c9c77a412dd89/external/bazel_tools/tools/build_defs/repo/utils.bzl:201:18: in maybe
Repository rule http_archive defined at:
/home/<username>/.cache/bazel/_bazel_<username>/2884ccfba9ba71fca71c9c77a412dd89/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
INFO: Repository maven instantiated at:
/home/<username>/gocode/github.com/google/fhir-examples/WORKSPACE:20:20: in <toplevel>
/home/<username>/.cache/bazel/_bazel_<username>/2884ccfba9ba71fca71c9c77a412dd89/external/com_google_fhir/bazel/workspace.bzl:8:18: in fhirproto_workspace
/home/<username>/.cache/bazel/_bazel_<username>/2884ccfba9ba71fca71c9c77a412dd89/external/rules_jvm_external/defs.bzl:36:19: in maven_install
Repository rule coursier_fetch defined at:
/home/<username>/.cache/bazel/_bazel_<username>/2884ccfba9ba71fca71c9c77a412dd89/external/rules_jvm_external/coursier.bzl:559:33: in <toplevel>
ERROR: Analysis of target '@com_google_fhir//java/com/google/fhir/examples:SplitBundle' failed; build aborted: Analysis of target '@local_jdk//:jdk' failed
INFO: Elapsed time: 42.634s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (21 packages loaded, 191 targets configured)
currently loading: @com_google_fhir//proto/google/fhir/proto/r4/core/resources ... (2 packages)
./generate-synthea.sh: line 42: bazel-bin/external/com_google_fhir/java/com/google/fhir/examples/SplitBundle: No such file or directory
mv: cannot stat '/home/<username>/fhirdata/ndjson/*.schema.json': No such file or directory
mv: cannot stat '/home/<username>/fhirdata/ndjson/*.analytic.ndjson': No such file or directory
Done
There is a broken link referring to the user guide in README.md#L7. I believe the correct destination should be https://github.com/google/fhir-examples/blob/master/USERGUIDE.md
.
Replacement suggestion:
For a more comprehensive explanation of the platform, see the [**User Guide**](https://github.com/google/fhir-examples/blob/master/USERGUIDE.md).
I tried following the guide available on this repo's README.
I am using a ubuntu virtual machine on virtualbox.
Encountering errors such as:
'''
INFO: Call stack for the definition of repository 'fhir_bazel_pip_dependencies' which is a pip_import (rule definition at /home/zhihaotan/.cache/bazel/_bazel_zhihaotan/9b5b980c5e264403b4ce49ee1b642806/external/rules_python/python/pip.bzl:42:14):
ERROR: An error occurred during the fetch of repository 'fhir_bazel_pip_dependencies':
pip_import failed: ()
ERROR: no such package '@fhir_bazel_pip_dependencies//': pip_import failed: ()
ERROR: no such package '@fhir_bazel_pip_dependencies//': pip_import failed: ()
INFO: Elapsed time: 18.796s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
./generate-synthea.sh: line 38: bazel-bin/external/com_google_fhir/java/SplitBundleMain: No such file or directory
mkdir: cannot create directory ‘/home/zhihaotan/fhirdata/analytic/’: File exists
mv: cannot stat '/home/zhihaotan/fhirdata/ndjson/.schema.json': No such file or directory
mv: cannot stat '/home/zhihaotan/fhirdata/ndjson/.analytic.ndjson': No such file or directory
Done
'''
Could I please get some help on this as well as on the tensorflow's guide?
Thanks for the great examples. With the Go parse patients example, can you give a hint on how to iterate through all patients that have been unmarshalled? I only see one, and the usual output of Patient.ndjson from Synthea is multiple. I only see the first one and I don't see a function to choose an index/slice.
(It's the file used to convert profiles to protos in the third example.)
When running generate_protos.sh proto/google/fhir_examples/myprofile:myprofile
, I get:
ERROR: /private/var/tmp/_bazel_sttawm/af784bd1a9c84e41a49e63c2d22f20ae/external/com_google_fhir/spec/BUILD:28:13: Executing genrule @com_google_fhir//spec:_genrule_fhir_stu3_package failed (Exit 1) bash failed: error executing command /bin/bash bazel-out/darwin-fastbuild/bin/external/com_google_fhir/spec/_genrule_fhir_stu3_package.genrule_script.sh
Use --sandbox_debug to see verbose messages from the sandbox
bazel-out/darwin-fastbuild/bin/external/com_google_fhir/spec/_genrule_fhir_stu3_package.genrule_script.sh: line 2: /usr/bin/zip: Argument list too long
Maybe passing a directory to zip would fix it?
I'm on a mac (ios 10.15) which gives:
sttawm$ bazel --version
bazel 3.3.0-homebrew
sttawm$ zip -v
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
This is Zip 3.0 (July 5th 2008), by Info-ZIP.
Currently maintained by E. Gordon. Please send bug reports to
the authors using the web page at www.info-zip.org; see README for details.
Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip,
as of above date; see http://www.info-zip.org/ for other sites.
Compiled with gcc 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.20) (-macos10.15-objc-selector-opts) for Unix (Mac OS X) on Apr 17 2020.
Zip special compilation options:
USE_EF_UT_TIME (store Universal Time)
SYMLINK_SUPPORT (symbolic links supported)
LARGE_FILE_SUPPORT (can read and write large files on file system)
ZIP64_SUPPORT (use Zip64 to store large files in archives)
STORE_UNIX_UIDs_GIDs (store UID/GID sizes/values using new extra field)
UIDGID_16BIT (old Unix 16-bit UID/GID extra field also used)
[encryption, version 2.91 of 05 Jan 2007] (modified for Zip 3)
Encryption notice:
The encryption code of this program is not copyrighted and is
put in the public domain. It was originally written in Europe
and, to the best of our knowledge, can be freely distributed
in both source and object forms from any country, including
the USA under License Exception TSU of the U.S. Export
Administration Regulations (section 740.13(e)) of 6 June 2002.
Zip environment options:
ZIP: [none]
ZIPOPT: [none]
The build path of bazel build cc:ParsePatients
should be updated as bazel build //cc/google/fhir_examples:ParsePatients
in the README.md
.
The thing is similar for bazel-bin/ParsePatients $WORKSPACE
which I found eventually working as:
bazel-bin/cc/google/fhir_examples/ParsePatients.runfiles/com_google_fhir_examples/cc/google/fhir_examples/ParsePatients $WORKSPACE
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
INFO: Repository fhir_bazel_pip_dependencies instantiated at:
/home/h/fhir-examples/WORKSPACE:23:12: in
/home/h/.cache/bazel/_bazel_h/53cd8c1ffe775ea94a7e4204fd2a4fc0/external/rules_python/python/pip.bzl:128:15: in pip3_import
Repository rule pip_import defined at:
/home/h/.cache/bazel/_bazel_h/53cd8c1ffe775ea94a7e4204fd2a4fc0/external/rules_python/python/pip.bzl:51:29: in
ERROR: An error occurred during the fetch of repository 'fhir_bazel_pip_dependencies':
Traceback (most recent call last):
File "/home/h/.cache/bazel/_bazel_h/53cd8c1ffe775ea94a7e4204fd2a4fc0/external/rules_python/python/pip.bzl", line 49, column 13, in _pip_import_impl
fail("pip_import failed: %s (%s)" % (result.stdout, result.stderr))
Error in fail: pip_import failed: (Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in run_code
exec(code, run_globals)
File "/home/h/.cache/bazel/bazel_h/53cd8c1ffe775ea94a7e4204fd2a4fc0/external/rules_python/tools/piptool.par/main.py", line 71, in
File "/tmp/tmpusr4m7d/pip-tmp/pip/init.py", line 43, in
from pip.utils import get_installed_distributions, get_prog
File "/tmp/tmpusr4m7d/pip-tmp/pip/utils/init.py", line 23, in
from pip.locations import (
File "/tmp/tmpusr4m7d/pip-tmp/pip/locations.py", line 9, in
from distutils import sysconfig
ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.8/distutils/init.py)
)
ERROR: no such package '@fhir_bazel_pip_dependencies//': pip_import failed: (Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in run_code
exec(code, run_globals)
File "/home/h/.cache/bazel/bazel_h/53cd8c1ffe775ea94a7e4204fd2a4fc0/external/rules_python/tools/piptool.par/main.py", line 71, in
File "/tmp/tmpusr4m7d/pip-tmp/pip/init.py", line 43, in
from pip.utils import get_installed_distributions, get_prog
File "/tmp/tmpusr4m7d/pip-tmp/pip/utils/init.py", line 23, in
from pip.locations import (
File "/tmp/tmpusr4m7d/pip-tmp/pip/locations.py", line 9, in
from distutils import sysconfig
ImportError: cannot import name 'sysconfig' from 'distutils' (/usr/lib/python3.8/distutils/init.py)
)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.