Example #1
0
 /**
  * @see parent::getProps()
  */
 function getProps()
 {
     $props = parent::getProps();
     $props["file_category_id"] = "ref class|CFilesCategory";
     $props["etat_envoi"] = "enum notNull list|oui|non|obsolete default|non show|0";
     $props["author_id"] = "ref class|CMediusers";
     $props["private"] = "bool default|0 show|0";
     $props["annule"] = "bool default|0 show|0";
     $props["doc_size"] = "num min|0 show|0";
     $type_doc = "";
     if (CModule::getActive("cda")) {
         $jdv_type = CCdaTools::loadJV("CI-SIS_jdv_typeCode.xml");
         foreach ($jdv_type as $_type) {
             $type_doc .= $_type["codeSystem"] . "^" . $_type["code"] . "|";
         }
         $type_doc = substr($type_doc, 0, -1);
     }
     $props["type_doc"] = empty($type_doc) ? "str" : "enum list|{$type_doc}";
     $sisra_types = "";
     if (CModule::getActive("sisra")) {
         $sisra_types = CSisraTools::getSisraTypeDocument();
         $sisra_types = implode("|", $sisra_types);
     }
     $props["type_doc_sisra"] = empty($sisra_types) ? "str" : "enum list|{$sisra_types}";
     $props["_extensioned"] = "str notNull";
     $props["_no_extension"] = "str notNull";
     $props["_file_size"] = "str show|1";
     $props["_send_problem"] = "text";
     return $props;
 }
 /**
  * Build ProvideAndRegisterDocumentSetRequest event
  *
  * @param CCompteRendu|CFile $object compte rendu
  *
  * @see parent::build()
  *
  * @throws CMbException
  * @return void
  */
 function build($object)
 {
     parent::build($object);
     $uuid = $this->uuid;
     $factory = CCDAFactory::factory($object);
     $cda = $factory->generateCDA();
     try {
         CCdaTools::validateCDA($cda);
     } catch (CMbException $e) {
         throw $e;
     }
     $xml = new CXDSXmlDocument();
     $xds = CXDSFactory::factory($factory);
     $xds->type = $this->type;
     $xds->extractData();
     $header_xds = $xds->generateXDS57($uuid, $this->action);
     $xml->importDOMDocument($xml, $header_xds);
     $this->message = $xml->saveXML();
     $this->updateExchange(false);
 }
<?php

/**
 * $Id$
 *
 * Affiche les informations la structure, le xml et si le document est valide
 *  
 * @category CDA
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html 
 * @link     http://www.mediboard.org */
$message = CValue::post("message");
$message = stripslashes($message);
$treecda = CCdaTools::parse($message);
$xml = CCdaTools::showxml($message);
$smarty = new CSmartyDP();
$smarty->assign("message", $message);
$smarty->assign("treecda", $treecda);
$smarty->assign("xml", $xml);
$smarty->display("inc_highlightcda.tpl");
 /**
  * @see parent::extractData
  */
 function extractData()
 {
     /** @var CDocumentItem $docItem */
     $docItem = $this->mbObject;
     $this->realm_code = "FR";
     $this->langage = $docItem->language;
     //Récupération du dernier log qui correspond à la date de création de cette version
     $last_log = $docItem->loadLastLog();
     $this->date_creation = $last_log->date;
     $this->date_author = $last_log->date;
     $this->targetObject = $object = $docItem->loadTargetObject();
     if ($object instanceof CConsultAnesth) {
         $this->targetObject = $object = $object->loadRefConsultation();
     }
     $this->practicien = $object->loadRefPraticien();
     $this->patient = $object->loadRefPatient();
     $this->patient->loadLastINS();
     $this->patient->loadIPP();
     $this->mbObject = $docItem;
     $this->root = CMbOID::getOIDFromClass($docItem, $this->receiver);
     $this->practicien->loadRefFunction();
     $this->practicien->loadRefOtherSpec();
     $group = new CGroups();
     $group->load($this->practicien->_group_id);
     $this->healt_care = CCdaTools::loadEntryJV("CI-SIS_jdv_healthcareFacilityTypeCode.xml", CIdSante400::getValueFor($group, "cda_association_code"));
     if ($docItem instanceof CFile) {
         $this->version = "1";
         $this->nom = basename($docItem->file_name);
     } else {
         $this->version = $docItem->version;
         $this->nom = $docItem->nom;
     }
     $this->id_cda_lot = "{$this->root}.{$docItem->_id}";
     $this->id_cda = "{$this->id_cda_lot}.{$this->version}";
     $confidentialite = "N";
     if ($docItem->private) {
         $confidentialite = "R";
     }
     $this->confidentialite = CCdaTools::loadEntryJV("CI-SIS_jdv_confidentialityCode.xml", $confidentialite);
     if ($docItem->type_doc) {
         $type = explode("^", $docItem->type_doc);
         $this->code = CCdaTools::loadEntryJV("CI-SIS_jdv_typeCode.xml", $type[1]);
     }
     //conformité HL7
     $this->templateId[] = $this->createTemplateID("2.16.840.1.113883.2.8.2.1", "HL7 France");
     //Conformité CI-SIS
     $this->templateId[] = $this->createTemplateID("1.2.250.1.213.1.1.1.1", "CI-SIS");
     //Confirmité IHE XSD-SD => contenu non structuré
     $this->templateId[] = $this->createTemplateID("1.3.6.1.4.1.19376.1.2.20", "IHE XDS-SD");
     $this->industry_code = CCdaTools::loadEntryJV("CI-SIS_jdv_practiceSettingCode.xml", "ETABLISSEMENT");
     $mediaType = "application/pdf";
     //Génération du PDF
     if ($docItem instanceof CFile) {
         $path = $docItem->_file_path;
         switch ($docItem->file_type) {
             case "image/tiff":
                 $mediaType = "image/tiff";
                 break;
             case "application/pdf":
                 $mediaType = $docItem->file_type;
                 $path = CCdaTools::generatePDFA($docItem->_file_path);
                 break;
             case "image/jpeg":
             case "image/jpg":
                 $mediaType = "image/jpeg";
                 break;
             case "application/rtf":
                 $mediaType = "text/rtf";
                 break;
             default:
                 $docItem->convertToPDF();
                 $file = $docItem->loadPDFconverted();
                 $path = CCdaTools::generatePDFA($file->_file_path);
         }
     } else {
         if ($msg = $docItem->makePDFpreview(1, 0)) {
             throw new CMbException($msg);
         }
         $file = $docItem->_ref_file;
         $path = CCdaTools::generatePDFA($file->_file_path);
     }
     $this->file = $path;
     $this->mediaType = $mediaType;
     $service["nullflavor"] = null;
     switch (get_class($object)) {
         case "CSejour":
             /** @var CSejour $object CSejour */
             $dp = $object->DP;
             $service["time_start"] = $object->entree;
             $service["time_stop"] = $object->sortie;
             $service["executant"] = $object->loadRefPraticien();
             if ($dp) {
                 $service["oid"] = "2.16.840.1.113883.6.3";
                 $service["code"] = $dp;
                 $service["type_code"] = "cim10";
             } else {
                 $service["nullflavor"] = "UNK";
             }
             break;
         case "COperation":
             /** @var COperation $object COperation */
             $no_acte = 0;
             foreach ($object->loadRefsActesCCAM() as $_acte_ccam) {
                 if ($_acte_ccam->code_activite === "4" || !$_acte_ccam->_check_coded || $no_acte >= 1) {
                     continue;
                 }
                 $service["time_start"] = $_acte_ccam->execution;
                 $service["time_stop"] = "";
                 $service["code"] = $_acte_ccam->code_acte;
                 $service["oid"] = "1.2.250.1.213.2.5";
                 $_acte_ccam->loadRefExecutant();
                 $service["executant"] = $_acte_ccam->_ref_executant;
                 $service["type_code"] = "ccam";
                 $no_acte++;
             }
             if ($no_acte === 0) {
                 $service["time_start"] = $object->debut_op;
                 $service["time_stop"] = $object->fin_op;
                 $service["executant"] = $object->loadRefPraticien();
                 $service["nullflavor"] = "UNK";
             }
             break;
         case "CConsultation":
             /** @var CConsultation $object CConsultation */
             $object->loadRefPlageConsult();
             $no_acte = 0;
             foreach ($object->loadRefsActesCCAM() as $_acte_ccam) {
                 if (!$_acte_ccam->_check_coded || $_acte_ccam->code_activite === "4" || $no_acte >= 1) {
                     continue;
                 }
                 $service["time_start"] = $_acte_ccam->execution;
                 $service["time_stop"] = "";
                 $service["code"] = $_acte_ccam->code_acte;
                 $service["oid"] = "1.2.250.1.213.2.5";
                 $_acte_ccam->loadRefExecutant();
                 $service["executant"] = $_acte_ccam->_ref_executant;
                 $service["type_code"] = "ccam";
                 $no_acte++;
             }
             if ($no_acte === 0) {
                 $service["time_start"] = $object->_datetime;
                 $service["time_stop"] = $object->_date_fin;
                 $service["executant"] = $object->loadRefPraticien();
                 $service["nullflavor"] = "UNK";
             }
             break;
         default:
     }
     $this->service_event = $service;
     if ($this->old_version) {
         $oid = CMbOID::getOIDFromClass($docItem, $this->receiver);
         $this->old_version = "{$oid}.{$this->old_id}.{$this->old_version}";
     }
 }
Example #5
0
<?php

/**
 * $Id$
 *
 * Vue des datatypes présent dans les CDA
 *  
 * @category CDA
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html 
 * @link     http://www.mediboard.org */
$listtypes = CCdaTools::returnType("modules/cda/resources/datatypes-base_original.xsd");
//template
$smarty = new CSmartyDP();
$smarty->assign("listTypes", $listtypes);
$smarty->display("vw_datatype.tpl");
Example #6
0
<?php

/**
 * $Id$
 *
 *  Affiche le code xml du datatype choisi
 *
 * @category CDA
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html 
 * @link     http://www.mediboard.org */
$name = CValue::get("name");
echo CMbString::purifyHTML("<h1>{$name}</h1>");
echo CMbString::highlightCode("xml", CCdaTools::showNodeXSD($name, "modules/cda/resources/datatypes-base_original.xsd"));
Example #7
0
<?php

/**
 * $Id$
 *
 * @category CDA
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
* @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @link     http://www.mediboard.org
*/
CCanDo::checkAdmin();
$action = CValue::get("action", "null");
$result = null;
$resultSynth = null;
if ($action !== "null") {
    $result = CCdaTools::createTest($action);
    $resultSynth = CCdaTools::syntheseTest($result);
}
$smarty = new CSmartyDP();
$smarty->assign("result", $result);
$smarty->assign("resultsynth", $resultSynth);
$smarty->assign("action", $action);
$smarty->display("vw_testdatatype.tpl");
Example #8
0
 *  
 * @category CDA
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html 
 * @link     http://www.mediboard.org
 */
CCanDo::checkAdmin();
$action = CValue::get("action", "null");
$result = "";
switch ($action) {
    case "createClass":
        $result = CCdaTools::createClass();
        break;
    case "createTest":
        $result = CCdaTools::createAllTestSchemaClasses();
        break;
    case "clearXSD":
        $result = CCdaTools::clearXSD();
        break;
    case "missClass":
        $result = CCdaTools::missclass();
        break;
    case "createClassXSD":
        $result = CCdaTools::createClassFromXSD();
        break;
}
$smarty = new CSmartyDP();
$smarty->assign("action", $action);
$smarty->assign("result", $result);
$smarty->display("vw_toolsdatatype.tpl");
Example #9
0
 *  
 * @category CDA
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
CCanDo::checkAdmin();
$group = CGroups::loadCurrent();
$tag = "cda_association_code";
$mb_oid = CAppUI::conf("mb_oid");
$path_ghostscript = CAppUI::conf("cda path_ghostscript");
$path_ghostscript = $path_ghostscript ? escapeshellarg("{$path_ghostscript}") : "gs";
$group->loadLastId400($tag);
$type_group = CCdaTools::loadJV("CI-SIS_jdv_healthcareFacilityTypeCode.xml");
$java = false;
$processorInstance = proc_open("java -verbose -version", array(1 => array('pipe', 'w'), 2 => array('pipe', 'w')), $pipes);
$processorResult = stream_get_contents($pipes[1]);
$processorErrors = stream_get_contents($pipes[2]);
proc_close($processorInstance);
if ($processorResult) {
    $java = true;
}
$ghostscript = false;
$processorInstance = proc_open("{$path_ghostscript} --version", array(1 => array('pipe', 'w'), 2 => array('pipe', 'w')), $pipes);
$processorResult = stream_get_contents($pipes[1]);
$processorErrors = stream_get_contents($pipes[2]);
proc_close($processorInstance);
if ($processorResult) {
    $ghostscript = true;