Sometimes preCERT throw exception when a PD is doing a final training attestation.  Usually, a credentialer can do it for the PD in BoardCert because BoardCert doesn't have all of the same restrictions in place.  However, sometimes the credentialer can't do it either.  When IT need to manually add a final training attestation, insert rows into the following tables.  If the resident is now an alumni, also update Person.CurrentTrainingProgramId to NULL.  If they need to remain in the program (for example, they are in CAP program and Psych is complete, but they still have more training in CAP to complete), the leave Person.CurrentTrainingProgramId populated. 


TrainingAttestation


USE [WebCAD]
GO

 

INSERT INTO [dbo].[TrainingAttestation]
([Person_Key]
,[Training_Program_Key]
,[AttestedDate]
,[AttestedBy]
,[IsPatientSafetyCompleted]
,[CreatedBy]
,[CreatedDate]
,[UpdatedBy]
,[UpdatedDate]
,[LegacyTrainingAttestationId]
,[CompletedDate])
VALUES
(<Person_Key, int,>
,<Training_Program_Key, int,>--the training program key where the training is being completed
,<AttestedDate, datetime,> --use today, or whatever date they say to use
,<AttestedBy, varchar(100),> --use the attesting program PD's email address
,<IsPatientSafetyCompleted, bit,> --ask requester if patient safety should be Yes or No and update accordingly
,<CreatedBy, varchar(100),> --You [dev's first initial last name]
,<CreatedDate, datetime,> --Today
,<UpdatedBy, varchar(100),> --You [dev's first initial last name]
,<UpdatedDate, datetime,> --Today
,<LegacyTrainingAttestationId, int,> NULL
,<CompletedDate, datetime,>) --confirm which completed date to use (should be the end sate of the PGY that the training is completed)
GO



TrainingAttestationCertification


USE [WebCAD]

GO


INSERT INTO [dbo].[TrainingAttestationCertification]

           ([TrainingAttestationId]

           ,[Certification_Key]

           ,[FirstYearEligible]

           ,[CreatedBy]

           ,[CreatedDate]

           ,[UpdatedBy]

           ,[UpdatedDate])

     VALUES

           (<TrainingAttestationId, int,> --the TrainingAttestationId from previous insert

           ,<Certification_Key, int,> -- i.e. 19 for Psych

           ,<FirstYearEligible, int,> -- this year is based on rules (ask Jenny, Jessica, or Amanda)

           ,<CreatedBy, varchar(100),>  You [dev's first initial last name] 

           ,<CreatedDate, datetime,> --Today

           ,<UpdatedBy, varchar(100),> --You [dev's first initial last name] 

           ,<UpdatedDate, datetime,>) --Today

GO