Stored Procedures Stored Procedures

NameDescription
dbo.AddAlertForDSSRule
dbo.AddAlertForPerson
dbo.AddAlertReminder
dbo.AddAlertResponse
dbo.AddClinData
dbo.AddClinForm
dbo.AddClinProblem
dbo.AddClinRelationToGroup
dbo.AddDrug
dbo.AddDrugByNewStrength
dbo.AddDrugByRestart
dbo.AddDrugReaction
dbo.AddDrugReasonStores a reason for starting or stopping a certain drug.
dbo.AddDrugTemplate
dbo.AddDrugTemplateByExample
dbo.AddDSSRuleText
dbo.AddDSSRuleToStudy
dbo.AddLabCodeToGroup
dbo.AddLabData
dbo.AddLabGroup
dbo.AddLabName
dbo.AddLabNameToGroup
dbo.AddLabRequest
dbo.AddMetaEvent
dbo.AddMetaForm
dbo.AddMyCenterLets a user declare what StudyCenter he is working in.  Will not update this relation if it already exists.  This allows a user to select a center a first time, but not to change it.  The idea is to reduce the burden on a system administrator for new users.  UpdateUserCenter may have more restricted permissions.
dbo.AddMyProfessionLets a user set his own profession.  
Note: If the user already has a profession, nothing will  happen.  The reason for this is to allow a user to select a profession the first time, reducing the burden on a system administrator, but to stop people to change professjon temporarily to get access to data they are not permitted to see.  
dbo.AddMyselfLets a user update his own personal data, reducing the burden on a system administrator.  Unlike the AddPerson procedure, this procedure will update the personal details of an existing person.
dbo.AddPersonAdd a Person to the Person table.  If the person already exists, nothing will happen.  The matching PersonId is returned from this procedure as a 1-row dataset.
dbo.AddRelation
dbo.AddSessionCreates a Session in the UserLog table.
dbo.AddStudCaseAdds a Person to a Study.  If the Person is already part of this Study, nothing will happen (no error).
dbo.AddStudyAdds a Study to the Study table.  Adding an existing study does nothing (no error).
dbo.AddStudyCenterAdds a StudyCenter.  Adding an existing StudyCenter does nothing (no error).
dbo.AddStudyGroupAdds a StudyGroup.  Study groups are always local to a StudyCenter.  If the StudyGroup already exists, nothing happens (no error).  Returns the GroupId for the group with the specified name.
dbo.AddTextItem
dbo.AddUser
dbo.ChangePassword
dbo.CloseImportContext
dbo.CloseSession
dbo.DbCheckVersion
dbo.DbFinalizeUpgrade
dbo.DbStartUpgrade
dbo.DeleteClinDataRow
dbo.DeleteClinForm
dbo.DeleteClinProblem
dbo.DeleteDrug
dbo.DeleteDrugTemplate
dbo.DeleteEvent
dbo.DeleteExternalLabdata
dbo.DeleteImportBatch
dbo.DeleteImportContext
dbo.DeleteLabGroup
dbo.DeleteLabName
dbo.DisableDrugDosingSchemes
dbo.ExpireRelations
dbo.GetAlertsByPerson
dbo.GetAlertsByStudyGroup
dbo.GetCaseList
dbo.GetCaseListAlert
dbo.GetCaseListAnonymous
dbo.GetCaseListDrug
dbo.GetCaseListDrugCombo
dbo.GetCaseListInactive
dbo.GetCaseListLab
dbo.GetCaseListLastForm
dbo.GetCaseListMyRelations
dbo.GetCaseListNewForms
dbo.GetCaseListNews
dbo.GetCaseListNewsweek
dbo.GetCAVE
dbo.GetCAVEHistory
dbo.GetClinAuditTrail
dbo.GetClinData
dbo.GetClinEvents
dbo.GetClinFormComments
dbo.GetClinFormData
dbo.GetClinFormHistory
dbo.GetClinForms
dbo.GetClinProblems
dbo.GetClinTouchReturns a TouchId, which is needed to execute the procedure AddClinData.  To get a TouchId, the parameter @SessId is checked, to ensure that we have a valid session for the study.

Future change:
a) Revoke GRANT from public, and give rights only to groups who can edit data.
b) Inserts data into ClinEvent, which should probably be left for AddClinEvent.
dbo.GetDatabaseInfo
dbo.GetDbListBox
dbo.GetDeletedClinForms
dbo.GetDrugDoseDetails
dbo.GetDrugForMultidose
dbo.GetDrugReactions
dbo.GetDrugReactionsDisp
dbo.GetDrugReasons
dbo.GetDrugRecentChange
dbo.GetDrugs
dbo.GetDrugsDispGIG
dbo.GetDrugsStudy
dbo.GetDrugTemplate
dbo.GetDrugTemplateNames
dbo.GetDrugTreatDetails
dbo.GetFormComment
dbo.GetImportContextUpdate
dbo.GetLabData
dbo.GetLabDataSingle
dbo.GetLabDataStudy
dbo.GetLabGroupMapping
dbo.GetLabGroups
dbo.GetLabNameUngrouped
dbo.GetLabReqTestAllPending
dbo.GetLabReqTestPending
dbo.GetLabSynonyms
dbo.GetLastLabTransferDate
dbo.GetMetaForm
dbo.GetMetaForms
dbo.GetMetaProblemTypes
dbo.GetMyActivity
dbo.GetMyFavoriteForms
dbo.GetMyFavoriteProblems
dbo.GetNomMatch
dbo.GetPersonDetails
dbo.GetPersonStatus
dbo.GetPopularListItems
dbo.GetProblemsStudy
dbo.GetProfessions
dbo.GetRoleMembers
dbo.GetRoles
dbo.GetRuleLag
dbo.GetStudyAndUser
dbo.GetStudyCenters
dbo.GetStudyGroups
dbo.GetStudyOptions
dbo.GetStudyStatus
dbo.GetTextSiblings
dbo.GetUserDetails
dbo.GetUserRelations
dbo.GetUsers
dbo.GetUsersOnline
dbo.MapByDobName
dbo.MapByNationalId
dbo.MapLabToVar
dbo.OpenImportContext
dbo.RemoveProc
dbo.ReportDrugDenominator
dbo.ReportDrugUsage
dbo.ReportLabUsage
dbo.RuleDrugInteractions
dbo.RuleDrugToProblem
dbo.RulePeriodicData
dbo.RulePeriodicForm
dbo.RunAtMidnight
dbo.RunHourly
dbo.UndeleteClinForm
dbo.UpdateBatchErrors
dbo.UpdateCaseAdopt
dbo.UpdateCaseGroup
dbo.UpdateCaseStatus
dbo.UpdateCAVE
dbo.UpdateClinDataEventId
dbo.UpdateClinDataLockRow
dbo.UpdateClinDataUnlockRow
dbo.UpdateClinEventSetTime
dbo.UpdateClinFormSetTime
dbo.UpdateClinProblemSummaryAllows a user to update the summary (short text) that describes a problem in the ClinProblem Table.
dbo.UpdateClinProblemType
dbo.UpdateDrugPause
dbo.UpdateDrugStop
dbo.UpdateDrugTreatmentDosetteDetails
dbo.UpdateDrugTreatmentMultidoseDetails
dbo.UpdateDrugTreatmentWeekDetails
dbo.UpdateDSSAlerts
dbo.UpdateDSSAlertsForAll
dbo.UpdateFormComment
dbo.UpdateFormSignClinId
dbo.UpdateFormStatus
dbo.UpdateFormText
dbo.UpdateLabCodeGroup
dbo.UpdateLabGroupMoveDown
dbo.UpdateLabGroupMoveUp
dbo.UpdateLabSynonym
dbo.UpdateLabSynonymByName
dbo.UpdateLabSynonymUndo
dbo.UpdateMyCenter
dbo.UpdateMyGroup
dbo.UpdateMyProfession
dbo.UpdatePackType
dbo.UpdatePersonSetNationalIdUpdates NationalId for a Person.
dbo.UpdateShowMyGroup
dbo.UpdateUserAccessUpdates the login rights for a user.  Only administrators can execute this procedure.  It enables or disables access to the entire database for a user, not only a particular study.
dbo.UpdateUserCenterChange the Center (work location) for a user.  Normal users should not have the rights to execute this procedure, or they would be able to see patient data from other locations.  Users that actually work in more than one place should have rights to execute.
dbo.UpdateUserDetailsUpdates details about a user.  Normally, only administrators should have the rights to execute this procedure.
dbo.UpdateUserGroup
dbo.UpdateUserProfessionChanges a user's profession.  A standard user should not have permission to execute this procedure, as it could lead to breach of patient confidentiality by administrative personnel.
dbo.UtilCreateNumericLabdata
dbo.UtilDropObject
dbo.UtilEnableDeleteCreates a new Study with a negative StudyId which can hold deleted data from a normal Study.
dbo.UtilNegateUserDisables a user in the UserList, forcing a new entry next time the user logs in.  Can be used manually, but also useful after moving a database from one server to another, because user_id() will change for a certain user name.
dbo.UtilRenameDefault
dbo.UtilRenamePrimaryKey