Ejemplo n.º 1
0
 public function getDashboardMap($override_tracking_id = NULL)
 {
     if ($override_tracking_id !== NULL) {
         //TODO -- Change this side-effect so override does NOT alter the context for the session!!!!
         $this->m_oContext->setSelectedTrackingID($override_tracking_id);
     }
     $aResult = $this->getWorklistRows();
     $offset = $aResult['matching_offset'];
     $all_rows = $aResult['DataRows'];
     $row = $all_rows[$offset];
     $currentTrackingID = $this->m_oContext->getSelectedTrackingID();
     if (!isset($row[WorklistData::WLIDX_TRACKINGID])) {
         throw new \Exception('Expected to get dashboard for trackingID=[' . $currentTrackingID . '] but did not!');
     }
     if ($currentTrackingID != $row[WorklistData::WLIDX_TRACKINGID]) {
         throw new \Exception('Expected to get dashboard for trackingID=[' . $currentTrackingID . '] but got data for [' . $row[WorklistData::WLIDX_TRACKINGID] . '] instead!');
     }
     $siteid = $this->m_oContext->getSiteID();
     $tid = $row[WorklistData::WLIDX_TRACKINGID];
     $pid = $row[WorklistData::WLIDX_PATIENTID];
     $oPatientData = $this->getPatient($pid);
     if ($oPatientData == NULL) {
         throw new \Exception('Did not get patient data for trackingID=[' . $currentTrackingID . ']');
     }
     // use DDR GETS ENTRY to fetch CLINICAL Hx WP field
     $worklistItemDict = $this->getWorklistItemFromMDWS($tid);
     $t['Tracking ID'] = $siteid . '-' . $tid;
     $t['Procedure'] = $row[WorklistData::WLIDX_STUDY];
     $t['Modality'] = $row[WorklistData::WLIDX_MODALITY];
     $t['ExamCategory'] = $row[WorklistData::WLIDX_PATIENTCATEGORYLOCATION];
     $t['PatientLocation'] = $row[WorklistData::WLIDX_EXAMLOCATION];
     $t['RequestedBy'] = $row[WorklistData::WLIDX_REQUESTINGPHYSICIAN];
     $aSchedInfo = $row[WorklistData::WLIDX_SCHEDINFO];
     $t['SchedInfo'] = $aSchedInfo;
     $t['RequestedDate'] = $row[WorklistData::WLIDX_DATEORDERED];
     $t['DesiredDate'] = $row[WorklistData::WLIDX_DATETIMEDESIRED];
     $t['ScheduledDate'] = $aSchedInfo['EventDT'];
     $t['PatientCategory'] = $row[WorklistData::WLIDX_PATIENTCATEGORYLOCATION];
     $t['ReasonForStudy'] = $row[WorklistData::WLIDX_REASONFORSTUDY];
     $t['ClinicalHistory'] = trim(isset($worklistItemDict["400"]) ? $worklistItemDict["400"] : '');
     $t['PatientID'] = $pid;
     $t['PatientSSN'] = WorklistData::formatSSN($oPatientData['ssn']);
     $t['Urgency'] = $row[WorklistData::WLIDX_URGENCY];
     $t['Transport'] = $row[WorklistData::WLIDX_TRANSPORT];
     $t['PatientName'] = $row[WorklistData::WLIDX_PATIENTNAME];
     $t['PatientAge'] = $oPatientData['age'];
     $t['PatientDOB'] = $oPatientData['dob'];
     $t['PatientEthnicity'] = $oPatientData['ethnicity'];
     $t['PatientGender'] = $oPatientData['gender'];
     $t['ImageType'] = $row[WorklistData::WLIDX_IMAGETYPE];
     $t['mpiPid'] = $oPatientData['mpiPid'];
     $t['mpiChecksum'] = $oPatientData['mpiChecksum'];
     $t['CountPendingOrders'] = $row[WorklistData::WLIDX_COUNTPENDINGORDERSSAMEPATIENT];
     $t['MapPendingOrders'] = $row[WorklistData::WLIDX_MAPPENDINGORDERSSAMEPATIENT];
     return $t;
 }