Skip to content

Commit

Permalink
Merge pull request #369 from DBCG/feature-plugins-docs
Browse files Browse the repository at this point in the history
Add doc examples
  • Loading branch information
JPercival authored Nov 18, 2021
2 parents d406cf6 + 0c8ec22 commit bc0f218
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,32 @@
import org.opencds.cqf.ruler.api.OperationProvider;
import org.springframework.beans.factory.annotation.Autowired;

import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.rest.annotation.Operation;

/**
* This is an example OperationProvider that returns a simple greeting. This is meant to be a demonstration of how to implement an OperationProvider,
* and not an actual implementation of anything. It also shows hows to use the <a href="#{@link}">{@link Description}</a> and <a href="#{@link}">{@link Operation}</a>
* annotations.
* <p>
* When implementing the operations it's important to capture the specific IG the operation is defined in. Additional, release versions should be used whenever possible.
* Please add both the appropriate Javadoc comments so that implementors have documentation when writing Java code, and also use the <a href="#{@link}">{@link Description}</a>
* annotation so that the relevant information is surfaced via the Tester UI and Swagger UI.
*/
public class HelloWorldProvider implements OperationProvider {

@Autowired
HelloWorldProperties helloWorldProperties;


/**
* Implements the $hello-world operation found in the <a href="https://www.hl7.org/fhir/clinicalreasoning-module.html">FHIR CR Module</a>
*
* @return a greeting
*/
@Description(shortDefinition = "returns a greeting", value = "Implements the $hello-world operation found in the <a href=\"https://www.hl7.org/fhir/clinicalreasoning-module.html\">FHIR CR Module</a>")
@Operation(idempotent=true, name = "$hello-world")
public OperationOutcome message() {
public OperationOutcome hello_world() {
OperationOutcome outcome = new OperationOutcome();
outcome.addIssue().setDiagnostics(helloWorldProperties.getMessage());
return outcome;
Expand Down

0 comments on commit bc0f218

Please sign in to comment.