Beispiel #1
0
 function loadRefsPrescriptions($perm = null)
 {
     if (CModule::getInstalled("dPlabo")) {
         $prescription = new CPrescriptionLabo();
         $where = array("patient_id" => "= '{$this->_id}'");
         $order = "date DESC";
         $this->_ref_prescriptions = $prescription->loadListWithPerms($perm, $where, $order);
     }
 }
/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Labo
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$user = CMediusers::get();
$patient_id = CValue::getOrSession("patient_id");
$prescription_labo_id = CValue::getOrSession("prescription_labo_id");
if (!$patient_id) {
    return;
}
// Chargement de la prescription demandée
$prescription = new CPrescriptionLabo();
$prescription->load($prescription_labo_id);
$prescription->loadRefs();
$patient = new CPatient();
$patient->load($patient_id);
$patient->loadRefsPrescriptions(PERM_EDIT);
foreach ($patient->_ref_prescriptions as $_prescription) {
    $_prescription->loadRefs();
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("patient", $patient);
$smarty->assign("prescription", $prescription);
$smarty->display("inc_vw_prescriptions.tpl");
/**
 * $Id: do_prescription_aed.php 19285 2013-05-26 13:10:13Z phenxdesign $
 *
 * @package    Mediboard
 * @subpackage Labo
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 19285 $
 */
$verouillee = CValue::post("verouillee");
// Si la prescription est verouillée, un id externe est créé pour identifier la prescription
if ($verouillee) {
    $tagCatalogue = CAppUI::conf('dPlabo CCatalogueLabo remote_name');
    $prescription_labo_id = CValue::post("prescription_labo_id");
    $prescription = new CPrescriptionLabo();
    $prescription->load($prescription_labo_id);
    if (!$prescription->verouillee) {
        $prescription->loadRefsFwd();
        // Chargement de l'id400 "labo code4" du praticien
        $prat =& $prescription->_ref_praticien;
        $tagCode4 = "labo code4";
        $idSantePratCode4 = new CIdSante400();
        $idSantePratCode4->loadLatestFor($prat, $tagCode4);
        // creation de l'id400 de la prescription
        $idPresc = new CIdSante400();
        //Paramétrage de l'id 400
        $idPresc->tag = "{$tagCatalogue} Prat:" . str_pad($idSantePratCode4->id400, 4, '0', STR_PAD_LEFT);
        // tag LABO Prat: 0017
        $idPresc->object_class = "CPrescriptionLabo";
        // Chargement du dernier id externe de prescription du praticien s'il existe
{
    echo CAppUI::getMsg();
    CApp::rip();
}
if (!class_exists("DOMDocument")) {
    trigger_error("sorry, DOMDocument is needed");
    return;
}
CCanDo::checkRead();
$doc = new CMbXMLDocument();
$doc->setSchema("modules/dPlabo/remote/prescription.xsd");
if (!$doc->checkSchema()) {
    CAppUI::setMsg("Schema manquant", UI_MSG_ERROR);
    redirect();
}
$mbPrescription = new CPrescriptionLabo();
// Chargement de la prescription
$mb_prescription_id = CValue::post("prescription_labo_id", null);
if (!$mb_prescription_id) {
    CAppUI::setMsg("Veuillez spécifier une prescription", UI_MSG_ERROR);
    redirect();
}
if ($mbPrescription->load($mb_prescription_id)) {
    $mbPrescription->loadRefs();
}
// Chargement de l'id400 "labo code4" du praticien
$prat =& $mbPrescription->_ref_praticien;
$tagCode4 = "labo code4";
$idSantePratCode4 = new CIdSante400();
$idSantePratCode4->loadLatestFor($prat, $tagCode4);
// Chargement de l'id400 "labo code9" du praticien
<?php

/**
 * $Id: httpreq_edit_prescription.php 19285 2013-05-26 13:10:13Z phenxdesign $
 *
 * @package    Mediboard
 * @subpackage Labo
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 19285 $
 */
CCanDo::checkRead();
$user = CMediusers::get();
$listPrats = $user->loadPraticiens(PERM_EDIT);
// Chargement de la prescription choisie
$prescription = new CPrescriptionLabo();
$prescription->load($prescription_labo_id = CValue::get("prescription_labo_id"));
if (!$prescription->_id) {
    $prescription->patient_id = CValue::get("patient_id");
    $prescription->date = CMbDT::dateTime();
    $prescription->praticien_id = $user->_id;
}
$prescription->loadRefsFwd();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("prescription", $prescription);
$smarty->assign("listPrats", $listPrats);
$smarty->display("inc_edit_prescription.tpl");
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Labo
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
global $uistyle;
// Recuperation de l'id de la prescription
$prescription_id = CValue::get("prescription_id");
// Chargement de la prescription selectionnée
$prescription = new CPrescriptionLabo();
$prescription->load($prescription_id);
$prescription->loadRefsFwd();
$prescription->_ref_praticien->loadRefFunction();
$prescription->_ref_praticien->_ref_function->loadRefsFwd();
$prescription->loadRefsBack();
$prescription->loadClassification();
$tab_prescription = array();
$tab_pack_prescription = array();
// Creation d'un nouveau fichier pdf
$pdf = new CPrescriptionPdf("P", "mm", "A4", true);
// Chargement de l'etablissement
$etab = CGroups::loadCurrent();
// Affichage de l'entete du document
// Impossible d'utiliser mbNormal.gif ==> format gif non supporté
$image = "../../style/{$uistyle}/images/pictures/logo.jpg";
/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Labo
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
if (!class_exists("DOMDocument")) {
    trigger_error("sorry, DOMDocument is needed");
    return;
}
CCanDo::checkRead();
$mbPrescription = new CPrescriptionLabo();
$doc = new CMbXMLDocument();
$docReference = new CMbXMLDocument();
$docReference->load("modules/dPlabo/remote/prescription.xml");
$docReference->setSchema("modules/dPlabo/remote/prescription.xsd");
$doc->setSchema("modules/dPlabo/remote/prescription.xsd");
if (!$doc->checkSchema()) {
    return;
}
// Chargement de la prescription
$mb_prescription_id = CValue::post("mb_prescription_id", 2);
if ($mbPrescription->load($mb_prescription_id)) {
    $mbPrescription->loadRefs();
}
$doc->setDocument("tmp/Prescription-" . $mbPrescription->_id . ".xml");
$prescription = $doc->addElement($doc, "prescription");
 /**
  * load results items with given patient and exam
  */
 function loadResults($patient_id, $examen_labo_id, $limit = 10)
 {
     $examen = new CExamenLabo();
     $examen->load($examen_labo_id);
     $order = "date DESC";
     $prescription = new CPrescriptionLabo();
     $prescription->patient_id = $patient_id;
     $prescriptions = $prescription->loadMatchingList($order);
     // Load items for each prescription to preserve prescription date ordering
     $items = array();
     $item = new CPrescriptionLaboExamen();
     foreach ($prescriptions as $_prescription) {
         $item->prescription_labo_id = $_prescription->_id;
         $item->examen_labo_id = $examen_labo_id;
         foreach ($item->loadMatchingList($order) as $_item) {
             $items[$_item->_id] = $_item;
         }
     }
     foreach ($items as &$item) {
         $item->_ref_prescription_labo =& $prescriptions[$item->prescription_labo_id];
         $item->_ref_examen_labo =& $examen;
     }
     return $items;
 }
<?php

/**
 * $Id: vw_prescriptionPdf.php 19285 2013-05-26 13:10:13Z phenxdesign $
 *
 * @package    Mediboard
 * @subpackage Labo
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 19285 $
 */
global $uistyle;
// Recuperation de l'id de la prescription
$prescription_id = CValue::get("prescription_id");
// Chargement de la prescription selectionnée
$prescription = new CPrescriptionLabo();
$prescription->load($prescription_id);
$prescription->loadRefsFwd();
$prescription->_ref_praticien->loadRefFunction();
$prescription->_ref_praticien->_ref_function->loadRefsFwd();
$prescription->loadRefsBack();
$tab_prescription = array();
$tab_pack_prescription = array();
// Creation d'un nouveau fichier pdf
$pdf = new CPrescriptionPdf("P", "mm", "A4", true);
// Chargement de l'etablissement
$etab = CGroups::loadCurrent();
// Affichage de l'entete du document
// Impossible d'utiliser mbNormal.gif ==> format gif non supporté
$image = "../../style/{$uistyle}/images/pictures/logo.jpg";
// Si le style ne possede pas de logo, on applique le logo par defaut de mediboard
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Labo
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
// Chargement de la prescription
$prescription = new CPrescriptionLabo();
if ($prescription->load(CValue::getOrSession("prescription_id"))) {
    $prescription->loadRefsBack();
    $prescription->loadClassification();
}
// Chargement du patient
$patient_id = CValue::first($prescription->patient_id, CValue::getOrSession("patient_id"));
$patient = new CPatient();
$patient->load($patient_id);
$patient->loadRefsPrescriptions(PERM_EDIT);
// Chargement de la première prescription dans le cas ou il n'y en a pas
if (!$prescription->_id && $patient->_id && count($patient->_ref_prescriptions)) {
    $prescription->load(reset($patient->_ref_prescriptions)->_id);
    $prescription->loadRefsBack();
    $prescription->loadClassification();
}
// Création du template
$smarty = new CSmartyDP();