Has any one got a program to export specific layout based forms and lists

teryhill wrote on Monday, June 22, 2015:

It appears to have worked

– MySQL dump 10.13 Distrib 5.5.32, for Win32 (x86)

– Host: localhost Database: openemr


– Server version 5.5.32
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE /;
/
!40103 SET TIME_ZONE=’+00:00’ /;
/
!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 /;
/
!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0
/;
/
!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=‘NO_AUTO_VALUE_ON_ZERO’ /;
/
!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;


– Dumping data for table list_options

– WHERE: list_id = ‘lbfnames’ AND option_id = ‘LBFmtbi’

INSERT INTO list_options (list_id, option_id, title, seq, is_default
, option_value, mapping, notes, codes, toggle_setting_1, toggle_setti ng_2) VALUES (‘lbfnames’,‘LBFmtbi’,‘Mild Traumatic Brain Injury’,22,0,0,’’,’’,’
',0,0);
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE /;
/
!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS /;
/
!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS /;
/
!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

– Dump completed on 2015-06-22 19:31:35

mdsupport wrote on Tuesday, June 23, 2015:

If you need, you can check out this utility. May be it should be included in the standard codebase in case someone needs it.

To be sure: it does not handle lists or plugins.

teryhill wrote on Tuesday, June 23, 2015:

Thanks I will look in to it.

Terry

Sent from my iPhone

On Jun 22, 2015, at 11:02 PM, MD Support mdsupport@users.sf.net wrote:

If you need, you can check out this utility. May be it should be included in the standard codebase in case someone needs it.

To be sure: it does not handle lists or plugins.


Has any one got a program to export specific layout based forms and lists


Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/openemr/discussion/202506/

To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

teryhill wrote on Tuesday, June 23, 2015:

Rod:
any Ideas why it worked from the command line and will not work from the program?

Thanks
Terry

sunsetsystems wrote on Tuesday, June 23, 2015:

Perhaps it’s the perl part that’s not working? Is perl installed? Check interface/main/backup.php (“if ($form_step == 102) …”) to see what’s done. Obviously we need some better error messages.

Rod
http://www.sunsetsystems.com/

teryhill wrote on Tuesday, June 23, 2015:

Rod:

It looks like you only have the perl code in place for the tables. I put a couple of statements in to echo ‘$cmd’ and ‘$dumppfx’ and they are just what I am getting in the export file.

I can run perl from the command line by just typing in perl and it waits until I exit it.

Hope this helps

Terry

sunsetsystems wrote on Tuesday, June 23, 2015:

Note that $cmd is built as a long command line including perl stuff. What you want to do is execute the whole thing at the command prompt to see what happens.

Rod
http://www.sunsetsystems.com/

teryhill wrote on Tuesday, June 23, 2015:

This is the only section of code with the perl stuff.

if ($tables) {
  $cmd .= "$mysql_dump_cmd -u " . escapeshellarg($sqlconf["login"]) .
    " -p" . escapeshellarg($sqlconf["pass"]) .
    " --opt --quote-names " .
    escapeshellarg($sqlconf["dbase"]) . " $tables" .
    " | $perl -pe 's/ DEFAULT CHARSET=utf8//i; s/ collate[ =][^ ;,]*//i;'" .
    " >> $EXPORT_FILE;";
}

Terry

sunsetsystems wrote on Tuesday, June 23, 2015:

Not sure what you’re getting at. I believe that code would be run if you’re exporting specific lists or layouts. Isn’t that what you are doing? If not, get whatever is generated for exec() and try it at the command prompt.

Rod
http://www.sunsetsystems.com/

teryhill wrote on Tuesday, June 23, 2015:

I am selecting a list to export. The selection does not have a ‘table’ checked just the list selected.

the generated command is as follows

‘SET character_set_client = utf8;’ ;echo “DELETE FROM list_options WHERE list_id = ‘Birth_Control_Before’;” ;echo “DELETE FROM list_options WHERE list_id = ‘lists’ AND option_id = ‘Birth_Control_Before’;” ;C:/xampp/mysql/bin\mysqldump -u “openemr” -p"escargot" --skip-opt --quote-names --complete-insert --no-create-info --where=“list_id = ‘lists’ AND option_id = ‘Birth_Control_Before’ OR list_id = ‘Birth_Control_Before’” “openemr” list_options ;

If you run it from the command line it will tells you that SET is not a valid command.

Hope this helps

Thank you for your help

Terry

sunsetsystems wrote on Tuesday, June 23, 2015:

Doesn’t make sense. Look at this line in the code:

$cmd = "echo 'SET character_set_client = utf8;' > $EXPORT_FILE;";

So the generated commands should start with “echo”.

You’ll need to do some debugging.

Rod
http://www.sunsetsystems.com/

teryhill wrote on Tuesday, June 23, 2015:

C:\xampp\mysql\bin\mysqldump -u “openemr” -p"escargot" --opt --qu
ote-names “openemr” fee_sheet_options | C:\xampp\perl\bin\perl -pe ‘s/ DEFAULT
CHARSET=utf8//i; s/ collate[ =][^ ;,]*//i;’ >> C:\Users\terry\AppData\Local\Temp
/openemr_config.sql;
Can’t find string terminator “’” anywhere before EOF at -e line 1.
mysqldump: Got errno 22 on write

Does this help?

sunsetsystems wrote on Wednesday, June 24, 2015:

Well you finally have an error message. :slight_smile:

Kinda odd though because I do see a closing “’” in the “-e” argument. It’s all one line, right? If so, it seems to raise the question of whether this perl version supports a single -e argument with multiple statements in it.

Try this:

perl -e 'print "hi there\n";'

and then

perl -e 'print "hi "; print "there\n";'

They should give the same result.

Rod
http://www.sunsetsystems.com/

teryhill wrote on Wednesday, June 24, 2015:

You ain’t gonna like this

C:\Users\terry> perl -e ‘print “hi there\n”;’
Can’t find string terminator “’” anywhere before EOF at -e line 1.

C:\Users\terry>perl -e ‘print "hi "; print “there\n”;’
Can’t find string terminator “’” anywhere before EOF at -e line 1.

sunsetsystems wrote on Wednesday, June 24, 2015:

Kinda looks like your perl is broken. But just for grins try this too:

perl -e 'print "hi there\n"'

Rod
http://www.sunsetsystems.com/

teryhill wrote on Wednesday, June 24, 2015:

nope same thing

sunsetsystems wrote on Wednesday, June 24, 2015:

http://www.ask-coder.com/1803026/why-am-i-getting-cant-find-string-terminator-anywhere-before-eof-at-e-line-1-when-i-try-to-run-a-perl-one-liner-on-windows

Bottom line seems to be that Windows creates a vacuum. :slight_smile:

So… maybe it could be fixed by rewriting the code to reverse the single and double quotes. Start with this as a test:

perl -e "print 'hi '; print 'there\n';"

Rod
http://www.sunsetsystems.com/

teryhill wrote on Wednesday, June 24, 2015:

On the right track

C:\Users\terry>perl -e “print 'hi '; print ‘there\n’;”
hi there\n
C:\Users\terry>

sunsetsystems wrote on Wednesday, June 24, 2015:

So the \n escape didn’t work… ok try:

perl -e "print \"hi \"; print \"there\n\";"

Rod
http://www.sunsetsystems.com/

teryhill wrote on Wednesday, June 24, 2015:

better

C:\Users\terry>perl -e "print "hi “; print “there\n”;”
hi there

C:\Users\terry>