Organise Database folder / Automatically add sample data

I was wondering if we might be able to change how the database folder is organized? I would like to have a couple of folders. One for the upgrades another for sample data. I was thinking of adding a feature to flex / docker that it looks for any sample data in that folder and if there is any then adds it to the database. This would make testing and demos easier IMO. Is anyone else interested in it? Thoughts?

-Julie

Hi @Julie_b ,

Rec working this into the devtools script on the flex dockers and would leverage the mechanism that the demo farm uses (it does some sneakery by using a 5.0.0 demo database and then running the upgrade scripts on it); the demo data is rather large so would just store the file in the flex docker itself. Related issue is here:
Add Test Data Easy Docker Dev Tool · Issue #3485 · openemr/openemr · GitHub

On a related note would also be very nice to have a tool in devtools that clears the install (so can then re-install via setup.php script). Related issue is here:
Expand dev tools in the development flex dockers · Issue #243 · openemr/openemr-devops · GitHub

@Julie_b , so you don’t need to spend time looking for it, here is the sneakery that allows use of same demo data on OpenEMR 5.0.0 and higher:
demo_farm_openemr/demo_build.sh at master · openemr/demo_farm_openemr · GitHub

Not quite understanding what you’re saying… Rec?

I made a very quick and dirty bash script for docker server install, that looks in a specific folder for sql files and then runs them, I think it might be pretty easy to add it to the devtools script.

For clearing the installation are we talking just the database or also files?

hi, Sorry for the shorthand. Meant to say “recommend”
For clearing, are talking about both the database and files. This allows developers to then develop/test the install setup.php script since the easy dev docker environment skips that since it autoinstalls and/or clear demo data and/or redo demo data to test the upgrade sql scripts (ie. opens the door to lots of testing).

Quick Questions, where is devtools called from?

If want to add a bunch of synthetic patient data you can use synthea to generate a bunch of files to import.

OpenEMR has some support for CCDA. You’ll need to set up the module for it though.

The devtools is coming from this script that is added to the flex dockers:
openemr-devops/devtools at master · openemr/openemr-devops · GitHub

Note can see bunch of examples for devtools stuff here:
openemr/CONTRIBUTING.md at master · openemr/openemr · GitHub
(check out items 7, 8, and 9)

Although would take a much larger effort, working in synthea import would be awesome (I so look forward to the day, when I can import 1 million synthea patients into OpenEMR just to see what happens :smile: ).

Here is what I was thinking. Added automaticly add sql from folder if there is files in it by boxlady · Pull Request #253 · openemr/openemr-devops · GitHub

I checked out synthea (Just the data). From what I can see the table layout/properties is different. It wouldn’t be too difficult to covert CSV to SQL with a script and then add that the folder. Setting it up so that it automatically imports / generates data is something that I would need to do so research on.