Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.37 KB | None | 0 0
  1. commit 3c9c7540a45d206abb167d9066d64ed37fcdad77
  2. Author: Corey Losenegger <losenegger@earthlinginteractive.com>
  3. Date: Wed Aug 23 15:00:28 2017 -0500
  4.  
  5. CXALIGN-53 Get report 1008 working with checkpoints
  6.  
  7. diff --git a/src/main/php/Align/EP/PdfHtmlDocument.php b/src/main/php/Align/EP/PdfHtmlDocument.php
  8. index 8d0e006c..52fa2567 100644
  9. --- a/src/main/php/Align/EP/PdfHtmlDocument.php
  10. +++ b/src/main/php/Align/EP/PdfHtmlDocument.php
  11. @@ -5,24 +5,34 @@ abstract class Align_EP_PdfHtmlDocument extends Align_EP_Component
  12. // protected $reportTitle = "REPORT TITLE HERE";
  13. protected $reportNumber;
  14. protected $cohortId;
  15. - protected $checkpointId;
  16. protected $facilityId;
  17. protected $departmentName;
  18. protected $previousCohortId;
  19. // protected $times;
  20. protected $generationTime;
  21.  
  22. + protected $checkpointId;
  23. + protected $checkpoint;
  24. + protected $previousCheckpoint;
  25. +
  26.  
  27. public function __construct( Align_EP_Registry $reg, $params ) {
  28. parent::__construct($reg);
  29.  
  30. $this->reportNumber = $params['reportTypeId'];
  31. $this->cohortId = isset($params['cohortId']) ? $params['cohortId'] : null;
  32. - $this->checkpointId = isset($params['checkpointId']) ? $params['checkpointId'] : null;
  33. $this->facilityId = $params['facilityId'];
  34. $this->departmentName = (isset($params['departmentName'])) ? $params['departmentName'] : null ;
  35. $this->previousCohortId = (isset($params['previousCohortId'])) ? $params['previousCohortId'] : null ;
  36. $this->generationTime = isset($params['generationTime']) ? $params['generationTime'] : time();
  37. +
  38. + $this->checkpointId = isset($params['checkpointId']) ? $params['checkpointId'] : null;
  39. + if ($this->checkpointId) {
  40. + $this->checkpoint = $this->Checkpoint_Finder->loadCheckpoint($this->checkpointId);
  41. + if ($this->checkpoint['previous checkpoint ID']) {
  42. + $this->previousCheckpoint = $this->Checkpoint_Finder->loadCheckpoint($this->checkpoint['previous checkpoint ID']);
  43. + }
  44. + }
  45. }
  46.  
  47. protected $_generationTimestamp;
  48. @@ -248,25 +258,20 @@ EOT;
  49. protected function getAdditionalParams() {
  50. if (!isset($this->_additionalParams)) {
  51. $paramsSql = <<<PARAMS
  52. - SELECT
  53. - fi.providertype,
  54. - ho.organizationid,
  55. - c.surveyversionid,
  56. - c.cycleid,
  57. - s.title as surveyversion
  58. - FROM aep.cohortfacility AS cf
  59. - JOIN aep.cohort AS c ON c.id = cf.cohortid
  60. - JOIN aep.facilityinfo AS fi ON fi.facilityid = cf.facilityid
  61. - JOIN aep.hierarchyorganization AS ho ON ho.hierarchyid = fi.facilityid
  62. + SELECT
  63. + c.providertype,
  64. + wafc.organizationid,
  65. + c.surveyversionid,
  66. + s.title as surveyversion
  67. + FROM aep.warehouseanswersforcheckpoint wafc
  68. + JOIN aep.checkpoint c ON wafc.checkpointid = c.id
  69. JOIN aep.surveyversion AS s ON c.surveyversionid = s.id
  70. - WHERE
  71. - cf.cohortid = {cohortId} AND
  72. - cf.facilityid = {facilityId};
  73. + WHERE wafc.checkpointid = {checkpointId}
  74. + GROUP BY wafc.organizationid, c.providertype, c.surveyversionid, s.title
  75. PARAMS;
  76.  
  77. $this->_additionalParams = $this->storageHelper->queryRow($paramsSql, [
  78. - 'cohortId' => $this->cohortId,
  79. - 'facilityId' => $this->facilityId
  80. + 'checkpointId' => $this->checkpointId,
  81. ]);
  82. }
  83.  
  84. @@ -285,10 +290,6 @@ PARAMS;
  85. return $this->getAdditionalParams()['organizationid'];
  86. }
  87.  
  88. - protected function getCycleId() {
  89. - return $this->getAdditionalParams()['cycleid'];
  90. - }
  91. -
  92. protected function getCohortId() {
  93. return $this->cohortId;
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement