Skip to content

Commit

Permalink
Add support for additional data during CQL evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
ndegwamartin committed Jan 31, 2024
1 parent 99c5b9c commit e967dcd
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,40 @@ internal constructor(
return evaluateLibrary(libraryUrl, null, parameters, expressions)
}

/**
* The function evaluates a FHIR library against the database.
*
* NOTE: The API may internally result in a blocking IO operation. The user should call the API
* from a worker thread or it may throw [BlockingMainThreadException] exception.
*
* @param libraryUrl the url of the Library to evaluate
* @param patientId the Id of the patient to be evaluated, if applicable
* @param parameters list of parameters to be passed to the CQL library, if applicable
* @param additionalData Bundle of additional resources to be passed to the CQL library, if
* applicable
* @param expressions names of expressions in the Library to evaluate. If null the result contains
* all evaluations or variables in library.
* @return a Parameters resource that contains an evaluation result for each expression requested.
* Or if expressions param is null then result contains all evaluations or variables in given
* library.
*/
@WorkerThread
fun evaluateLibrary(
libraryUrl: String,
patientId: String?,
parameters: Parameters?,
additionalData: IBaseBundle?,
expressions: Set<String>?,
): IBaseParameters {
return libraryProcessor.evaluate(
/* url = */ libraryUrl,
/* patientId = */ patientId,
/* parameters = */ parameters,
/* additionalData = */ additionalData,
/* expressions = */ expressions,
)
}

/**
* The function evaluates a FHIR library against the database.
*
Expand Down

0 comments on commit e967dcd

Please sign in to comment.