I may be wrong but that line does not look like it changes at all. I looked up str_pad and all it does is add padding to the 000000001 that never changes.
$input = “Alien”;
echo str_pad($input, 10); // produces "Alien "
This may be an easy fix. What if there was a
use OpenEMR\Common\Database\QueryUtils;
Inside the createISA() add
public static function ediSenquence()
{
//Query the edi_sequence number and return that value
$sql = "select id from edi_sequence";
return QueryUtils::fetchRecords($sql);
}
$control = self::eidSequence();
$ISA[13] = str_pad($control['id'], 9, " "); // INTERCHANGE CONTROL NUMBER
Question, does the sequence number have to be nine digits?
How does this look to you?