keithlofstrom wrote on Friday, March 09, 2012:
Thanks for all the postings about CSV patient data import so far … but the suggestions are either incomplete, I’m missing something, I’m misconfigured, … etc.
When I try to import, I get an
. . . “Invalid parameter for CSV import: Fields enclosed by” . . .
error, as shown, with no indication of what it thinks the fields are enclosed by.
I am using OpenEMR 4.1 .
I want to import a list of 1143 patients - I have 10 parameters to go into the patient_data table (insurance companies and patient insurance will be next). I use linux, and Perl for manipulating text. I did the suggested creation of a few example patients (George Jetson, Fname Lname, etc.) with different fields included and omitted to see what gets toggled, then exporting the CSV and examining it. Most of the 83 fields are blank, some are my data, some are dates and fields and a few NULLs added by openemr somewhere.
Here are two example exported lines of CSV data, default settings for the export:
“7”;“Mr.”;“SpaceSpeak”;;“George”;“Jetson”;“J”;“2091-11-21”;“ContAddr”;“99961”;“ContCity”;“OS”;“USA”;“987654321”;“999-99-9999”;“Occupation”;;;;;“22”;“married”;“EmergencyContact”;“2012-03-08 13:22:00”;“Male”;;;“2”;“ContactEmail”;;“amer_ind_or_alaska_native”;“not_hisp_or_latin”;“Interpreter Fred”;“Not Migrant”;“147”;“789.01”;“Not Homeless”;“2444-04-14 00:00:00”;“7”;“7”;“User Def 1”;“User Def 2”;“User Def 3”;“User Def 4”;“NO”;“YES”;“YES”;;“NO”;“YES”;;“0”;“Patient”;;;;;;;;;;;;;;;;“standard”;NULL;NULL;“NO”;NULL;“eligible”;“MothersName”;“Guardian”;“YES”;“NO”;“NO”;“NO”;“0000-00-00 00:00:00”;“Not Dead Yet”;NULL
“8”;;;;“Ftest”;“LTest”;“Mtest”;“2043-12-01”;“Street Address”;“99991”;“Orbit City”;“OS”;“USA”;;“987-65-4321”;;;;;;“0”;;;“2012-03-09 08:59:23”;“Male”;;;“2”;;;;;;;;;;“0000-00-00 00:00:00”;“8”;“8”;;;;;;;;;;;;“0”;;;;;;;;;;;;;;;;;“standard”;NULL;NULL;“NO”;NULL;;;;;;;;“0000-00-00 00:00:00”;;NULL
The second line resembles the data I have to feed in. I don’t have S.S. for everyone, and some of the zip codes are zip+4.
I’ve frobbed this a few dozen times, different delimiters or none, filling in the blank fields with “” , removing the \. and trying that. The data is pretty well scrubbed. So I assume I am missing something basic.
I could start over and learn about SQL and format my input records that way, I suppose, but I prefer to make CSV work, then document the heck out of the process on the wiki for future users who aren’t Perl coders.
OpenEMR needs a book. I’ve sold articles to software magazines; perhaps when I finish the book I am writing now, I can help write the OpenEMR book. A lot more setup, debug, and maintenance information must be made explicit and accessible to the average IT geek, perhaps (horrors) the average small practice doctor.