Skip to content

Commit

Permalink
fix: ccdaservice needed bump libxmljs2:0.33.0 (openemr#7132)
Browse files Browse the repository at this point in the history
* fix: ccdaservice needed bump libxmljs2:0.33.0

* remove unneed package from debugging

* ternary stuff

* fixes from jerry's review
  • Loading branch information
stephenwaite authored Jan 1, 2024
1 parent 0725994 commit 3bbee4f
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 2,044 deletions.
8 changes: 4 additions & 4 deletions ccdaservice/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,26 @@ To ensure the lastest libraries are installed, node version changes or the packa


## Ubuntu Setup
* Latest version tested is node v18.13.0
* Latest version tested is node v20.10.0

If node is not already installed then do the following(Research the required installation for your environment):
- `cd ~`
- `apt-get remove --purge nodejs npm` // Ensures clean install and will allow chance to clean up.
- `curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -`
- `curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -`
- `sudo apt-get install -y nodejs`

Navigate to: openemr/ccdaservice and run the following to install requires dependencies.
- `sudo npm install --omit=dev`
## Windows Setup
* Download and install nodejs for your Windows version.
- Latest version tested is node v18.13.0
- Latest version tested is node v20.10.0
* Ensure system variable NODE_PATH is set i.e. `%USERPROFILE%\AppData\Roaming\npm\node_modules`.

Navigate to: openemr/ccdaservice and run the following from an elevated PowerShell or CMD.exe (run as Administrator):
- `npm install --global --omit=dev windows-build-tools` (Recommended) Though compiling libxmljs is no longer required, if for some reason your environment doesn't have download compiled libxmljs2 binary available then npm will try to compile.
- `npm install --omit=dev`
### Use
* CCDA service must be enabled in OpenEMR's menu Globals->Connectors.
* CCDA service must be enabled in OpenEMR's menu Admin->Config->Connectors->Enable C-CDA Service.
* This service will automatically start on demand when required by OpenEMR.
### Developing
* Note that these scripts run in strict mode so javascript will hold you very much accountable with how objects and variables are handled.
Expand Down
2,065 changes: 33 additions & 2,032 deletions ccdaservice/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ccdaservice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"license": "GPL-3.0",
"dependencies": {
"file": "./oe-blue-button-generate",
"libxmljs2": "0.31.0",
"libxmljs2": "0.33.0",
"lodash": "4.17.21",
"net": "1.0.2",
"oe-cqm-service": "6.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
class CommonPlugin extends AbstractPlugin
{
protected $application;
protected $listenerObject;

/**
* Application Table Object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ class CarecoordinationController extends AbstractActionController
*/
private $documentsController;

/**
* @var Application\Listener\Listener
*/
private $listenerObject;

/**
* @var string
*/
private $date_format;

public function __construct(CarecoordinationTable $table, DocumentsController $documentsController)
{
$this->carecoordinationTable = $table;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ public function socket_get($data)
error_log("Failed to close pipehandle for ccdaservice");
}
} else {
$command = 'nodejs';
$command = 'node';
if (!$system->command_exists($command)) {
if ($system->command_exists('node')) {
// older or custom Ubuntu systems that have node rather than nodejs command
$command = 'node';
if ($system->command_exists('nodejs')) {
// older or custom Ubuntu systems that have nodejs rather than node command
$command = 'nodejs';
} else {
error_log("Node is not installed on the system. Connection failed");
throw new CcdaServiceConnectionException('Connection Failed.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class CcdaServiceRequestModelGenerator
{
private $data;
private $createdtime;
private $exportwithDocuments;

/**
* @var EncounterccdadispatchTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ public function getAllergies($pid)
$code_snomed = $get_code_details[1];
$code_text_snomed = lookup_code_descriptions($row['code']);
} else {
$code = $get_code_details[1];
$code = $get_code_details[1] ?? '';
$code_text = lookup_code_descriptions($single_code);
}

Expand Down Expand Up @@ -1099,8 +1099,8 @@ public function getAllergies($pid)
<startdate>" . xmlEscape($row['begdate'] ? preg_replace('/-/', '', $row['begdate']) : "00000000") . "</startdate>
<enddate>" . xmlEscape($row['enddate'] ? preg_replace('/-/', '', $row['enddate']) : "00000000") . "</enddate>
<reaction_text>" . xmlEscape($reaction_text ? Listener::z_xlt($reaction_text) : "") . "</reaction_text>
<reaction_code>" . xmlEscape($reaction_code[1] ?: '') . "</reaction_code>
<reaction_code_type>" . xmlEscape(str_replace('-', ' ', $reaction_code[0]) ?: '') . "</reaction_code_type>
<reaction_code>" . xmlEscape($reaction_code[1] ?? '') . "</reaction_code>
<reaction_code_type>" . xmlEscape(str_replace('-', ' ', $reaction_code[0] ?? '') ?: '') . "</reaction_code_type>
<RxNormCode>" . xmlEscape($code_rx) . "</RxNormCode>
<RxNormCode_text>" . xmlEscape(!empty($code_text_rx) ? $code_text_rx : $row['title']) . "</RxNormCode_text>
</allergy>";
Expand Down
1 change: 1 addition & 0 deletions src/Services/Cda/CdaTemplateImportDispose.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
class CdaTemplateImportDispose
{
protected $codeService;
protected $userauthorized;

public function __construct()
{
Expand Down
1 change: 1 addition & 0 deletions src/Services/Qrda/QrdaReportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class QrdaReportService
protected $patientJson;
protected $effectiveDate;
protected $effectiveDateEnd;
protected $client;
public $measuresPath;

public function __construct()
Expand Down

0 comments on commit 3bbee4f

Please sign in to comment.