Skip to content

Commit

Permalink
fold writable directories into documents directory (openemr#2254)
Browse files Browse the repository at this point in the history
  • Loading branch information
bradymiller committed Mar 10, 2019
1 parent 3e9669d commit 5b05151
Show file tree
Hide file tree
Showing 24 changed files with 134 additions and 136 deletions.
22 changes: 6 additions & 16 deletions Documentation/INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ certain files and directories. The files include
openemr/sites/default/sqlconf.php and
openemr/interface/modules/zend_modules/config/application.config.php.
In linux, these can be set by "chmod a+w filename"
command to grant global write permissions to the file. The directories include
openemr/sites/default/edi, openemr/sites/default/era, openemr/sites/default/documents,
openemr/sites/default/letter_templates. In
command to grant global write permissions to the file. The directory includes
openemr/sites/default/documents. In
linux, if the webserver user name is "apache", then the command
"chown -R apache:apache directory_name" will grant global write permissions
to the directories, and we recommend making these changes permanent.
Expand Down Expand Up @@ -194,17 +193,16 @@ is set to a correct value that will work on your system.

Step 6 gives instructions on configuring the Apache web server. We suggest
you print these instructions for future reference. Instructions are given to
secure the "openemrwebroot/sites/*/documents",
"openemrwebroot/sites/*/edi" and "openemrwebroot/sites/*/era"
directories, which contain patient information. This can
be done be either placing pertinent .htaccess files in these directories
secure the "openemrwebroot/sites/*/documents"
directory, which contain patient information. This can
be done be either placing pertinent .htaccess files in this directory
or by editing the apache configuration file. The location of the apache
configuration file is dependent on the operating system. In linux, you can
type 'httpd -V' on the commandline; the location to the configuration file
will be the HTTPD_ROOT variable plus the SERVER_CONFIG_FILE variable.
In windows, the XAMPP 1.7.0 package places the configuration file at
xampp\apache\conf\httpd.conf. To configure Zend and to secure the /documents,
/edi and /era directories you can paste following to the end of the apache
directory you can paste following to the end of the apache
configuration file (ensure you put full path to directories):
<Directory "openemrwebroot">
AllowOverride FileInfo
Expand All @@ -216,14 +214,6 @@ AllowOverride None
order deny,allow
Deny from all
</Directory>
<Directory "openemrwebroot/sites/*/edi">
order deny,allow
Deny from all
</Directory>
<Directory "openemrwebroot/sites/*/era">
order deny,allow
Deny from all
</Directory>

The final screen includes some additional instructions and important
information. We suggest you print these instructions for future reference.
Expand Down
48 changes: 24 additions & 24 deletions Documentation/Readme_edihistory.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<!--
README_edihistory.html
Copyright 2016 Kevin McCormick <kevin@records>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
Expand Down Expand Up @@ -47,10 +47,10 @@ <h3>README Claim History Project</h3>
This applies to version 2 of my edi_history project. <strong>Use at your own risk.</strong> The intended use is for health care facilities only. The scripts in this project are intended to create a system for managing x12 edi files. These are the mysterious x12 format data files known as 837 Claim, 835 Payment, 270 Benefit Inquiry, 271 Benefit Response, 276 Claim Status Inquiry, 277/277CA Claim Status, and 278 Authorization; and do not forget 999 Acknowledgement. (The 824 type is not dealt with, but if anyone gets these, it should not be too hard to interpret.) These are the &quot;Health Care&quot; types used for billing and insurance information. The prior version had scripts for certain proprietary formats, but this version is x12 format only.
</p>
<p>
In order to best use these scripts, you must diligently upload all your edi files using the &quot;New Files&quot; tab. Of course, in order to upload you must first download. In order to download, you must complete some registrations, obtain accounts with usernames and passwords, and configure OpenEMR with the information for your x12 partner(s).
In order to best use these scripts, you must diligently upload all your edi files using the &quot;New Files&quot; tab. Of course, in order to upload you must first download. In order to download, you must complete some registrations, obtain accounts with usernames and passwords, and configure OpenEMR with the information for your x12 partner(s).
</p>
<p>
Since the information in the EDI files is <strong>HIPAA protected</strong>, do not use these scripts on a public server! (or any computer where access is not restricted) The files and tables are stored in the OpenEMR directory under &quot;openemr/sites/[sitedir]/edi/history/&quot; Use the OpenEMR access control scheme to determine which users can use the scripts, probably &quot;accounting&quot;. The files and contained information will be as secure as your OpenEMR installation.
Since the information in the EDI files is <strong>HIPAA protected</strong>, do not use these scripts on a public server! (or any computer where access is not restricted) The files and tables are stored in the OpenEMR directory under &quot;openemr/sites/[sitedir]/edi/history/&quot; Use the OpenEMR access control scheme to determine which users can use the scripts, probably &quot;accounting&quot;. The files and contained information will be as secure as your OpenEMR installation.
</p>
<p><em>Upgrade</em><br />
The &quot;upgrade&quot; process consists of renaming existing .csv files to <em>old_[files|claims]_[type].csv</em> and moving the existing &quot;era&quot; files to the newly created &quot;f835&quot; directory. This is handled by the <em>csv_setup()</em> function in <em>edih_csv_inc.php</em>. Otherwise, the only actons are the creation of the new directories. If you want the <em>/history/</em> directory to be clear of old cruft, then you can manually delete or move the &quot;old&quot; csv files under the <em>/csv</em> directory and also remove the <em>era</em>, <em>text</em>, <em>ibr</em>, <em>ebr</em>, and <em>dpr</em> directories, if present. Do not delete any of the following directories: archive, csv, f270, f271, f276, f277, f278, f835, f997, log, or tmp.
Expand All @@ -67,7 +67,7 @@ <h3>README Claim History Project</h3>
Click EDI History in left nav (setup script will run. Check the log under the Notes tab)<br />
Now copy your existing x12 edi files into their respective directories. Note [ftype] will be like f277, f835, f997, etc.<br />
<pre><code>
cp [/path/to/mydir]/history/[ftype]/* /var/www/htdocs/openemr/sites/[sitedir]/edi/history/[ftype]/<br />
cp [/path/to/mydir]/history/[ftype]/* /var/www/htdocs/openemr/sites/[sitedir]/documents/edi/history/[ftype]/<br />
</code></pre>
Repeat for each file type, but do not copy the csv files. <br />
&nbsp;&nbsp;&ndash; the dpr, text, ebr, ibr types are no longer used, so don't bother.<br />
Expand All @@ -80,7 +80,7 @@ <h3>README Claim History Project</h3>
Verify file ownership and permissions. (example: owner apache, group apache)<br />
The directories permissions should be &quot;0755&quot; (&quot;drwxr-xr-x&quot;) and x12 files &quot;0400&quot; (&quot;-r--------&quot;)<br />
<pre><code>
cd /var/www/htdocs/openemr/sites/[sitedir]/edi/history<br />
cd /var/www/htdocs/openemr/sites/[sitedir]/documents/edi/history<br />
chown apache:apache [ftype]/*<br />
chmod 0400 [ftype]/*<br />
</code></pre>
Expand Down Expand Up @@ -146,7 +146,7 @@ <h3>File Locations:</h3>

<p>
Installed files:
</p>
</p>
<ul>
<li>/openemr/Documentation
<ul>
Expand Down Expand Up @@ -179,7 +179,7 @@ <h3>File Locations:</h3>
<li>edih_271_code_class.php</li>
<li>edih_835_code_class.php</li>
<li>edih_997_codes.php</li>
</ul>
</ul>
<li>/openemr/library/css</li>
<ul>
<li>edi_history_v2.css</li>
Expand All @@ -192,7 +192,7 @@ <h3>File Locations:</h3>
<li>/library/js/jquery-ui-1.10.4.custom/js/</li>
<ul>
<li>jquery-1.10.2.min.js</li>
<li>jquery-ui-1.10.4.custom.min.js</li>
<li>jquery-ui-1.10.4.custom.min.js</li>
</ul>
<li>/library/js/jquery-ui-1.10.4.custom/custom-theme/css/</li>
<ul>
Expand All @@ -202,16 +202,16 @@ <h3>File Locations:</h3>
<ul>
<li>jquery.dataTables.min.css</li>
<li>dataTables.jqueryui.min.css</li>
</ul>
</ul>
</ul>
</ul>
</ul>
<p>
The <em>csv_setup()</em> function creates a file storage directory tree: </br>
&nbsp;&nbsp; openemr/sites/[sitedir]/edi/history </br>
&nbsp;&nbsp; openemr/sites/[sitedir]/documents/edi/history </br>
with subdirectories: archive csv f270 f271 f276 f277 f278 f835 f997 log tmp
</p>
<p>
and these csv files under: /openemr/sites/[sitedir]/edi/history/csv</br>
and these csv files under: /openemr/sites/[sitedir]/documents/edi/history/csv</br>
&nbsp;&nbsp; claims_[ftype].csv files_[ftype].csv tables are created for each file type on first appearance
</p>
<p>
Expand All @@ -225,20 +225,20 @@ <h3>File Locations:</h3>
near line 82 (after the &quot;if (elems[0] == 'ST') { }&quot; block)
</p>
<pre><code>
// add this mod
// add this mod
if ($elems[0] == 'BHT') {
// give each claim a unique BHT number,: isa-control-num and st-num are concatenated
//
$bat_content .= str_replace("*0123*", sprintf("*%s%04d*", $bat_icn, $bat_stcount), $seg) . "~";
//
$bat_content .= str_replace("*0123*", sprintf("*%s%04d*", $bat_icn, $bat_stcount), $seg) . "~";
continue;
}

</code></pre>
<p>
The EDI methods and files are cryptic and mysterious. The formats are definitely not what I would call
user-friendly. The contents and meaning of the various files, loops, and segments may be better understood
with serious research. There are so called &quot;Companion Documents&quot; published by some insurance companies
and possibly by your clearinghouse. Search for &quot;X12 835 837 277 999 Companion Document&quot; and see if you find
user-friendly. The contents and meaning of the various files, loops, and segments may be better understood
with serious research. There are so called &quot;Companion Documents&quot; published by some insurance companies
and possibly by your clearinghouse. Search for &quot;X12 835 837 277 999 Companion Document&quot; and see if you find
anything useful.
</p>
</div>
Expand Down
28 changes: 7 additions & 21 deletions Documentation/help_files/openemr_installation_help.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,9 @@

<p><?php echo ("In the day to day working of the application certain files are created by the application and stored in the web server document root directory. Files like faxes, images etc. are constantly being uploaded to the application");?>.

<p><?php echo ("To facilitate this process the following directories should be writable by the web server (Apache)"); ?>:
<p><?php echo ("To facilitate this process the following directory should be writable by the web server (Apache)"); ?>:
<ul>
<li><strong>/var/www/html/openemr/sites/default/documents</strong> - <?php echo ("where all scanned documents etc are stored"); ?></li>
<li><strong>/var/www/html/openemr/sites/default/edi</strong> - <?php echo ("saves transmitted electronic batches for various kinds"); ?></li>
<li><strong>/var/www/html/openemr/sites/default/era</strong> - <?php echo ("saves output from automated remittance (X12 835) processing. This includes archived remittance files, and copies of the generated HTML reports"); ?></li>
<li><strong>/var/www/html/openemr/sites/default/letter_templates</strong> - <?php echo ("sample empty letter template"); ?></li>
<li><strong>/var/www/html/openemr/sites/default/documents</strong> - <?php echo ("where all files etc are stored"); ?></li>
</ul>

<p><?php echo ("These files need to have owner and user set to the Apache user. In Linux the Apache user and owner are 'www-data' in Ubuntu and Debian, 'apache' in Redhat, Fedora and CentOS , 'nobody' is a generic user and group name that is used by other applications as well");?>.
Expand Down Expand Up @@ -366,9 +363,7 @@

<p><?php echo ("They are"); ?>:
<ul>
<li><strong>/var/www/html/openemr/sites/default/documents</strong> - <?php echo ("where all scanned documents etc are stored"); ?></li>
<li><strong>/var/www/html/openemr/sites/default/edi</strong> - <?php echo ("saves transmitted electronic batches for various kinds"); ?></li>
<li><strong>/var/www/html/openemr/sites/default/era</strong> - <?php echo ("saves output from automated remittance (X12 835) processing. This includes archived remittance files, and copies of the generated HTML reports"); ?></li>
<li><strong>/var/www/html/openemr/sites/default/documents</strong> - <?php echo ("where all files etc are stored"); ?></li>
</ul>
<p><?php echo ("It will also ask you to add some data to the Apache configuration file to make the Zend Framework work better");?>.

Expand All @@ -394,7 +389,7 @@

<p><?php echo ("macOS Server 5 websites - /Library/Server/Web/Config/apache2/server-httpd.conf");?>.

<p><?php echo ("To configure Zend and to secure the /documents, /edi and /era directories you can paste following to the end of the apache configuration file");?>:
<p><?php echo ("To configure Zend and to secure the /documents directory you can paste following to the end of the apache configuration file");?>:

<pre>
&lt;Directory &quot;openemrwebroot&quot;&gt;
Expand All @@ -407,12 +402,6 @@
&lt;Directory &quot;openemrwebroot/sites/*/documents&quot;&gt;
&nbsp;&nbsp;Require all denied
&lt;/Directory&gt;
&lt;Directory &quot;openemrwebroot/sites/*/edi&quot;&gt;
&nbsp;&nbsp;Require all denied
&lt;/Directory&gt;
&lt;Directory &quot;openemrwebroot/sites/*/era&quot;&gt;
&nbsp;&nbsp;Require all denied
&lt;/Directory&gt;
</pre>

<p><?php echo ("The 'openemrwebroot' is the directory in which the OpenEMR scripts exist on the web server");?>.
Expand Down Expand Up @@ -527,12 +516,9 @@

<p><i class="fa fa-exclamation-triangle oe-text-red" aria-hidden="true"></i> <?php echo ("IMPORTANT: If you do not do this the setup script for a fresh install will be executed when you log in to OpenEMR with the potential for massive data loss");?>.

<p><strong><?php echo ("Step 4");?></strong> - <?php echo ("The following directories containing patient information should however be copied from the old version to the new version"); ?>:
<p><strong><?php echo ("Step 4");?></strong> - <?php echo ("The following directory contains patient information should however be copied from the old version to the new version"); ?>:
<ul>
<li><?php echo ("openemr/sites/default/documents - scanned documents, images etc"); ?></li>
<li><?php echo ("openemr/sites/default/era - electronic remittance advice files"); ?></li>
<li><?php echo ("openemr/sites/default/edi - transmitted electronic batches for various kinds"); ?></li>
<li><?php echo ("openemr/sites/default/letter_templates - customized letters"); ?></li>
<li><?php echo ("openemr/sites/default/documents - files, documents, images etc"); ?></li>
</ul>

<p><?php echo ("If there are other files that you have customized, then you will also need to customize those files in the current version");?>.
Expand Down Expand Up @@ -583,7 +569,7 @@

<p><?php echo ("The non-database data for each individual site will reside in the 'sites' directory under a sub-directory bearing the name of the site, i.e if your first multiuser site was called 'multi1' then the setup script will create a directory by the name of 'multi1' in the 'sites' directory"); ?>.

<p><?php echo ("This directory will contain several directories that will hold unique site-specific patient information, 'documents', 'era', 'edi' and 'letter_templates' as well as the site-specific files 'config.php' and 'sqlconf.php'"); ?>.
<p><?php echo ("This directory will contain a directory that will hold unique site-specific patient information, 'documents', as well as the site-specific files 'config.php' and 'sqlconf.php'"); ?>.

<p><?php echo ("In addition it will contain other directories - 'images' and 'LBF', and files - faxtitle.eps , referral_template.html, clickoptions.txt, faxcover.txt and statement.inc.php which will not contain patient information but can be customized as per the site requirement"); ?>.

Expand Down
Loading

0 comments on commit 5b05151

Please sign in to comment.