-- select * from hib.[documenttemplatereviewgroup] order by groupid,documenttemplateid
-- select * from hib.[documenttemplatereviewgroup] dtrg left join hib.documenttemplate dt on dtrg.documenttemplateid=dt.id left join hib.[group] g on dtrg.groupid=g.id order by groupid,documenttemplateid

--; Delete all entries in the [documenttemplatereviewgroup] table
Delete from hib.[documenttemplatereviewgroup]

/*
	For NDS Reviewer, display all documents on the Documents page except those specifically for an Independent data source.

	For ORD Reviewer, display all documents on the Documents page except those specifically for an Independent data source.

	For Privacy Reviewer, display all documents on the Documents page except those specifically for an Independent data source.

	For Security Reviewer, do not display the following documents on the Documents page:
		•	EHR Access Request Form
		•	Those specific to an Independent Data Source

	For CAPRI/VistAWeb Reviewer, do not display the following documents on the Documents page:
		•	OEF-OIF Data Use Agreement
		•	CDW Domain Checklist
		•	Vital Status Rules of Behavior
		•	Those specific to an Independent Data Source

	For Homeless Reviewer, do not display the following documents on the Documents page:
		•	EHR Access Request Form
		•	OEF-OIF Data Use Agreement
		•	CDW Domain Checklist
		•	Vital Status Rules of Behavior 
		•	Those specific to an Independent Data Source


	(Tim on 11/20/2014:  The independent should be able to see documents in Req. 3.9, the Research Request memo, and the Research Protocol.)
			•	Research Request Memo
			•	Research Protocol

		3.9: The following documents are common to all workflows and may be changed by Change Request:
			•	Research Study Institutional Review Board (IRB) Approval Letter
			•	Sample Informed Consent and HIPAA Authorization
			•	Research and Development (RD) Committee Approval Letter
			•	IRB Approval of Waiver of HIPAA-Compliant Authorization 
			•	Real SSN Access Request
*/

/*
--Security Reviewer
select * from hib.documenttemplate where [name] like '%EHR Access Request Form%'		--documenttemplateid=43

--CAPRI/VistAWeb Reviewer
select * from hib.documenttemplate where [name] like '%OEF-OIF Data Use Agreement%'		--documenttemplateid=42
select * from hib.documenttemplate where [name] like '%CDW-Domain Checklist%'			--documenttemplateid=19
select * from hib.documenttemplate where [name] like '%Vital Status Rules of Behavior%'	--documenttemplateid=16

--Homeless Reviewer
select * from hib.documenttemplate where [name] like '%EHR Access Request Form%'		--documenttemplateid=43
select * from hib.documenttemplate where [name] like '%OEF-OIF Data Use Agreement%'		--documenttemplateid=42
select * from hib.documenttemplate where [name] like '%CDW-Domain Checklist%'			--documenttemplateid=19
select * from hib.documenttemplate where [name] like '%Vital Status Rules of Behavior%'	--documenttemplateid=16
*/

--Security Reviewer, do not display the following documents on the Documents page:
insert into hib.[documenttemplatereviewgroup] (documenttemplateid, groupid)
values (43, 5)


--CAPRI/VistAWeb Reviewer, do not display the following documents on the Documents page:
insert into hib.[documenttemplatereviewgroup] (documenttemplateid, groupid)
values (42, 13)
insert into hib.[documenttemplatereviewgroup] (documenttemplateid, groupid)
values (19, 13)
insert into hib.[documenttemplatereviewgroup] (documenttemplateid, groupid)
values (16, 13)


--Homeless Reviewer, do not display the following documents on the Documents page:
insert into hib.[documenttemplatereviewgroup] (documenttemplateid, groupid)
values (43, 16)
insert into hib.[documenttemplatereviewgroup] (documenttemplateid, groupid)
values (42, 16)
insert into hib.[documenttemplatereviewgroup] (documenttemplateid, groupid)
values (19, 16)
insert into hib.[documenttemplatereviewgroup] (documenttemplateid, groupid)
values (16, 16)

