Need to export the actual data from these other tables not the id’s – Each record needs to have a “begin” and “end” statement- I’m only getting one record. For this one client I know there are over 800 records.
- Code: Select all
function irExport(){
var dir = scopes.file.convertToJSFile(pmsInterfaceDirectory);
if(dir && dir.exists() && dir.isDirectory()){
var irsFromEC = scopes.file.convertToJSFile(dir.getAbsoluteFile()+'/'+ir_Export_File_Name);
/** @type {JSFoundset<db:/eyecor_user_data/interpretation_report>}*/
var irs = databaseManager.getFoundSet('eyecor_user_data','interpretation_report')
irs.sort('last_name desc')
irs.loadAllRecords();
var procedure = irs.interpretation_report_to_procedures
var dr = irs.interpretation_report_to_doctors
var patient = irs.interpretation_report_to_patients
var str=''
str += 'BEGIN\r\n';
str += 'ID='+irs.interpretation_report_id+'\r\n';
str += 'LName='+patient.last_name+'\r\n'
str += 'FName='+patient.first_name+'\r\n'
str += 'ExamDate='+utils.dateFormat(irs.examdate,DATE_FORMAT)+'\r\n'
str += 'RecordedDate=' +utils.dateFormat(irs.record_date,DATE_FORMAT)+'\r\n'
str += 'CPTCode='+procedure.code+'\r\n'
str += 'CPTDescription='+procedure.description_short+'\r\n'
str += 'ClinicalFindings='+irs.clinical_findings+'\r\n'
str += 'ComparativeData='+irs.comparative_data+'\r\n'
str += 'ClinicalManagement='+irs.clinical_management+'\r\n'
str += 'DocsName='+dr.name+'\r\n'
str += 'END\r\n';
scopes.file.writeTXTFile(irsFromEC,str);
globals.DIALOGS.showInfoDialog('IRs','Exported I and Rs from EyeCOR');
}
}
I'm running Version: 6.1.6 - build 1439
Any suggestions?
Thanks in advance
Bob