コード例 #1
0
ファイル: repository.php プロジェクト: athoncopy/athon
writeTimeFile($idfile . "--Repository: Ho terminato");
//================  FINE RISPOSTA AL DOCUMENT SOURCE  =================//
if ($ATNA_active == 'A') {
    require_once './lib/syslog.php';
    $syslog = new Syslog();
    // ATNA IMPORT per Provide And Register Document Set
    $eventOutcomeIndicator = "0";
    //EventOutcomeIndicator 0 OK 12 ERROR
    $repository_endpoint = $_SERVER['PHP_SELF'];
    $ip_repository = $rep_host;
    $ip_source = $_SERVER['REMOTE_ADDR'];
    $today = date("Y-m-d");
    $cur_hour = date("H:i:s");
    $datetime = $today . "T" . $cur_hour;
    $message_import = "<AuditMessage>\n    <EventIdentification EventDateTime=\"{$datetime}\" EventActionCode=\"R\" EventOutcomeIndicator=\"0\">\n        <EventID code=\"110107\" codeSystemName=\"DCM\" displayName=\"Import\"/>\n        <EventTypeCode code=\"ITI-15\" codeSystemName=\"IHE Transactions\" displayName=\"Provide and Register Document Set\"/>\n    </EventIdentification>\n    <AuditSourceIdentification AuditSourceID=\"MARIS Repository\">\n        <AuditSourceTypeCode code=\"4\" />\n    </AuditSourceIdentification>\n    <ActiveParticipant UserID=\"{$ip_source}\" UserIsRequestor=\"true\">\n        <RoleIDCode code=\"110153\" codeSystemName=\"DCM\" displayName=\"Source\"/>\n    </ActiveParticipant>\n    <ActiveParticipant UserID=\"{$repository_endpoint}\" UserIsRequestor=\"false\">\n        <RoleIDCode code=\"110152\" codeSystemName=\"DCM\" displayName=\"Destination\"/>\n    </ActiveParticipant>\n    <ParticipantObjectIdentification ParticipantObjectID=\"{$submission_uniqueID}\" ParticipantObjectTypeCode=\"2\" ParticipantObjectTypeCodeRole=\"20\">\n        <ParticipantObjectIDTypeCode code=\"urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd\"/>\n    </ParticipantObjectIdentification>\n    </AuditMessage>";
    $logSyslog = $syslog->Send($ATNA_host, $ATNA_port, $message_import);
    // ATNA EXPORT per Register Document Set
    $eventOutcomeIndicator = "0";
    //EventOutcomeIndicator 0 OK 12 ERROR
    $message_export = "<AuditMessage>\n    <EventIdentification EventDateTime=\"{$datetime}\" EventActionCode=\"R\" EventOutcomeIndicator=\"{$eventOutcomeIndicator}\">\n        <EventID code=\"110106\" codeSystemName=\"DCM\" displayName=\"Export\"/>\n        <EventTypeCode code=\"ITI-14\" codeSystemName=\"IHE Transactions\" displayName=\"Register Document Set\"/>\n    </EventIdentification>\n    <AuditSourceIdentification AuditSourceID=\"MARIS Repository\">\n        <AuditSourceTypeCode code=\"4\" />\n    </AuditSourceIdentification>\n    <ActiveParticipant UserID=\"{$ip_repository}\" UserIsRequestor=\"true\">\n        <RoleIDCode code=\"110153\" codeSystemName=\"DCM\" displayName=\"Source\"/>\n    </ActiveParticipant>\n    <ActiveParticipant UserID=\"http://" . $reg_host . ":" . $reg_port . $reg_path . "\" UserIsRequestor=\"false\">\n        <RoleIDCode code=\"110152\" codeSystemName=\"DCM\" displayName=\"Destination\"/>\n    </ActiveParticipant>\n    <ParticipantObjectIdentification ParticipantObjectID=\"{$submission_uniqueID}\" ParticipantObjectTypeCode=\"2\" ParticipantObjectTypeCodeRole=\"20\">\n        <ParticipantObjectIDTypeCode code=\"urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd\"/>\n    </ParticipantObjectIdentification>\n    </AuditMessage>";
    $logSyslog = $syslog->Send($ATNA_host, $ATNA_port, $message_export);
    writeTimeFile($idfile . "--Repository: Ho spedito i messaggi di ATNA");
}
unset($_SESSION['tmp_path']);
unset($_SESSION['idfile']);
unset($_SESSION['logActive']);
unset($_SESSION['log_query_path']);
unset($_SESSION['tmp_retrieve_path']);
//PULISCO LA CACHE TEMPORANEA
if ($clean_cache == "A") {
    if ($windows > 0) {
コード例 #2
0
ファイル: storedquery.php プロジェクト: athoncopy/athon
// 	#### SI NODI CLASSIFICATION
//
//
//
// }//END OF if($returnType_a=="LeafClass" && $returnComposedObjects_a=="true")
// ATNA Stored Query
if ($ATNA_active == 'A') {
    $today = date("Y-m-d");
    $cur_hour = date("H:i:s");
    $datetime = $today . "T" . $cur_hour;
    require_once './lib/syslog.php';
    $syslog = new Syslog();
    $message_query = "<AuditMessage xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"healthcare-security-audit.xsd\">\n\t\t<EventIdentification EventActionCode=\"E\" EventDateTime=\"{$datetime}\" EventOutcomeIndicator=\"0\">\n\t\t\t<EventID code=\"110112\" codeSystemName=\"DCM\" displayName=\"Query\"/>\n\t\t\t<EventTypeCode code=\"ITI-18\" codeSystemName=\"IHE Transactions\" displayName=\"Registry Stored Query\"/>\n\t\t</EventIdentification>\n\t\t<AuditSourceIdentification AuditSourceID=\"MARIS REGISTRY\"/>\n\t\t\t<ActiveParticipant UserID=\"Consumer\" NetworkAccessPointTypeCode=\"2\" NetworkAccessPointID=\"" . $_SERVER['REMOTE_ADDR'] . "\"  UserIsRequestor=\"true\">\n        \t\t<RoleIDCode code=\"110153\" codeSystemName=\"DCM\" displayName=\"Source\"/>\n\t\t</ActiveParticipant>\n\t\t<ActiveParticipant UserID=\"" . $http_protocol . $ip_server . ":" . $port_server . $www_REG_path . "\" NetworkAccessPointTypeCode=\"2\" NetworkAccessPointID=\"" . $reg_host . "\"  UserIsRequestor=\"false\">\n        \t\t<RoleIDCode code=\"110152\" codeSystemName=\"DCM\" displayName=\"Destination\"/>\n    \t\t</ActiveParticipant>\n\t\t<ParticipantObjectIdentification ParticipantObjectID=\"empty\" ParticipantObjectTypeCode=\"2\" ParticipantObjectTypeCodeRole=\"24\">\n        \t\t<ParticipantObjectIDTypeCode code=\"ITI-16\" codeSystemName=\"IHE Transactions\" displayName=\"Registry Stored Query\"/>\n\t\t<ParticipantObjectQuery>" . base64_encode($SQLQuery_ESEGUITA) . "</ParticipantObjectQuery>    \t</ParticipantObjectIdentification>\n\t\t</AuditMessage>";
    // ParticipantObjectID da TF deve essere vuoto ma non valida da syslog nist
    //manca la parte relativa al recupero del patientID.  <ParticipantObjectIdentification ParticipantObjectID=\"".trim($patient_id)."\" ParticipantObjectTypeCode=\"1\" ParticipantObjectTypeCodeRole=\"1\"><ParticipantObjectIDTypeCode code=\"2\"/></ParticipantObjectIdentification>
    $logSyslog = $syslog->Send($ATNA_host, $ATNA_port, $message_query);
    writeTimeFile($idfile . "--StoredQuery: Ho spedito il messaggio di ATNA");
}
// Fine if($ATNA_active=='A')
//Statistiche
if ($statActive == "A") {
    //Parte per calcolare i tempi di esecuzione
    $mtime = microtime();
    $mtime = explode(" ", $mtime);
    $mtime = $mtime[1] + $mtime[0];
    $endtime = $mtime;
    $totaltime = number_format($endtime - $starttime, 15);
    $STAT_QUERY = "INSERT INTO STATS (REPOSITORY,DATA,EXECUTION_TIME,OPERATION) VALUES ('" . $_SERVER['REMOTE_ADDR'] . "',CURRENT_TIMESTAMP,'{$totaltime}','STOREDQUERY-B')";
    $ris = query_exec2($STAT_QUERY, $connessione);
    writeSQLQueryService($ris . ": " . $STAT_QUERY);
}