Deb install properties or similar with consult fax enabled property set
eforms in the database
completed eforms in the database with fdid's > the number of eforms
Write a consult
attach or not a lab or eform
Fax it
Only selected results for the patient gets faxed and it is reflected in the print preview
Print preview is as expected
Rather unpredictably old eforms with small number fdid get attached that are from other patients files
In the case of one referral of a patient to an agency with attached eform specific to that agency (fid of 214)
In this case the appropriate referral eform to be attached was fid 241 but the eform fdid 214 was also attached from another patient
Another patient refered to a consultant without an attachment had an attachment of fdid=84
I suppose the work around is to print to paper and fax that, which seems a step backwards
The error is persistent and renumbering the offending fdid (s) does not solve the problem as that then gives an NPE
2019-08-21 13:15:41,327 ERROR [WKHtmlToPdfUtils:168] Error running command : [wkhtmltopdf, -s, Letter, -T, 10mm, -L, 8mm, -R, 8mm, --print-media-type, --javascript-delay, 3000, https://127.0.0.1:8443/oscar/EFormViewForPdfGenerationServlet?parentAjaxId=eforms&providerId=null&fdid=214&blankForm=true, /tmp/tomcat7-tomcat7-tmp/wkhtmltopdf.3823160654005998264.pdf]
2019-08-21 13:15:41,333 ERROR [EctConsultationFormFaxAction:385] IOException occurred inside ConsultationFormFaxAction
java.io.IOException: Cannot convert html file to pdf
Accepting without independent verification.
Peter,
The eforms that get attached are selected by querying consult docs table
Â
String sql = "SELECT * FROM eform_data e where e.patient_independent = false " +
"AND e.fdid IN (SELECT cd.document_no FROM consultdocs cd WHERE cd.requestId = '" + consultationId + "' AND cd.docType = 'E' AND cd.deleted IS NULL) " +
"ORDER BY e.form_date DESC, e.form_time DESC";
can you check if those old eforms are associated with your consult or not?
Â
I followed the code through, and don’t see any way else it would grab any other eform during the faxing action
Â
Â
Actually,
Â
The following code looks suspicious to what you are experiencing. Does you consult have an eform associated with them?
if(reqId!=null && !reqId.trim().equals("") && consultationRequestDao.getConsultation(Integer.parseInt(reqId))!=null){
ProfessionalSpecialist professionalSpecialist = consultationRequestDao.getConsultation(Integer.parseInt(reqId)).getProfessionalSpecialist();
if (professionalSpecialist!=null && professionalSpecialist.getEformId()!=null && professionalSpecialist.getEformId()!=0){
String localUri = PrintAction.getEformRequestUrl(request);
buffer = WKHtmlToPdfUtils.convertToPdf(localUri + professionalSpecialist.getEformId() + "&blankForm=true");
bis = new ByteInputStream(buffer, buffer.length);
streams.add(bis);
alist.add(bis);
Â
Â
fixed so that if you have an eform set for your professional specialist, the latest one for that patient, if found, will be send along.
Â