Fhir Protobuf Translate

null

Лицензия

Лицензия

Категории

Категории

Protobuf Данные Data Structures
Группа

Группа

com.github.rahulsom
Идентификатор

Идентификатор

fhir-protobuf-translate
Последняя версия

Последняя версия

0.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

Fhir Protobuf Translate
null
Ссылка на сайт

Ссылка на сайт

https://github.com/rahulsom/fhir-protobuf
Система контроля версий

Система контроля версий

https://github.com/rahulsom/fhir-protobuf

Скачать fhir-protobuf-translate

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.rahulsom/fhir-protobuf-translate/ -->
<dependency>
    <groupId>com.github.rahulsom</groupId>
    <artifactId>fhir-protobuf-translate</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.rahulsom/fhir-protobuf-translate/
implementation 'com.github.rahulsom:fhir-protobuf-translate:0.1.0'
// https://jarcasting.com/artifacts/com.github.rahulsom/fhir-protobuf-translate/
implementation ("com.github.rahulsom:fhir-protobuf-translate:0.1.0")
'com.github.rahulsom:fhir-protobuf-translate:jar:0.1.0'
<dependency org="com.github.rahulsom" name="fhir-protobuf-translate" rev="0.1.0">
  <artifact name="fhir-protobuf-translate" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.rahulsom', module='fhir-protobuf-translate', version='0.1.0')
)
libraryDependencies += "com.github.rahulsom" % "fhir-protobuf-translate" % "0.1.0"
[com.github.rahulsom/fhir-protobuf-translate "0.1.0"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
com.github.rahulsom : fhir-protobuf-types jar 0.1.0

test (2)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
ca.uhn.hapi.fhir : hapi-fhir-structures-dstu3 jar 3.1.0

Модули Проекта

Данный проект не имеет модулей.

FHIR Protobuf

Experimental FHIR parser that serializes to Protobuf. See this to see motivation.

Warning
This is not an official FHIR format. This was written before google open sourced their implementation of fhir protocol buffers. Based on what we’ve seen on the mailing lists, it appears that the google implementation will be adopted as an official standard.

Features

  • ✓ Parse and Create Protobufs using Protobuf DSL

  • ✓ Parse and Create Protobuf’s JSON using Protobuf DSL

  • ✓ Convert Standard JSON to Protobuf JSON

  • ✓ Convert Protobuf JSON to Standard JSON

Usage

Download the library you need from Maven

Types

badge

Contains types for parsing Protobuf binary and JSON formats.

Translate

badge

Supports translation of FHIR JSON to Protobuf JSON and back. Depends on Types.

Once released, the artifact will ba available on Maven Central. Until then, snapshots can be downloaded from Sonatype OSS.

To create a practitioner

Practitioner practitioner = Practitioner.newBuilder().
        setId("Practitioner_1").
        addName(HumanName.newBuilder().
                addGiven("Bob").
                setFamily("Kelso")).
        setGender(Practitioner_gender.Practitioner_gender_male).
        addIdentifier(Identifier.newBuilder().
                setSystem("https://stmarys.com/practitioners").
                setValue("BK001")).
        build();

To serialize to Protobuf Binary Format

byte[] protobufByteArray = practitioner.toByteArray();

To parse from Protobuf Binary Format

Practitioner practitionerFromBinary = Practitioner.parseFrom(protobufByteArray);

To serialize to Protobuf Json Format

String protobufJson = JsonFormat.printer().print(practitioner);

To parseFrom Protobuf Json Format

Practitioner.Builder jsonPractitionerBuilder = Practitioner.newBuilder();
JsonFormat.parser().merge(protobufJson, jsonPractitionerBuilder);
Practitioner practitionerFromJson = jsonPractitionerBuilder.build();

To translate FHIR Json to Protobuf Json

String protoJson = Converter.fromFhirJson(fhirJsonAsString);

To translate Protobuf Json to FHIR Json

String fhirJson = Converter.toFhirJson(protoJson);

Версии библиотеки

Версия
0.1.0