Skip to main content
Version: v0.0.8

Function: scriptWarning()

scriptWarning(code, position): NcpdpScriptWarning

Construct a frozen NcpdpScriptWarning from a code and a position.

There is deliberately no value parameter. That absence is the whole safety property: a factory that accepts a value grows interpolation sites, and every parser in this family that leaked patient data into a log line did so through one.

Parameters

code

ScriptWarningCode

The stable warning code, which selects the message.

position

ScriptPosition

XPath-style location of the condition.

Returns

NcpdpScriptWarning

A frozen warning.

Example

scriptWarning(SCRIPT_WARNING_CODES.VERSION_ABSENT, scriptPosition("/Message"));