AZHDPATC ;COMPARES IHS/VA PAT FILES, TO DEFINE UNEQUAL DFN'S [ 06/11/91 9:35 AM ]
;;2.0;UTILITY;CMB/RFD
;THIS ROUTINE WILL $O THRU THE PATIENT AND 3RD PARTY GLOBALS LOOKING FOR MISSNG ENTRIES
ST W !,"I WILL $O THRU THE PATIENT GLOBALS LOOKING FOR UNEQUAL DFN"
W !,"AS UNEQUAL DFN ARE FOUND THE DFN WILL BE DISPLAYED"
W !,"YOU SHOULD USE A SLAVE PRINTER FOR THIS RUN, AS THE SCREEN WILL SCROLL AND YOU WILL LOSE NEEDED INFORMATION",!
S CNT=0,CNT1=0,CNT2=0,U="^"
W !,"LOOPING THROUGH THE IHS PATIENT GLOBAL",!
LOOP S DFN=0 F AZHDNUM=1:1 S DFN=$O(^AUPNPAT(DFN)) G:DFN?.A LOOP1 W "I" D:'$D(^DPT(DFN)) PRT
LOOP1 ;
W !,"LOOPING THROUGH THE VA PATIENT GLOBAL",!
S DFN=0 F AZHDNUM=1:1 S DFN=$O(^DPT(DFN)) G:DFN?.A LOOP2 W "V" D:'$D(^AUPNPAT(DFN)) PRT1
LOOP2 ;
W !,"LOOPING THROUGH THE MEDICARE GLOBAL",!
S DFN=0 F AZHDNUM=1:1 S DFN=$O(^AUPNMCR(DFN)) G:DFN?.A LOOP3 W "M" D:'$D(^AUPNPAT(DFN)) PRT2
LOOP3 ;
W !,"LOOPING THROUGH THE MEDICAID GLOBAL",!
S DFN=0,DA=0 F AZHDNUM=1:1 S DA=$O(^AUPNMCD(DA)) G:DA?.A LOOP4 S DFN=$P(^AUPNMCD(DA,0),U,1) W "D" D:'$D(^AUPNPAT(DFN)) PRT2
LOOP4 ;
W !,"LOOPING THROUGH THE RAILROAD GLOBAL",!
S DFN=0 F AZHDNUM=1:1 S DFN=$O(^AUPNRRE(DFN)) G:DFN?.A LOOP5 W "R" D:'$D(^AUPNPAT(DFN)) PRT2
LOOP5 ;
W !,"LOOPING THROUGH THE PRIVATE INSURANCE GLOBAL",!
S DFN=0 F AZHDNUM=1:1 S DFN=$O(^AUPNPRVT(DFN)) G:DFN?.A EXIT W "P" D:'$D(^AUPNPAT(DFN)) PRT2
PRT ;PRINT FOR ENTRIES IN AUPNPAT NOT IN DPT
W !!,"ENTRY IN AUPNPAT NOT IN DPT, DFN=",DFN S CNT=CNT+1 Q
PRT1 ;PRINT FOR ENTRIES IN DPT NOT IN AUPNPAT
W !!,"ENTRY IN DPT NOT IN AUPNPAT, DFN=",DFN S CNT1=CNT1+1 Q
PRT2 ;PRINT FOR ENTRIES IN 3RD PARTY FILES BUT NOT IN AUPNPAT
W !!,"ENTRY IN 3RD PARTY FILE NOT IN AUPNPAT, DFN=",DFN S CNT2=CNT2+1 Q
EXIT W !!,"**E N D O F R U N **"
W !,"NUMBER OF DFN NOT IN DPT=",CNT
W !,"NUMBER OF DFN NOT IN AUPNPAT=",CNT1
W !,"NUMBER OF 3RD PARTY DFN's NOT IN AUPNPAT=",CNT2
K CNT,CNT1,CNT2,AZHDNUM
Q
AZHDPATC ;COMPARES IHS/VA PAT FILES, TO DEFINE UNEQUAL DFN'S [ 06/11/91 9:35 AM ]
+1 ;;2.0;UTILITY;CMB/RFD
+2 ;THIS ROUTINE WILL $O THRU THE PATIENT AND 3RD PARTY GLOBALS LOOKING FOR MISSNG ENTRIES
ST WRITE !,"I WILL $O THRU THE PATIENT GLOBALS LOOKING FOR UNEQUAL DFN"
+1 WRITE !,"AS UNEQUAL DFN ARE FOUND THE DFN WILL BE DISPLAYED"
+2 WRITE !,"YOU SHOULD USE A SLAVE PRINTER FOR THIS RUN, AS THE SCREEN WILL SCROLL AND YOU WILL LOSE NEEDED INFORMATION",!
+3 SET CNT=0
SET CNT1=0
SET CNT2=0
SET U="^"
+4 WRITE !,"LOOPING THROUGH THE IHS PATIENT GLOBAL",!
LOOP SET DFN=0
FOR AZHDNUM=1:1
SET DFN=$ORDER(^AUPNPAT(DFN))
IF DFN?.A
GOTO LOOP1
WRITE "I"
IF '$DATA(^DPT(DFN))
DO PRT
LOOP1 ;
+1 WRITE !,"LOOPING THROUGH THE VA PATIENT GLOBAL",!
+2 SET DFN=0
FOR AZHDNUM=1:1
SET DFN=$ORDER(^DPT(DFN))
IF DFN?.A
GOTO LOOP2
WRITE "V"
IF '$DATA(^AUPNPAT(DFN))
DO PRT1
LOOP2 ;
+1 WRITE !,"LOOPING THROUGH THE MEDICARE GLOBAL",!
+2 SET DFN=0
FOR AZHDNUM=1:1
SET DFN=$ORDER(^AUPNMCR(DFN))
IF DFN?.A
GOTO LOOP3
WRITE "M"
IF '$DATA(^AUPNPAT(DFN))
DO PRT2
LOOP3 ;
+1 WRITE !,"LOOPING THROUGH THE MEDICAID GLOBAL",!
+2 SET DFN=0
SET DA=0
FOR AZHDNUM=1:1
SET DA=$ORDER(^AUPNMCD(DA))
IF DA?.A
GOTO LOOP4
SET DFN=$PIECE(^AUPNMCD(DA,0),U,1)
WRITE "D"
IF '$DATA(^AUPNPAT(DFN))
DO PRT2
LOOP4 ;
+1 WRITE !,"LOOPING THROUGH THE RAILROAD GLOBAL",!
+2 SET DFN=0
FOR AZHDNUM=1:1
SET DFN=$ORDER(^AUPNRRE(DFN))
IF DFN?.A
GOTO LOOP5
WRITE "R"
IF '$DATA(^AUPNPAT(DFN))
DO PRT2
LOOP5 ;
+1 WRITE !,"LOOPING THROUGH THE PRIVATE INSURANCE GLOBAL",!
+2 SET DFN=0
FOR AZHDNUM=1:1
SET DFN=$ORDER(^AUPNPRVT(DFN))
IF DFN?.A
GOTO EXIT
WRITE "P"
IF '$DATA(^AUPNPAT(DFN))
DO PRT2
PRT ;PRINT FOR ENTRIES IN AUPNPAT NOT IN DPT
+1 WRITE !!,"ENTRY IN AUPNPAT NOT IN DPT, DFN=",DFN
SET CNT=CNT+1
QUIT
PRT1 ;PRINT FOR ENTRIES IN DPT NOT IN AUPNPAT
+1 WRITE !!,"ENTRY IN DPT NOT IN AUPNPAT, DFN=",DFN
SET CNT1=CNT1+1
QUIT
PRT2 ;PRINT FOR ENTRIES IN 3RD PARTY FILES BUT NOT IN AUPNPAT
+1 WRITE !!,"ENTRY IN 3RD PARTY FILE NOT IN AUPNPAT, DFN=",DFN
SET CNT2=CNT2+1
QUIT
EXIT WRITE !!,"**E N D O F R U N **"
+1 WRITE !,"NUMBER OF DFN NOT IN DPT=",CNT
+2 WRITE !,"NUMBER OF DFN NOT IN AUPNPAT=",CNT1
+3 WRITE !,"NUMBER OF 3RD PARTY DFN's NOT IN AUPNPAT=",CNT2
+4 KILL CNT,CNT1,CNT2,AZHDNUM
+5 QUIT