Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration file about the code generator #1843

Open
zero-zero-senven opened this issue Dec 4, 2024 · 4 comments
Open

Configuration file about the code generator #1843

zero-zero-senven opened this issue Dec 4, 2024 · 4 comments
Labels
question Further information is requested

Comments

@zero-zero-senven
Copy link

When I use org.hl7.fhir.core.generator and org.hl7.fhir.r5 to generated code, found that generated code is missing a lot of methods, properties and constants, by reading the code I guess may be extended in the confuguration was too old, Resulting in the generated code is incomplete, mainly in the model and extension package, I hope the developer can supplement this part of the configuration, of course, according to the generated code direction of the configuration can also be calculated, but, you know, this is very time-consuming.

Thanks a lot.

@grahamegrieve
Copy link
Collaborator

hmm. The code generator isn't used very much - typically only when there's a new version of the FHIR specification. Once a version is generated, we generally don't regenerate it ever (and it does take me a few days to do that). Why are you trying to generate using it?

@dotasek dotasek added the question Further information is requested label Dec 4, 2024
@zero-zero-senven
Copy link
Author

I expect systems built on HAPI-FHIR to have the ability to customize resources, although these resources are not interoperable, they are for service and specific business. Through the understanding of related warehouses of FHIR, I found that HAPI-FHIR and org.hl7.fhir.core are related to each other to a certain degree, so I guess I need to develop my own custom resources (such as CusPatient) through sushi. Then org.hl7.fhir.core generates corresponding java classes for profile files, and HAPI-FHIR generates corresponding cusPatientDao and cusPatientProvider. Based on the above, do you have any problems? Hope to answer, THANK YOU!

@zero-zero-senven
Copy link
Author

Before that, I read the HAPI-FHIR DOC, but I did not have a clear understanding of custom resources, and the document only gave extensions based on Java classes, which is probably a very tedious work, and human maintenance of StructionDefinition and Java classes is a relatively error-prone problem. Therefore, I want to use the org.hl7.fhir.core project to generate concrete java classes by profile for distribution.

@jamesagnew
Copy link
Contributor

Our current stance is that you need to hand-code custom resources for use in HAPI FHIR. It's definitely supported (and regularly tested) to ensure that you can do this, but we don't currently support any kind of automated code generation for these classes.

This is obviously tedious and clunky work (as you point out) but we don't have code generator currently as a part of the library. As @grahamegrieve points out, the generator you found isn't written with custom resources in mind, it's for building the core standard classes themselves.

I agree with you that it would be nice to have an automated generator. We would of course welcome code contributions to help make this happen, or sponsored work to help bring it to reality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants