Comments (12)
I'm taking a look at this, regenerating all of the protos may be a bit tricky, does anyone need anything other than the R4 (and future) core resources/datatypes
from fhir.
I submitted #243 for the R4 protos. If anyone has any issues please let me know
from fhir.
Hi @tmc -- great question. If I recall correctly, the team initially looked into including the go_package options in the protocol buffer generator itself--but that required some other changes to inject the right context to generate the go_package path. We also didn't want to manually add the go_package option into the protos if it wasn't automatically added from the core proto generator, because re-running the generator as is would produce different output.
That's why we went with the interim approach to unblock the go modules migration asap--a generation script that manages building the go protos, which handles inserting the right go_package reliably during the generation process for now. This script needed to exist anyway to help manage rebuilding the go protos after any proto change (and hopefully as a user, it handles everything for you regardless of where the go_package temporarily lived).
We're planning on implementing the relevant changes needed to add the option to proto generator as well in the near future. We can keep this issue open and post updates here as that comes to fruition.
Let us know if you have any other context on your use cases that are impacted by this! Thank you!
from fhir.
Building protos which import the FHIR protos is pretty burdensome in cases where generating Go libraries is needed. IIUC the only way is to add hundreds of --go_opt
and --go_grpc_opts
args in the protoc
call.
for resource in resources:
go_opts+=("--go_opt=Mproto/google/fhir/proto/r4/core/resources/${resource}.proto=${GOOGLE_FHIR_PATH}/google/fhir/proto/r4/core/resources/${resource}_go_proto")
done
protoc "${go_opts[@]}" [...]
Other prominent Google protos declare go_package
in the proto file:
I recognize complexity to add this but fwiw I think all Go users will thank you 😄
from fhir.
Thanks for your excellent work on this proto representation of FHIR!
Are there any plans to add go_package to the .proto files? We're encountering this issue. It's not practical to have an "M" line for every single .proto file added to the compile step for us plebs who aren't using Bazel or similar tooling, so it would be a godsend for us. 😃
I can provide more context on our use case via email: [email protected]
from fhir.
I still have some code working over stu3 types (unfortunately).
from fhir.
Unfortunately some of the STU3 proto generation code was removed recently in c9ab5d2. This may come down to adding the annotations by hand to those protos. I only have experience on the Go code, I'm ramping up to how the proto generator works
from fhir.
does anyone need anything other than the R4 (and future) core resources/datatypes?
Nope :)
from fhir.
FWIW, protoc-gen-go itself emits warnings about this for all fhir protos, e.g.
2023/08/31 12:26:02 WARNING: Missing 'go_package' option in "proto/google/fhir/proto/r4/core/resources/structure_definition.proto",
please specify it with the full Go package path as a future release of protoc-gen-go will require this be specified.
See https://developers.google.com/protocol-buffers/docs/reference/go-generated#package for more information.
from fhir.
It would still be useful to get go_package options added to the rest of the proto tree.
So, a few asks/questions:
- Add go_package lines to the (I believe) hand authored protos in this directory: https://github.com/google/fhir/tree/master/proto/google/fhir/proto and this directory: https://github.com/google/fhir/tree/master/proto/google/fhir/proto/r4 files
- Add go_package to the r4/core/profiles subtree.
from fhir.
@tmc are you using r4/core/profiles or do you just want to use a glob that includes all these files? I tried to focus on all the files I expected people to need. If you need more we can reopen this, but I'll have to wait until I get time again to do that.
from fhir.
This ended up working out for my use case, I don't need to pass a huge number of "M" lines to protoc anymore. Thanks!
from fhir.
Related Issues (20)
- Patient Id is not accepting string expecting type object
- Consider tagging submodule "go"? HOT 2
- [Go] How to parse profile HOT 3
- Unmarshaller support for R5 versions HOT 3
- Canonical FHIR Resource Enum HOT 2
- go: module source tree too large HOT 1
- R5 support
- py/ subtree accidentally deleted? HOT 1
- Idiomatic way of dealing with unknown fields? [golang] HOT 3
- No need to require backports.zoneinfo on Python 3.9+ HOT 2
- Python 3.10 + 3.11 support HOT 2
- Python: Upgrade to abseil-py v1.0.0
- [Urgent] Need help with issue using jsonformat NewMarshaller
- Missing GoalAchievementStatus code system
- Go - Task_Output encoded REST message does not match FHIR Store model HOT 4
- FHIR 4.3.0 / R4B support
- protobuf 4.21 support HOT 1
- Building under Windows using MSVC HOT 1
- FR: Exposing a list of maven deps HOT 1
- Example for Generating Protos Using the scripts seems broken
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fhir.