Exemplo n.º 1
0
}
// Recherche sur les traitements
$trait = new CTraitement();
/** @var CTraitement[] $traitements */
$traitements = array();
$patients_trait = array();
$where_trait = array();
$ljoin["dossier_medical"] = "dossier_medical.object_id = traitement.traitement_id";
if ($traitement_patient) {
    $where_trait["traitement"] = "LIKE '%{$traitement_patient}%'";
    $where_trait["object_class"] = " ='CPatient'";
}
$order_trait = "traitement_id, traitement";
$total_traitements = null;
if ($where_trait) {
    $total_traitements = $trait->countList($where_trait, null, $ljoin);
    $traitements = $trait->loadList($where_trait, $order_trait, "{$page_traitement}, 30", null, $ljoin);
}
foreach ($traitements as $key => $_traitement) {
    $_traitement->loadRefDossierMedical();
    $_traitement->_ref_dossier_medical->loadRefObject();
    $traitements_[$key] = $_traitement->_ref_dossier_medical->object_id;
    $_traitement->loadRefsFwd();
}
// Recherche sur les diagnostics
/** @var CDossierMedical[] $dossiersMed */
$dossiersMed = array();
$where_diag = array();
if ($diagnostic_patient) {
    $where_diag["codes_cim"] = "LIKE '%{$diagnostic_patient}%'";
    $where_diag["object_class"] = " = 'CPatient'";
 /**
  * Compte les antécédents annulés et non-annulés
  * 
  * @return void
  */
 function countTraitements()
 {
     $traitement = new CTraitement();
     $where = array();
     $where["dossier_medical_id"] = " = '{$this->_id}'";
     $where["annule"] = " != '1'";
     $this->_count_traitements = $traitement->countList($where);
     $where["annule"] = " = '1'";
     $this->_count_cancelled_traitements = $traitement->countList($where);
 }