/** * @see parent::getProps() */ function getProps() { $props = parent::getProps(); $props["_list_classes"] = "enum list|" . implode("|", array_keys(CCompteRendu::getTemplatedClasses())); $props["content"] = "html helped|_list_classes"; $props["last_modified"] = "dateTime"; return $props; }
/** * @see parent::send() */ function send(CCompteRendu $docItem) { $object = $docItem->loadTargetObject(); if ($object instanceof CConsultAnesth) { $object = $object->loadRefConsultation(); } if ($object instanceof CPatient) { CAppUI::stepAjax("Impossible d'ajouter un document lié directement à un patient", UI_MSG_ERROR); } $receiver_hl7v3 = new CReceiverHL7v3(); $receiver_hl7v3->actif = 1; $receiver_hl7v3->group_id = CGroups::loadCurrent()->_id; /** @var CReceiverHL7v3[] $receivers */ $receivers = $receiver_hl7v3->loadMatchingList(); foreach ($receivers as $_receiver) { $request = $_receiver->sendEventProvideAndRegisterDocumentSetRequest($docItem); mbTrace($request); } }
/** * Count unsent document items * * @return void */ function countUnsentDocItems() { $where["file_category_id"] = "= '{$this->_id}'"; $where["etat_envoi"] = "!= 'oui'"; $where["object_id"] = "IS NOT NULL"; $file = new CFile(); $this->_count_unsent_files = $file->countList($where); $document = new CCompteRendu(); $this->_count_unsent_documents = $document->countList($where); $this->_count_unsent_doc_items = $this->_count_unsent_documents + $this->_count_unsent_files; }
/** * Génération d'un pdf à partir d'une source, avec stream au client si demandé * * @param string $content source html * @param boolean $stream envoi du pdf au navigateur * @param CCompteRendu $compte_rendu compte-rendu ciblé * @param CFile $file le CFile pour lequel générer le pdf * * @return string */ function generatePDF($content, $stream, $compte_rendu, $file) { $this->content = $this->fixBlockElements($content); // Remplacement des champs seulement à l'impression $this->content = str_replace("[Général - numéro de page]", "<span class='page'></span>", $this->content); $date_lock = ""; $locker = new CMediusers(); if ($compte_rendu->valide) { $locker = $compte_rendu->loadRefLocker(); $log_lock = $compte_rendu->loadLastLogForField("valide"); $date_lock = $log_lock->date; } $this->content = str_replace("[Meta Données - Date de verrouillage - Date]", $compte_rendu->valide ? CMbDT::format($date_lock, "%d/%m/%Y") : "", $this->content); $this->content = str_replace("[Meta Données - Date de verrouillage - Heure]", $compte_rendu->valide ? CMbDT::format($date_lock, "%Hh%M") : "", $this->content); $this->content = str_replace("[Meta Données - Verrouilleur - Nom]", $locker->_user_last_name, $this->content); $this->content = str_replace("[Meta Données - Verrouilleur - Prénom]", $locker->_user_first_name, $this->content); $this->content = str_replace("[Meta Données - Verrouilleur - Initiales]", $locker->_shortview, $this->content); CHtmlToPDFConverter::$_page_ordonnance = $compte_rendu->_page_ordonnance; $pdf_content = CHtmlToPDFConverter::convert($this->content, $compte_rendu->_page_format, $compte_rendu->_orientation); if ($file->_file_path) { file_put_contents($file->_file_path, $pdf_content); } $this->nbpages = preg_match_all("/\\/Page\\W/", $pdf_content, $matches); if ($stream) { header("Pragma: "); header("Cache-Control: "); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); //HTTP/1.1 header("Cache-Control: post-check=0, pre-check=0", false); // END extra headers to resolve IE caching bug header("MIME-Version: 1.0"); header("Content-length: " . strlen($pdf_content)); header('Content-type: application/pdf'); header("Content-disposition: inline; filename=\"" . $file->file_name . "\""); echo $pdf_content; } return $pdf_content; }
/** * Insertion des modèles par référence pour les packs * * @return boolean */ protected function setupAddmodeles() { $ds = $this->ds; $query = "SELECT * from pack;"; $packs = $ds->loadList($query); foreach ($packs as $_pack) { if ($_pack['modeles'] == '') { continue; } $modeles = explode("|", $_pack['modeles']); if (count($modeles) == 0) { continue; } $compterendu = new CCompteRendu(); foreach ($modeles as $_modele) { if (!$compterendu->load($_modele)) { continue; } $query = "INSERT INTO modele_to_pack (modele_id, pack_id)\r\n VALUES ({$_modele}, {$_pack['pack_id']})"; $ds->exec($query); } } return true; }
* @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version SVN: $Id:\$ * @link http://www.mediboard.org */ $nbDoc = CView::get("nbDoc", "str"); CView::checkin(); $documents = array(); $pdf = new CMbPDFMerger(); CMbArray::removeValue("0", $nbDoc); if (!count($nbDoc)) { CAppUI::stepAjax("Aucun document à imprimer !"); CApp::rip(); } $compte_rendu = new CCompteRendu(); $where = array("compte_rendu_id" => CSQLDataSource::prepareIn(array_keys($nbDoc))); /** @var $_compte_rendu CCompteRendu */ foreach ($compte_rendu->loadList($where) as $_compte_rendu) { $_compte_rendu->date_print = CMbDT::dateTime(); $_compte_rendu->store(); $_compte_rendu->makePDFpreview(1); $nb_print = $nbDoc[$_compte_rendu->_id]; for ($i = 1; $i <= $nb_print; $i++) { $pdf->addPDF($_compte_rendu->_ref_file->_file_path); } } // Stream du PDF au client avec ouverture automatique // Si aucun pdf, alors PDFMerger génère une exception que l'on catche try { $pdf->merge("browser", "documents.pdf");
$owner = 'func'; $id = $compte_rendu->function_id; } else { if ($compte_rendu->group_id) { $owner = 'etab'; $id = $compte_rendu->group_id; } else { $owner = 'etab'; $id = CGroups::loadCurrent()->_id; } } } $headers = CCompteRendu::loadAllModelesFor($id, $owner, $compte_rendu->object_class, "header"); $prefaces = CCompteRendu::loadAllModelesFor($id, $owner, $compte_rendu->object_class, "preface"); $endings = CCompteRendu::loadAllModelesFor($id, $owner, $compte_rendu->object_class, "ending"); $footers = CCompteRendu::loadAllModelesFor($id, $owner, $compte_rendu->object_class, "footer"); if ($compte_rendu->_owner != "prat") { unset($headers["prat"]); unset($prefaces["prat"]); unset($endings["prat"]); unset($footers["prat"]); } if ($compte_rendu->_owner == "etab") { unset($headers["func"]); unset($prefaces["func"]); unset($endings["func"]); unset($footers["func"]); } switch ($compte_rendu->type) { case "header": $compte_rendu->_count_utilisation = $compte_rendu->countBackRefs("modeles_headed");
CAppUI::stepAjax("Fichier non reconnu", UI_MSG_ERROR); CApp::rip(); } $doc = file_get_contents($file['tmp_name']); $xml = new CMbXMLDocument(null); $xml->loadXML($doc); $root = $xml->firstChild; if ($root->nodeName == "modeles") { $root = $root->childNodes; } else { $root = array($xml->firstChild); } $modeles_ids_xml = array(); $components = array("header_id", "footer_id", "preface_id", "ending_id"); foreach ($root as $_modele) { $modele = new CCompteRendu(); $modele->user_id = $user_id; $modele->function_id = $function_id; $modele->group_id = $group_id; // Mappings des champs principaux foreach ($_modele->childNodes as $_node) { if (in_array($_node->nodeName, CCompteRendu::$fields_import_export)) { $modele->{$_node->nodeName} = $_node->nodeValue; } } $modele->nom = utf8_decode($modele->nom); // Mapping de l'entête, pieds de page, introduction, conclusion foreach ($components as $_component) { if ($modele->{$_component}) { $modele->{$_component} = $modeles_ids[$modele->{$_component}]; }
<?php /** * Retourne la source d'un document * * @category CompteRendu * @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version SVN: $Id:\$ * @link http://www.mediboard.org */ CCanDo::checkRead(); $cr_id = CValue::get("compte_rendu_id"); $update_date_print = CValue::get("update_date_print", 0); $cr = new CCompteRendu(); $cr->load($cr_id); if (!$cr->_id) { return; } $cr->loadContent(); if (!$cr->canRead()) { return; } // Mise à jour de la date d'impression if ($update_date_print) { $cr->date_print = "now"; if ($msg = $cr->store()) { CAppUI::setMsg($msg, UI_MSG_ERROR); } }
// Compter les modèles d'étiquettes $modele_etiquette = new CModeleEtiquette(); $where = array(); $where['object_class'] = "= 'COperation'"; $where["group_id"] = " = '" . CGroups::loadCurrent()->_id . "'"; $nb_modeles_etiquettes_operation = $modele_etiquette->countList($where); $where['object_class'] = "= 'CSejour'"; $nb_modeles_etiquettes_sejour = $modele_etiquette->countList($where); $nb_printers = 0; if (CModule::getActive("printing")) { // Chargement des imprimantes pour l'impression d'étiquettes $user_printers = CMediusers::get(); $function = $user_printers->loadRefFunction(); $nb_printers = $function->countBackRefs("printers"); } $compte_rendu = new CCompteRendu(); $salles = array(); if (!empty($list_urgences)) { $salle = new CSalle(); $salles = $salle->loadGroupList(); } // Création du template $smarty = new CSmartyDP(); $smarty->assign("praticien", $praticien); $smarty->assign("boardItem", $boardItem); $smarty->assign("date", $date); $smarty->assign("canceled", $canceled); $smarty->assign("listUrgences", $list_urgences); $smarty->assign("listDay", $list_plages); $smarty->assign("nb_canceled", $nb_canceled); $smarty->assign("board", $board);
$smarty->assign("selOp", $selOp); $smarty->assign("patient", $patient); $smarty->assign("listAnesths", $listAnesths); $smarty->assign("onSubmit", $onSubmit); $smarty->assign("create_dossier_anesth", $create_dossier_anesth); $smarty->display("inc_choose_dossier_anesth.tpl"); return; } $dossier_anesth->loadRefsDocs(); $consult = $dossier_anesth->loadRefConsultation(); $consult->loadRefPlageConsult(); if ($pdf) { // Si le modèle est redéfini, on l'utilise $model = CCompteRendu::getSpecialModel($consult->_ref_chir, "CConsultAnesth", "[FICHE ANESTH]"); if ($model->_id) { CCompteRendu::streamDocForObject($model, $dossier_anesth, $model->factory); } } $consult->loadRefsFwd(); $consult->loadRefsDossiersAnesth(); $consult->loadRefsExamsComp(); $consult->loadRefsExamNyha(); $consult->loadRefsExamPossum(); $dossier_anesth->loadRefs(); $dossier_anesth->_ref_sejour->loadRefDossierMedical(); $other_intervs = array(); $pos_curr_interv = 0; foreach ($consult->loadRefsDossiersAnesth() as $_dossier_anesth) { if ($_dossier_anesth->operation_id) { $_op = $_dossier_anesth->loadRefOperation(); $_op->loadRefPlageOp();
$type = "_ref_files"; $nameFile = "file_name"; } if ($elementClass == "CCompteRendu") { $type = "_ref_documents"; $nameFile = "nom"; } if (array_key_exists($elementId, $object->{$type})) { $listFile =& $object->{$type}; $listFile[$elementId]->canRead(); $acces_denied = !$listFile[$elementId]->_canRead; if ($listFile[$elementId]->_canRead) { $fileSel = $listFile[$elementId]; $file_id = $fileSel->_id; if ($pdf_active && $type == "_ref_documents") { $compte_rendu = new CCompteRendu(); $compte_rendu->load($elementId); $compte_rendu->loadFile(); $fileSel = $compte_rendu->_ref_file; $file_id = $fileSel->_id; } $keyTable = $listFile[$elementId]->_spec->key; $keyFileSel = $listFile[$elementId]->{$nameFile}; $keyFileSel .= "-" . $elementClass . "-"; $keyFileSel .= $listFile[$elementId]->{$keyTable}; // Récupération de la catégorie $catFileSel = new CFilesCategory(); $catFileSel->load($fileSel->file_category_id); } } else { CAppUI::stepAjax(CAppUI::tr("CDocumentItem-_not_available"), UI_MSG_WARNING);
<?php /** * Utilisation d'un modèle * * @category CompteRendu * @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version SVN: $Id:\$ * @link http://www.mediboard.org */ CCanDo::checkRead(); $compte_rendu_id = CValue::get("compte_rendu_id"); $compte_rendu = new CCompteRendu(); $compte_rendu->load($compte_rendu_id); $modeles = array(); switch ($compte_rendu->type) { case "header": $modeles = $compte_rendu->loadBackRefs("modeles_headed", "nom", null, null, null, null, null, array("object_id" => "IS NULL")); break; case "preface": $modeles = $compte_rendu->loadBackRefs("modeles_prefaced", "nom"); break; case "body": $links = $compte_rendu->loadBackRefs("pack_links"); $modeles = CMbObject::massLoadFwdRef($links, "pack_id"); break; case "ending": $modeles = $compte_rendu->loadBackRefs("modeles_ended", "nom"); break;
// Accès aux listes de choix de la fonction et de l'établissement $module = CModule::getActive("dPcompteRendu"); $is_admin = $module && $module->canAdmin(); $access_function = $is_admin || CAppUI::conf("compteRendu CListeChoix access_function"); $access_group = $is_admin || CAppUI::conf("compteRendu CListeChoix access_group"); // Liste sélectionnée $liste = new CListeChoix(); $liste->user_id = $user->_id; $liste->load($liste_id); if ($liste->_id) { if ($liste->function_id && !$access_function) { CAppUI::redirect("m=system&a=access_denied"); } if ($liste->group_id && !$access_group) { CAppUI::redirect("m=system&a=access_denied"); } } $liste->loadRefOwner(); $liste->loadRefModele(); $liste->loadRefsNotes(); $modeles = CCompteRendu::loadAllModelesFor($user->_id, "prat", null, "body"); $owners = $user->getOwners(); // Création du template $smarty = new CSmartyDP(); $smarty->assign("modeles", $modeles); $smarty->assign("owners", $owners); $smarty->assign("access_function", $access_function); $smarty->assign("access_group", $access_group); $smarty->assign("user", $user); $smarty->assign("liste", $liste); $smarty->display("inc_edit_liste_choix.tpl");
$where = array(); CApp::setTimeLimit(300); $loops = CValue::get("loops", 100); $trunk = CValue::get("trunk", 100); mbTrace($loops, "loops"); mbTrace($trunk, "trunk"); $problems = array(); for ($loop = 0; $loop < $loops; $loop++) { $starting = $loop * $trunk; $ds = $doc->_spec->ds; $query = "SELECT `compte_rendu`.`compte_rendu_id`, `contenthtml`.`content` \r\n FROM compte_rendu, contenthtml\r\n WHERE compte_rendu.content_id = contenthtml.content_id\r\n ORDER BY compte_rendu_id DESC\r\n LIMIT {$starting}, {$trunk}"; $docs = $ds->loadHashList($query); foreach ($docs as $doc_id => $doc_source) { // Root node surrounding $source = utf8_encode("<div>{$doc_source}</div>"); // Entity purge $source = preg_replace("/&\\w+;/i", "", $source); // Escape warnings, returns false if really invalid $doc = new CMbXMLDocument(); if (false == ($validation = $doc->loadXML($source))) { $doc = new CCompteRendu(); $doc->load($doc_id); $problems[$doc_id] = $doc; } } } mbTrace(count($problems), "Problems count"); // Création du template $smarty = new CSmartyDP(); $smarty->assign("problems", $problems); $smarty->display("check_document.tpl");
* @return bool */ function searchSpan(&$xml) { foreach ($xml->childNodes as $_node) { /** @var $_node DOMElement */ if ($_node->nodeName === "span" && ($_node->getAttribute("class") === "name" || $_node->getAttribute("class") === "field") && $_node->childNodes->length != 1 && $_node->firstChild && ($_node->firstChild->nodeType != XML_TEXT_NODE || !preg_match("/\\[.+\\]/", $_node->nodeValue))) { return true; } if ($_node->childNodes) { searchSpan($_node); } } return false; } $compte_rendu = new CCompteRendu(); $where = array(); $where["object_id"] = "IS NULL"; $compte_rendus = $compte_rendu->loadList($where, null, "350000"); /** @var $compte_rendus CCompteRendu[] */ $list = array(); /** @var DOMDocument $xml */ $xml = new DOMDocument('1.0', 'iso-8859-1'); foreach ($compte_rendus as $_compte_rendu) { mbLog($_compte_rendu->_id); $_compte_rendu->loadContent(); $content = CMbString::convertHTMLToXMLEntities($_compte_rendu->_source); $content = utf8_encode(CHtmlToPDF::cleanWord($content)); $xml->loadXML("<div>" . $content . "</div>"); if (searchSpan($xml->documentElement)) { $list[] = $_compte_rendu;
* * @package Mediboard * @subpackage Hospi * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CCanDo::checkEdit(); $modele_etiquette_id = CValue::getOrSession("modele_etiquette_id"); $modele_etiquette = new CModeleEtiquette(); $group_id = CGroups::loadCurrent()->_id; if ($modele_etiquette_id) { $modele_etiquette->load($modele_etiquette_id); $modele_etiquette->loadRefsNotes(); } // Nouveau modèle d'étiquette dans le cas d'un changement d'établissement if (!$modele_etiquette_id || $modele_etiquette->group_id != $group_id) { // Chargement des valeurs par défaut si pas de modele_etiquette_id $modele_etiquette = new CModeleEtiquette(); $modele_etiquette->valueDefaults(); $modele_etiquette->group_id = $group_id; } $classes = CCompteRendu::getTemplatedClasses(); $classes["CRPU"] = CAppUI::tr("CRPU"); // Création du template $smarty = new CSmartyDP(); $smarty->assign("modele_etiquette", $modele_etiquette); $smarty->assign("classes", $classes); $smarty->assign("fields", CModeleEtiquette::$fields); $smarty->assign("listfonts", CModeleEtiquette::$listfonts); $smarty->display("inc_edit_modele_etiquette.tpl");
$canFile = false; $canDoc = false; $praticienId = null; $affichageFile = array(); $nbItems = 0; if (!$object_class && !$object_id) { CAppUI::stepMessage(UI_MSG_ERROR, "Problème de récupération de la liste des fichiers"); CApp::rip(); } // Chargement de l'objet /** @var CMbObject $object */ $object = new $object_class(); $object->load($object_id); $file = new CFile(); $canFile = $file->canCreate($object); $cr = new CCompteRendu(); $canDoc = $cr->canCreate($object); // To add the modele selector in the toolbar if ($object_class == 'CConsultation') { $object->loadRefPlageConsult(); $praticienId = $object->_praticien_id; } else { if ($object_class == 'CConsultAnesth') { $object->_ref_consultation->loadRefPlageConsult(); $praticienId = $object->_ref_consultation->_praticien_id; } else { if ($object_class == 'CSejour') { $praticienId = $object->praticien_id; } else { if ($object_class == 'COperation') { $praticienId = $object->chir_id;
preg_match_all("/(:?\\[\\[Texte libre - ([^\\]]*)\\]\\])/i", $compte_rendu->_source, $matches); $templateManager->textes_libres = $matches[2]; // Suppression des doublons $templateManager->textes_libres = array_unique($templateManager->textes_libres); if (isset($compte_rendu->_ref_file->_id)) { $smarty->assign("file", $compte_rendu->_ref_file); } $smarty->assign("textes_libres", $templateManager->textes_libres); $exchange_source = CExchangeSource::get("mediuser-" . $curr_user->_id); $smarty->assign("exchange_source", $exchange_source, "smtp"); // Ajout d'entête / pied de page à la volée $headers = array(); $footers = array(); if (CAppUI::conf("dPcompteRendu CCompteRendu header_footer_fly")) { $headers = CCompteRendu::loadAllModelesFor($user->_id, "prat", $compte_rendu->object_class, "header"); $footers = CCompteRendu::loadAllModelesFor($user->_id, "prat", $compte_rendu->object_class, "footer"); } $smarty->assign("headers", $headers); $smarty->assign("footers", $footers); // Nettoyage des balises meta et link. // Pose problème lors de la présence d'un entête et ou/pied de page $source =& $templateManager->document; $source = preg_replace("/<meta\\s*[^>]*\\s*[^\\/]>/", '', $source); $source = preg_replace("/(<\\/meta>)+/i", '', $source); $source = preg_replace("/<link\\s*[^>]*\\s*>/", '', $source); $pdf_thumbnails = CAppUI::conf("dPcompteRendu CCompteRendu pdf_thumbnails"); $pdf_and_thumbs = CAppUI::pref("pdf_and_thumbs"); // Chargement du if ($compte_rendu->_id) { $compte_rendu->loadModele(); }
} // Application des destinataires foreach ($_POST as $key => $value) { // Remplacement des destinataires if (preg_match("/_dest_([\\w]+)_([0-9]+)/", $key, $dest)) { $destinataires[] = $dest; } } if (count($destinataires) && $do_merge) { $object = new $_POST["object_class"](); /** @var $object CMbObject */ $object->load($_POST["object_id"]); CDestinataire::makeAllFor($object); $allDest = CDestinataire::$destByClass; // Récupération des correspondants ajoutés par l'autocomplete $cr_dest = new CCompteRendu(); $cr_dest->load($_POST["compte_rendu_id"]); $cr_dest->mergeCorrespondantsCourrier($allDest); $bodyTag = '<div id="body">'; // On sort l'en-tête et le pied de page $posBody = strpos($_POST["_source"], $bodyTag); if ($posBody) { $headerfooter = substr($_POST["_source"], 0, $posBody); $index_div = strrpos($_POST["_source"], "</div>") - ($posBody + strlen($bodyTag)); $body = substr($_POST["_source"], $posBody + strlen($bodyTag), $index_div); } else { $headerfooter = ""; $body = $_POST["_source"]; } // On fait le doBind avant le foreach si la config est à 1. if (CAppUI::conf("dPcompteRendu CCompteRendu multiple_doc_correspondants")) {
<?php /** * Tâche automatique de suppression de documents déclarés temporaires * * @category CompteRendu * @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version SVN: $Id:\$ * @link http://www.mediboard.org */ CCanDo::checkEdit(); $modele = new CCompteRendu(); $limit = CValue::get("limit", 100); $where = array(); $where["object_id"] = "IS NULL"; $where["purgeable"] = "= '1'"; $modeles = $modele->loadList($where); CMbObject::massCountBackRefs($modeles, "documents_generated"); foreach ($modeles as $_modele) { $documents = $_modele->loadBackRefs("documents_generated", null, $limit); foreach ($documents as $_doc) { $_doc->delete(); } }
// Auto send categories $category = new CFilesCategory(); $category->send_auto = "1"; foreach ($categories = $category->loadMatchingList() as $_category) { $_category->countDocItems(); $_category->countUnsentDocItems(); } // Unsent docItems $max_load = CAppUI::conf("dPfiles CDocumentSender auto_max_load"); $where["file_category_id"] = CSQLDataSource::prepareIn(array_keys($categories)); $where["etat_envoi"] = "!= 'oui'"; $where["object_id"] = "IS NOT NULL"; $file = new CFile(); $items["CFile"] = $file->loadList($where, "file_id DESC", $max_load); $count["CFile"] = $file->countList($where); $document = new CCompteRendu(); $items["CCompteRendu"] = $document->loadList($where, "compte_rendu_id DESC", $max_load); $count["CCompteRendu"] = $document->countList($where); // Sending $max_send = CAppUI::conf("dPfiles CDocumentSender auto_max_send"); foreach ($items as $_items) { $sent = 0; /** @var CDocumentItem[] $_items */ foreach ($_items as $_item) { $_item->loadTargetObject(); if ($do && !$_item->_send_problem) { // Max sent if (++$sent > $max_send) { break; } $_item->_send = "1";
$facture->loadRefsReglements(); $template_header = new CTemplateManager(); $template_footer = new CTemplateManager(); $header_height = $footer_height = 100; $titre = $facture_class == "CFactureCabinet" ? "[ENTETE FACTURE CABINET]" : "[ENTETE FACTURE ETAB]"; $header = CCompteRendu::getSpecialModel($facture->_ref_praticien, $facture_class, $titre); if ($header->_id) { $header->loadContent(); $facture->fillTemplate($template_header); $template_header->renderDocument($header->_source); if ($header->height) { $header_height = $header->height; } } $titre = $facture_class == "CFactureCabinet" ? "[PIED DE PAGE FACT CABINET]" : "[PIED DE PAGE FACT ETAB]"; $footer = CCompteRendu::getSpecialModel($facture->_ref_praticien, $facture_class, $titre); if ($footer->_id) { $footer->loadContent(); $facture->fillTemplate($template_footer); $template_footer->renderDocument($footer->_source); if ($footer->height) { $footer_height = $footer->height; } } $style = file_get_contents("style/mediboard/tables.css"); $smarty = new CSmartyDP(); $smarty->assign("style", $style); $smarty->assign("facture", $facture); $smarty->assign("header_height", $header_height); $smarty->assign("footer_height", $footer_height); $smarty->assign("header", $template_header->document);
<?php /** * $Id$ * * @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(); $cr = new CCompteRendu(); $cr->load($cr->getRandomValue("compte_rendu_id", true)); $factory = CCDAFactory::factory($cr); $message = $factory->generateCDA(); $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");
// Si le modèle est redéfini, on l'utilise $model = CCompteRendu::getSpecialModel($sejour->_ref_praticien, "COperation", "[FICHE DHE]"); if ($model->_id) { CCompteRendu::streamDocForObject($model, $sejour, "CDomPDFConverter"); } } if ($operation_id = CValue::get("operation_id")) { $operation->load($operation_id); $operation->loadRefsFwd(); $sejour = $operation->_ref_sejour; $operation->_ref_sejour->loadRefsFwd(); $operation->_ref_sejour->loadNDA(); $patient =& $operation->_ref_sejour->_ref_patient; $patient->loadRefs(); // Si le modèle est redéfini, on l'utilise $model = CCompteRendu::getSpecialModel($sejour->_ref_praticien, "COperation", "[FICHE DHE]"); if ($model->_id) { CCompteRendu::streamDocForObject($model, $operation, "CDomPDFConverter"); } } $today = CMbDT::date(); $group = CGroups::loadCurrent(); $group->loadConfigValues(); $simple_DHE = $group->_configs['dPplanningOp_COperation_DHE_mode_simple']; // Création du template $smarty = new CSmartyDP(); $smarty->assign("operation", $operation); $smarty->assign("sejour", $sejour); $smarty->assign("today", $today); $smarty->assign("simple_DHE", $simple_DHE); $smarty->display("view_planning.tpl");
<?php /** * Onglet de configuration * * @category CompteRendu * @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version SVN: $Id:\$ * @link http://www.mediboard.org */ CCanDo::checkAdmin(); $arch = exec("arch"); $can_64bit = $arch == "x86_64"; $modele = new CCompteRendu(); $where = array(); $where["object_id"] = "IS NULL"; $where["type"] = " = 'body'"; $modeles = $modele->loadList($where, "nom"); // Création du template $smarty = new CSmartyDP(); $smarty->assign("dompdf_installed", file_exists("lib/dompdf/include/dompdf.cls.php")); $smarty->assign("wkhtmltopdf_installed", file_exists("lib/wkhtmltopdf/wkhtmltopdf-i386") || file_exists("lib/wkhtmltopdf/wkhtmltopdf-amd64")); $smarty->assign("can_64bit", $can_64bit); $smarty->assign("modeles", $modeles); $smarty->display('configure.tpl');
$cr = new CCompteRendu(); $cr->_page_format = "A4"; $cr->_orientation = "portrait"; // use template for header and footer $template_header = new CTemplateManager(); $context->fillTemplate($template_header); $header = CCompteRendu::getSpecialModel($user, "CPatient", "[ENTETE MOZAIC]"); if ($header->_id) { $header->loadContent(); $template_header->renderDocument($header->_source); } else { $template_header->document = "<p style=\"text-align:center;\">" . $context->_view . "</p>"; } $template_footer = new CTemplateManager(); $context->fillTemplate($template_footer); $footer = CCompteRendu::getSpecialModel($user, "CPatient", "[PIED DE PAGE MOZAIC]"); if ($footer->_id) { $footer->loadContent(); $template_footer->renderDocument($footer->_source); } else { $template_footer->document = "<p style=\"text-align:center;\">" . CMbDT::dateToLocale(CMbDT::dateTime()) . "</p>"; } // main body $_dispo = explode("_", $dispo); $_dispos = explode("x", $_dispo[1]); $cols = $_dispos[0]; $lines = $_dispos[1]; $content = "<html>\n<head>\n<style>\n body {border:0;margin:0; position:relative;}\n #header, #footer {position:absolute; top: 0; width:100%; overflow: hidden;}\n #footer {top:25cm;}\n #body {height:23cm; width:100%; border-collapse: collapse; table-layout: fixed; position: absolute; top: 2cm;}\n #images {position:relative; width: 100%; height:100%;}\n #body div.col {\n position: absolute;\n overflow: hidden;\n line-height: 100%;\n max-width: 100%;\n text-align: center;\n vertical-align: middle!important;\n }\n\n #images img {\n box-shadow: 0 0 5px #b8b8b8;\n }\n\n #body p {\n position:absolute;\n bottom:0;\n left:0;\n width:100%;\n text-align: center;\n }\n\n #body p span {\n background-color:white;\n border:solid 1px #6e6e6e;\n padding:3px;\n }\n\n .droppable {\n padding:4px;\n }\n\n #body img {max-width:100%; max-height: 100%;}\n .nb_line_1 {height:100%;}\n .nb_line_2 {height:50%;}\n .nb_line_3 {height:33%;}\n\n .nb_col_1 {width:100%;}\n .nb_col_2 {width:50%;}\n .nb_col_3 {width:33%;}\n\n .line_1 {top:0;}\n .nb_line_2.line_2 {top:50%;}\n .nb_line_3.line_2 {top:33%;}\n .nb_line_3.line_3 {top:66%;}\n\n .col_1 {left:0;}\n .nb_col_2.col_2 {left:50%;}\n .nb_col_3.col_2 {left:33%;}\n .nb_col_3.col_3 {left:66%;}\n\n</style>\n</head>\n<body>\n<div id=\"header\">{$template_header->document}</div>\n<div id=\"body\"><div id=\"images\">"; for ($a = 1; $a <= $lines; $a++) { for ($b = 1; $b <= $cols; $b++) { $content .= "\n <div class=\"col nb_col_{$cols} nb_line_{$lines} col_{$b} line_{$a}\">";
<?php /** * Impression de compte-rendu * * @category CompteRendu * @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version SVN: $Id:\$ * @link http://www.mediboard.org */ // Récupération du compte-rendu $compte_rendu_id = CValue::get("compte_rendu_id", 0); $compte_rendu = new CCompteRendu(); $compte_rendu->load($compte_rendu_id); $compte_rendu->loadContent(); // Utilisation des headers/footers if ($compte_rendu->header_id || $compte_rendu->footer_id) { $compte_rendu->loadComponents(); $header = $compte_rendu->_ref_header; $header->loadContent(); $footer = $compte_rendu->_ref_footer; $footer->loadContent(); $header->height = isset($header->height) ? $header->height : 20; $footer->height = isset($footer->height) ? $footer->height : 20; $style = "\r\n<style type=\"text/css\">\r\n #header {\r\n height: {$header->height}px;\r\n }\r\n\r\n #footer {\r\n height: {$footer->height}px;\r\n }"; if ($header->_id) { $header->_source = "<div id=\"header\">{$header->_source}</div>"; $header->height += 20; $compte_rendu->header_id = null;
/** * Charge les listes de choix d'une classe pour un utilisateur, sa fonction et son établissement * * @param int $user_id identifiant de l'utilisateur * @param string $modeleType classe ciblée * @param string $other_function_id autre fonction * * @return void */ function loadHelpers($user_id, $modeleType, $other_function_id = "") { $compte_rendu = new CCompteRendu(); $ds = $compte_rendu->getDS(); // Chargement de l'utilisateur courant $currUser = CMediusers::get($user_id); $order = "name"; // Where user_id $whereUser = array(); $whereUser["user_id"] = $ds->prepare("= %", $user_id); $whereUser["class"] = $ds->prepare("= %", $compte_rendu->_class); // Where function_id $whereFunc = array(); $whereFunc["function_id"] = $other_function_id ? "IN ({$currUser->function_id}, {$other_function_id})" : $ds->prepare("= %", $currUser->function_id); $whereFunc["class"] = $ds->prepare("= %", $compte_rendu->_class); // Where group_id $whereGroup = array(); $group = CGroups::loadCurrent(); $whereGroup["group_id"] = $ds->prepare("= %", $group->_id); $whereGroup["class"] = $ds->prepare("= %", $compte_rendu->_class); // Chargement des aides $aide = new CAideSaisie(); /** @var CAideSaisie $aidesUser */ $aidesUser = $aide->loadList($whereUser, $order, null, "aide_id"); /** @var CAideSaisie $aidesFunc */ $aidesFunc = $aide->loadList($whereFunc, $order, null, "aide_id"); /** @var CAideSaisie $aidesGroup */ $aidesGroup = $aide->loadList($whereGroup, $order, null, "aide_id"); $this->helpers["Aide de l'utilisateur"] = array(); foreach ($aidesUser as $aideUser) { if ($aideUser->depend_value_1 == $modeleType || $aideUser->depend_value_1 == "") { $this->helpers["Aide de l'utilisateur"][CMbString::htmlEntities($aideUser->name)] = CMbString::htmlEntities($aideUser->text); } } $this->helpers["Aide de la fonction"] = array(); foreach ($aidesFunc as $aideFunc) { if ($aideFunc->depend_value_1 == $modeleType || $aideFunc->depend_value_1 == "") { $this->helpers["Aide de la fonction"][CMbString::htmlEntities($aideFunc->name)] = CMbString::htmlEntities($aideFunc->text); } } $this->helpers["Aide de l'établissement"] = array(); foreach ($aidesGroup as $aideGroup) { if ($aideGroup->depend_value_1 == $modeleType || $aideGroup->depend_value_1 == "") { $this->helpers["Aide de l'établissement"][CMbString::htmlEntities($aideGroup->name)] = CMbString::htmlEntities($aideGroup->text); } } }
$date_docs_min = CValue::getOrSession("date_docs_min"); $date_docs_max = CValue::getOrSession("date_docs_max"); $entree_min = CValue::getOrSession("entree_min"); $entree_max = CValue::getOrSession("entree_max"); $sortie_min = CValue::getOrSession("sortie_min"); $sortie_max = CValue::getOrSession("sortie_max"); $intervention_min = CValue::getOrSession("intervention_min"); $intervention_max = CValue::getOrSession("intervention_max"); $prat_interv = CValue::getOrSession("prat_interv"); $section_search = CValue::getOrSession("section_search"); $type = CValue::getOrSession("type"); $page = CValue::get("page"); $docs = array(); $where = array(); $ljoin = array(); $cr = new CCompteRendu(); $long_period = CMbDT::daysRelative($date_docs_min, $date_docs_max) > 10; $total_docs = 0; if (($cat_docs || $specialite_docs || $prat_docs || $date_docs_min && $date_docs_max) && !$long_period) { switch ($section_search) { case "sejour": $ljoin["sejour"] = "sejour.sejour_id = compte_rendu.object_id OR sejour.sejour_id IS NULL"; $where["compte_rendu.object_class"] = "= 'CSejour'"; if ($type) { $where["sejour.type"] = "= '{$type}'"; } if ($entree_min) { $where[] = "sejour.entree >= '{$entree_min} 00:00:00'"; } if ($entree_max) { $where[] = "sejour.entree <= '{$entree_max} 23:59:59'";