Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ACGSUTIL

ACGSUTIL.m

Go to the documentation of this file.
ACGSUTIL ;IHS/OIRM/DSD/THL,AEF - UTILITY PROGRAMS TO CHECK DATABASE INTEGRITY; [ 03/27/2000   2:22 PM ]
 ;;2.0t1;CONTRACT INFORMATION SYSTEM;;FEB 16, 2000
 ;;UTILITY PROGRAMS TO CHECK DATABASE INTEGRITY
 Q
RQD ;EP;CHECKS ALL CIS ENTRIES FOR DATA IN REQUIRED FIELDS
 S ACGRDA=0 F  S ACGRDA=$O(^ACGS(ACGRDA)) Q:'ACGRDA  S ACGCNO=$P(^ACGS(ACGRDA,0),U,3) I ACGRDA'=ACGCNO S ACG1=$P(^ACGTPA($P(^("DT"),U),0),U) D @ACG1^ACGSRQD
 K ACGRDA,ACG1
 Q
PP ;EP;CHECKS THE PLACE OF PERFORMANCE FOR CONSISTENCY WITH RQD FORMAT
 N ACGRDA,ACG,ACG28DA
 S ACGRDA=0
 F  S ACGRDA=$O(^ACGS(ACGRDA)) Q:'ACGRDA  D
 .S ACG=$P(^ACGS(ACGRDA,"DT1"),U,7)
 .I ACG'="" D
 ..I $E(ACG)?1N S ACG=$P(ACG,+ACG,2)
 ..I ACG'="" D
 ...S ACG28DA=$O(^AUTTGL("B",ACG,""))
 ...I 'ACG28DA D SET
 ...I ACG28DA,ACG28DA'=$P(^ACGS(ACGRDA,10),U,2) S $P(^(10),U,2)=ACG28DA
 S DIK="^ACGS("
 F DIK(1)="1028^1","1005" D ENALL^DIK
 K DIK
 Q
VENDOR ;EP;UPDATES THE VENDOR/CONTRACTOR GEOGRAPHICAL LOCATION XREF'S
 S DIK="^AUTTVNDR(",DIK(1)="1125"
 D ENALL^DIK
 K DIK
 Q
SET ;CREATES NEW GEOGRAPHICAL LOCATION IF NO MATCH EXISTS
 S X=ACG,DIC="^AUTTGL(",DIC(0)="L"
 D FILE^ACGSDIC
 K DIC
 S (ACG28DA,$P(^ACGS(ACGRDA,10),U,2))=+Y
 Q
CLEAN ;EP;CLEANS DANGLING XREF'S
 N ACG,ACG1,ACG2,X
 ;F X=66:1:82 S ACG=$C(X),ACG1="" W:IOST["C-" "." F  S ACG1=$O(^ACGS(ACG,ACG1)) Q:ACG1=""  S ACG2=0 F  S ACG2=$O(^ACGS(ACG,ACG1,ACG2)) Q:'ACG2  I '$D(^ACGS(ACG2,0)) K ^ACGS(ACG,ACG1,ACG2),^ACGS(ACG2)
 F ACG=66:1:82 S ACGX=$C(ACG) W:IOST["C-" !,ACGX," Cross Reference being checked." K ^ACGS(ACGX)
 F ACG=1,2,4,5,10,11,15,16,19,24,30,103,121,1099 W !,"Re-indexing field ",ACG S DIK="^ACGS(",DIK(1)=ACG_"^1" S:ACG=19 DIK(1)="19^2" D ENALL^DIK
 Q
XREF ;EP;RE-INDEX SELECTED XREF'S
 N ACG,ACG1,ACG2,X
 F X=66:1:82 S ACG=$C(X),ACG1="" W:IOST["C-" "." K ^ACGS(ACG)
 S DIK="^ACGS(",DIK(1)=""
 D IX1^DIK
 Q
ORIG ;EP;SETS MISSING REQUIRED DATA IN MODIFICATIONS FROM ORIGINAL ACTION
 S X=0,U="^"
 F  S X=$O(^ACGS("C",X)) Q:'X  D
 .F ACG=12:1:20 S @("ACG"_ACG)=$P(^ACGS(X,"DT"),U,ACG)
 .F ACG=22,27,28 S @("ACG"_ACG)=$P(^ACGS(X,"DT1"),U,(ACG-21))
 .S ACG53=$P(^ACGS(X,"DT2"),U,18)
 .S Y=0 F  S Y=$O(^ACGS("C",X,Y)) Q:'Y  D:X'=Y
 ..F ACG=12:1:20 S:$P(^ACGS(Y,"DT"),U,ACG)=""&(@("ACG"_ACG)'="") $P(^("DT"),U,ACG)=@("ACG"_ACG)
 ..F ACG=22,27,28 S:$P(^ACGS(Y,"DT1"),U,(ACG-21))=""&(@("ACG"_ACG)'="") $P(^("DT1"),U,(ACG-21))=@("ACG"_ACG)
 ..S:$P(^ACGS(Y,"DT2"),U,18)=""&(ACG53'="") $P(^("DT2"),U,18)=ACG53
 Q
 ;