ABMMRS3 ; IHS/ASDST/DMJ - NEW PROGRAM ;
;;2.4;IHS 3P BILLING SYSTEM;;APR 14, 2000
;IHS/DSD/MRS
;
INIT S (CLAIM,BDFN,DFN,SITE)=""
K ^ABMMRS1,^ABMMRS2,^ABMMRS3,^ABMMRS4,^ABMMRS5
F S CLAIM=$O(^ABMMRS(CLAIM)) Q:CLAIM="" D
.F S BDFN=$O(^ABMMRS(CLAIM,BDFN)) Q:BDFN="" D SEP
S ^ABMMRS1=N1
S N=0,X="" F S X=$O(^ABMMRS2(X)) Q:X="" S N=N+1
S ^ABMMRS2=N
S N=0,X="" F S X=$O(^ABMMRS3(X)) Q:X="" S N=N+1
S ^ABMMRS3=N
S N=0,X="" F S X=$O(^ABMMRS4(X)) Q:X="" S N=N+1
S ^ABMMRS4=N
S N=0,X="" F S X=$O(^ABMMRS5(X)) Q:X="" S N=N+1
Q
SEP ;Separate file
F X="BILL","CLAIM" D
.F S DFN=$O(^ABMMRS(CLAIM,BDFN,X,DFN)) Q:DFN="" D
..F S SITE=$O(^ABMMRS(CLAIM,BDFN,X,DFN,SITE)) Q:SITE="" D
...I ^ABMMRS(CLAIM)=1 S ^ABMMRS1(CLAIM,BDFN,SITE)=DFN Q
...I ^ABMMRS(CLAIM)=2 D Q
....S ^ABMMRS2(CLAIM,BDFN,X,DFN,SITE)=^ABMMRS(CLAIM,BDFN,X,DFN,SITE) Q
...I ^ABMMRS(CLAIM)=3 D Q
....S ^ABMMRS3(CLAIM,BDFN,X,DFN,SITE)=^ABMMRS(CLAIM,BDFN,X,DFN,SITE) Q
...I ^ABMMRS(CLAIM)=4 D Q
....S ^ABMMRS4(CLAIM,BDFN,X,DFN,SITE)=^ABMMRS(CLAIM,BDFN,X,DFN,SITE) Q
...S ^ABMMRS5(CLAIM,BDFN,X,DFN,SITE)=^ABMMRS(CLAIM,BDFN,X,DFN,SITE)
Q
ABMMRS3 ; IHS/ASDST/DMJ - NEW PROGRAM ;
+1 ;;2.4;IHS 3P BILLING SYSTEM;;APR 14, 2000
+2 ;IHS/DSD/MRS
+3 ;
INIT SET (CLAIM,BDFN,DFN,SITE)=""
+1 KILL ^ABMMRS1,^ABMMRS2,^ABMMRS3,^ABMMRS4,^ABMMRS5
+2 FOR
SET CLAIM=$ORDER(^ABMMRS(CLAIM))
IF CLAIM=""
QUIT
Begin DoDot:1
+3 FOR
SET BDFN=$ORDER(^ABMMRS(CLAIM,BDFN))
IF BDFN=""
QUIT
DO SEP
End DoDot:1
+4 SET ^ABMMRS1=N1
+5 SET N=0
SET X=""
FOR
SET X=$ORDER(^ABMMRS2(X))
IF X=""
QUIT
SET N=N+1
+6 SET ^ABMMRS2=N
+7 SET N=0
SET X=""
FOR
SET X=$ORDER(^ABMMRS3(X))
IF X=""
QUIT
SET N=N+1
+8 SET ^ABMMRS3=N
+9 SET N=0
SET X=""
FOR
SET X=$ORDER(^ABMMRS4(X))
IF X=""
QUIT
SET N=N+1
+10 SET ^ABMMRS4=N
+11 SET N=0
SET X=""
FOR
SET X=$ORDER(^ABMMRS5(X))
IF X=""
QUIT
SET N=N+1
+12 QUIT
SEP ;Separate file
+1 FOR X="BILL","CLAIM"
Begin DoDot:1
+2 FOR
SET DFN=$ORDER(^ABMMRS(CLAIM,BDFN,X,DFN))
IF DFN=""
QUIT
Begin DoDot:2
+3 FOR
SET SITE=$ORDER(^ABMMRS(CLAIM,BDFN,X,DFN,SITE))
IF SITE=""
QUIT
Begin DoDot:3
+4 IF ^ABMMRS(CLAIM)=1
SET ^ABMMRS1(CLAIM,BDFN,SITE)=DFN
QUIT
+5 IF ^ABMMRS(CLAIM)=2
Begin DoDot:4
+6 SET ^ABMMRS2(CLAIM,BDFN,X,DFN,SITE)=^ABMMRS(CLAIM,BDFN,X,DFN,SITE)
QUIT
End DoDot:4
QUIT
+7 IF ^ABMMRS(CLAIM)=3
Begin DoDot:4
+8 SET ^ABMMRS3(CLAIM,BDFN,X,DFN,SITE)=^ABMMRS(CLAIM,BDFN,X,DFN,SITE)
QUIT
End DoDot:4
QUIT
+9 IF ^ABMMRS(CLAIM)=4
Begin DoDot:4
+10 SET ^ABMMRS4(CLAIM,BDFN,X,DFN,SITE)=^ABMMRS(CLAIM,BDFN,X,DFN,SITE)
QUIT
End DoDot:4
QUIT
+11 SET ^ABMMRS5(CLAIM,BDFN,X,DFN,SITE)=^ABMMRS(CLAIM,BDFN,X,DFN,SITE)
End DoDot:3
End DoDot:2
End DoDot:1
+12 QUIT