<commit_before><commit_msg>Added Risk Category/Assessment datatype support<commit_after>###
@namespace scoping into the CQL_QDM namespace
###
@CQL_QDM ||= {}


###
Data elements that meet criteria using this datatype should document the use of
tools and calculators (indicated by the QDM category and its corresponding
value set) that suggest vulnerabilities for any given patient. This datatype
should be used with the QDM Attribute result to specify criteria related to the
actual result.
###
class CQL_QDM.RiskCategoryAssessment extends CQL_QDM.QDMDatatype
  constructor: (@entry) ->
    super @entry
    @_negationRationale = @entry.negationRationale
    @_result = @entry.result
    @_startDatetime = @entry.start_time
    @_stopDatetime = @entry.end_time

  ###
  @returns {Code}
  ###
  negationRationale: ->
    cql.Code(@_negationRationale.code, @_negationRationale.code_system)

  ###
  @returns {Code}
  ###
  result: ->
    cql.Code(@_result.code, @_result.code_system)

  ###
  @returns {Date}
  ###
  startDatetime: ->
    cql.DateTime.fromDate(moment.utc(@_startDatetime, 'X').toDate())

  ###
  @returns {Date}
  ###
  stopDatetime: ->
    cql.DateTime.fromDate(moment.utc(@_stopDatetime, 'X').toDate())

{'fraction_non_alphanumeric': 0.12049180327868853, 'fraction_numerical': 0.0, 'mean_word_length': 4.402654867256637, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5325215', 'n_tokens_mistral': 398, 'n_tokens_neox': 393, 'n_words': 99}