Exemple #1
0
 /**
  * Method setProceduresSection()
  */
 private function setProceduresSection()
 {
     $Procedures = new Procedures();
     $proceduresData = $Procedures->getPatientProceduresByPid($this->pid);
     unset($Procedures);
     $procedures = [];
     if (empty($proceduresData) || $this->isExcluded('procedures')) {
         $procedures['@attributes'] = ['nullFlavor' => 'NI'];
     }
     $procedures['templateId'] = ['@attributes' => ['root' => $this->requiredProcedures ? '2.16.840.1.113883.10.20.22.2.7.1' : '2.16.840.1.113883.10.20.22.2.7']];
     $procedures['code'] = ['@attributes' => ['code' => '47519-4', 'codeSystemName' => 'LOINC', 'codeSystem' => '2.16.840.1.113883.6.1']];
     $procedures['title'] = 'Procedures';
     $procedures['text'] = '';
     if ($this->isExcluded('vitals')) {
         $this->addSection(['section' => $procedures]);
         return;
     }
     if (!empty($proceduresData)) {
         $procedures['text'] = ['table' => ['@attributes' => ['border' => '1', 'width' => '100%'], 'thead' => ['tr' => [['th' => [['@value' => 'Procedure'], ['@value' => 'Date']]]]], 'tbody' => ['tr' => []]]];
         $procedures['entry'] = [];
         foreach ($proceduresData as $item) {
             $procedures['text']['table']['tbody']['tr'][] = ['td' => [['@value' => $item['code_text']], ['@value' => $this->parseDateToText($item['create_date'])]]];
             //  Procedure Activity Procedure
             $entry = ['@attributes' => ['typeCode' => 'DRIV'], 'procedure' => ['@attributes' => ['classCode' => 'PROC', 'moodCode' => 'EVN'], 'templateId' => ['@attributes' => ['root' => '2.16.840.1.113883.10.20.22.4.14']], 'id' => ['@attributes' => ['root' => UUID::v4()]], 'code' => ['@attributes' => ['code' => $item['code'], 'codeSystem' => $this->codes($item['code_type']), 'displayName' => $item['code_text']]], 'statusCode' => ['@attributes' => ['code' => 'completed']], 'effectiveTime' => ['@attributes' => ['value' => $this->parseDate($item['create_date'])]]]];
             if ($item['uid'] > 0) {
                 $entry['procedure']['performer'] = $this->getPerformerByUid($item['uid']);
             }
             $entry['procedure']['methodCode'] = ['@attributes' => ['nullFlavor' => 'UNK']];
             $procedures['entry'][] = $entry;
         }
     }
     if ($this->requiredProcedures || isset($procedures['entry'])) {
         $this->addSection(['section' => $procedures]);
     }
     unset($proceduresData, $procedures);
 }