Skip to content

Commit

Permalink
Merge pull request #1711 from sparc-request/kg-coverage_analysis_cpt_…
Browse files Browse the repository at this point in the history
…code

KG - Coverage Analysis Report Epic CPT Code
  • Loading branch information
Stuart-Johnson committed Feb 14, 2019
2 parents b0a7b50 + c7a65fe commit c31885f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions app/models/arm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,17 @@ def name=(name)
def display_line_items_visits(use_epic, display_all_services)
if use_epic
# only show the services that are set to be pushed to Epic
display_all_services ? line_items_visits.joins(:service).where(services: {send_to_epic: true}) : line_items_visits.joins(:service).where(services: {send_to_epic: true}).joins(:visits).where.not( "research_billing_qty = 0 and insurance_billing_qty = 0 and effort_billing_qty = 0" ).uniq
if display_all_services
self.line_items_visits.joins(:service).where.not(services: { cpt_code: [nil, ''] })
else
self.line_items_visits.joins(:service, :visits).where.not(services: { cpt_code: [nil, ''] }, visits: { research_billing_qty: 0, insurance_billing_qty: 0, effort_billing_qty: 0 }).distinct
end
else
display_all_services ? line_items_visits : line_items_visits.joins(:visits).where.not( "research_billing_qty = 0 and insurance_billing_qty = 0 and effort_billing_qty = 0" ).uniq
if display_all_services
self.line_items_visits
else
self.line_items_visits.joins(:visits).where.not(visits: { research_billing_qty: 0, insurance_billing_qty: 0, effort_billing_qty: 0 }).distinct
end
end
end

Expand Down

0 comments on commit c31885f

Please sign in to comment.