/* vaccine - do Vacceine and HIV Status section. */ #include "common.h" #include "hash.h" #include "linefile.h" #include "dystring.h" #include "cheapcgi.h" #include "spDb.h" #include "gsidSubj.h" #include "hdb.h" #include "net.h" static boolean vaccineExists(struct section *section, struct sqlConnection *conn, char *subjId) /* Return TRUE if vaccineAll table exists and it has an entry with the gene symbol */ { if (sqlTableExists(conn, "gsidSubjInfo") == TRUE) { return(TRUE); } return(FALSE); } static void vaccinePrint(struct section *section, struct sqlConnection *conn, char *subjId) /* Print out Vaccine section. */ { char *immunStatus; char *daysInfectF, *daysInfectL; char *injections; char query[256]; struct sqlResult *sr; char **row; printf(""); safef(query, sizeof(query), "select immunStatus, daysInfectF, daysInfectL, injections from gsidSubjInfo where subjId='%s'", subjId); sr = sqlMustGetResult(conn, query); row = sqlNextRow(sr); if (row != NULL) { immunStatus = row[0]; daysInfectF = row[1]; daysInfectL = row[2]; injections = row[3]; printf(""); printf(""); printf(""); printf(""); printf(""); printf(""); /* remove the following item per GSID user feedback */ /*printf(""); */ printf(""); printf(""); printf(""); printf(""); } printf("
"); printf("Vaccine/Placebo: %s%s", immunStatus, GSBLANKS); printf(""); printf("Estimated Study Day of Infection (ESDI)*: %s\n", daysInfectF); printf("
"); /* !!! currently all subjects in the database are infected. */ /* update this when non-infected subjects addded into DB */ printf("HIV Status: %s%s", "Infected", GSBLANKS); printf(""); printf("Days of infection relative to last negative date: %s\n", daysInfectL); printf("
"); printf("Injections:  %s%s", injections, GSBLANKS); printf("
"); sqlFreeResult(&sr); return; } struct section *vaccineSection(struct sqlConnection *conn, struct hash *sectionRa) /* Create vaccine section. */ { struct section *section = sectionNew(sectionRa, "vaccine"); section->exists = vaccineExists; section->print = vaccinePrint; return section; }