Votes
AR
27 days ago
šŸ‘
AN
Anissa Neal
8 months ago
In Progress

Consent documents missing on update to 4.0.60.5

We just updated to 60.5 and have discovered that in the Consent section there is a new tab for document attachments (PDF scans of the physical consent forms for example). As a result, attachments that were added prior are missing from the consent field. While they still live in the Documents section under Client Information, they are now detached from the actual consent records that they were previously linked to; they are not under the new Documents tab in the Consent section.

šŸ“Consent šŸ—ƒļøDocuments šŸ›Bug 4.0.60.5
Comments
AR
Ali Ryder šŸ§‘ā€šŸ’¼ Staff

Official response from HICC:

The issue with consent documents appearing to ā€œdisappearā€ in version 60.5 is a known one. It stems from the introduction of a new table—HIFIS_Consent_Documents—which allows multiple documents to be attached to a single consent.

While the existing documents haven’t been lost, they need to be referenced in this new table, along with some minor key updates in the database to enable deletions.

To address this, we’ve developed an SQL script that inserts the existing document records into the new table. Additionally, simply adding records to the new table was causing deletion issues for documents created prior to 60.5. Updating the consent table to remove the now-obsolete foreign key values (which are now managed by the new table) has resolved these issues for other communities experiencing the same problem.

Here is the SQL script you will need to run — As best practice, you should perform a backup of your database before proceeding:

/-- inserting missing Consent Documents, change in 60.5 requires data to be moved to new table --/INSERT INTO [dbo].[HIFIS_Consent_Documents]      ([ConsentID]      ,[DocumentID]      ,[CreatedDate]      ,[LastUpdatedDate]      ,[LastUpdatedBy]      ,[CreatedBy])SELECTC.ConsentID,D.DocumentID,D.CreatedDate,D.LastUpdatedDate,D.LastUpdatedBy,D.CreatedByFROM HIFIS_Documents DINNER JOIN HIFIS_Consent C ON C.DocumentID = D.DocumentIDLEFT JOIN [HIFIS_Consent_Documents] CD ON  CD.[DocumentID] = D.DocumentIDWHERE D.DocumentTypeID = 12;/-- removes foreign key from HIFIS_Consent no longer required with new table --/UPDATE CSET C.DOCUMENTID = NULLFROM HIFIS_CONSENT C          INNER JOIN HIFIS_CONSENT_DOCUMENTS CD ON CD.DOCUMENTID = C.DOCUMENTID          INNER JOIN HIFIS_DOCUMENTS D ON D.DOCUMENTID = CD.DOCUMENTIDWHERE D.DOCUMENTTYPEID = 12;

After the script has been run, please verify if the consent documents are once again accessible.