How to migrate hundreds of patients between 2 OpenEMRs?

I need to migrate a few hundred patients from one OpenEMR 6.1 Patch 1 system to another, ASAP. I have CCDA export/import working using the CareCorordination module on some test instances, but it only allows moving one patient at a time and even then doesn’t move their uploaded documents. What do people advise for achieving this more efficiently and thoroughly please? Do you have to script it somehow?

I read that CCDA import is improved in OpenEMR 7, in what ways is that?

Thanks in advance

Is it all of the patients from one installation to another, or is it a filtered view of the patients (IE several hundred out of several thousand)?

Several hundred out of several thousand. And there will be some new patients in the target EMR.

So I wonder if anyone has already written a custom script for this process, but what I know about OpenEMR Core this would be my thoughts on your problem. Unfortunately, I don’t know if it will work with your time constraints as you mentioned you need something ASAP, but here are my thoughts.

I’m not sure what is in the 6.1 release, but 7.0 lets you select multiple patients to export. It has pagination but I think it maxes out at 70 patients to be exported per page. We’ve fixed a number of import problems but we are in the process of finishing things on the import side for ONC certification over the next two weeks so I can’t attest to whether the bulk import on CCD-A is fully working right now in our master branch (what will become the 7.0).

The biggest problem is the uploaded patient documents which CCD-A I don’t believe currently handles even in 7.0.

Someone may have something written to do this already, but if I had to tackle your problem the only thing I could think of doing would be to use the Carecoordination to move over my patients clinical information and then use the standard api to grab the patients documents and then recreate them in my target installation. That’d probably be the quickest route without having to write something to use the API to manually transfer every single patient data point over.

Another option would be to modify the Carecoordination module to actually embed the patient documents as an Unstructured Document. Here is the specification for that CCDA Section / Component. Unstructured Document CCDA Specification.

This could be done as a URL reference element which then the Carecoordination importer would need to externally fetch and retrieve from the source system or it can be a base64 encoded version of the patient document. The URL reference approach is probably the most flexible as it can support very large document files but it has all kinds of security concerns if we were to bring something like that into core. For your use case I’d go with the base64 option if you can get away with it as I think that’d be a simpler implementation. You may need to bump up your server’s php max upload as well as your php max memory limit in order to handle the larger document sizes.

Another option would be to use the FHIR bulk exporter to grab everything. You can pass in all of your patient ids to get just the patients you want. This has the advantage of grabbing all of your patient data if there is something that doesn’t come across in your standard continuity of care document. The downside is you’d have to write something at the standard API level right now to push that data into OpenEMR.

Do you know what file formats of uploaded documents you are dealing with? What their file sizes are? Are they pdfs mostly? Larger or smaller than 1MB?

JPEG photos of docs from phones (>3 MB), PDFs, Word docs from MS Office, TIFFs. With a bit more time I can come up with more filesizes for you.

I really look forward to multiple patiet export and import in 7.0. When the code’s ready, I can setup an instance of OpenEMR in order to run a pre-release 7.0.

Using the standard API is out of my skillset. Modifying the Carecoordination module may or may not be, but I expect it would be. I’ll look at the FHIR bulk exporter.

Thanks very much for such a comprehensive answer.

1 Like