Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions ci/conda_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ natsort
pycryptodome
pandas < 2.0.0
werkzeug < 3.0.0
pip < 25.3
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 contact information in all consent documents.
-- 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, 53
Copy link
Collaborator

Choose a reason for hiding this comment

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

The comments indicate that the internal version number is intended to match the IRB protocol version ... were we mistaken earlier that the current version of the IRB protocol was 48?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see Andy addressed this one too, saying it is "reflecting the protocol version we landed on once the IRB reviewed and approved the last changes". Just to be very, very sure: although the consent content text created in this patch was previously stated to match that of IRB protocol version 48, it is actually a match for the consent content text in IRB protocol version 53, which is now the most current IRB protocol version, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We weren't mistaken at the time, but some back-and-forth with the IRB on supporting documents (unrelated to the consents we use in the Microsetta platform) resulted in further amendments that we didn't anticipate when this PR was opened and last reviewed. We're now at v53 of the IRB protocol, which has been marked fully approved in Kuali.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looks like we were responding at the same time - yes, I can confirm that v53 is the current correct protocol version.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, so what I heard there is that the consents texts represented in Microsetta are a match for both v48 and v53 of the IRB protocol because those versions differ in some other texts (that we don't have to keep in this db). Makes sense to me; thanks :)

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 = 53 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 = 53 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 = 53 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 = 53 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 = 53 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 | v53 | Expires: January 22, 2026</p>'
WHERE version = 53 AND locale = 'en_US';

-- Spanish versions
UPDATE ag.consent_documents
SET consent_content = consent_content || '<p class="consent_content">Protocolo n.° 141853 | v53 | Caduca: 22 de enero de 2026</p>'
WHERE version = 53 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 = 53 AND locale = 'en_US';
2 changes: 1 addition & 1 deletion microsetta_private_api/util/tests/test_google_geocoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def test_geocode_address(self):
obs_long = round(obs_long, 2)

self.assertEqual(obs_lat, 32.88)
self.assertEqual(obs_long, -117.23)
self.assertEqual(obs_long, -117.24)
self.assertEqual(obs_state, "CA")
self.assertEqual(obs_country, "US")
self.assertEqual(obs_error, False)
Expand Down
Loading