Skip to content

Instantly share code, notes, and snippets.

@citizenrich
Created July 11, 2018 01:03
Show Gist options
  • Select an option

  • Save citizenrich/5702454a66c724b959a73dd1030b786c to your computer and use it in GitHub Desktop.

Select an option

Save citizenrich/5702454a66c724b959a73dd1030b786c to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"github.com/citizenrich/fhirprotogo/proto/stu3"
"github.com/golang/protobuf/jsonpb"
)
func main() {
fmt.Println("heyo")
stuff := `{
"resourceType": "Patient",
"id": "123",
"meta": {
"versionId": "33",
"lastUpdated": "2018-06-08T08:37:11.053+00:00"
},
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Some narrative</div>"
},
"name": [
{
"use": "official",
"family": "Chalmers",
"given": [
"Mathias",
"Fabian"
]
}
],
"gender": "male",
"birthDate": "1974-12-25"
}`
dest := google_fhir_stu3_proto.Bundle{}
// marshaller := jsonpb.Unmarshaler{}
buffer, err := jsonpb.UnmarshalString(stuff, &dest)
if err != nil {
fmt.Println(err)
}
fmt.Println(buffer)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment