# NOT RUN {
# set the connection
connectionDetails <- DatabaseConnector::createConnectionDetails()
   
# load the model and data
plpModel <- loadPlpModel("C:/plpmodel")
# extract the new data in the 'newData.dbo' schema using the model settings 
newDataList <- similarPlpData(plpModel=plpModel, 
                              newConnectionDetails = connectionDetails,
                              newCdmDatabaseSchema = 'newData.dbo',
                              newCohortDatabaseSchema = 'newData.dbo',   
                              newCohortTable = 'cohort', 
                              newCohortId = 1, 
                              newOutcomeDatabaseSchema = 'newData.dbo', 
                              newOutcomeTable = 'outcome',     
                              newOutcomeId = 2)    
               
# get the prediction:
prediction <- applyModel(newDataList$population, newDataList$plpData, plpModel)$prediction
# }
Run the code above in your browser using DataLab