For example, if we have some legacy database and we use a separate integration layer to comply with the FHIR specification, is there a way to implement FHIR Operations within the integration layer in a generalized way?
Are you referring to custom operations like $expand or are you referring to basic functions like ‘create’ and ‘update’?
this is about custom operations. (which having $ prefix)
Implementation of each custom operation requires custom code. Custom operations have no “computable” description of functionality, just free text. A developer needs to take that free-text description and decide how they want to implement it on their particular platform. There’s no expectation that the operation must be layered on top of the basic RESTful behaviors of search, create, update, etc. and in some cases it’ll be more efficient to bypass the RESTful interface and manipulate the underlying persistence layer directly. However, in theory, most FHIR operations should be implementable by just using the REST interface. I don’t think we’ve ever set a requirement that that must be true though.