Browse Source

Debug text

master
Maxime Wack 8 years ago
parent
commit
21025adfc8
2 changed files with 12 additions and 9 deletions
  1. +3
    -0
      donnees.R
  2. +9
    -9
      functionsOvalide.R

+ 3
- 0
donnees.R View File

@@ -24,6 +24,7 @@ if (length(arguments) != 13)
getOvalide(CHUuser, CHUpass, ATIHuser, ATIHpass, annee, mois)

# extractOvalide
print("ePMSI : extraction des tableaux")
read.csv2("listOvalide.csv") %>%
{
apply(., 1, . %>%
@@ -47,6 +48,7 @@ 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
print("LIVENNE : RUM et structure")
src_mysql("pmsi_dim", "localhost", user = user, password = password) %>%
tbl(sql("SELECT idhosp, idrss, idrum, date_entree, date_sortie, cmd, um FROM fix116
UNION
@@ -76,6 +78,7 @@ src_mysql("pmsi_dim", "localhost", user = user, password = password) %>%
summarise(duree_rss = sum(duree_rum))) -> rum

# GAM et structure --> hospit non codées
print("LIVENNE : GAM")
src_mysql("pmsi_dim", "localhost", user = user, password = password) %>%
tbl("mvt_gam") %>%
select(idhosp, date_entree, date_sortie, uf, pass_typ, type_resp) %>%


+ 9
- 9
functionsOvalide.R View File

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

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

# Token
print("TOKEN")
print("ePMSI : TOKEN")
getURL(pasrel, .opts = curlopts) %>%
read_html %>%
html_node("input[name='lt']") %>%
@@ -63,45 +63,45 @@ getOvalide <- function(CHUuser, CHUpass, ATIHuser, ATIHpass, annee, mois)
print(token)

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

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

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

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

# Ovalide MCO T2A
print("MCO T2A")
print("ePMSI : 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) %>%
cat

# Resultats pour annee/mois
print("RESULTATS")
print("ePMSI : 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) %>%
cat

# Tableaux
print("TABLEAUX")
print("ePMSI : 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