xrecepter: wrapper for medicin macro

View source: R/xrecepter.R

xrecepterR Documentation

wrapper for medicin macro

Description

wrapper for medicin macro

Usage

xrecepter(
  drugdb,
  adm,
  atc,
  window = 5,
  value,
  min,
  max,
  def,
  maxdepot,
  period = c("'01jan1995'd", "'31dec2015'd"),
  name = "adrug",
  user,
  wd,
  sas.program = "/usr/local/bin/sas ",
  sas.switches,
  sas.runner,
  macro = "~/research/SoftWare/heaven/sas/medicin_macro_version_31.sas",
  save.tmp = FALSE,
  verbose = TRUE,
  server = "doob",
  remote = FALSE,
  remote.home,
  left_only = 1
)

Arguments

drugdb

drugdb data

adm

admission data

atc

atc kode specifying drugdb of interest

window

number of purchases that enter the calculations

value

is a vector of strengths of one unit (e.g., pill) of the drug. The vector should have one such strength for each of the different packages that occur in the data.

min

is a vector of the same length as value where each element is the assumed minimum total dosis that a patient can consume on one day. For example, if the value is 50 mg and the pills of this strength can be cut (in halves) the minimum total dosis is 25 mg.

max

is a vector of the same length as value where each element is the assumed maximum total dosis that a patient can consume on one day. For example, if the value is 50 mg and one can at most consume 4 pills a day the maximum total dosis is 200 mg.

def

is a vector of the same length as value where each element is the assumed default dosis that an average patient would consume on one day. For example, if the value is 50 mg and usually a patient would consume 2 pills the default is 100 mg.

maxdepot

Maximum number of units that a patient can stash

period

Vector of two dates that SAS can eat: c("'01jan1995'd","'31dec2015'd"). Can also be numeric values: number of days since 1960-01-01.

name

working name of output file (only relevant when save.tmp is set)

user

user name on remote (unix like) machine

wd

working directory

sas.program

path to sas program

sas.switches

On linux this defaults to "" on any other system to "-batch -nosplash -noenhancededitor -sysin"

sas.runner

How sas is invoked. On linux this defaults to "system" on any other system to "shell".

macro

path to sas macro

save.tmp

if TRUE do not delete the temporary SAS files

verbose

like bla bla?

server

name of remote (unix like) machine

remote

if TRUE run on a remote (unix like) machine

remote.home

home folder on remote (unix like) machine

left_only

- when 1 only use prior prescription, when 0 use prior and future prescriptions.

Details

wrapper for medicin macro

Author(s)

Thomas A. Gerds <tag@biostat.ku.dk>

Examples

library(heaven)
## Not run: 
 library(heaven)
library(data.table)
set.seed(05021992)
N=18
packs = list("R03AK11"=list(c(10,1)))
lmdb=simPrescriptionData(N,packages=packs,max.packages=1)
lpr=simAdmissionData(N)
## very simple data 
lmdb <- lmdb[c(1,4,18)]
R03 = list(atc=c("R03AK11"),
          maxdepot=100,
          period=as.Date(c("1995-01-01", "2012-12-31")),
           prescriptionwindow=2,
          doses=list(value=c(5,10),
                     min = c(.5,.5),
                     max = c(2,2),
                     def = c(1,1)))
xrecepter(drugdb=lmdb,adm=lpr,window=5,remote=FALSE,wd="~/tmp",save.tmp=0L,
          value=rep(R03$doses$value,2),min=rep(R03$doses$min,2),max=rep(R03$doses$max,2),
          def=rep(R03$doses$def,2),maxdepot=100,period=c(12784,20089),atc="R03AK11",
          name="blaupill",sas.program="/usr/local/bin/sas",
          verbose=FALSE)

## End(Not run) 


tagteam/heaven documentation built on April 26, 2024, 6:22 a.m.