Пример #1
0
if ($d1->_is_master_ipp || $d2->_is_master_ipp) {
    $and .= "AND id1.object_class = 'CPatient' \n AND id2.object_class = 'CPatient'";
}
if ($d1->_is_master_nda || $d2->_is_master_nda) {
    $and .= "AND id1.object_class = 'CSejour' \n AND id2.object_class = 'CSejour'";
}
$intersect_id400s = $ds->loadList("SELECT id1.id400\n                                   FROM id_sante400 AS id1 \n                                   LEFT JOIN id_sante400 AS id2 ON id2.id400 = id1.id400 \n                                   AND id2.object_class = id1.object_class\n                                   WHERE id1.tag = '{$d1->tag}'\n                                   AND id2.tag = '{$d2->tag}'\n                                   {$and}");
$intersect_id400s = CMbArray::pluck($intersect_id400s, "id400");
if (!$intersect_id400s) {
    $intersect_id400s = array();
}
$intersect = array();
foreach ($intersect_id400s as $_id400) {
    $idex_d1 = new CIdSante400();
    $idex_d1->tag = "{$d1->tag}";
    $idex_d1->id400 = $_id400;
    $idex_d1->loadMatchingObject();
    $idex_d1->loadTargetObject();
    $idex_d2 = new CIdSante400();
    $idex_d2->tag = "{$d2->tag}";
    $idex_d2->id400 = $_id400;
    $idex_d2->loadMatchingObject();
    $idex_d2->loadTargetObject();
    $intersect[$_id400] = array($idex_d1, $idex_d2);
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("d1_id", $d1_id);
$smarty->assign("d2_id", $d2_id);
$smarty->assign("intersect", $intersect);
$smarty->display("inc_resolve_conflicts.tpl");