Skip to content

Instantly share code, notes, and snippets.

@henrymazza
Last active December 16, 2021 17:50
Show Gist options
  • Save henrymazza/91cf85b1dacb5affae356023aa179715 to your computer and use it in GitHub Desktop.
Save henrymazza/91cf85b1dacb5affae356023aa179715 to your computer and use it in GitHub Desktop.

Payload for ML

ClientReferral

  [6] pry(main)> ClientReferral.last(100).first

  ClientReferral Load (17.8ms)  SELECT "client_referrals".* FROM "client_referrals" ORDER BY "client_referrals"."id" DESC LIMIT $1  [["LIMIT", 100]]

#<ClientReferral:0x000000011dbb1250> {
                             :id => 318940,
                     :aasm_state => "processing",
                     :created_at => Thu, 18 Nov 2021 02:47:54 UTC +00:00,
                     :updated_at => Thu, 18 Nov 2021 02:48:12 UTC +00:00,
              :stripe_card_token => nil,
             :stripe_customer_id => nil,
                 :internal_match => false,
                         :filter => {
        "query" => {
                                             "ages" => [
                [0] 2798
            ],
                                        "associate" => false,
                                        "locations" => [
                [0] {
                       "lat" => "40.0149856",
                       "lng" => "-105.2705456",
                    "radius" => 25
                }
            ],
                                      "specialties" => [
                [0] 2881,
                [1] 2877,
                [2] 2869,
                [3] 2846
            ],
                                 "matching_enabled" => true,
                                "accepting_clients" => true,
                                "location_accesses" => true,
                             "telehealth_preferred" => false,
                        "enabled_matching_networks" => [
                [0] 19
            ],
                      "exclude_past_notified_limit" => true,
            "any_provider_network_matching_enabled" => true
        }
    },
                      :form_data => {},
                          :issue => {},
                        :clients => {},
                         :config => {
                                "automatch" => true,
                                "time_zone" => "America/Denver",
                             "max_contacts" => 25,
                           "accept_timeout" => 60,
                         "auto_cancel_days" => 8,
                       "block_accept_count" => 5,
                       "block_notify_count" => 10,
                   "distance_search_expand" => 10,
                   "distance_search_radius" => 15,
                  "accept_schedule_timeout" => 24,
               "distance_search_expand_max" => 25,
            "automatch_providers_min_count" => 2,
        "pending_referral_auto_cancel_days" => 10
    },
             :contact_first_name => "Jess-313983",
              :contact_last_name => "Schoen-313983",
                  :contact_email => "[email protected]",
                  :contact_phone => "7205136681",
            :contact_sms_allowed => false,
                 :insurance_name => nil,
            :insurance_plan_name => nil,
               :insurance_number => nil,
                :insurance_group => nil,
    :insurance_holder_first_name => nil,
     :insurance_holder_last_name => nil,
                   :referral_key => "de4f78c66dd1502141b0",
              :persona_client_id => 307423,
              :contact_birthdate => Sat, 02 Oct 1993,
                      :gender_id => 222,
             :contact_cell_phone => "7205136681",
                    :notified_at => Thu, 18 Nov 2021 02:47:54 UTC +00:00,
                    :can_contact => false,
                    :canceled_at => nil,
                 :notified_count => 1,
                :referral_source => nil,
               :admin_touched_at => nil,
           :send_reminder_emails => true,
              :pending_stated_at => nil,
              :pending_reason_id => nil,
                      :ad_medium => nil,
                  :ad_track_date => nil,
        :form_wizard_response_id => 3012040,
              :external_referral => nil,
       :external_referral_search => nil,
         :external_referral_date => nil,
                    :lat_lng_zip => "72907-0537",
                   :lat_lng_city => "Caryton",
                  :lat_lng_state => "AK",
               :lat_lng_geo_data => {},
                           :tags => [],
                   :needs_review => false,
              :backfill_eligible => true
}

Members

  [18] pry(main)> cc = ClientReferral.last(rand(10000)).first.members

  ClientReferral Load (297.8ms)  SELECT "client_referrals".* FROM "client_referrals" ORDER BY "client_referrals"."id" DESC LIMIT $1  [["LIMIT", 4150]]
  ClientReferralMember Load (7.2ms)  SELECT "client_referral_members".* FROM "client_referral_members" WHERE "client_referral_members"."client_referral_id" = $1  [["client_referral_id", 314890]]
  
[
    [0] #<ClientReferralMember:0x00000001080dfa30> {
                                     :id => 803330,
                     :client_referral_id => 314890,
                            :notified_at => Sun, 14 Nov 2021 23:43:34 UTC +00:00,
                            :declined_at => Sun, 14 Nov 2021 23:47:02 UTC +00:00,
                            :accepted_at => nil,
                                   :note => nil,
                             :aasm_state => "declined",
                             :created_at => Sun, 14 Nov 2021 23:43:34 UTC +00:00,
                             :updated_at => Sun, 14 Nov 2021 23:47:02 UTC +00:00,
             :provider_rematch_reason_id => 3100,
                             :patient_id => nil,
                           :block_number => 1,
                           :scheduled_at => nil,
                             :expired_at => nil,
                           :referral_key => "dcf76e9a8cefcfc5b58f",
                    :persona_provider_id => 2755,
              :last_contact_attempted_at => nil,
                       :contact_attempts => 0,
                           :search_order => nil,
                           :timed_out_at => nil,
                       :persona_admin_id => nil,
                :notification_delayed_at => nil,
        :manual_match_client_notified_at => nil
    },
    [1] #<ClientReferralMember:0x00000001080df080> {
                                     :id => 803329,
                     :client_referral_id => 314890,
                            :notified_at => Sun, 14 Nov 2021 23:43:34 UTC +00:00,
                            :declined_at => nil,
                            :accepted_at => Tue, 16 Nov 2021 06:04:15 UTC +00:00,
                                   :note => nil,
                             :aasm_state => "accepted",
                             :created_at => Sun, 14 Nov 2021 23:43:33 UTC +00:00,
                             :updated_at => Tue, 16 Nov 2021 06:04:15 UTC +00:00,
             :provider_rematch_reason_id => nil,
                             :patient_id => nil,
                           :block_number => 1,
                           :scheduled_at => nil,
                             :expired_at => nil,
                           :referral_key => "e5f32ffc600b4805a185",
                    :persona_provider_id => 3327,
              :last_contact_attempted_at => nil,
                       :contact_attempts => 0,
                           :search_order => nil,
                           :timed_out_at => nil,
                       :persona_admin_id => nil,
                :notification_delayed_at => nil,
        :manual_match_client_notified_at => nil
    },
    [2] #<ClientReferralMember:0x00000001080de6d0> {
                                     :id => 803358,
                     :client_referral_id => 314890,
                            :notified_at => Sun, 14 Nov 2021 23:54:26 UTC +00:00,
                            :declined_at => nil,
                            :accepted_at => Wed, 17 Nov 2021 04:45:25 UTC +00:00,
                                   :note => nil,
                             :aasm_state => "accepted",
                             :created_at => Sun, 14 Nov 2021 23:54:25 UTC +00:00,
                             :updated_at => Wed, 17 Nov 2021 04:45:25 UTC +00:00,
             :provider_rematch_reason_id => nil,
                             :patient_id => nil,
                           :block_number => 1,
                           :scheduled_at => nil,
                             :expired_at => nil,
                           :referral_key => "37b2798f284314f8ad9e",
                    :persona_provider_id => 4767,
              :last_contact_attempted_at => nil,
                       :contact_attempts => 0,
                           :search_order => nil,
                           :timed_out_at => nil,
                       :persona_admin_id => nil,
                :notification_delayed_at => nil,
        :manual_match_client_notified_at => nil
    }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment