AZXAPTRG ; IHS/PHXAO/TMJ - PATIENT REGISTRATION - TOTAL RE-EXPORT 4/3/01 ;
;;2.0;RELEASE OF INFORMATION;;FEB 21, 2002
;;IHS/PHXAO/TMJ Phoenix Area - Toni Jarland
;This Routine populates the ^AGPATCH Global in preparation
;for the next regular Monthly Patient Registration Export
;
START ;Sytem Variable Setup's for Variable N - Date
;Returns N in cyymmdd.time Format
D SETUP^AUMXPORT
;Minus 2 Day Delay Factor for Patient Registration Export Requirements
S N=N-2
;
W !,"The Export Date/Time Value of N is: "_N
W !,"Record this value - should a restart be necessary",!
;
;
S DFN=0,L=$P(^AUPNPAT(0),U,3)
W:'$D(ZTQUEUED) ! ; IHS/ASDST/GTH AUM*99.1*10
S DX=$X,DY=$Y
F S DFN=$O(^AUPNPAT(DFN)) Q:'DFN D I '(DFN#100),'$D(ZTQUEUED) X IOXY W "On IEN ",DFN," of ",L," in ^AUPNPAT(..." ; IHS/ASDST/GTH AUM*99.1*10
. Q:'$D(^DPT(DFN))
. S D=0
. F S D=$O(^AUPNPAT(DFN,41,D)) Q:'D I '$$INAC(DFN,D) S ^AGPATCH(N,D,DFN)=""
.Q
;
W:'$D(ZTQUEUED) !!,"If you change your mind, you need to KILL ^AGPATCH(",N,").",!! ; IHS/ASDST/GTH AUM*99.1*10
S DX=$X,DY=$Y,W=$S('$D(ZTQUEUED):"X IOXY W ""Counting..."",T",1:"") ; IHS/ASDST/GTH AUM*99.1*10
G COUNT
;
Q
;
COUNT ;
W #
S (D,T)=0
F S D=$O(^AGPATCH(N,D)) Q:'D X W S DFN=0 F S DFN=$O(^AGPATCH(N,D,DFN)) Q:'DFN X W S T=T+1
;Q T
;
W !!,"DONE WITH COUNT - PROCESSED: "_T_" HEALTH RECORD ENTRIES",!
K DFN,N,T,W,D
Q
INAC(DFN,D) ; Pt is inactive -inactive date, or status is Deleted/Inactive/Merged ;
;
I $P($G(^AUPNPAT(DFN,41,D,0)),U,3) Q 1 ; Inactive Date
I '$L($P($G(^AUPNPAT(DFN,41,D,0)),U,5)) Q 0
I "DI"[$P($G(^AUPNPAT(DFN,41,D,0)),U,5) Q 1 ; Deleted or Inactive
I "M"[$P($G(^AUPNPAT(DFN,41,D,0)),U,5) Q 1
AZXAPTRG ; IHS/PHXAO/TMJ - PATIENT REGISTRATION - TOTAL RE-EXPORT 4/3/01 ;
+1 ;;2.0;RELEASE OF INFORMATION;;FEB 21, 2002
+2 ;;IHS/PHXAO/TMJ Phoenix Area - Toni Jarland
+3 ;This Routine populates the ^AGPATCH Global in preparation
+4 ;for the next regular Monthly Patient Registration Export
+5 ;
START ;Sytem Variable Setup's for Variable N - Date
+1 ;Returns N in cyymmdd.time Format
+2 DO SETUP^AUMXPORT
+3 ;Minus 2 Day Delay Factor for Patient Registration Export Requirements
+4 SET N=N-2
+5 ;
+6 WRITE !,"The Export Date/Time Value of N is: "_N
+7 WRITE !,"Record this value - should a restart be necessary",!
+8 ;
+9 ;
+10 SET DFN=0
SET L=$PIECE(^AUPNPAT(0),U,3)
+11 ; IHS/ASDST/GTH AUM*99.1*10
IF '$DATA(ZTQUEUED)
WRITE !
+12 SET DX=$X
SET DY=$Y
+13 ; IHS/ASDST/GTH AUM*99.1*10
FOR
SET DFN=$ORDER(^AUPNPAT(DFN))
IF 'DFN
QUIT
Begin DoDot:1
+14 IF '$DATA(^DPT(DFN))
QUIT
+15 SET D=0
+16 FOR
SET D=$ORDER(^AUPNPAT(DFN,41,D))
IF 'D
QUIT
IF '$$INAC(DFN,D)
SET ^AGPATCH(N,D,DFN)=""
+17 QUIT
End DoDot:1
IF '(DFN#100)
IF '$DATA(ZTQUEUED)
XECUTE IOXY
WRITE "On IEN ",DFN," of ",L," in ^AUPNPAT(..."
+18 ;
+19 ; IHS/ASDST/GTH AUM*99.1*10
IF '$DATA(ZTQUEUED)
WRITE !!,"If you change your mind, you need to KILL ^AGPATCH(",N,").",!!
+20 ; IHS/ASDST/GTH AUM*99.1*10
SET DX=$X
SET DY=$Y
SET W=$SELECT('$DATA(ZTQUEUED):"X IOXY W ""Counting..."",T",1:"")
+21 GOTO COUNT
+22 ;
+23 QUIT
+24 ;
COUNT ;
+1 WRITE #
+2 SET (D,T)=0
+3 FOR
SET D=$ORDER(^AGPATCH(N,D))
IF 'D
QUIT
XECUTE W
SET DFN=0
FOR
SET DFN=$ORDER(^AGPATCH(N,D,DFN))
IF 'DFN
QUIT
XECUTE W
SET T=T+1
+4 ;Q T
+5 ;
+6 WRITE !!,"DONE WITH COUNT - PROCESSED: "_T_" HEALTH RECORD ENTRIES",!
+7 KILL DFN,N,T,W,D
+8 QUIT
INAC(DFN,D) ; Pt is inactive -inactive date, or status is Deleted/Inactive/Merged ;
+1 ;
+2 ; Inactive Date
IF $PIECE($GET(^AUPNPAT(DFN,41,D,0)),U,3)
QUIT 1
+3 IF '$LENGTH($PIECE($GET(^AUPNPAT(DFN,41,D,0)),U,5))
QUIT 0
+4 ; Deleted or Inactive
IF "DI"[$PIECE($GET(^AUPNPAT(DFN,41,D,0)),U,5)
QUIT 1
+5 IF "M"[$PIECE($GET(^AUPNPAT(DFN,41,D,0)),U,5)
QUIT 1