MHVXTM ;WAS/DLF - team extracts ; 9/25/08 4:12pm
;;1.0;My HealtheVet;**6**;Aug 23, 2005;Build 82
;;Per VHA Directive 2004-038, this routine should not be modified.
;
Q
;
; Integration Agreements:
; 2692 : TEAMS^ORQPTQ1
; 10103 : $$DT^XLFDT
; $$NOW^XLFDT
;
;
TEAM(QRY,ERR,DATAROOT) ; return all OE/RR teams
;
; return provider data in DATAROOT
; QRY, ERR passed by ref.
;
; Input:
; QRY - Query array
;
; DATAROOT - Root of array to hold extract data
;
; Output:
; DATAROOT - Populated data array
; includes number of hits and timestamp
; ERR - Errors during extraction, zero on success
;
N DT,EXTIME,HIT,KEYNM,LOGND,TMIEN,TMNM,U,X
;
S LOGND=$T(+0)_"^TEAM" ; node for logging
D LOG^MHVUL2(LOGND,"BEGIN","S","TRACE")
; needed vars.
S U="^",DT=$$DT^XLFDT,ERR=0,EXTIME=$$NOW^XLFDT,HIT=0
;
K @DATAROOT ; clean up residue
D TEAMS^ORQPTQ1(.MHVTMAR)
S (X,HIT)=0
F S X=$O(MHVTMAR(X)) Q:X="" D
.I $E($P(MHVTMAR(X),U,2),1,$L(QRY("LNAME")))=QRY("LNAME") D
..S TMIEN=$P(MHVTMAR(X),U)
..S TMNM=$P(MHVTMAR(X),U,2)
..S HIT=HIT+1
..S @DATAROOT@("TEAMS",HIT)=TMIEN_U_TMNM
S @DATAROOT=HIT_U_EXTIME ; hits ^ time
D XITLOG(LOGND,HIT)
K MHVTMAR
;
Q
XITLOG(ND,HT) ; exit log
D LOG^MHVUL2(ND,HT_" HITS","S","TRACE")
D LOG^MHVUL2(ND,"END","S","TRACE") Q
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HMHVXTM 1451 printed Nov 22, 2024@17:26:25 Page 2
MHVXTM ;WAS/DLF - team extracts ; 9/25/08 4:12pm
+1 ;;1.0;My HealtheVet;**6**;Aug 23, 2005;Build 82
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
+4 QUIT
+5 ;
+6 ; Integration Agreements:
+7 ; 2692 : TEAMS^ORQPTQ1
+8 ; 10103 : $$DT^XLFDT
+9 ; $$NOW^XLFDT
+10 ;
+11 ;
TEAM(QRY,ERR,DATAROOT) ; return all OE/RR teams
+1 ;
+2 ; return provider data in DATAROOT
+3 ; QRY, ERR passed by ref.
+4 ;
+5 ; Input:
+6 ; QRY - Query array
+7 ;
+8 ; DATAROOT - Root of array to hold extract data
+9 ;
+10 ; Output:
+11 ; DATAROOT - Populated data array
+12 ; includes number of hits and timestamp
+13 ; ERR - Errors during extraction, zero on success
+14 ;
+15 NEW DT,EXTIME,HIT,KEYNM,LOGND,TMIEN,TMNM,U,X
+16 ;
+17 ; node for logging
SET LOGND=$TEXT(+0)_"^TEAM"
+18 DO LOG^MHVUL2(LOGND,"BEGIN","S","TRACE")
+19 ; needed vars.
+20 SET U="^"
SET DT=$$DT^XLFDT
SET ERR=0
SET EXTIME=$$NOW^XLFDT
SET HIT=0
+21 ;
+22 ; clean up residue
KILL @DATAROOT
+23 DO TEAMS^ORQPTQ1(.MHVTMAR)
+24 SET (X,HIT)=0
+25 FOR
SET X=$ORDER(MHVTMAR(X))
if X=""
QUIT
Begin DoDot:1
+26 IF $EXTRACT($PIECE(MHVTMAR(X),U,2),1,$LENGTH(QRY("LNAME")))=QRY("LNAME")
Begin DoDot:2
+27 SET TMIEN=$PIECE(MHVTMAR(X),U)
+28 SET TMNM=$PIECE(MHVTMAR(X),U,2)
+29 SET HIT=HIT+1
+30 SET @DATAROOT@("TEAMS",HIT)=TMIEN_U_TMNM
End DoDot:2
End DoDot:1
+31 ; hits ^ time
SET @DATAROOT=HIT_U_EXTIME
+32 DO XITLOG(LOGND,HIT)
+33 KILL MHVTMAR
+34 ;
+35 QUIT
XITLOG(ND,HT) ; exit log
+1 DO LOG^MHVUL2(ND,HT_" HITS","S","TRACE")
+2 DO LOG^MHVUL2(ND,"END","S","TRACE")
QUIT
+3 QUIT