Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First Level of eiacuc Processing #1205

Closed
wants to merge 9 commits into from
Prev Previous commit
Next Next commit
New Stored Preocurfe to end date expired ehrProtocols
jonesgaohsu committed Dec 12, 2024
commit eac4446e42f429115f74b2b500b45e9791eabbde
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
--This build is a stored procedure that uses a temp table and then updates onprc_ehronprc_ehr.eIACUC_PRIME_VIEW_PROTOCOLS
CREATE Procedure onprc_ehr.ExpiredProtocols

AS
--Create a Temp Table that creates Base Protocol and Revision Number
WITH ExpiredProtocol AS (
SELECT
p.rowID,
p.BaseProtocol,
p.Protocol_ID,
p.revisionNumber,
p.Protocol_State,
p. Approval_Date,
p.Last_Modified,
p.Three_Year_Expiration
FROM
onprc_ehr.eIACUC_PRIME_VIEW_PROTOCOLS p
WHERE
p.Protocol_State IN ('expired', 'terminated', 'withdrawn')
AND p.Approval_Date in
(Select Max(e.Approval_Date) from onprc_ehr.eIACUC_PRIME_VIEW_PROTOCOLS e where p.baseProtocol = e.BaseProtocol )

)
--This will update the onprc_ehr.eIACUC_PRIME_VIEW_PROTOCOLS inserting the BaseProtocol and RevisionNumber
--Match expoired protocols to records in ehr.protocol
--Select * from ExpiredProtocol p1, ehr.protocol ehr
--where (p1.BaseProtocol = ehr.external_Id and ehr.enddate is Null)

Update e
set e.enddate = p.Approval_Date, e.contacts = 'Protocol enddated based on eiACUC Status ' + p.Protocol_State
From ehr.protocol e, ExpiredProtocol p
where e.external_id = p.BaseProtocol

2 changes: 1 addition & 1 deletion onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java
Original file line number Diff line number Diff line change
@@ -126,7 +126,7 @@ public String getName()
@Override
public @Nullable Double getSchemaVersion()
{
return 24.003;
return 24.004;
}

@Override