I’m currently working on hapi fhir using eclipse IDE. and I want to add in my own REST APIs.
I would like to ask where should I place the REST API that I will be making? I wanted it to coexist with the /create, /update etc. that hapi fhir is using for the JSON files.
Can you explain what you mean by “your own REST APIs”? Are you talking about FHIR-conformant custom operations or something completely outside the FHIR spec? (Note that FHIR doesn’t use /create or /update in its URL conventions.)
I was thinking of making a separate API that has it’s own JSON format that saves the data it gets to a database. I was under the impression that the /create, /update etc in the Controller.Java in the hapi fhir main library are APIs.
If you’re defining custom JSON, then you’re outside the FHIR standard and outside what HAPI is set up to support directly. You’re of course free to create whatever APIs you like, but you can’t call them “FHIR” unless they use the FHIR syntax (and you can’t call them RESTful FHIR unless they use the FHIR URI syntax).
The same place you’d start writing a custom API? You might be able to leverage a tiny bit of HAPI’s code, but most of it will be custom. I guess part of the question is - why do you want to use HAPI to write a custom API?