Scanned notes error--"mkdir return

docbda wrote on Saturday, March 03, 2012:

I received this error after importing the “scanned notes” folder into OEMR.  I have 4.1.0 that I just installed a few days ago on a WAMP5 server.  I did a search in the forums for this, but all the posts were old and on prior versions of OEMR.  I took a peek at the code and it looks like the image directory is automatically created if it doesn’t exist (although I am not a programmer).  Is this an issue with permissions?  Am I supposed to put a path statement somewhere?  Do I need to run a patch?  What am I missing?

Thanks in advance for the help

Blake

docbda wrote on Sunday, March 04, 2012:

mkdir returned 1:

sorry…error didn’t show up in the title of the thread

sunsetsystems wrote on Sunday, March 04, 2012:

Yes most likely a permissions problem.  The web server needs permission to create directories under sites/<site ID>/documents/  within the OpenEMR installation directory.  By the way the software is named OpenEMR, not OEMR.

Rod
www.sunsetsystems.com

docbda wrote on Sunday, March 04, 2012:

Rod,

On researching the permissions issue, I have found that Windows, unlike Unix, doesn’t use permissions per se.  I did, however, attempt to change the folder options (while logged into windows with admin privileges) for “sites/<site ID>/documents/” from “read only,” in folder properties both under the general tab as well as the security tab, but the changes revert back to read only (as in I can’t get the changes to save).  I also tried changing the folder attributes via the command line, but this didn’t work either.  I changed the sharing attributes for the folders as well-to include “read and write for everyone,” but this did nothing.  Googling this issue revealed much frustration out there concering the inability to change folders from “read only” in Windows, but no workable solution.  This is interesting, however, because multiple people are saying that permissions in Windows is a non-issue because windows doesn’t use them.

It is my understanding (although limited), that the <directory> commands in the Apache config file only limit access to directories for peeps logged on to the server, and do not affect the web server’s ability to create or write to a directory.  Also, looking through the PHP.ini file didn’t turn up anything.

Any other suggestions? 

BTW these forums are impressive.  I haven’t had to wait for more than a few hours (usually less) for a response to a question.

Blake

docbda wrote on Sunday, March 04, 2012:

Also, I did apply the 4-1-0-patch 7, but this did not affect the problem.

Blake

sunsetsystems wrote on Monday, March 05, 2012:

Oh, Windows.  The scanned_notes form does not seem to be Windows-friendly - specifically it invokes “mkdir” which is not a Windows command.  You’ll need a developer to fix that for you.

Rod
www.sunsetsystems.com

aethelwulffe wrote on Monday, March 05, 2012:

WHAT???  Uh, sorry, but the scanned notes form works fine on windows, and mkdir is indeed a windows/dos command.

aethelwulffe wrote on Monday, March 05, 2012:

What steps did you take to install the form (exactly)?  Have you installed other forms from the contrib folder before?

sunsetsystems wrote on Monday, March 05, 2012:

Sorry, I should have said the mkdir command executed by the scanned_notes form is not valid for Windows.  Maybe it will do something for someone, but on my Win 7 system it will fail for two reasons:

1. Use of forward slashes in the path.
2. “mkdir -p …” creates a directory named “-p”, and the second time you do that it will fail because that directory already exists.

Maybe you are executing mkdir from a Cygwin install?

Rod
www.sunsetsystems.com

docbda wrote on Monday, March 05, 2012:

Yes, I installed the example xml input file, communication_log.xml,  using the xml form generator and it worked fine.

The steps I used were as follows:
1.  copied the scanned_notes folder from the contrib/forms folder to interface/forms folder
2.  Logged into OpenEMR and went to admin>other>forms
3.  “Scanned Notes” appears under “Unregistered”
4.  Clicked “register,”  “Scanned Notes” now appears under “registered”
5.  Clicked “install DB” followed by “disabled”
6.  Under a New Encounter for a test patient, “Scanned Notes” appears under the “Miscellaneous” tab
7.  Click “Scanned Notes” and bring up the Scanned Notes form.
8.  Browse to a .pdf test file.
9.  Click Save
10.  mkdir rterned 1:

5. 

docbda wrote on Wednesday, March 07, 2012:

Rod and Art,  you guys ever come to a conclusion on whether the scanned notes form is compatible with Windows?

Blake

sunsetsystems wrote on Wednesday, March 07, 2012:

I’m sticking to my story. :slight_smile:

Rod
www.sunsetsystems.com

zhhealthcare wrote on Wednesday, March 07, 2012:

Try the following

edit new.php file in the folder and replace the following section

// If the patient’s encounter image directory does not yet exist, create it.
  if (! is_dir($imagedir)) {
   $tmp0 = exec(“mkdir -p ‘$imagedir’”, $tmp1, $tmp2);
   if ($tmp2) die(“mkdir returned $tmp2: $tmp0”);
   exec(“touch ‘$imagedir/index.html’”);
  }
  // Remove any previous image files for this encounter and form ID.

With

// If the patient’s encounter image directory does not yet exist, create it.
if(!is_dir($imagedir))
{
if (!mkdir($imagedir, 0777, true))
{
die(‘Failed to create folders…’);
}
chmod($imagedir, 0777);
}
//---------------------------------------------

Eldho
Zh Healthcare

aethelwulffe wrote on Wednesday, March 07, 2012:

Actually, I posted here, but perhaps my post has mysteriously gone missing.  The scanned notes form in the contrib folder is not functional.  I don’t know what happened to it.  I AM USING THE SCANNED NOTES FORM and have been, on a windows server2003 install, and testing it on XP daily.
Get the same version I am using here:  http://starfrontiers.org/oemr/scanned_notes.zip.  It is indeed different from what is in the contrib folder.  I would not have much faith in things in the contrib folder.

docbda wrote on Thursday, March 08, 2012:

Eldho,

Making your changes returned the following error:
“convert -density 96 ‘C:\wamp\tmp\phpEF9D.tmp’ ‘C:/wamp/www/sites/default/documents/2/encounters/6_2.jpg’” returned 4:

Blake

docbda wrote on Thursday, March 08, 2012:

Art,

I tried to go to the link you provided, but it looks like your server was down-or at least I could not connect.

Blake

sunsetsystems wrote on Thursday, March 08, 2012:

“convert” comes from ImageMagick, which is required.  Do you have that installed?  See www.imagemagick.org.

Rod
www.sunsetsystems.com

aethelwulffe wrote on Thursday, March 08, 2012:

docbda,

Sorry, our ISP is doing area (ahem) “upgrades”.  It >should< be up for a while.  Have another go.

gutiersa wrote on Tuesday, March 13, 2012:

Hi:

Incidentally I had also been trying out this form.
I downloaded above and replaced the non-working form with it.
I still does not work for me.

when I send I get

path to documents folder/####/encounters

at the browser window which is plain white and  remains open instead of taking me back to the openemr fax/scan window.
the encounter folder does not get made.
In the patient chart, at the visit screen, under “scanned notes” it is just blank.

I would love to be able to use this tool, because I write my notes.
It is cumbersome for the other doctor in my practice to change to documents to open and read my previous notes then back to the visit to document his own note.

gutiersa wrote on Tuesday, March 13, 2012:

BTW:

freebsd 9.0 release
apache22
myslq5.5.21
php5
openemr 4.1.0_7

user for documents folder is apache (ie www:www)

sandra