Browse Source

Debug dans getOvalide

master
Maxime Wack 8 years ago
parent
commit
aec11540b8
2 changed files with 46 additions and 12 deletions
  1. +23
    -5
      donnees.R
  2. +23
    -7
      functionsOvalide.R

+ 23
- 5
donnees.R View File

@@ -1,14 +1,29 @@
source("functionsOvalide.R")
library(lubridate)

annee <- 2015
mois <- 10
date <- "04/12/2015"

user <- readline("Livenne user : ")
password <- readline("Livenne pass : ")
arguments <- commandArgs()
if (length(arguments) != 13)
{
print ("Usage : donnees.sh CHUuser CHUpass ATIHuser ATIHpass LivenneUser LivennePass annee mois")
quit()
} else
{
CHUuser <- arguments[6]
CHUpass <- arguments[7]
ATIHuser <- arguments[8]
ATIHpass <- arguments[9]
user <- arguments[10]
pass <- arguments[11]
annee <- as.numeric(arguments[12])
mois <- as.numeric(arguments[13])
}

# Ovalide
# getOvalide
getOvalide(CHUuser, CHUpass, ATIHuser, ATIHpass, annee, mois)

# extractOvalide
read.csv2("listOvalide.csv") %>%
{
apply(., 1, . %>%
@@ -28,6 +43,9 @@ read.csv2("listOvalide.csv") %>%
names(OvalideP) <<- .$name
}

unlink(str_c("OVALIDE T2A.MCO.DGF", annee, mois, "html", sep = "."))
unlink(str_c("OVALIDE T2A.MCO.DGF", annee - 1, mois, "html", sep = "."))

# RUM + structure + calcul durée de séjour
src_mysql("pmsi_dim", "localhost", user = user, password = password) %>%
tbl(sql("SELECT idhosp, idrss, idrum, date_entree, date_sortie, cmd, um FROM fix116


+ 23
- 7
functionsOvalide.R View File

@@ -51,41 +51,57 @@ getOvalide <- function(CHUuser, CHUpass, ATIHuser, ATIHpass, annee, mois)
unlink("cookie.jar")

# Cookie
print("COOKIE")
system(str_c(curl, pasrel))

# Token
print("TOKEN")
getURL(pasrel, .opts = curlopts) %>%
read_html %>%
html_node("input[name='lt']") %>%
html_attr("value") -> token
print(token)

# Login
system(str_c(curl, '-d "username=', ATIHuser, '&password=', curlPercentEncode(ATIHpass), '&lt=', token, '&_eventId=submit&submit=SE+CONNECTER" ', url))
print("LOGIN")
system(str_c(curl, '-d "username=', ATIHuser, '&password=', curlPercentEncode(ATIHpass), '&lt=', token, '&_eventId=submit&submit=SE+CONNECTER" ', pasrel))

# Auth
getURL(str_c(epmsi, 'authenticate.do'),
.opts = curlopts)
print("AUTH")
system(str_c(curl, epmsi, 'authenticate.do'))
# getURL(str_c(epmsi, 'authenticate.do'),
# .opts = curlopts) %>%
# cat

# Applis
print("APPLIS")
getURL(str_c(epmsi, 'jsp/epmsi/applis/applis.jsp'),
.opts = curlopts)
.opts = curlopts) %>%
cat

# Ovalide
print("OVALIDE")
getURL(str_c(epmsi, 'jsp/epmsi/applis/applisMat2a.jsp'),
referer = str_c(epmsi, 'jsp/epmsi/applis/applis.jsp'),
.opts = curlopts)
.opts = curlopts) %>%
cat

# Ovalide MCO T2A
print("MCO T2A")
getURL(str_c(epmsi, 'appli_16.do?champPmsi=1&statut=1&applicationType=3'),
referer = str_c(epmsi, 'jsp/epmsi/applis/applisMat2a.jsp'),
.opts = curlopts)
.opts = curlopts) %>%
cat

# Resultats pour annee/mois
print("RESULTATS")
getURL(str_c(epmsi, 'appli_05.do?year=', annee, '&period=', mois),
referer = str_c(epmsi, 'appli_16.do?champPmsi=1&statut=1&applicationType=3'),
.opts = curlopts)
.opts = curlopts) %>%
cat

# Tableaux
print("TABLEAUX")
getBinaryURL(str_c(epmsi, 'appli_05.zip?action=4&win=1'),
referer = str_c(epmsi, 'appli_05.do?year=', annee, '&period=', mois),
.opts = curlopts) %>%


Loading…
Cancel
Save