Skip to content

Fix Occupational Medicine payment option mapping - check both linkIds#5899

Draft
Copilot wants to merge 2 commits intodevelopfrom
copilot/fix-payer-selection-bug
Draft

Fix Occupational Medicine payment option mapping - check both linkIds#5899
Copilot wants to merge 2 commits intodevelopfrom
copilot/fix-payer-selection-bug

Conversation

Copy link
Contributor

Copilot AI commented Jan 20, 2026

Occupational Medicine visits use payment-option-occupational linkId in the questionnaire, but the harvest zambda only checked for payment-option, causing the payment option to default to "Self" instead of the selected "Employer".

Changes

  • sub-intake-harvest/index.ts: Updated payment option extraction to check both payment-option and payment-option-occupational linkIds
// Before
const paymentOption = flattenedPaperwork.find(
  (response: QuestionnaireResponseItem) => response.linkId === 'payment-option'
)?.answer?.[0]?.valueString;

// After  
const paymentOption = flattenedPaperwork.find(
  (response: QuestionnaireResponseItem) => 
    response.linkId === 'payment-option' || response.linkId === 'payment-option-occupational'
)?.answer?.[0]?.valueString;

This ensures the payment variant is correctly extracted and stored in the Encounter extension for both regular visits and Occupational Medicine visits.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • downloads.sentry-cdn.com
    • Triggering command: /usr/local/bin/node node ./scripts/install.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>EHR. Occupational Medicine. Payer/Responsible for Claim displays 'Self' selected, when patient selected 'Employer' option during paperwork.</issue_title>
<issue_description>Tested on:

  • ENV [testing], Version [1.26.0]
  • Browser [Chrome]

Steps To Reproduce:

  1. Book Occupational Medicine visit
  2. Select payment 'Employer'
  3. Complete paperwork
  4. Go to 'Visit details' in the EHR
  5. Check 'Payer/Responsible for Claim'

Expected behavior

'Employer' should be selected

Actual behavior

'Self' is selected

Screenshots/Video

image.png</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: saewitz <48358905+saewitz@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix payer selection issue in occupational medicine paperwork Fix Occupational Medicine payment option mapping - check both linkIds Jan 20, 2026
Copilot AI requested a review from saewitz January 20, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments