コード例 #1
0
/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Cabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$consultation_id = CValue::get("consultation_id");
$consultations = array();
$consultation = new CConsultation();
$consultation->load($consultation_id);
$consultation->loadRefsFwd();
$date = $consultation->_ref_plageconsult->date;
$prat = $consultation->_ref_plageconsult->_ref_chir;
$prat->loadRefs();
$patient = $consultation->_ref_patient;
$patient->loadRefs();
$prat->loadRefFunction();
$chir_ids = array_keys($prat->_ref_function->loadRefsUsers());
$ds = $consultation->getDS();
// nexts rdvs for the same function
$ljoin = array("plageconsult" => "plageconsult.plageconsult_id = consultation.plageconsult_id");
$where = array();
$where["date"] = ">= '{$date}' ";
$where["patient_id"] = " = '{$consultation->patient_id}' ";
$where[] = "plageconsult.chir_id " . $ds->prepareIn($chir_ids) . " OR plageconsult.remplacant_id " . $ds->prepareIn($chir_ids);
$where["annule"] = " != '1' ";
コード例 #2
0
ファイル: print_noemie.php プロジェクト: fbone/mediboard4
$consult = new CConsultation();
$where = array();
$ljoin["plageconsult"] = "consultation.plageconsult_id = plageconsult.plageconsult_id";
$where["consultation.du_tiers"] = "> 0";
$where["consultation.tiers_date_reglement"] = "IS NULL";
$where["plageconsult.date"] = "BETWEEN '{$filter->_date_min}' AND '{$filter->_date_max}'";
// Filtre sur les praticiens
$chir_id = CValue::getOrSession("chir");
$listPrat = CConsultation::loadPraticiensCompta($chir_id);
$where["plageconsult.chir_id"] = CSQLDataSource::prepareIn(array_keys($listPrat));
$order = "plageconsult.date";
/** @var CConsultation[] $listConsults */
$listConsults = $consult->loadList($where, $order, null, null, $ljoin);
$total = array("nb" => 0, "value" => 0);
foreach ($listConsults as $consult) {
    $consult->loadRefsFwd();
    $consult->loadRefsReglements();
    // Chargment de la FSE
    if (CModule::getActive("fse")) {
        if ($fse = CFseFactory::createFSE()) {
            $fse->loadIdsFSE($consult);
        }
    }
    // Retour Noemie déjà traité
    $hasNoemie = !$consult->_current_fse || $consult->_current_fse->hasNoemie();
    if ($hasNoemie) {
        unset($listConsults[$consult->_id]);
        continue;
    }
    // Nouveau règelement pour le formulaire
    $consult->_new_reglement_tiers = new CReglement();
コード例 #3
0
 /**
  * @deprecated
  * @see parent::loadRefsFwd()
  */
 function loadRefsFwd()
 {
     $this->loadRefChir();
     // Chargement operation/sejour
     $this->loadRefOperation();
     $this->_ref_operation->loadRefsFwd();
     $this->_date_op =& $this->_ref_operation->_datetime;
     // Chargement consultation
     $this->loadRefConsultation();
     $this->_ref_consultation->loadRefsFwd();
     $this->_ref_plageconsult =& $this->_ref_consultation->_ref_plageconsult;
     $this->_date_consult =& $this->_ref_consultation->_date;
     // Calcul de la Clairance créatinine
     $patient =& $this->_ref_consultation->_ref_patient;
     $patient->loadRefLatestConstantes(null, null, $this->_ref_consultation, false);
     $const_med = $patient->_ref_constantes_medicales;
     $const_med->updateFormFields();
     $age = intval($patient->_annees);
     if ($const_med->poids && $this->creatinine && $age && $age >= 18 && $age <= 110 && $const_med->poids >= 35 && $const_med->poids <= 120 && $this->creatinine >= 6 && $this->creatinine <= 70) {
         $this->_clairance = $const_med->poids * (140 - $age) / (7.2 * $this->creatinine);
         if ($patient->sexe == 'm') {
             $this->_clairance *= 1.04;
         } else {
             $this->_clairance *= 0.85;
         }
         $this->_clairance = round($this->_clairance, 2);
     }
     // Calcul des Pertes Sanguines Acceptables
     if ($this->ht && $this->ht_final && $const_med->_vst) {
         $this->_psa = $const_med->_vst * ($this->ht - $this->ht_final) / 100;
     }
 }