Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added date and active filters, new codes, and some basic type matchin… #38

Merged
merged 1 commit into from
Sep 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions app/assets/javascripts/provider-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ $(() => {
updateProviderCity({ target: { value: $('#city-input').val() } });
updateProviderSpecialty({ target: { value: $('#specialty-select').val() } });
updateProviderName({ target: { value: $('#name-input').val() } });
updateProviderActiveDate({ target: { value: $('#active-input').val() } });
updateProviderActive({ target: { value: $('#is-active-input').val() } });
}
});

Expand Down Expand Up @@ -70,6 +72,15 @@ const updateProviderName = function (event) {
updateProviderSearchParam(event, 'name');
};

const updateProviderActive = function (event) {
console.log("in here!");
updateProviderSearchParam(event, 'active');
}

const updateProviderActiveDate = function (event) {
providerParams['date'] = 'le' + event.target.value + '&date=ge' + event.target.value;
};

const submitProviderSearch = function (_event) {
const params = Object.entries(providerParams)
.filter(([key, value]) => value && value.length > 0)
Expand Down
6 changes: 5 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ def good_response(response)
].freeze

INDIVIDUAL_AND_GROUP_SPECIALTIES = [
{ value: '101200000X', name: 'Drama Therapist' },
{ value: '101Y00000X', name: 'Counselor' },
{ value: '101YA0400X', name: 'Addiction (Substance Use Disorder) Counselor' },
{ value: '101YM0800X', name: 'Mental Health Counselor' },
Expand Down Expand Up @@ -611,6 +612,7 @@ def good_response(response)
{ value: '171000000X', name: 'Military Health Care Provider' },
{ value: '1710I1002X', name: 'Independent Duty Corpsman' },
{ value: '1710I1003X', name: 'Independent Duty Medical Technicians' },
{ value: '171400000X', name: 'Health & Wellness Coach' },
{ value: '171100000X', name: 'Acupuncturist' },
{ value: '171M00000X', name: 'Case Manager/Care Coordinator' },
{ value: '171R00000X', name: 'Interpreter' },
Expand Down Expand Up @@ -831,6 +833,7 @@ def good_response(response)
{ value: '2084B0002X', name: 'Obesity Medicine (Psychiatry & Neurology) Physician' },
{ value: '2084B0040X', name: 'Behavioral Neurology & Neuropsychiatry Physician' },
{ value: '2084D0003X', name: 'Diagnostic Neuroimaging (Psychiatry & Neurology) Physician' },

{ value: '2084F0202X', name: 'Forensic Psychiatry Physician' },
{ value: '2084H0002X', name: 'Hospice and Palliative Medicine (Psychiatry & Neurology) Physician' },
{ value: '2084N0008X', name: 'Neuromuscular Medicine (Psychiatry & Neurology) Physician' },
Expand Down Expand Up @@ -1044,6 +1047,7 @@ def good_response(response)
{ value: '2472R0900X', name: 'Renal Dialysis Technician' },
{ value: '2472V0600X', name: 'Veterinary Technician' },
{ value: '247ZC0005X', name: 'Clinical Laboratory Director (Non-physician)' },
{ value: '342000000X', name: 'Transportation Network Company' },
{ value: '363A00000X', name: 'Physician Assistant' },
{ value: '363AM0700X', name: 'Medical Physician Assistant' },
{ value: '363AS0400X', name: 'Surgical Physician Assistant' },
Expand Down Expand Up @@ -1322,7 +1326,7 @@ def good_response(response)
{ value: '320600000X', name: 'Residential Treatment Facility, Mental Retardation and/or Developmental Disabilities' },
{ value: '320700000X', name: 'Residential Treatment Facility, Physical Disabilities' },
{ value: '320800000X', name: 'Community Based Residential Treatment Facility, Mental Illness' },
{ value: '320900000X', name: 'Community Based Residential Treatment Facility, Mental Retardation and/or Developmental Disabilities' },
{ value: '320900000X', name: 'Intellectual and/or Developmental Disabilities Community Based Residential Treatment Facility' },
{ value: '322D00000X', name: 'Residential Treatment Facility, Emotionally Disturbed Children' },
{ value: '323P00000X', name: 'Psychiatric Residential Treatment Facility' },
{ value: '324500000X', name: 'Substance Abuse Rehabilitation Facility' },
Expand Down
6 changes: 4 additions & 2 deletions app/controllers/providers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def search
.each_with_object(base_params) do |(local_key, fhir_key), search_params|
search_params[fhir_key] = modifiedparams[local_key]
end
# binding.pry
# binding.pry
@bundle = @client.search(
FHIR::PractitionerRole,
search: { parameters: query }
Expand Down Expand Up @@ -140,7 +140,9 @@ def roles
zipcode: 'location.address-postalcode',
city: 'location.address-city',
specialty: 'specialty',
name: 'practitioner.name'
name: 'practitioner.name',
date: 'date',
active: 'active'
}.freeze

end
5 changes: 5 additions & 0 deletions app/views/providers/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
<input id="city-input" type="text" class="form-control bg-dark text-white" placeholder="Cambridge" onkeyup="updateProviderCity(event)">
<label for="name-input">Name</label>
<input id="name-input" type="text" class="form-control bg-dark text-white" onkeyup="updateProviderName(event)">
<label for="active-input">Active On</label>
<input id="active-input" type="date" class="form-control bg-dark text-white" onkeyup="updateProviderActiveDate(event)">
<label for="is-active-input">Show only currently active plans</label>
<input id="is-active-input" type="checkbox" value="true" onclick="updateProviderActive(event)">
<br>

<button id="provider-search-button", class="btn btn-outline-success" onclick="submitProviderSearch(event)">
Find
Expand Down