<commit_before>define ['angular', 'underscore.string'], (ng, _s) ->
  clinical = ng.module 'qiprofile.clinical', []

  clinical.factory 'Clinical', ->
    # @param encounter the clinical encounter
    # @returns the augmented clinical encounter object 
    extend: (encounter) ->
      # Add the title virtual property.
      Object.defineProperties encounter,
        # @return 'Surgery' for a surgery encounter,
        #   otherwise return the encounter class 
        title:
          get: ->
            if _s.endsWith(@_cls, 'Surgery') then 'Surgery' else @_cls
      
      # Return the augmented clinical encounter object.
      encounter
<commit_msg>Add isSurgery method.<commit_after>define ['angular', 'underscore.string'], (ng, _s) ->
  clinical = ng.module 'qiprofile.clinical', []

  clinical.factory 'Clinical', ->
    # @param encounter the clinical encounter
    # @returns the augmented clinical encounter object 
    extend: (encounter) ->
      # @return whether this is a surgery encounter
      encounter.isSurgery = -> _s.endsWith(@_cls, 'Surgery')

      # Add the title virtual property.
      Object.defineProperties encounter,
        # @return 'Surgery' for a surgery encounter,
        #   otherwise return the encounter class 
        title:
          get: ->
            if @isSurgery() then 'Surgery' else @_cls
      
      # Return the augmented clinical encounter object.
      encounter

{'fraction_non_alphanumeric': 0.09978917779339423, 'fraction_numerical': 0.0, 'mean_word_length': 2.660668380462725, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '1858458', 'n_tokens_mistral': 387, 'n_tokens_neox': 366, 'n_words': 125}