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

ACGSINTG.m

Go to the documentation of this file.
ACGSINTG ;IHS/OIRM/DSD/THL,AEF - CHECK INTEGRITY OF EACH CIS ENTRY; [ 03/27/2000   2:22 PM ]
 ;;2.0t1;CONTRACT INFORMATION SYSTEM;;FEB 16, 2000
 ;;ROUTINE TO CHECK INTEGRITY BETWEEN VARIOUS FIELDS OF EACH CIS ENTRY
 ;;
EN S X=0,U="^"
 F  S X=$O(^ACGS(X)) Q:'X  I $D(^ACGS(X,"DT")),$D(^("DT1")),$D(^("DT2")),$D(^("DT3")) S ACGDT=^("DT"),ACGDT1=^("DT1"),ACGDT2=^("DT2"),ACGDT3=^("DT3") D
 .I $P(ACGDT,U,13)>3,$P(ACGDT3,U,11)'="" W !,X,?10,"SOB" S $P(^ACGS(X,"DT3"),U,11)=""
 .I $P(ACGDT3,U,7)="" W !,X,?10,"CICA" S $P(^ACGS(X,"DT3"),U,7)="A"
 .I $P(ACGDT,U,12)="" D
 ..W !,X,?10,$P(ACGDT,U,12,21)
 ..I $P(ACGDT,U,17)=12 S $P(^ACGS(X,"DT"),U,12)="B" D 20
 ..I $P(ACGDT,U,17)<12 S $P(^ACGS(X,"DT"),U,12)="A" D 20
 .I $P(ACGDT,U,12)="A" D
 ..I $P(ACGDT,U,17)<12,$P(ACGDT,U,19)<60,$P(ACGDT,U,18)'="" W !,X,?10,$P(ACGDT,U,12,21) S $P(^ACGS(X,"DT"),U,18)="" D 20
 ..I $P(ACGDT,U,17)=12,$P(ACGDT,U,19)>59 W !,X,?10,$P(ACGDT,U,12,21) S $P(^ACGS(X,"DT"),U,12)="B" S:$P(ACGDT,U,18)="" $P(^ACGS(X,"DT"),U,18)=81 D 20
 ..I $P(ACGDT,U,17)=12,$P(ACGDT,U,19)=56 W !,X,?10,$P(ACGDT,U,12,21) S $P(^ACGS(X,"DT"),U,17)=1,$P(ACGDT,U,18)=""
 ..I $P(ACGDT,U,17)=12,$P(ACGDT,U,19)'=56,$P(ACGDT,U,19)<60 W !,X,?10,$P(ACGDT,U,12,21) S $P(^ACGS(X,"DT"),U,17)=10,$P(ACGDT,U,18)=""
 .I $P(ACGDT,U,12)'="A" D
 ..I $P(ACGDT,U,17)="" W !,X,?10,$P(ACGDT,U,12,21) S $P(^ACGS(X,"DT"),U,17)=12,$P(ACGDT,U,18)=81,$P(^ACGS(X,"DT3"),U,7)="C" D 20
 ..I $P(ACGDT,U,17)=12 D
 ...I $P(ACGDT,U,18)="" W !,X,?10,$P(ACGDT,U,12,21) S $P(^ACGS(X,"DT"),U,18)=81
 ...I $P(ACGDT,U,20)<4 W !,X,?10,$P(ACGDT,U,12,21) D 20
 .I $P(ACGDT,U,12)="C",$P(ACGDT,U,18)'=71 W !,X,?10,$P(ACGDT,U,12,21) S:$P(ACGDT,U,17)'=12 $P(^ACGS(X,"DT"),U,12)=12 S:$P(ACGDT,U,18)'=71 $P(^ACGS(X,"DT"),U,18)=71 D 20
 .S ACG37=$P(^ACGS(X,"DT2"),U,2) I ACG37["-"!($L(ACG37)>7) D
 ..W !,X,?10,ACG37
 ..I ACG37["-" S ACG37=$P(ACG37,"-",2) S $P(^ACGS(X,"DT2"),U,2)=ACG37
 ..I $L(ACG37)>7,$E(ACG37)?1N S ACG37=$E(ACG37,2,8)
 ..I $L(ACG37)>7,$E(ACG37)="J" S ACG37=$E(ACG37,1,7)
 ..S:"j"=$E(ACG37) ACG37="J"_$E(ACG37,2,8) S $P(^ACGS(X,"DT2"),U,2)=ACG37
 ..W !,X,?10,ACG37
 .I $P(ACGDT3,U,9)=1,$P(ACGDT3,U,10)="" W !,X,?10,ACG37 S $P(^ACGS(X,"DT3"),U,10)=2
 .I $P(ACGDT1,U,5)>100000,$P(ACGDT2,U,10)="" W !,X,?10,"SYN" S $P(^ACGS(X,"DT2"),U,10)=$S($P(^ACGS(X,"DT"),U,18)'=77:1,1:2)
 Q
20 S $P(^ACGS(X,"DT"),U,20)=$S($P(^ACGS(X,"DT"),U,12)'="A":4,1:3)
 Q