Created
July 3, 2018 19:36
-
-
Save citizenrich/3ca70e3a469a6166868eb8a07ae25374 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "github.com/citizenrich/fhirprotogo/proto/stu3" | |
| "github.com/grpc-ecosystem/grpc-gateway/runtime" | |
| ) | |
| func main() { | |
| fmt.Println("heyo") | |
| stuff := []byte(`{ | |
| "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.Patient{} | |
| marshaller := runtime.ProtoMarshaller{} | |
| buffer, err := marshaller.Unmarshal(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