I've been looking at the Google fhir repo(https://github.com/google/fhir). The proto files within this repo are generated from the FHIR spec(something like this: http://hl7.org/fhir/account.html). I want to understand how proto files can be generated from a specification. I'm working on a project which has a specification(this could be a JSON/ spreadsheet any other data representation), from these specifications I want to generate proto files. Any other workaround to generate the protos would be appreciated.
Asked
Active
Viewed 166 times
1 Answers
1
The FHIR proto generation code is included in the same repo - https://github.com/google/fhir/tree/master/java/src/main/java/com/google/fhir/protogen
There's generally a bootstrapping step, which for FHIR is the StructureDefinition resource. Once you can parse a StructureDefinition, all the other resources are defined using instances of StructureDefinition.

Paul Church
- 244
- 1
- 2
-
Hey, thank you for the answer. I've seen the protogen code, but I'm not exactly sure what is going on. I was trying to generate protos locally to check the flow, but couldn't do it due to build errors. It would be great if you could elaborate on the process they're following - as in the scripts, the parsing etc – nymphadora Jul 28 '20 at 07:48
-
1Unfortunately I'm not very familiar with this code myself. You could try opening a github issue, might be more likely to be seen by the maintainers. – Paul Church Jul 28 '20 at 18:46