Extracting descriptions from a form link item
This section provides examples of using JavaScript to extract descriptions from a form link item.
Given that the form link item Format field contains the information as shown in the image below:
It is useful to be able to extract the AETERM(s) from the Format field and populate them to a new field. This can then be used as a supportive item in medical coding.
Example code:
var merged = [].concat.apply([], CMIND_AE); function getStringBetween(str, start, end) { var result = str.match(new RegExp(start + "(.*)" + end)); return result[1]; } var supportingValues = merged.map(function(formlink){ return getStringBetween(formlink.summary, 'AE Description:', '- Date of Onset:'); }); return supportingValues; |
For more information on how to use JavaScript in Viedoc see Using JavaScript in Viedoc.