-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created scripting program to update compliance string "ARRS " to "DCM" (
#1207) * Created scripting program to update compliance string "ARRS " to "DCM" * Modified Compliance translation string from "arrs" to "dcm" * Modified Compliance translation from "ARRS" to "DCM" * Modified Compliance translation from "ARRS" to "DCM"
- Loading branch information
Showing
2 changed files
with
251 additions
and
1 deletion.
There are no files selected for viewing
250 changes: 250 additions & 0 deletions
250
...mplianceDB/resources/schemas/dbscripts/sqlserver/onprc_ehr_compliancedb-24.004-24.005.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,250 @@ | ||
|
||
|
||
EXEC core.fn_dropifexists 'p_ComplianceAccesscontainerUpdate', 'onprc_ehr_compliancedb', 'PROCEDURE'; | ||
GO | ||
|
||
-- Author: R. Blasa | ||
-- Created: 12-10-2024 | ||
|
||
/* | ||
** | ||
** Created by | ||
** Blasa 12-10-2024 Storedprocedure to update string name "ARRS" to "DCM" | ||
** | ||
** | ||
** | ||
** | ||
*/ | ||
|
||
CREATE Procedure onprc_ehr_compliancedb.p_ComplianceTranslatestringUpdate | ||
|
||
|
||
AS | ||
|
||
|
||
|
||
BEGIN | ||
|
||
------ Update container value and include as part of the main Compliance module | ||
|
||
If exists(select * from ehr_compliancedb.EmployeePerUnit ------> count= 496 | ||
where unit like '%arrs%' | ||
) | ||
BEGIN | ||
|
||
Update ehr_compliancedb.EmployeePerUnit | ||
set unit = replace(unit,'arrs', 'DCM') | ||
|
||
|
||
|
||
If @@Error <> 0 | ||
GoTo Err_Proc | ||
|
||
END | ||
|
||
|
||
If exists(select * from ehr_compliancedb.EmployeePerUnit ------> count= 496 | ||
where category like '%arrs%' | ||
) | ||
BEGIN | ||
|
||
Update ehr_compliancedb.EmployeePerUnit | ||
set category = replace(category,'arrs', 'DCM') | ||
|
||
|
||
|
||
If @@Error <> 0 | ||
GoTo Err_Proc | ||
|
||
END | ||
|
||
|
||
|
||
If exists(select * from ehr_compliancedb.Employees | ||
where majorudds like '%arrs%' | ||
) | ||
BEGIN | ||
|
||
Update ehr_compliancedb.Employees | ||
set majorudds = replace(majorudds,'arrs', 'DCM') | ||
|
||
|
||
|
||
If @@Error <> 0 | ||
GoTo Err_Proc | ||
|
||
END | ||
|
||
|
||
|
||
If exists(select * from ehr_compliancedb.Employees | ||
where unit like '%arrs%' | ||
) | ||
BEGIN | ||
|
||
Update ehr_compliancedb.Employees | ||
set unit = replace(unit,'arrs', 'DCM') | ||
|
||
If @@Error <> 0 | ||
GoTo Err_Proc | ||
|
||
END | ||
|
||
|
||
|
||
If exists(select * from ehr_compliancedb.Employees | ||
where category like '%arrs%' | ||
) | ||
BEGIN | ||
|
||
Update ehr_compliancedb.Employees | ||
set category = replace(category,'arrs', 'DCM') | ||
|
||
If @@Error <> 0 | ||
GoTo Err_Proc | ||
|
||
END | ||
|
||
|
||
|
||
If exists(select * from ehr_compliancedb.requirements | ||
where requirementname like '%arrs%' | ||
) | ||
BEGIN | ||
|
||
Update ehr_compliancedb.requirements | ||
set requirementname = replace(requirementname,'arrs', 'DCM') | ||
|
||
|
||
If @@Error <> 0 | ||
GoTo Err_Proc | ||
|
||
END | ||
|
||
|
||
|
||
If exists(select * from ehr_compliancedb.EmployeeRequirementExemptions | ||
where requirementname like '%arrs%' | ||
) | ||
BEGIN | ||
|
||
Update ehr_compliancedb.EmployeeRequirementExemptions | ||
set requirementname = replace(requirementname,'arrs', 'DCM') | ||
|
||
|
||
If @@Error <> 0 | ||
GoTo Err_Proc | ||
|
||
END | ||
|
||
|
||
|
||
|
||
If exists(select * from ehr_compliancedb.unit_names | ||
where unit like '%arrs%' | ||
) | ||
BEGIN | ||
|
||
Update ehr_compliancedb.unit_names | ||
set unit = replace(unit,'arrs', 'DCM') | ||
|
||
|
||
|
||
If @@Error <> 0 | ||
GoTo Err_Proc | ||
|
||
END | ||
|
||
|
||
If exists(select * from ehr_compliancedb.RequirementsPerCategory | ||
where RequirementName like '%arrs%' | ||
) | ||
BEGIN | ||
|
||
Update ehr_compliancedb.RequirementsPerCategory | ||
set requirementname = replace(requirementname,'arrs', 'DCM') | ||
|
||
|
||
|
||
If @@Error <> 0 | ||
GoTo Err_Proc | ||
|
||
END | ||
|
||
|
||
If exists(select * from ehr_compliancedb.RequirementsPerCategory | ||
where category like '%arrs%' | ||
) | ||
BEGIN | ||
|
||
Update ehr_compliancedb.RequirementsPerCategory | ||
set category = replace(category,'arrs', 'DCM') | ||
|
||
If @@Error <> 0 | ||
GoTo Err_Proc | ||
|
||
END | ||
|
||
|
||
If exists(select * from ehr_compliancedb.RequirementsPerCategory | ||
where unit like '%arrs%' | ||
) | ||
BEGIN | ||
|
||
Update ehr_compliancedb.RequirementsPerCategory | ||
set unit = replace(unit,'arrs', 'DCM') | ||
|
||
|
||
If @@Error <> 0 | ||
GoTo Err_Proc | ||
|
||
END | ||
|
||
If exists(select * from ehr_compliancedb.completiondates | ||
where requirementname like '%arrs%' | ||
) | ||
BEGIN | ||
|
||
Update ehr_compliancedb.completiondates | ||
set requirementname = replace(requirementname,'arrs', 'DCM') | ||
|
||
|
||
If @@Error <> 0 | ||
GoTo Err_Proc | ||
|
||
END | ||
|
||
If exists(select * from ehr_compliancedb.EmployeeCategory | ||
where categoryname like '%arrs%' | ||
) | ||
BEGIN | ||
|
||
Update ehr_compliancedb.EmployeeCategory | ||
set categoryname = replace(categoryname ,'arrs', 'DCM') | ||
|
||
|
||
If @@Error <> 0 | ||
GoTo Err_Proc | ||
|
||
END | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
No_Records: | ||
|
||
RETURN 0 | ||
|
||
|
||
Err_Proc: | ||
-- | ||
RETURN 1 | ||
|
||
|
||
END | ||
|
||
GO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters