Skip to content
Open
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions microsetta_private_api/db/patches/0148.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
-- This update to the consent documents serves three purposes:
-- 1) Update the contaxt information in all consent documents.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there is a typo: "contaxt" for "contact"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching that, fixed.

-- 2) Add the IRB Protocol number, version, and expiration to all of the consent documents.
-- 3) Fix an oustanding typo in the English versions
-- NOTE: With this patch, we're going to update our internal version number in the database to match the IRB protocol version.

-- First, we'll create a new version of the documents that are a clone of the last version (v2, created in database patch 0147.sql)
INSERT INTO ag.consent_documents (consent_type, locale, date_time, consent_content, reconsent_required, account_id, version)
SELECT consent_type, locale, NOW(), consent_content, 'true', account_id, 48
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So am I correct in understanding that 48 is the version of the IRB protocol, and that is why we are jumping from 2 to 48 instead of 3?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. When we set up the versioning system in the database, I was not aware that the IRB maintained version numbers for each set of amendments, nor that we should be showing the IRB version on the document that the participant sees. While it's not strictly necessary for our internal version to match, I think it will minimize future confusion to make the jump now and maintain parity going forward.

FROM ag.consent_documents
WHERE version = 2;

-- Next, we'll replace the contact information. It appears there were multiple different sets of verbiage for each language, so we will need to run several different queries to catch all of them.
-- English version I
UPDATE ag.consent_documents
SET consent_content = REPLACE(
consent_content,
'If you have questions or research-related problems, you may reach Rob Knight at 858-246-1184 or email our help account: [email protected].',
'If you have questions or research-related problems, you may contact:<ul><li>Rob Knight at 858-246-1184 or</li><li>The research team (phone: 858-246-3234, email: [email protected])</li></ul>'
)
WHERE version = 48 AND locale = 'en_US';

-- English version II
UPDATE ag.consent_documents
SET consent_content = REPLACE(
consent_content,
'If you have questions or research-related problems, you may reach us by emailing our help account [email protected] or Rob Knight at 858-246-1184.',
'If you have questions or research-related problems, you may contact:<ul><li>Rob Knight at 858-246-1184 or</li><li>The research team (phone: 858-246-3234, email: [email protected])</li></ul>'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not going to request this as a change, but I do want to ask it as a question: if there are future cases like this, would you consider assigning the new text to a SQL variable so that it isn't typed out (or I assume pasted) multiple times, especially for the spanish versions (where in this case all four cases appear to be the same text)? I realize this patch is a one-time fix, so one can definitely argue it wouldn't be worth it, but I've developed a special horror of text that is supposed to be identical being defined in multiple places. If it were me, I'd probably even do the same with the new version number.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely, I agree that would be cleaner approach and will use that going forward for similar database patches where we're using the same string multiple times.

)
WHERE version = 48 AND locale = 'en_US';

-- Spanish version I
UPDATE ag.consent_documents
SET consent_content = REPLACE(
consent_content,
'Si tiene preguntas o problemas relacionados con la investigación, puede comunicarse con Rob Knight al 858-246-1184 o enviar un correo electrónico a nuestra cuenta de ayuda: [email protected].',
'Si tiene alguna duda o problemas relacionados con la investigación, puede comunicarse con<ul><li>Rob Knight al 858-246-1184 o con</li><li>El equipo de investigación (teléfono: 858-246-3234, correo electrónico: [email protected])</li></ul>'
)
WHERE version = 48 AND locale IN ('es_MX', 'es_ES');

-- Spanish version II
UPDATE ag.consent_documents
SET consent_content = REPLACE(
consent_content,
'Si tiene alguna duda o problemas relacionados con la investigación, puede llamar a Rob Knight al 858-246-1184 o enviar un correo electrónico a nuestra cuenta de ayuda: [email protected].',
'Si tiene alguna duda o problemas relacionados con la investigación, puede comunicarse con<ul><li>Rob Knight al 858-246-1184 o con</li><li>El equipo de investigación (teléfono: 858-246-3234, correo electrónico: [email protected])</li></ul>'
)
WHERE version = 48 AND locale IN ('es_MX', 'es_ES');

-- Spanish version III
UPDATE ag.consent_documents
SET consent_content = REPLACE(
consent_content,
'Si tiene alguna duda o problemas relacionados con la investigación, usted puede comunicarse con nosotros enviando un correo electrónico a nuestra cuenta de ayuda [email protected] o llamando a Rob Knight al 858-246-1184.',
'Si tiene alguna duda o problemas relacionados con la investigación, puede comunicarse con<ul><li>Rob Knight al 858-246-1184 o con</li><li>El equipo de investigación (teléfono: 858-246-3234, correo electrónico: [email protected])</li></ul>'
)
WHERE version = 48 AND locale IN ('es_MX', 'es_ES');


-- Then, we'll tack the IRB protocol number, version, and expiration on. We need to do this in two steps, one for each language we support.
-- English versions
UPDATE ag.consent_documents
SET consent_content = consent_content || '<p class="consent_content">Protocol #141853 | v48 | Expires: January 22, 2026</p>'
WHERE version = 48 AND locale = 'en_US';

-- Spanish versions
UPDATE ag.consent_documents
SET consent_content = consent_content || '<p class="consent_content">Protocolo n.° 141853 | v48 | Caduca: 22 de enero de 2026</p>'
WHERE version = 48 AND locale IN ('es_MX', 'es_ES');


-- Lastly, we'll fix the outstanding typo in the English documents
UPDATE ag.consent_documents
SET consent_content = REPLACE(
consent_content,
'You may contact UC San Diego Office of IRB Administration',
'You may contact the UC San Diego Office of IRB Administration'
)
WHERE version = 48 AND locale = 'en_US';
Loading