/** * @see parent::loadComplete() */ function loadComplete() { parent::loadComplete(); $this->loadIPP(); $this->loadRefPhotoIdentite(); $this->loadRefsCorrespondantsPatient(); $this->loadRefDossierMedical(); $this->_ref_dossier_medical->canDo(); $this->_ref_dossier_medical->loadRefsAntecedents(); $this->_ref_dossier_medical->loadRefsTraitements(); $prescription = $this->_ref_dossier_medical->loadRefPrescription(); if ($prescription && is_array($prescription->_ref_prescription_lines)) { foreach ($prescription->_ref_prescription_lines as $_line) { $_line->loadRefsPrises(); } } $this->loadRefLatestConstantes(null, array("poids", "taille")); $const_med = $this->_ref_constantes_medicales; if ($const_med) { $this->_poids = $const_med->poids; $this->_taille = $const_med->taille; } }
function addIntervention($elParent, COperation $operation, $referent = null, $light = false) { $identifiant = $this->addElement($elParent, "identifiant"); $this->addElement($identifiant, "emetteur", $operation->_id); $last_idex = $operation->_ref_last_id400; if (isset($last_idex->_id)) { $this->addElement($identifiant, "recepteur", $last_idex->id400); } $sejour = $operation->loadRefSejour(); if (!$operation->plageop_id) { $operation->completeField("date"); } // Calcul du début de l'intervention $mbOpDate = CValue::first($operation->_ref_plageop->date, $operation->date); $time_operation = $operation->time_operation == "00:00:00" ? null : $operation->time_operation; $mbOpHeureDebut = CValue::first($operation->debut_op, $operation->entree_salle, $time_operation, $operation->horaire_voulu, $operation->_ref_plageop->debut); $mbOpDebut = CMbRange::forceInside($sejour->entree, $sejour->sortie, "{$mbOpDate} {$mbOpHeureDebut}"); // Calcul de la fin de l'intervention $mbOpHeureFin = CValue::first($operation->fin_op, $operation->sortie_salle, CMbDT::addTime($operation->temp_operation, CMbDT::time($mbOpDebut))); $mbOpFin = CMbRange::forceInside($sejour->entree, $sejour->sortie, "{$mbOpDate} {$mbOpHeureFin}"); $debut = $this->addElement($elParent, "debut"); $this->addElement($debut, "date", CMbDT::date($mbOpDebut)); $this->addElement($debut, "heure", CMbDT::time($mbOpDebut)); $fin = $this->addElement($elParent, "fin"); $this->addElement($fin, "date", CMbDT::date($mbOpFin)); $this->addElement($fin, "heure", CMbDT::time($mbOpFin)); if ($light) { // Ajout des participants $mbParticipants = array(); foreach ($operation->_ref_actes_ccam as $acte_ccam) { $acte_ccam->loadRefExecutant(); $mbParticipant = $acte_ccam->_ref_executant; $mbParticipants[$mbParticipant->user_id] = $mbParticipant; } $participants = $this->addElement($elParent, "participants"); foreach ($mbParticipants as $mbParticipant) { $participant = $this->addElement($participants, "participant"); $medecin = $this->addElement($participant, "medecin"); $this->addProfessionnelSante($medecin, $mbParticipant); } // Libellé de l'opération $this->addTexte($elParent, "libelle", $operation->libelle, 80); } else { $this->addUniteFonctionnelle($elParent, $operation); // Uniquement le responsable de l’'intervention $participants = $this->addElement($elParent, "participants"); $participant = $this->addElement($participants, "participant"); $medecin = $this->addElement($participant, "medecin"); $this->addProfessionnelSante($medecin, $operation->loadRefChir()); // Libellé de l'opération $this->addTexte($elParent, "libelle", $operation->libelle, 4000); // Remarques sur l'opération $this->addTexte($elParent, "commentaire", CMbString::convertHTMLToXMLEntities("{$operation->materiel} - {$operation->rques}"), 4000); // Conventionnée ? $this->addElement($elParent, "convention", $operation->conventionne ? 1 : 0); // TypeAnesthésie : nomemclature externe (idex) if ($operation->type_anesth) { $tag_hprimxml = $this->_ref_receiver->_tag_hprimxml; $idexTypeAnesth = CIdSante400::getMatch("CTypeAnesth", $tag_hprimxml, null, $operation->type_anesth); $this->addElement($elParent, "typeAnesthesie", $idexTypeAnesth->id400); } // Indicateurs $indicateurs = $this->addElement($elParent, "indicateurs"); $dossier_medical = new CDossierMedical(); $dossier_medical->object_class = "CPatient"; $dossier_medical->object_id = $operation->loadRefPatient()->_id; $dossier_medical->loadMatchingObject(); $antecedents = $dossier_medical->loadRefsAntecedents(); foreach ($antecedents as $_antecedent) { $rques = CMbString::htmlspecialchars($_antecedent->rques); $rques = CMbString::convertHTMLToXMLEntities($rques); $this->addCodeLibelle($indicateurs, "indicateur", $_antecedent->_id, $rques); } // Extemporané if ($operation->exam_extempo) { $this->addCodeLibelle($indicateurs, "indicateur", "EXT", "Extemporané"); } // Recours / Durée USCPO $this->addElement($elParent, "recoursUscpo", $operation->duree_uscpo ? 1 : 0); $this->addElement($elParent, "dureeUscpo", $operation->duree_uscpo ? $operation->duree_uscpo : null); // Côté (droit|gauche|bilatéral|total|inconnu) // D - Droit // G - Gauche // B - Bilatéral // T - Total // I - Inconnu $cote = array("droit" => "D", "gauche" => "G", "bilatéral" => "B", "total" => "T", "inconnu" => "I", "haut" => "HT", "bas" => "BS"); $this->addCodeLibelle($elParent, "cote", $cote[$operation->cote], CMbString::capitalize($operation->cote)); } }
*/ CCanDo::checkRead(); $dossier_medical_id = CValue::get("dossier_medical_id"); $object_guid = CValue::get("object_guid"); $type = CValue::get("type"); $exclude = CValue::get("exclude"); if ($object_guid) { $dossier_medical = CMbObject::loadFromGuid($object_guid); } else { $dossier_medical = new CDossierMedical(); $dossier_medical->load($dossier_medical_id); } if ($type) { $dossier_medical->loadRefsAntecedentsOfType($type); } else { $dossier_medical->loadRefsAntecedents(); } $tab_atc = array(); $ant_communs = array(); $patient = null; if ($dossier_medical->object_class == "CSejour") { $dossier_medical->loadRefObject(); /* @var CSejour $sejour*/ $sejour = $dossier_medical->_ref_object; $doss_patient = $sejour->loadRefPatient()->loadRefDossierMedical(); if ($type) { $doss_patient->loadRefsAntecedentsOfType($type); } else { $doss_patient->loadRefsAntecedents(); } $tab_atc["CPatient"] = $doss_patient->_ref_antecedents_by_type;
CCanDo::checkAdmin(); $ds = CSQLDataSource::get("std"); $mode = CValue::get("mode", "check"); $request = "SELECT DISTINCT(d.object_id), d.object_class\r\n FROM `dossier_medical` d\r\n WHERE d.`object_id` <> '0'\r\n AND EXISTS (\r\n SELECT * FROM `dossier_medical` e\r\n WHERE e.`object_class` = d.`object_class`\r\n AND e.`object_id` = d.`object_id`\r\n AND e.`dossier_medical_id` <> d.`dossier_medical_id`\r\n );"; $resultats = $ds->loadList($request); CAppUI::stepAjax("Dossiers à corriger: " . count($resultats), UI_MSG_OK); if ($mode == "repair") { $correction = 0; foreach ($resultats as $result) { //Dossier de références $where = array(); $where["object_class"] = "= '" . $result['object_class'] . "'"; $where["object_id"] = "= '" . $result['object_id'] . "'"; $dossier_ok = new CDossierMedical(); $dossier_ok->loadObject($where, "dossier_medical_id ASC"); $dossier_ok->loadRefsAntecedents(); $dossier_ok->loadRefsEtatsDents(); $dossier_ok->loadRefsTraitements(); //Chargement des autres dossiers $_dossier = new CDossierMedical(); $where["dossier_medical_id"] = "!= '" . $dossier_ok->_id . "'"; $dossiers = $_dossier->loadList($where); //Merge des dossiers foreach ($dossiers as $dossier) { /* @var CDossierMedical $dossier*/ if ($msg = $dossier_ok->merge(array($dossier))) { mbTrace($msg); } else { $correction++; } }