@ -248,9 +290,10 @@ nhcs|Character vector with the NHCs to test.
file|Template file that will be used to interact with the DB.
file|Template file that will be used to interact with the DB.
samples.mod|If TRUE (default), it fills the "samples" template sheet.
samples.mod|If TRUE (default), it fills the "samples" template sheet.
clinics.mod|If TRUE (default), it fills the "CLINICS" template sheet.
clinics.mod|If TRUE (default), it fills the "CLINICS" template sheet.
dbtype|used to manually specify the database type. It defaults to NULL and the type is deduced.
### Details
### Details
Fills the Query Template file with the OVID and OV newly generated codes. It is required that the DB has been updated with the sqlGenOVID function. It replaces previous content in the template file sheets that are filled. In the case of "CLINICS" table, if there were already an entry in the DB for that OVID code, the template file is filled with that information.
Fills the Query Template file with the OVID and OV or UMID and UM newly generated codes. It is required that the DB has been updated with the sqlGenOVID function. It replaces previous content in the template file sheets that are filled. In the case of "CLINICS" table, if there were already an entry in the DB for that OVID/UMID code, the template file is filled with that information.
### Value
### Value
Invisibly for success (and failures cause errors).
Invisibly for success (and failures cause errors).
@ -316,6 +396,7 @@ conn|connection handle returned by odbcConnect.
filetemp|Template file that will be used to interact with the DB.
filetemp|Template file that will be used to interact with the DB.
sinc.samples|If TRUE (default is FALSE for security), it updates the SAMPLES table in the DB with the information in the "samples" template sheet.
sinc.samples|If TRUE (default is FALSE for security), it updates the SAMPLES table in the DB with the information in the "samples" template sheet.
clinics.mod|If TRUE (default is FALSE for security), it updates the CLINICS table in the DB with the information in the "CLINICS" template sheet.
clinics.mod|If TRUE (default is FALSE for security), it updates the CLINICS table in the DB with the information in the "CLINICS" template sheet.
dbtype|used to manually specify the database type. It defaults to NULL and the type is deduced.
### Details
### Details
Updates the DB with the information filled in the template file. All the "samples" entries are added as new rows (as all samples are new even if the patient was already in the DB). The new patients included in the "CLINICS" sheet are introduced in the DB as new rows and the ones that were already there are modified in its previous row location.
Updates the DB with the information filled in the template file. All the "samples" entries are added as new rows (as all samples are new even if the patient was already in the DB). The new patients included in the "CLINICS" sheet are introduced in the DB as new rows and the ones that were already there are modified in its previous row location.
@ -247,9 +288,10 @@ nhcs|Character vector with the NHCs to test.
file|Template file that will be used to interact with the DB.
file|Template file that will be used to interact with the DB.
samples.mod|If TRUE (default), it fills the "samples" template sheet.
samples.mod|If TRUE (default), it fills the "samples" template sheet.
clinics.mod|If TRUE (default), it fills the "CLINICS" template sheet.
clinics.mod|If TRUE (default), it fills the "CLINICS" template sheet.
dbtype|used to manually specify the database type. It defaults to NULL and the type is deduced.
### Details
### Details
Fills the Query Template file with the OVID and OV newly generated codes. It is required that the DB has been updated with the sqlGenOVID function. It replaces previous content in the template file sheets that are filled. In the case of "CLINICS" table, if there were already an entry in the DB for that OVID code, the template file is filled with that information.
Fills the Query Template file with the OVID and OV or UMID and UM newly generated codes. It is required that the DB has been updated with the sqlGenOVID function. It replaces previous content in the template file sheets that are filled. In the case of "CLINICS" table, if there were already an entry in the DB for that OVID/UMID code, the template file is filled with that information.
### Value
### Value
Invisibly for success (and failures cause errors).
Invisibly for success (and failures cause errors).
@ -315,6 +394,7 @@ conn|connection handle returned by odbcConnect.
filetemp|Template file that will be used to interact with the DB.
filetemp|Template file that will be used to interact with the DB.
sinc.samples|If TRUE (default is FALSE for security), it updates the SAMPLES table in the DB with the information in the "samples" template sheet.
sinc.samples|If TRUE (default is FALSE for security), it updates the SAMPLES table in the DB with the information in the "samples" template sheet.
clinics.mod|If TRUE (default is FALSE for security), it updates the CLINICS table in the DB with the information in the "CLINICS" template sheet.
clinics.mod|If TRUE (default is FALSE for security), it updates the CLINICS table in the DB with the information in the "CLINICS" template sheet.
dbtype|used to manually specify the database type. It defaults to NULL and the type is deduced.
### Details
### Details
Updates the DB with the information filled in the template file. All the "samples" entries are added as new rows (as all samples are new even if the patient was already in the DB). The new patients included in the "CLINICS" sheet are introduced in the DB as new rows and the ones that were already there are modified in its previous row location.
Updates the DB with the information filled in the template file. All the "samples" entries are added as new rows (as all samples are new even if the patient was already in the DB). The new patients included in the "CLINICS" sheet are introduced in the DB as new rows and the ones that were already there are modified in its previous row location.
query<-paste0("SELECT O.NHC,S.* FROM ",db["dbtables"]," S INNER JOIN ",db["dbcode"]," O ON O.",db["dbcode"],"=S.",db["dbcode"])
query<-paste0("SELECT O.NHC,S.* FROM ",db["dbtables"]," S INNER JOIN ",db["dbcode"]," O ON O.",db["dbcode"],"=S.",db["dbcode"])
}
if (nrow(sqlQuery(conn, query) %>% filter(NHC %in% nhcs)) == 0){
return("No hay muestras de ningún paciente.")
}
if (isFALSE(verb)){
if (isFALSE(verb)){
sqlQuery(conn, "SELECT O.NHC,S.*
FROM SAMPLES S
INNER JOIN OVID O
ON O.OVID=S.OVID") %>% filter(NHC %in% nhcs) %>%
<td>If TRUE (default), it fills the “CLINICS” template sheet.</td>
<td>If TRUE (default), it fills the “CLINICS” template sheet.</td>
</tr>
</tr>
<trclass="even">
<td>dbtype</td>
<td>used to manually specify the database type. It defaults to NULL and the type is deduced.</td>
</tr>
</tbody>
</tbody>
</table>
</table>
</div>
</div>
<divid="details-5"class="section level3">
<divid="details-5"class="section level3">
<h3>Details</h3>
<h3>Details</h3>
<p>Fills the Query Template file with the OVID and OV newly generated codes. It is required that the DB has been updated with the sqlGenOVID function. It replaces previous content in the template file sheets that are filled. In the case of “CLINICS” table, if there were already an entry in the DB for that OVID code, the template file is filled with that information.</p>
<p>Fills the Query Template file with the OVID and OV or UMID and UM newly generated codes. It is required that the DB has been updated with the sqlGenOVID function. It replaces previous content in the template file sheets that are filled. In the case of “CLINICS” table, if there were already an entry in the DB for that OVID/UMID code, the template file is filled with that information.</p>