<commit_before><commit_msg>fix: when deleting patient records, also delete appointsments, payments, invoice line items and proc charges<commit_after>import Ember from 'ember';
import PouchDbMixin from 'hospitalrun/mixins/pouchdb';

export default Ember.Mixin.create(PouchDbMixin, {
  getPatientAppointments: function(patient) {
    var patientId = patient.get('id');
    var maxValue = this.get('maxValue');
    return this.store.query('appointment', {
      options: {
        startkey: [patientId, null, null, 'appointment_'],
        endkey: [patientId, maxValue, maxValue, maxValue]
      },
      mapReduce: 'appointments_by_patient'
    })
  }
});
{'fraction_non_alphanumeric': 0.11638591117917305, 'fraction_numerical': 0.0, 'mean_word_length': 4.404958677685951, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5196640', 'n_tokens_mistral': 202, 'n_tokens_neox': 197, 'n_words': 48}