Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add doc examples #369

Merged
merged 1 commit into from
Nov 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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