Article
· Sep 7 1m read

Getting those hyphens ( - ) in (or out) of your custom FHIR operation

Often times when working with FHIR data, for example with IRIS For Health, you'll find it useful to create a custom FHIR operation. The FHIR Standard comes with a set of defined operations (such as $everything) but a custom operation comes in handy when you need to create some extra functionality that goes beyond the set of standard FHIR operations. The docs take you step-by-step (though this comment may be helpful to those of you just getting started). One thing I would highlight, purely for aesthetic purposes, is how to syntactically name your function such that you can call it with hyphens. The docs do explain it:

If your operation contains a hyphen (-), just remove the hyphen from the method name. For example, if the system-wide operation is $my-operation, name the method FHIRSystemOpMyOperation.

though I'll just make it more explicit here:

For a hyphen-less operation, for example $thisismyoperation, then name your method FHIRSystemOpThisismyoperation (yes, the "T" in "This" must be capital).

 

If you wish instead for your operation to be $this-is-my-operation, your method should be FHIRSystemOpThisIsMyOperation. (The capital letter gets translated to needing a hyphen beforehand).

Discussion (0)1
Log in or sign up to continue