I was able to create a script that imported encounters that were lost during three days of data loss. The problem I am experiencing is that new encounters are being created with the same encounter numbers that I brought in. I looked through the code and it seems that OpenEMR doesn’t check for an existing encounter number, it just created one with the number it thinks it should. Is there a way to prevent OpenEMR from creating encounters that have the same encounter number as the ones I imported?
I have tracked the code down to the following line of code in encounter_events.inc
I could really use some advice here. How would I import these encounters and not compromise new data coming in?