<commit_before>Template.listPatients.helpers
    patientCount: -> Patients.find().count()
    patients: ->
        filter = Session.get "patientFilter"
        if filter
            Patients.find filter
        else
            Patients.find()

Template.listPatients.events
    "keyup [name=search]": (e) ->
        value = $(e.target).val()
        filter = $or: [
            { firstName: $regex: value }
            { lastName: $regex: value }
            { mrn: $regex: value }
            { shortId: $regex: value }
        ]
        Session.set "patientFilter", filter
<commit_msg>Clear patient list search after browsing. Fixes #20<commit_after>Template.listPatients.helpers
    patientCount: -> Patients.find().count()
    patients: ->
        filter = Session.get "patientFilter"
        if filter
            Patients.find filter
        else
            Patients.find()

Template.listPatients.rendered = ->
    Session.set "patientFilter", null

Template.listPatients.events
    "keyup [name=search]": (e) ->
        value = $(e.target).val()
        filter = $or: [
            { firstName: $regex: value }
            { lastName: $regex: value }
            { mrn: $regex: value }
            { shortId: $regex: value }
        ]
        Session.set "patientFilter", filter

{'fraction_non_alphanumeric': 0.12354312354312354, 'fraction_numerical': 0.001554001554001554, 'mean_word_length': 1.9272727272727272, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 10, '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': '7046591', 'n_tokens_mistral': 367, 'n_tokens_neox': 354, 'n_words': 83}