BPMXVST ;IHS/OIT/LJF - REPOINT VISIT FILE POINTERS - 6/26/12 ;
;;1.0;IHS PATIENT MERGE;**2**;MAR 01, 2010;Build 1
;IHS/OIT/NKD 6/13/2012 Removed unused local variables
; Moved processing check from BPMXDRV
;
DESC ;---- ROUTINE DESCRIPTION
;;
;;BPMXVST:
;;This routine loops through the Visit file looking for DELETED visits
;;belonging to the "FROM" patient, which it then repoints to the "TO"
;;patient.
;;
;;Only called if REPOINT DELETED VISITS parameter is turned ON
;;
;;This routine is called by the special merge routine driver - BPMXDRV
;;$$END
;
N I,X F I=1:1 S X=$P($T(DESC+I),";;",2) Q:X["$$END" W !,X
Q
EN(BPMRY) ;EP; entry point from ^BPMXDRV
; BPMRY = TEMP GLOBAL SET UP BY THE PATIENT MERGE SOFTWARE,
; I.E., "^TMP(""XDFROM"",$J)"
;
;IHS/OIT/NKD BPM*1.0*2 QUIT IF PARAMETER IS NOT SET TO 'YES'
Q:$$GET1^DIQ(15.1,2,99999.01)'="YES"
;IHS/OIT/NKD BPM*1.0*2 REMOVED UNUSED LOCAL VARIABLES
;NEW BPMFR,BPMGFR,BPMGTO,BPMTO,FILE,GLOB
N BPMFR,BPMTO
;
S BPMFR=$O(@BPMRY@(0)) Q:'BPMFR
S BPMTO=$O(@BPMRY@(BPMFR,0)) Q:'BPMTO
;IHS/OIT/NKD BPM*1.0*2 REMOVED UNUSED LOCAL VARIABLES
;S BPMGFR=$O(@BPMRY@(BPMFR,BPMTO,0)) Q:'+BPMGFR
;S BPMGTO=$O(@BPMRY@(BPMFR,BPMTO,BPMGFR,0)) Q:'+BPMGTO
;S GLOB="^TMP(""XDRFROM"""_","_$J_","_BPMFR_","_BPMTO_","_""""_BPMGFR_""""_","_""""_BPMGTO_""""_")"
;S FILE=@GLOB
;
D REPOINT(BPMFR,BPMTO)
Q
;
REPOINT(BPMFR,BPMTO) ; loop through visit file and change pointer
NEW BPMD0
S BPMD0=0
F S BPMD0=$O(^AUPNVSIT(BPMD0)) Q:'BPMD0 D
. Q:$P($G(^AUPNVSIT(BPMD0,0)),U,5)'=BPMFR
. Q:$P(^AUPNVSIT(BPMD0,0),U,11)'=1 ;skip if not a deleted visit
. S $P(^AUPNVSIT(BPMD0,0),U,5)=BPMTO ;stuff TO patient pointer
Q
BPMXVST ;IHS/OIT/LJF - REPOINT VISIT FILE POINTERS - 6/26/12 ;
+1 ;;1.0;IHS PATIENT MERGE;**2**;MAR 01, 2010;Build 1
+2 ;IHS/OIT/NKD 6/13/2012 Removed unused local variables
+3 ; Moved processing check from BPMXDRV
+4 ;
DESC ;---- ROUTINE DESCRIPTION
+1 ;;
+2 ;;BPMXVST:
+3 ;;This routine loops through the Visit file looking for DELETED visits
+4 ;;belonging to the "FROM" patient, which it then repoints to the "TO"
+5 ;;patient.
+6 ;;
+7 ;;Only called if REPOINT DELETED VISITS parameter is turned ON
+8 ;;
+9 ;;This routine is called by the special merge routine driver - BPMXDRV
+10 ;;$$END
+11 ;
+12 NEW I,X
FOR I=1:1
SET X=$PIECE($TEXT(DESC+I),";;",2)
IF X["$$END"
QUIT
WRITE !,X
+13 QUIT
EN(BPMRY) ;EP; entry point from ^BPMXDRV
+1 ; BPMRY = TEMP GLOBAL SET UP BY THE PATIENT MERGE SOFTWARE,
+2 ; I.E., "^TMP(""XDFROM"",$J)"
+3 ;
+4 ;IHS/OIT/NKD BPM*1.0*2 QUIT IF PARAMETER IS NOT SET TO 'YES'
+5 IF $$GET1^DIQ(15.1,2,99999.01)'="YES"
QUIT
+6 ;IHS/OIT/NKD BPM*1.0*2 REMOVED UNUSED LOCAL VARIABLES
+7 ;NEW BPMFR,BPMGFR,BPMGTO,BPMTO,FILE,GLOB
+8 NEW BPMFR,BPMTO
+9 ;
+10 SET BPMFR=$ORDER(@BPMRY@(0))
IF 'BPMFR
QUIT
+11 SET BPMTO=$ORDER(@BPMRY@(BPMFR,0))
IF 'BPMTO
QUIT
+12 ;IHS/OIT/NKD BPM*1.0*2 REMOVED UNUSED LOCAL VARIABLES
+13 ;S BPMGFR=$O(@BPMRY@(BPMFR,BPMTO,0)) Q:'+BPMGFR
+14 ;S BPMGTO=$O(@BPMRY@(BPMFR,BPMTO,BPMGFR,0)) Q:'+BPMGTO
+15 ;S GLOB="^TMP(""XDRFROM"""_","_$J_","_BPMFR_","_BPMTO_","_""""_BPMGFR_""""_","_""""_BPMGTO_""""_")"
+16 ;S FILE=@GLOB
+17 ;
+18 DO REPOINT(BPMFR,BPMTO)
+19 QUIT
+20 ;
REPOINT(BPMFR,BPMTO) ; loop through visit file and change pointer
+1 NEW BPMD0
+2 SET BPMD0=0
+3 FOR
SET BPMD0=$ORDER(^AUPNVSIT(BPMD0))
IF 'BPMD0
QUIT
Begin DoDot:1
+4 IF $PIECE($GET(^AUPNVSIT(BPMD0,0)),U,5)'=BPMFR
QUIT
+5 ;skip if not a deleted visit
IF $PIECE(^AUPNVSIT(BPMD0,0),U,11)'=1
QUIT
+6 ;stuff TO patient pointer
SET $PIECE(^AUPNVSIT(BPMD0,0),U,5)=BPMTO
End DoDot:1
+7 QUIT