-
Notifications
You must be signed in to change notification settings - Fork 157
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
FHIRPath CLI #1283
Comments
It would also be nice to:
|
Would like to try out this issue @lmsurpre |
@erodrago please go right ahead. if you have any questions, come find us on Zulip. https://chat.fhir.org/#narrow/stream/212434-ibm |
Alright thanks @prb112 |
Signed-off-by: Paul Bastide <pbastide@us.ibm.com>
PR #2130 |
Confirmed that, after #2186, we now print usage info when invalid args are passed (and suppress the stacktrace by default):
I also confirmed that I was able to invoke the cli via both stdin and also via file: $ curl -s 'https://localhost:9443/fhir-server/api/v4/metadata' | java -jar fhir-path/target/fhir-path-4.7.0-SNAPSHOT-cli.jar --path 'CapabilityStatement.rest.resource.type.count()'
146 $ java -jar fhir-path/target/fhir-path-4.7.0-SNAPSHOT-cli.jar --path 'CapabilityStatement.rest.resource.type.count()' --file tmp.json
146 |
Java isn't the best for quick little cli utilities like this because the JVM is still a bit heavy to start. I'd love to see if we could compile it to a native image using graalvm sometime... |
Is your feature request related to a problem? Please describe.
Currently, java project can use our fhirpath implementation by
and
2. writing code like this:
This works ok, but I think would be cool to build an all-in-one shaded cli jar for our fhirpath module so that we can execute this more easily from the command line:
java -jar fhir-path-$VERSION.jar resource fhirpath
Describe the solution you'd like
Introduce a main that takes arguments for the resource content and the fhirpath string to execute.
Ideally, we could pass resource content from
One convention I've seen used is to interpret
-
as an indicator that we should read from stdin instead of a string or file, but I'm not tied to that.Look at the
fhir-persistence-schema
andfhir-swagger-generator
projects for examples on how to create the shaded all-in-one jar.Describe alternatives you've considered
The alternative is to let clients do this themselves or use a different fhirpath engine for simple command-line stuff (e.g. the node fhirpath module).
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: