Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oppfolging 5aar utforsker #48

Merged
merged 5 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ablanor
Title: AblaNor- Rapporteket
Version: 1.3.2
Version: 1.3.3
Authors@R: c(
person(given = "Kristina",
family = "Skaare",
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# ablanor 1.3.3
Bugfiks av det sammenstilte prosedyreskjemaet med 5-års oppfølging.

# ablanor 1.3.2
Fjerne egne getData for sammenstilte skjemaer i utforsker. All
databehandling skjer nå i getPrep funksjonene. Lagt til flere variabler fra
Expand Down
69 changes: 35 additions & 34 deletions R/getPrepData.R
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,7 @@ getBaseregProsFollowup5Data <- function(registryName,

# VELGER KUN 5 års oppfølging (PROMS)
d_proms %<>%
dplyr::filter(registration_type == "FiveYearollowup") %>%
dplyr::filter(registration_type == "Fiveyearfollowup") %>%
dplyr::rename("proms_status" = "status",
"mceid_followup" = "mceid",
"proms_tssendt" = "tssendt",
Expand Down Expand Up @@ -1759,7 +1759,7 @@ getBaseregProsFollowup5Data <- function(registryName,

# Tidsvariabler for besvart followup
aar_followup_5aar = as.ordered(
x = lubridate::year(followup5_dato_followup)),
x = lubridate::year(dato_followup)),


# Tidsvariabler for opprettet followup
Expand All @@ -1781,50 +1781,51 @@ getBaseregProsFollowup5Data <- function(registryName,
dplyr::arrange(mceid) %>%


dplyr::mutate(

eprom_datagrunnlag_5aar = factor(
x = dplyr::case_when(

# ALT FOR NYE REGISTRERINGER
dato_pros > nyeste_eprom_bestilling ~
"nei, registreringen er for ny",
eprom_datagrunnlag_5aar = factor(
x = dplyr::case_when(

# ALT FOR NYE REGISTRERINGER
dato_pros > nyeste_eprom_bestilling ~
"nei, registreringen er for ny",

# EPROMS OPPRETTET OG SATT TIL AVDØD MED EN GANG
(has_fiveyearfollowup %in% 1 &
eprom_opprettet_5aar %in% "ja" &
followup5_incomplete_reason %in% 3) ~
"nei, opprettet satt til død",

# EPROMS OPPRETTET OG SATT TIL AVDØD MED EN GANG
(has_fiveyearfollowup %in% 1 &
eprom_opprettet_5aar %in% "ja" &
followup5_incomplete_reason %in% 3) ~
"nei, opprettet satt til død",

# NY VERSJON: KONTROLL KRITIER FØR OPPRETTELSE
(has_fiveyearfollowup %in% 1 &
is.na(eprom_opprettet_5aar)) ~
"nei, ikke opprettet etter kriteriesjekk",

# NY VERSJON: OPPRETTELES EN DAG, OG BESTILLING INNEN 30 DAGER ETTER
# "BESTILT I DAG, SENDES I MORGEN"
(has_fiveyearfollowup %in% 1 &
eprom_opprettet_5aar %in% "ja" &
kriterie_alle_5aar %in% "ja" &
is.na(eprom_sendt_5aar)) ~
"nei, eprom venter på utsendelse",
# NY VERSJON: KONTROLL KRITIER FØR OPPRETTELSE
(has_fiveyearfollowup %in% 1 &
is.na(eprom_opprettet_5aar)) ~
"nei, ikke opprettet etter kriteriesjekk",

# NY VERSJON: OPPRETTELES EN DAG, OG BESTILLING INNEN 30 DAGER ETTER
# "BESTILT I DAG, SENDES I MORGEN"
(has_fiveyearfollowup %in% 1 &
eprom_opprettet_5aar %in% "ja" &
kriterie_alle_5aar %in% "ja" &
is.na(eprom_sendt_5aar)) ~
"nei, eprom venter på utsendelse",

# DISSE ER MED I DATAGRUNNLAGET!
(has_fiveyearfollowup %in% 1 &
eprom_opprettet_5aar %in% "ja" &
kriterie_alle_5aar %in% "ja") ~ "ja",

# DISSE ER MED I DATAGRUNNLAGET!
(has_fiveyearfollowup %in% 1 &
eprom_opprettet_5aar %in% "ja" &
kriterie_alle_5aar %in% "ja") ~ "ja"
),

levels = c("ja",
"nei, registreringen er for ny",
"nei, opprettet satt til død",
"nei, ikke opprettet etter kriteriesjekk",
"nei, eprom venter på utsendelse"),
ordered = TRUE),

levels = c("ja",
"nei, registreringen er for ny",
"nei, opprettet satt til død",
"nei, ikke opprettet etter kriteriesjekk",
"nei, eprom venter på utsendelse"),

ordered = TRUE),

eprom_besvart_5aar = dplyr::case_when(
eprom_datagrunnlag_5aar %in% "ja" &
Expand Down
Loading