nl_tokens: Searches the aggregate options of a choice for the specified option .
pl_tokens: function findOptionInChoice ( choice , optionId , dataElementSpecs ) { // First look for a direct match for ( const option of choice . aggregateOptions ) { if ( optionId . equals ( option . identifier ) ) { return option ; } } // Then look for a match on one of the selected options's base types // E.g., if choice has Quantity but selected option is IntegerQuantity for ( const option of choice . aggregateOptions ) { if ( checkHasBaseType ( optionId , option . identifier , dataElementSpecs ) ) { return <mask> ; } } return null ; }