- Macros are supported for string, ref, array values, and named array values. Named array keys are not supported.
- Macro syntax is
${macro-name(value)}
- Macros are not support mixed with literal values.
- Errors evaluating macros will result in RPC request failure with
500
status code. - Unknown macros will result in an error and a
400
status code.
Good!
"parameters": {
{ "string": "${local-fileman-date(2005-01-21T07:57:00Z)}"
}
"parameters": {
{ "array": [ "true", ${local-fileman-date(2005-01-21T07:57:00Z)}", "", "patient" ]
}
"parameters": {
{
"namedArray": {
"patient":"${local-fileman-date(2005-01-21T07:57:00Z)}",
"domain":"vitals"
}
}
}
Not Good
"parameters": {
{ "string": "Today is ${local-fileman-date(2005-01-21T07:57:00Z)}"
}
"parameters": {
{
"namedArray": {
"${local-fileman-date(2005-01-21T07:57:00Z)}":"patient",
"domain":"vitals"
}
}
}
Replace a ISO-8601 date value with a localized fileman date for a targeted Vista site
MacroProcessorFactory
is autowired withMacro
instancesVistalinkRpcInvokerFactory
is autowired with aMacroProcessorFactory
. It will pass this factory along as it createsVistalinkRpcInvokers
VistalinkRpcInvoker
will use the factory to create aMacroProcessor
based on aMacroExecutionContext
that is specific to itself.VistalinkRpcInvoker
will invoke theMacroProcessor
to evaluate each value.- If the value is a macro it is processed and a new value is returned.
- If the value is not a macro, it is returned unchanged.
- Looks for macro syntax in evaluated values.
- Maps macros to their
Macro
implementation. - Invokes the
Macro.evaluate
and returns the results.
- Provides a macro-free place to execute RPCs. This allows Macros to use RPCs during the evaluation process.
Macro
implementations provide aname
that is used in for the macro in RPC requests, e.g.local-fileman-date
- Implementations may interact with RPCs through a provided execution context which allows low-level invocation.
- Connection, authentication, and error handling are performed by the
MacroExecutionContext
itself.
- Connection, authentication, and error handling are performed by the