# Patient Insurance History Build

**URL:** <https://community.open-emr.org/t/patient-insurance-history-build/17416>\
**Category:** OpenEMR Development\
**Tags:** infrastructure\
**Created:** [November 10, 2021, 12:20am UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416 "2021-11-10T00:20:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![juggernautsei](https://community.open-emr.org/user_avatar/community.open-emr.org/juggernautsei/32/10764_2.png) [@juggernautsei](https://community.open-emr.org/u/juggernautsei)\
**Post date:** [November 10, 2021, 12:20am UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/1 "2021-11-10T00:20:13Z")

</div>

We (OEMR) need a patient insurance history manager.

A patient has to change primary insurance at the beginning of the year. The current primary insurance has open claims that are still pending payment. If that outstanding claim is rejected after the primary insurance has been changed in the patients’ chart. The previous insurance information needs to be re-entered to reprocess that encounter.

In the current insurance\_data table, we can add a column inactive. Adding that column will allow for the current primary insurance to be left in the table but not shown in the patients’ dashboard. New primary insurance can be added without overwriting the previous primary insurance. A mechanism would have to be built to manage the insurance history and be able to reactivate old primary insurance.

Any thoughts would be greatly appreciated.

I am kind of hoping someone has already built this and is willing to share it with the community.

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [November 10, 2021, 1:56am UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/2 "2021-11-10T01:56:04Z")

</div>

Hi @juggernautsei , I thought the effective date entry can help here. Even the billing manager can use that date to pull the insurance info. Just tested at [OpenEMR Login](https://eight.openemr.io/c/openemr/interface/login/login.php?site=default) and [OpenEMR Login](https://eleven.openemr.io/a/openemr/interface/login/login.php?site=default)

---

<div class="post-metadata">

**Author:** ![juggernautsei](https://community.open-emr.org/user_avatar/community.open-emr.org/juggernautsei/32/10764_2.png) [@juggernautsei](https://community.open-emr.org/u/juggernautsei)\
**Post date:** [November 11, 2021, 7:53pm UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/3 "2021-11-11T19:53:10Z")

</div>

@stephenwaite What happens when the patients’ primary insurance company is changed? Will the effective date pull up the previous insurance company?

This is difficult to test on the demo system because there needs to be a claim that has been rejected after the patients’ primary insurance has changed from what it was when the claim was submitted?

---

<div class="post-metadata">

**Author:** ![dmnlbh](https://community.open-emr.org/letter_avatar_proxy/v4/letter/d/e99b99/32.png) [@dmnlbh](https://community.open-emr.org/u/dmnlbh)\
**Post date:** [December 5, 2022, 2:45pm UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/4 "2022-12-05T14:45:54Z")

</div>

I thought I would revisit this topic, as we are running into similar issues as Sherwin. We need to update insurances fairly regularly, especially for Medicaid recipients here in North Carolina, who can move to a new Medicaid provider at the end of a month.

Thought: I like the idea of having a history of all insurances that can have both an effective date And and end date. I think they system works in that when a new effective date is added, it replaces the old insurance. I think accessible historical date would be very helpful from a billing perspective. Otherwise, I feel like our day to day users lose this data. I don’t this capability exists, but I would be interested in having it as a user.

Lastly, can someone confirm that if a new insurance with a new effective date is added then the new insurance becomes the primary insurance in the billing manager. Just wanted to confirm for our admin staff before making changes. And is there a way to pull the old insurance info from the database? Sometimes we do need this data and it seems to go away visually when insurance is updated.

---

<div class="post-metadata">

**Author:** ![juggernautsei](https://community.open-emr.org/user_avatar/community.open-emr.org/juggernautsei/32/10764_2.png) [@juggernautsei](https://community.open-emr.org/u/juggernautsei)\
**Post date:** [December 5, 2022, 5:22pm UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/5 "2022-12-05T17:22:54Z")

</div>

@dmnlbh  
I am working on something close to this.  
I had a request to be able to switch the insurance companies status from primary to secondary.

Have you tried to use the track anything feature in the system to track insurance changes?

 ![image](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/3X/d/4/d42fc7681db315653e90a6f6c4c16e8a2c386d10.png)

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [December 6, 2022, 4:59pm UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/6 "2022-12-06T16:59:03Z")

</div>

here’s the [comment for the logic](https://github.com/openemr/openemr/blob/master/library/patient.inc.php#L1290-L1295) that affects insurance data

probably best to revisit and only insert new data while giving an admin the power to delete a record

---

<div class="post-metadata">

**Author:** ![juggernautsei](https://community.open-emr.org/user_avatar/community.open-emr.org/juggernautsei/32/10764_2.png) [@juggernautsei](https://community.open-emr.org/u/juggernautsei)\
**Post date:** [December 6, 2022, 6:34pm UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/7 "2022-12-06T18:34:42Z")

</div>

@stephenwaite, I read the comments that patient include file.  
What are your thoughts on the requested feature?

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [December 6, 2022, 6:50pm UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/8 "2022-12-06T18:50:44Z")

</div>

I think it can be done without adding an end date and then creating a delete button for admins only.

Currently the billing manager does a smart look up based on effective date and date of encounter 🙂

---

<div class="post-metadata">

**Author:** ![juggernautsei](https://community.open-emr.org/user_avatar/community.open-emr.org/juggernautsei/32/10764_2.png) [@juggernautsei](https://community.open-emr.org/u/juggernautsei)\
**Post date:** [December 7, 2022, 12:02pm UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/9 "2022-12-07T12:02:43Z")

</div>

@dmnlbh  
How do you envision this feature insurance history working for you?  
I was working with a company that did DME. They had a need to switch between insurance companies making one primary for one claim then making the other primary for another claim.  
What is your use case?

---

<div class="post-metadata">

**Author:** ![dmnlbh](https://community.open-emr.org/letter_avatar_proxy/v4/letter/d/e99b99/32.png) [@dmnlbh](https://community.open-emr.org/u/dmnlbh)\
**Post date:** [December 7, 2022, 2:52pm UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/10 "2022-12-07T14:52:51Z")

</div>

We have frequent situations where clients change insurances, especially for Medicaid. In our state (NC), there are multiple plans that can be changed usually at the beginning of a month. We need to update the insurance that is active/primary, as well as see what the past history of insurances are for potential previous billing/follow up and submitting/outstanding claims under the previous insurance.

Case example: Many clients will change insurance at the end of a year 12/31 with new insurance starting 1/1. There might be outstanding claims needing to be paid from the previous year after the new insurance takes effect.

I envisioned the end date noting a period of time for coverage that is still viewable in the system. I’m not sure if that is accomplished with the smart look up that @stephenwaite was referring to. I’d love to know how to do that if is shows us a history.

---

<div class="post-metadata">

**Author:** ![juggernautsei](https://community.open-emr.org/user_avatar/community.open-emr.org/juggernautsei/32/10764_2.png) [@juggernautsei](https://community.open-emr.org/u/juggernautsei)\
**Post date:** [December 7, 2022, 6:17pm UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/11 "2022-12-07T18:17:25Z")

</div>

@dmnlbh for the use case and vision.

I hope @stephenwaite can enlighten us on how the smart lookup works and if there is GUI side to the smart lookup feature.

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [December 7, 2022, 7:41pm UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/12 "2022-12-07T19:41:37Z")

</div>

the smart lookup is embedded in the query in the [billing\_report script](https://github.com/openemr/openemr/blob/master/interface/billing/billing_report.php#L1116-L1122)

it looks for the latest primary insurance whose effective date is less than the date of encounter

the GUI side is how the “old” insurances are displayed in the demographics which need a little spiffing like for the “until present”

 ![Screenshot from 2022-12-07 14-40-44](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/3X/3/4/3451e42f00769a19edcb8bd9a1ddd308653f6afc.png)

 ![Screenshot from 2022-12-07 14-42-06](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/3X/5/2/523cbdddb96a142ffaf450e0e53b1b4c62208e83.png)

---

<div class="post-metadata">

**Author:** ![juggernautsei](https://community.open-emr.org/user_avatar/community.open-emr.org/juggernautsei/32/10764_2.png) [@juggernautsei](https://community.open-emr.org/u/juggernautsei)\
**Post date:** [December 8, 2022, 11:24am UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/13 "2022-12-08T11:24:00Z")

</div>

@stephenwaite how many “past/old” insurances will the system track this way?

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [December 8, 2022, 5:16pm UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/14 "2022-12-08T17:16:54Z")

</div>

the db will store them ad infinitum if the logic for the delete is changed, there’s also [this bug](https://github.com/openemr/openemr/issues/5953) which is affecting the display too

---

<div class="post-metadata">

**Author:** ![dmnlbh](https://community.open-emr.org/letter_avatar_proxy/v4/letter/d/e99b99/32.png) [@dmnlbh](https://community.open-emr.org/u/dmnlbh)\
**Post date:** [December 8, 2022, 6:21pm UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/15 "2022-12-08T18:21:17Z")

</div>

would i need to run the entire billing query you cited to get that information or can I pull out the section highlighted?

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [December 8, 2022, 6:23pm UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/16 "2022-12-08T18:23:42Z")

</div>

once a cpl things are done the info will be viewable on the dashboard

---

<div class="post-metadata">

**Author:** ![KenSchae](https://community.open-emr.org/user_avatar/community.open-emr.org/kenschae/32/17482_2.png) [@KenSchae](https://community.open-emr.org/u/KenSchae)\
**Post date:** [December 8, 2022, 8:35pm UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/17 "2022-12-08T20:35:21Z")

</div>

I’ll throw you another curve …

We are a mental health practice with both Psychiatric (medical) providers and Psychotherapists. Many patients have one insurance for the medical and a different insurance for the therapy. I see this a lot with my BCBS patients. BCBS will cover only the medical visits, and Optum is covering the therapy visits.

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [December 8, 2022, 8:43pm UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/18 "2022-12-08T20:43:54Z")

</div>

could do something custom in the billing report to look at taxonomy of rendering provider

---

<div class="post-metadata">

**Author:** ![juggernautsei](https://community.open-emr.org/user_avatar/community.open-emr.org/juggernautsei/32/10764_2.png) [@juggernautsei](https://community.open-emr.org/u/juggernautsei)\
**Post date:** [December 8, 2022, 8:45pm UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/19 "2022-12-08T20:45:01Z")

</div>

I have seen this curve ball before. A practice like your would need to be able to set the primary insurance on the fly. The biller should know which insurance should go on the claim at the time the batching process takes place. DME has the same issue. There are software packages that has that ability to change the insurance in what we call the billing manager.  
The switch that I am building should take care of that ability to easily switch the listed insurances between primary and so on. But now I need to go change it to list all of the insurances in the table.

---

<div class="post-metadata">

**Author:** ![juggernautsei](https://community.open-emr.org/user_avatar/community.open-emr.org/juggernautsei/32/10764_2.png) [@juggernautsei](https://community.open-emr.org/u/juggernautsei)\
**Post date:** [December 26, 2022, 3:53pm UTC](https://community.open-emr.org/t/patient-insurance-history-build/17416/20 "2022-12-26T15:53:09Z")

</div>

@stephenwaite  
Could you help me out a minute? Is there something in globals that need to be enable to get the smart lookup to work? (Video has not sound. I didn’t feel like talking. =)

[![](https://img.youtube.com/vi/CPMdTNE4u-4/maxresdefault.jpg "Insurance gone wrong: not getting the smart look up") ](https://www.youtube.com/watch?v=CPMdTNE4u-4)

This is a test patient in our system. I changed the insurance to a new primary insurance. But the smart lookup did not show. Does smart lookup only show if the insurance has been used in a claim?

[Next page](https://community.open-emr.org/t/patient-insurance-history-build/17416.md?page=2)
