hapi-fhir-jpaserver-starter
hapi-fhir-jpaserver-starter copied to clipboard
How to access the Database with the daoRegistry to create / read / update resources in custom functions on the server?
We are writing custom APIs to extend the functionality of the FHIR server. We are able to use the client
IGenericClient fhirClient = ctx.newRestfulGenericClient(serverBase);
to create, read and modify resources. But It seems wrong to use the RestfulClient when we are the same server.. Is there some documentation around using the daoRegistry?
cc: @joiskash
We've never really written any specific documentation on how to use the DaoRegistry (pull requests against the docs would certainly be appreciated!) but FWIW we have done this a lot internally, and I know lots of other HAPI FHIR users do this as well.
Ok thanks @jamesagnew . Just a quick question though, is it ok to use the fhirClient like this ? We have basically added new services and controllers to the hapi-fhir-jpaserver-starter. Within those services we initialize the fhirClient using the docker network ip. And use it to create / update resources etc. I also asked this question in zulip chat, pasting the link below for your reference!
https://chat.fhir.org/#narrow/stream/179166-implementers/topic/Logical.20element.20flow