Created
July 11, 2018 01:03
-
-
Save citizenrich/5702454a66c724b959a73dd1030b786c 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/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