Skip to content

Commit

Permalink
Twig Portal Refactor from master openemr#4684 (openemr#4687)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjpadgett committed Oct 17, 2021
1 parent 9af0ac3 commit f9211b5
Show file tree
Hide file tree
Showing 15 changed files with 1,327 additions and 786 deletions.
21 changes: 18 additions & 3 deletions portal/get_profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
*
* Copyright (C) 2016-2019 Jerry Padgett <[email protected]>
* Copyright (C) 2016-2021 Jerry Padgett <[email protected]>
* Copyright (C) 2020 Tyler Wrenn <[email protected]>
*
* LICENSE: This program is free software; you can redistribute it and/or
Expand Down Expand Up @@ -34,7 +34,6 @@
require_once("./../library/patient.inc");

require_once("./lib/appsql.class.php");
require_once("./lib/section_fetch.class.php");

$appsql = new ApplicationTable();
$pending = $appsql->getPortalAudit($pid, 'review');
Expand Down Expand Up @@ -125,8 +124,24 @@
echo "<div class='card'>";
echo "<header class='card-header border border-bottom-0 immunizations'>" . xlt('Patient Immunization') . '</header>';
echo "<div class='card-body border'>";
$result = FetchSection::getImmunizations($pid);

$query = "SELECT im.*, cd.code_text, DATE(administered_date) AS administered_date,
DATE_FORMAT(administered_date,'%m/%d/%Y') AS administered_formatted, lo.title as route_of_administration,
u.title, u.fname, u.mname, u.lname, u.npi, u.street, u.streetb, u.city, u.state, u.zip, u.phonew1,
f.name, f.phone, lo.notes as route_code
FROM immunizations AS im
LEFT JOIN codes AS cd ON cd.code = im.cvx_code
JOIN code_types AS ctype ON ctype.ct_key = 'CVX' AND ctype.ct_id=cd.code_type
LEFT JOIN list_options AS lo ON lo.list_id = 'drug_route' AND lo.option_id = im.route
LEFT JOIN users AS u ON u.id = im.administered_by_id
LEFT JOIN facility AS f ON f.id = u.facility_id
WHERE im.patient_id=?";
$result = $appsql->zQuery($query, array($pid));
$records = array();
foreach ($result as $row) {
$records[] = $row;
}
foreach ($records as $row) {
echo text($row['administered_formatted']) . ' : ';
echo text($row['code_text']) . ' : ';
echo text($row['note']) . ' : ';
Expand Down
Loading

0 comments on commit f9211b5

Please sign in to comment.