New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New dictation modernazation #818
Changes from 15 commits
5b8a752
6540378
551ab56
55576d3
dfc7adf
0981412
75f79de
6818c37
7d103bd
3e2d009
e2ab3e1
5084ea8
92f63ec
3b93b49
777a2b1
87357b3
d08959b
af662e0
1a70cf6
c064b8e
fc2d761
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/** | ||
* Drag and Drop file uploader. | ||
* | ||
* Copyright (C) 2017 Sherwin Gaddis sherwingaddis@gmail.com | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are trying to standardize our docblocks. Examples here http://www.open-emr.org/wiki/index.php/How_to_Document_Your_Code_Properly#Examples_for_OpenEMR |
||
* | ||
* LICENSE: 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, see <http://opensource.org/licenses/gpl-license.php>. | ||
* | ||
* @package OpenEMR | ||
* @author Sherwin Gaddis sherwingaddis@gmail.com | ||
*/ | ||
|
||
$patient_id = filter_input(INPUT_GET, 'patient_id'); | ||
$category_id = filter_input(INPUT_GET, 'parent_id'); | ||
|
||
|
||
$sanitize_all_escapes=true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This functionality has been removed, remove 25, 26 |
||
$fake_register_globals=false; | ||
|
||
require_once("../globals.php"); | ||
require_once(dirname(__FILE__) . "/../../library/documents.php"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think '$GLOBALS["srcdir"]' would point to the library folder There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually $scrdir will do the job. |
||
|
||
if (!empty($_FILES)) { | ||
|
||
$name = $_FILES['file']['name']; | ||
$type = $_FILES['file']['type']; | ||
$tmp_name = $_FILES['file']['tmp_name']; | ||
$size = $_FILES['file']['size']; | ||
$owner = $GLOBALS['userauthorized']; | ||
|
||
|
||
addNewDocument($name,$type,$tmp_name,$error,$size,$owner,$patient_id_or_simple_directory=$patient_id,$category_id, | ||
$higher_level_path='',$path_depth='1'); | ||
|
||
} | ||
|
||
?> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need for closing tag here |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,50 @@ | ||
<!-- Form generated from formsWiz --> | ||
<?php | ||
/** | ||
* Dictation Form | ||
* | ||
* @package OpenEMR | ||
* @link http://www.open-emr.org | ||
* @author Sherwin Gaddis <sherwingaddis@gmail.com> | ||
* @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 | ||
* @copyright Copyright (c) 2017 Sherwin Gaddis <sherwingaddis@gmail.com> | ||
* | ||
*/ | ||
|
||
|
||
|
||
use OpenEMR\Core\Header; | ||
|
||
include_once("../../globals.php"); | ||
include_once("$srcdir/api.inc"); | ||
formHeader("Form: dictation"); | ||
$returnurl = 'encounter_top.php'; | ||
?> | ||
<html><head> | ||
<?php html_header_show();?> | ||
<link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css"> | ||
<html> | ||
<head> | ||
<?php Header::setupHeader(); ?> | ||
<script type="text/javascript" src="<?php echo $webroot."/library/custom_template/ckeditor/ckeditor.js" ?>"</script> | ||
<script src="<?php echo $webroot."/library/custom_template/ckeditor/_samples/sample.js" ?>" type="text/javascript"></script> | ||
<link href="<?php echo $webroot."/library/custom_template/ckeditor/_samples.css"; ?>" rel="stylesheet" type="text/css" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. after you rebase your code to the most recent codebase, then you will use the ckeditor that is in public/assets/ |
||
</head> | ||
<body class="body_top"> | ||
<form method=post action="<?php echo $rootdir;?>/forms/dictation/save.php?mode=new" name="my_form"> | ||
<span class="title"><?php echo xlt('Speech Dictation'); ?></span><br><br> | ||
<span class=text><?php echo xlt('Dictation: '); ?></span><br><textarea cols=80 rows=24 wrap=virtual name="dictation" ></textarea><br> | ||
<span class=text><?php echo xlt('Additional Notes:'); ?> </span><br><textarea cols=80 rows=8 wrap=virtual name="additional_notes" ></textarea><br> | ||
<br> | ||
<a href="javascript:top.restoreSession();document.my_form.submit();" class="link_submit">[<?php echo xlt('Save'); ?>]</a> | ||
<br> | ||
<a href="<?php echo "$rootdir/patient_file/encounter/$returnurl";?>" class="link" | ||
onclick="top.restoreSession()">[<?php echo xlt('Don\'t Save'); ?>]</a> | ||
</form> | ||
<div class="container"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Container should be up by the body, we want most everything contained |
||
<div class="page-header"> | ||
<h1><?php echo xlt('Speech Dictation'); ?></h1><br><br> | ||
</div> | ||
|
||
<form method=post action="<?php echo $rootdir;?>/forms/dictation/save.php?mode=new" name="my_form"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. forms needs to deal with session leak issue (especially since it was removed from the Save link):
More information on this can be found here: |
||
|
||
<div class="form-group"> | ||
<label for="dictation"><?php echo xlt('Dictation: '); ?></label><br><textarea class="form-control ckeditor" cols=80 rows=24 wrap="virtual" name="dictation" ></textarea> | ||
</div> | ||
<div class="form-group"> | ||
<label for="additional_notes"><?php echo xlt('Additional Notes:'); ?> </label><br><textarea class="form-control ckeditor" cols=80 rows=8 wrap="virtual" name="additional_notes" ></textarea> | ||
</div> | ||
|
||
<button type="submit" class="btn btn-default btn-save"><?php echo xlt('Save'); ?></button> | ||
|
||
<a href="<?php echo "$rootdir/patient_file/encounter/$returnurl";?>" class="btn btn-cancel btn-link" onclick="top.restoreSession()"><?php echo xlt('Cancel'); ?></a> | ||
</form> | ||
</div> | ||
|
||
<?php | ||
formFooter(); | ||
?> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
<?php | ||
//------------Forms generated from formsWiz | ||
/** | ||
* Dictation report for display | ||
* | ||
* @package OpenEMR | ||
* @link http://www.open-emr.org | ||
* @author Sherwin Gaddis <sherwingaddis@gmail.com> | ||
* @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 | ||
* @copyright Copyright (c) 2017 Sherwin Gaddis <sherwingaddis@gmail.com> | ||
* | ||
*/ | ||
|
||
include_once(dirname(__FILE__).'/../../globals.php'); | ||
include_once($GLOBALS["srcdir"]."/api.inc"); | ||
require_once("../../../public/assets/htmlpurifier-4.9.2/library/HTMLPurifier.auto.php"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove above line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After you rebase code to most recent codebase, then you can remove the above line. |
||
|
||
/** | ||
* Retrieve data from the dictation table | ||
* | ||
* @param int $pid | ||
* @param int $encounter | ||
* @param int $cols | ||
* @param int $id | ||
* | ||
*/ | ||
|
||
function dictation_report( $pid, $encounter, $cols, $id) { | ||
$count = 0; | ||
$data = formFetch("form_dictation", $id); | ||
|
@@ -18,8 +40,11 @@ function dictation_report( $pid, $encounter, $cols, $id) { | |
$value = "yes"; | ||
} | ||
$key=ucwords(str_replace("_"," ",$key)); | ||
print "<td><span class=bold>" . xlt($key) . ": </span><span class=text>" . | ||
nl2br(text($value)) . "</span></td>"; | ||
$config = HTMLPurifier_Config::createDefault(); | ||
$purifier = new HTMLPurifier($config); | ||
$clean_html = $purifier->purify($value); | ||
print "<td><span class='bold'>" . xlt($key) . ": </span><span class='text'>" . | ||
$clean_html . "</span></td>"; | ||
$count++; | ||
if ($count == $cols) { | ||
$count = 0; | ||
|
@@ -29,4 +54,3 @@ function dictation_report( $pid, $encounter, $cols, $id) { | |
} | ||
print "</tr></table>"; | ||
} | ||
?> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,61 @@ | ||
<!-- Forms generated from formsWiz --> | ||
<?php | ||
/** | ||
* Dictation Form Edit Saved Data | ||
* | ||
* @package OpenEMR | ||
* @link http://www.open-emr.org | ||
* @author Sherwin Gaddis <sherwingaddis@gmail.com> | ||
* @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 | ||
* @copyright Copyright (c) 2017 Sherwin Gaddis <sherwingaddis@gmail.com> | ||
* | ||
*/ | ||
|
||
|
||
|
||
|
||
use OpenEMR\Core\Header; | ||
include_once("../../globals.php"); | ||
require_once("../../../public/assets/htmlpurifier-4.9.2/library/HTMLPurifier.auto.php"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did this come in via bower or composer? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was brought in via composer in the current codebase There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so, is autoloaded There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the ../../../public should be replaced with which global? I looked for it and couldn't find it or remember what it is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since it's autoloaded, no include/require is needed. The class is magically available in all scripts. However, will need to rebase your code on the most current codebase (in order to bring this code in). Also should delete entire public/assets/htmlpurifier-4.9.2 directory from your branch. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will likely need a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The use statement was not needed as @bradymiller suggested. It works without the use statement. I will post in a moment. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It shouldn't work without that line. It needs to be added There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now I am not sure which line you are referring. If you are referring to this line: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After you rebase code to most recent codebase, then you can remove the above line. |
||
|
||
$returnurl = 'encounter_top.php'; | ||
?> | ||
<html><head> | ||
<?php html_header_show();?> | ||
<link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css"> | ||
<html> | ||
<head> | ||
<title>Review</title> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. translate and use Dictation:
|
||
<?php Header::setupHeader(); ?> | ||
<script type="text/javascript" src="<?php echo $webroot."/library/custom_template/ckeditor/ckeditor.js" ?>"</script> | ||
<script src="<?php echo $webroot."/library/custom_template/ckeditor/_samples/sample.js" ?>" type="text/javascript"></script> | ||
<link href="<?php echo $webroot."/library/custom_template/ckeditor/_samples.css"; ?>" rel="stylesheet" type="text/css" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After you rebase code to most recent codebase, then you can use the ckeditor in public/assets/ |
||
</head> | ||
<body class="body_top"> | ||
<div class="container"> | ||
<?php | ||
include_once("$srcdir/api.inc"); | ||
$obj = formFetch("form_dictation", $_GET["id"]); | ||
$id = filter_input(INPUT_GET, "id", FILTER_VALIDATE_INT); | ||
$obj = formFetch("form_dictation", $id); | ||
?> | ||
<form method=post action="<?php echo $rootdir?>/forms/dictation/save.php?mode=update&id=<?php echo attr($_GET["id"]);?>" name="my_form"> | ||
<span class="title"><?php echo xlt('Speech Dictation'); ?></span><Br><br> | ||
<span class=text><?php echo xlt('Dictation: '); ?></span><br><textarea cols=80 rows=24 wrap=virtual name="dictation" ><?php echo text($obj{"dictation"});?></textarea><br> | ||
<span class=text><?php echo xlt('Additional Notes: '); ?></span><br><textarea cols=80 rows=8 wrap=virtual name="additional_notes" ><?php echo text($obj{"additional_notes"});?></textarea><br> | ||
<br> | ||
<a href="javascript:top.restoreSession();document.my_form.submit();" class="link_submit">[<?php echo xlt('Save'); ?>]</a> | ||
<br> | ||
<a href="<?php echo "$rootdir/patient_file/encounter/$returnurl";?>" class="link" | ||
onclick="top.restoreSession()">[<?php echo xlt('Don\'t Save Changes'); ?>]</a> | ||
</form> | ||
<form method=post action="<?php echo $rootdir?>/forms/dictation/save.php?mode=update&id=<?php echo attr($id);?>" name="my_form"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. forms needs to deal with session leak issue (especially since it was removed from the Save link):
More information on this can be found here: |
||
<div class="page-header"> | ||
<h1><?php echo xlt('Speech Dictation Review/Edit'); ?></h1> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably doesn't makes sense to make this title different on the forms since most forms do not allow this (goal is keeping things as uniform as possible), since usually view.php redirects to new.php on a lot of the forms. Also good to keep the title in head the same as this title which should be the same as the form name. So would use 'Speech Dictation' in all those place. |
||
</div> | ||
<div class="form-group"> | ||
<label for="dictation"><?php echo xlt('Dictation: '); ?></label><br><textarea class="form-control ckeditor" cols=80 rows=24 wrap="virtual" name="dictation" ><?php | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggest breaking this super long line up. Textarea with "form-control" shouldn't have the colts attribute, CSS takes care of that |
||
$config = HTMLPurifier_Config::createDefault(); | ||
$purifier = new HTMLPurifier($config); | ||
$clean_html = $purifier->purify($obj{"dictation"}); | ||
echo trim($clean_html); ?></textarea> | ||
</div> | ||
<div class="form-group"> | ||
<label for="additional_notes"><?php echo xlt('Additional Notes: '); ?></span><br><textarea class="form-control ckeditor"cols=80 rows=8 wrap="virtual" name="additional_notes" ><?php | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above comment |
||
$config = HTMLPurifier_Config::createDefault(); | ||
$purifier = new HTMLPurifier($config); | ||
$clean_html = $purifier->purify($obj{"additional_notes"}); | ||
echo trim($clean_html); ?></textarea> | ||
</div> | ||
|
||
<button type="submit" class="btn btn-default btn-save"><?php echo xlt('Update'); ?></button> | ||
|
||
<a href="<?php echo "$rootdir/patient_file/encounter/$returnurl";?>" class="btn btn-cancel btn-link" onclick="top.restoreSession()"><?php echo xlt('Cancel'); ?></a> | ||
</form> | ||
</div> | ||
|
||
<?php | ||
formFooter(); | ||
?> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/.travis.yml export-ignore | ||
/Doxyfile export-ignore | ||
/art/ export-ignore | ||
/benchmarks/ export-ignore | ||
/configdoc/ export-ignore | ||
/configdoc/usage.xml -crlf | ||
/docs/ export-ignore | ||
/phpdoc.ini | ||
/smoketests/ export-ignore | ||
/tests/* export-ignore | ||
/tests/path2class.func.php -export-ignore |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
tags | ||
conf/ | ||
test-settings.php | ||
config-schema.php | ||
library/HTMLPurifier/DefinitionCache/Serializer/*/ | ||
library/standalone/ | ||
library/HTMLPurifier.standalone.php | ||
library/HTMLPurifier*.tgz | ||
library/package*.xml | ||
smoketests/test-schema.html | ||
configdoc/*.html | ||
configdoc/configdoc.xml | ||
docs/doxygen* | ||
*.phpt.diff | ||
*.phpt.exp | ||
*.phpt.log | ||
*.phpt.out | ||
*.phpt.php | ||
*.phpt.skip.php | ||
*.htmlt.ini | ||
*.patch | ||
/*.php | ||
vendor | ||
composer.lock | ||
*.rej | ||
*.orig | ||
*.bak | ||
core |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
language: php | ||
php: | ||
- '5.3' | ||
- '5.4' | ||
- '5.5' | ||
- '5.6' | ||
- '7.0' | ||
- '7.1' | ||
before_script: | ||
- git clone --depth=50 https://github.com/ezyang/simpletest.git | ||
- cp test-settings.travis.php test-settings.php | ||
script: | ||
- php tests/index.php |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
CREDITS | ||
|
||
Almost everything written by Edward Z. Yang (Ambush Commander). Lots of thanks | ||
to the DevNetwork Community for their help (see docs/ref-devnetwork.html for | ||
more details), Feyd especially (namely IPv6 and optimization). Thanks to RSnake | ||
for letting me package his fantastic XSS cheatsheet for a smoketest. | ||
|
||
vim: et sw=4 sts=4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this file