Skip to content

Commit d4ae1a0

Browse files
authored
Created a new program to modify every active compliance requirement n… (#1598)
* Created a new program to modify every active compliance requirement names onto the new set of predefined name. * Created a new reporting program called "Tissue Distribution by AnimalID per Calendar". * Created a new reporting program called "Tissue Distribution by AnimalID per Calendar". * Created a new reporting program called "Tissue Distribution by AnimalID per Calendar". * Modified Compliance Requirement names to have the names translated to its new naming conversion. * Modified Complinace Requirement name program updates.
1 parent 5c7c8bf commit d4ae1a0

3 files changed

Lines changed: 151 additions & 1 deletion

File tree

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
2+
CREATE TABLE onprc_ehr.RequirementName_Convert(
3+
searchid integer IDENTITY(100,1) NOT NULL,
4+
PreviousDesignation varchar(255) NULL,
5+
afterName varchar(255) NULL,
6+
FileName varchar(1000) NULL
7+
) ON [PRIMARY]
8+
GO
9+
10+
11+
/*
12+
**
13+
** Created by Date Comment
14+
**
15+
**
16+
** Blasa 1/6/2026 Convert Compliance Requirement Names to its new predefined names.
17+
*/
18+
19+
20+
CREATE Procedure onprc_ehr.sp_Compliance_requirementname_Update_Process
21+
22+
23+
24+
25+
AS
26+
27+
DECLARE
28+
29+
@SearchKey Int,
30+
@TempsearchKey Int,
31+
@Code varchar(500)
32+
Begin
33+
34+
35+
36+
---Initial Values
37+
set @TempSearchkey = 0
38+
set @Searchkey = 0
39+
40+
41+
42+
select top 1 @Searchkey= searchid from onprc_ehr.requirementname_Convert
43+
order by searchid
44+
45+
46+
While @TempSearchKey < @SearchKey
47+
BEGIN
48+
49+
select top 1 @Code=PreviousDesignation from onprc_ehr.requirementname_Convert
50+
Where searchid = @Searchkey
51+
52+
If @@Error <> 0
53+
GoTo Err_Proc
54+
55+
------Process Requirement Names
56+
57+
Update ss
58+
set ss.RequirementName = '' + trim(jj.aftername) + ' ' + trim(jj.filename) + ''
59+
60+
from ehr_Compliancedb.Requirements ss, onprc_ehr.requirementname_Convert jj where ss.RequirementName like '' + trim(@code) + '%'
61+
And jj.PreviousDesignation like '' + trim(@code) + '%'
62+
63+
If @@Error <> 0
64+
GoTo Err_Proc
65+
66+
------Process Completion Dates
67+
68+
Update ss
69+
set ss.RequirementName = '' + trim(jj.aftername) + ' ' + trim(jj.filename) + ''
70+
71+
from ehr_Compliancedb.CompletionDates ss, onprc_ehr.requirementname_Convert jj where ss.RequirementName like '' + trim(@code) + '%'
72+
And jj.PreviousDesignation like '' + trim(@code) + '%'
73+
74+
If @@Error <> 0
75+
GoTo Err_Proc
76+
77+
------Process Requirements per Employees
78+
79+
Update ss
80+
set ss.RequirementName = '' + trim(jj.aftername) + ' ' + trim(jj.filename) + ''
81+
82+
from ehr_Compliancedb.RequirementsPerEmployee ss, onprc_ehr.requirementname_Convert jj where ss.RequirementName like '' + trim(@code) + '%'
83+
And jj.PreviousDesignation like '' + trim(@code) + '%'
84+
85+
If @@Error <> 0
86+
GoTo Err_Proc
87+
88+
-----Process Requirements per Categories
89+
90+
Update ss
91+
set ss.RequirementName = '' + trim(jj.aftername) + ' ' + trim(jj.filename) + ''
92+
93+
from ehr_Compliancedb.RequirementsPerCategory ss, onprc_ehr.requirementname_Convert jj where ss.RequirementName like '' + trim(@code) + '%'
94+
And jj.PreviousDesignation like '' + trim(@code) + '%'
95+
96+
If @@Error <> 0
97+
GoTo Err_Proc
98+
99+
-----Process Employee Requirements Exemptions
100+
101+
Update ss
102+
set ss.RequirementName = '' + trim(jj.aftername) + ' ' + trim(jj.filename) + ''
103+
104+
from ehr_Compliancedb.EmployeeRequirementExemptions ss, onprc_ehr.requirementname_Convert jj where ss.RequirementName like '' + trim(@code) + '%'
105+
And jj.PreviousDesignation like '' + trim(@code) + '%'
106+
107+
If @@Error <> 0
108+
GoTo Err_Proc
109+
110+
111+
----- Process the next data record
112+
113+
Set @TempSearchkey = @SearchKey
114+
115+
116+
select top 1 @Searchkey= searchid from onprc_ehr.requirementname_Convert
117+
Where searchid > @TempSearchkey
118+
order by searchid
119+
120+
If @@Error <> 0
121+
GoTo Err_Proc
122+
123+
124+
END ---(While)
125+
126+
127+
128+
RETURN 0
129+
130+
131+
Err_Proc:
132+
133+
134+
RETURN 1
135+
136+
137+
END
138+
139+
GO
140+
141+

onprc_ehr/resources/schemas/onprc_ehr.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,4 +1471,13 @@
14711471
</columns>
14721472
</table>
14731473

1474+
<table tableName="RequirementName_Convert" tableDbType="TABLE">
1475+
<columns>
1476+
<column columnName="searchid"/>
1477+
<column columnName="PreviousDesignation"/>
1478+
<column columnName="afterName"/>
1479+
<column columnName="FileName"/>
1480+
</columns>
1481+
</table>
1482+
14741483
</tables>

onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public String getName()
124124
@Override
125125
public @Nullable Double getSchemaVersion()
126126
{
127-
return 25.003;
127+
return 25.004;
128128
}
129129

130130
@Override

0 commit comments

Comments
 (0)