Skip to content

v0.7.0 - Golang Modules, Java Build Cleanup

Compare
Choose a tag to compare
@nickgeorge nickgeorge released this 03 Dec 01:15
· 636 commits to master since this release

Go Modules

This release adds support for go get and go modules. This means that the Go libraries may now be built and used without Bazel. Note that proto imports must now be prefixed by github.com/google/fhir/go.

See the Go Examples in the Fhir-Examples repo for an example of using the FhirProto libraries with modules.

Java BUILD Cleanup

FhirProto Java has outgrown a single BUILD file. To bring this in line with other languages, there is now one BUILD rule per directory. To avoid long and redundant paths, some Java directories have been collapsed:

@com_google_fhirproto//java/src/main/java -> @com_google_fhirproto//java
@com_google_fhirproto//java/src/test/java -> @com_google_fhirproto//javatests

This means that imports will now better reflect the directory structure, like in other languages. For instance:

com.google.fhir.common.JsonFormat will be provided by @com_google_fhirproto//java/com/google/fhir/common:json_format, instead of @com_google_fhirproto//java:json_format

Note that no actual Java package names have been changed, but BUILD dependencies have to be updated.

For an example of how to update your dependencies, see the Java Fhir Examples commit.

Golang jsonformat API

Golang jsonformat unmarshalling now uses the same validation conventions as other languages. Both NewUnmarshaller and NewUnmarshallerWithoutValidation will enforce basic FHIR primitive validity - e.g., DateTimes must be valid FHIR DateTimes, bound codes must use a valid code string from the correct code system. The difference is that the default Parser will also enforce StructureDefinition/Profile constraints such as required fields and FHIRProto expressions. If you want to be able to parse incomplete/non-compliant protos, use NewUnmarshallerWithoutValidation. Finally, the default (i.e., validating) parser will no longer fail on the first error, and instead return all the errors it encountered in the case of a failure.

Other

Fixed a bug where references would fail validation in Python and C++ if they did not conform to a known schema.

Upcoming

With the newly-updated BUILD structure for Java in place, look forward to added multi-version support and profiling in Java.