DGPFLMT1 ;ALB/RBS - PRF TRANSMISSION ERRORS BUILD LIST AREA ; 6/10/05 11:38am
;;5.3;Registration;**650,960**;Aug 13, 1993;Build 22
; Last Edited: SHRPE/SGM - Jun 7, 2018 13:50
;
; DG*5.3*960 - filter for only active and locally owned assignments
; GET modified for filters BLD modified for additional columns
;
;no direct entry
QUIT
;
;
EN(DGARY,DGSRTBY,DGCNT) ;Entry point to build list area
;
;The following input variables are 'system wide variables' in the
;DGPF TRANSMISSION ERRORS List Manager screen:
;
; Input:
; DGARY - subscript name for temp global
; DGSRTBY - list sort by criteria
; "N" = Patient Name
; "D" = Date/Time Error Received
; Output:
; DGCNT - number of lines in the list
; DGARY - ^TMP(DGARY,$J) - display list
; - ^TMP("DGPFSORT",$J) - used to create final DGARY list
;
;display wait msg
D WAIT^DICD
;
;retrieve and sort
D GET(DGSRTBY)
;
;build list
D BLD(DGARY,DGSRTBY,.DGCNT)
;
;if no entries in list, display message
I 'DGCNT D
. D SET(DGARY,1,"",1,,,.DGCNT)
. D SET(DGARY,2,"There are no transmission error messages on file.",3,$G(IOINHI),$G(IOINORM),.DGCNT)
;
Q
;
;
GET(DGSRTBY) ;Get "RJ" status entries.
;
; Input:
; DGSRTBY - list sort by value
;
; Output:
; ^TMP("DGPFSORT",$J,0,<assignment ien>,<site ien>,<HL7 log ien>)=""
;
;The 0 node is created to group each patient's PRF Assignment record
;with each Site Transmitted To that is rejecting the update with all
;of the pointed to HL7 transmission log records.
;Only the most recent transmission log entry will be displayed.
;
N DGAIEN ;assignment ien
N DGDAT ;original transmission date
N DGLIEN ;HL7 log record ien
N DGPFA ;assignment array
N DGPFAH ;assignment history data array
N DGPFL ;HL7 transmission log data array
N DGPFPAT ;patient data array
N DGSITE ;site transmitted to ien
N DGSSN ;patient ssn
;
;loop through ASTAT index of transmission date/times
S DGDAT=0
F S DGDAT=$O(^DGPF(26.17,"ASTAT",DGDAT)) Q:'DGDAT D
. Q:'$D(^DGPF(26.17,"ASTAT",DGDAT,"RJ"))
. S DGLIEN=0
. F S DGLIEN=$O(^DGPF(26.17,"ASTAT",DGDAT,"RJ",DGLIEN)) Q:'DGLIEN D
. . K DGPFL,DGPFAH
. . ;- retrieve HL7 log data
. . Q:'$$GETLOG^DGPFHLL(DGLIEN,.DGPFL)
. . Q:'+DGPFL("ASGNHIST")
. . S DGSITE=$P($G(DGPFL("SITE")),U,1)
. . Q:DGSITE']""
. . ;- retrieve assignment history data to get PRF Assignment ien
. . Q:'$$GETHIST^DGPFAAH(+DGPFL("ASGNHIST"),.DGPFAH)
. . S DGAIEN=$P($G(DGPFAH("ASSIGN")),U,1)
. . Q:'DGAIEN
. . ;
. . ;- create 0 node by patient assignment, site ien and log ien
. . S ^TMP("DGPFSORT",$J,0,DGAIEN,DGSITE,DGLIEN)=""
;
Q:'$O(^TMP("DGPFSORT",$J,0,"")) ;quit if nothing setup
;
;- now loop the sorted 0 node and only use the most recent HL7 error
; record to create the List Manager display temp file.
;
S DGAIEN=0
F S DGAIEN=$O(^TMP("DGPFSORT",$J,0,DGAIEN)) Q:DGAIEN="" D
. S DGSITE=0
. F S DGSITE=$O(^TMP("DGPFSORT",$J,0,DGAIEN,DGSITE)) Q:DGSITE="" D
. . N X,Y
. . K DGPFL,DGPFAH,DGPFA,DGPFPAT
. . S DGLIEN=0 ;- get most recent record ien
. . S DGLIEN=$O(^TMP("DGPFSORT",$J,0,DGAIEN,DGSITE,""),-1)
. . Q:DGLIEN=""
. . ;- retrieve HL7 log data
. . Q:'$$GETLOG^DGPFHLL(DGLIEN,.DGPFL)
. . ;- retrieve assignment file data to get Owner Site
. . Q:'$$GETASGN^DGPFAA(DGAIEN,.DGPFA)
. . ;- retrieve patient data to get ssn
. . Q:'$$GETPAT^DGPFUT2(+DGPFA("DFN"),.DGPFPAT)
. . S DGSSN=$G(DGPFPAT("SSN")) S:'DGSSN DGSSN="UNKNOWN"
. . ;- add ssn to existing array
. . S DGPFA("SSN")=DGSSN
. . ;- retrieve assignment history data
. . Q:'$$GETHIST^DGPFAAH(+DGPFL("ASGNHIST"),.DGPFAH)
. . ;
. . ;- DG*5.3*960 - FILTER check
. . ; STAT: 1:active; 0:inactive
. . ; OWN: 1:Owner local facility; 0:Owner not local
. . ; FLAG: "A" or flag variable pointer
. . S X=$G(DGSORT("STAT")) I X?1N,+DGPFA("STATUS")'=X Q
. . S X=$G(DGSORT("OWN")) I X?1N D Q:'Y
. . . S Y=+DGPFA("OWNER"),Y=$S(Y<1:0,1:$$ISDIV^DGPFUT(Y))
. . . I X=1,Y>0 Q
. . . I X=0 S Y=$S(Y>0:0,1:1)
. . . Q
. . S X=$G(DGSORT("FLAG")) I +X,$P(X,U)'=$P(DGPFA("FLAG"),U) Q
. . ;
. . ;- setup output array
. . D SORT(DGLIEN,DGSRTBY,.DGPFA,.DGPFAH,.DGPFL)
. . Q
. Q
;
Q
;
;
SORT(DGLIEN,DGSRTBY,DGPFA,DGPFAH,DGPFL) ;Setup output global
;
; Input:
; DGLIEN - ien of HL7 log record
; DGSRTBY - list sort value
; DGPFA - assignment array
; DGPFAH - assignment history array
; DGPFL - HL7 log array
;
; Output:
; ^TMP("DGPFSORT",$J,1,S4,S5,S6,S7) = data string values
; Subscript's are as follows for each sort by:
;
; List by patient name List by HL7 received d/t
; Sort="N" Sort="D"
; -------------------- ------------------------
; S4 patient_name ack_received_d/t
; S5 assignment_ien assignment_ien
; S6 site_ien site_transmitted_to
; S7 HL7_log_ien HL7_log_ien
;
; The data string value consists of 5 "^"-pieces
; DFN ^ Patient_name ^ SSN ^ Ack_received_dt ^ Site_transmitted_to
;
N DGACKDT ;d/t error msg received
N DGAIEN ;assignment ien
N DGPNAME ;patient name
N DGSITE ;site transmitted to ien
N DGSTRING ;detail line
N DGSUB ;subscript var
;
;- subscript setup
S DGACKDT=$P($G(DGPFL("ACKDT")),U) S:DGACKDT="" DGACKDT="UNKNOWN"
S DGAIEN=$P($G(DGPFAH("ASSIGN")),U) S:DGAIEN="" DGAIEN="UNKNOWN"
S DGPNAME=$P($G(DGPFA("DFN")),U,2) S:DGPNAME="" DGPNAME="UNKNOWN"
S DGSITE=$P($G(DGPFL("SITE")),U)
;
;- data string setup -
S DGSTRING=$P($G(DGPFA("DFN")),U)
S $P(DGSTRING,U,2)=DGPNAME
S $P(DGSTRING,U,3)=$P($G(DGPFA("SSN")),U)
S $P(DGSTRING,U,4)=DGACKDT
S $P(DGSTRING,U,5)=$P($G(DGPFL("SITE")),U,2)
;
;- patient name sort
I DGSRTBY="N" S DGSUB=DGPNAME
;- date/time error received type sort
I DGSRTBY="D" S DGSUB=DGACKDT
;
S ^TMP("DGPFSORT",$J,1,DGSUB,DGAIEN,DGSITE,DGLIEN)=DGSTRING
Q
;
;
BLD(DGARY,DGSRTBY,DGCNT) ;Build list area
;
; Input:
; DGARY - subscript name for temp global
; DGSRTBY - list sort by value
;
; Output:
; DGCNT - number of lines in the list
; DGARY - display list - ^TMP(DGARY,$J)
;
N DGACKDT ;d/t error msg received
N DGAIEN ;assignment ien
N DGLAST ;date of last activation action
N DGLIEN ;log record ien
N DGLINE ;line counter
N DGORIG ;original assignment date
N DGOWNER ;owner of assignment
N DGPNAME ;patient name
N DGSIEN ;site ien
N DGSITE ;site transmitted to name
N DGSSN ;patient ssn
N DGSTRING ;detail line
N DGSUB ;loop var
N DGTEMP ;sort array root
;
S DGTEMP=$NA(^TMP("DGPFSORT",$J,1))
S DGSUB="",DGLINE=0
;
F S DGSUB=$O(@DGTEMP@(DGSUB)) Q:DGSUB="" D
. S DGAIEN=0
. F S DGAIEN=$O(@DGTEMP@(DGSUB,DGAIEN)) Q:'DGAIEN D
. . S DGORIG=$$GETADT^DGPFAAH(DGAIEN)
. . S DGSIEN=0
. . F S DGSIEN=$O(@DGTEMP@(DGSUB,DGAIEN,DGSIEN)) Q:'DGSIEN D
. . . S DGLIEN=0
. . . F S DGLIEN=$O(@DGTEMP@(DGSUB,DGAIEN,DGSIEN,DGLIEN)) Q:'DGLIEN D
. . . . N X
. . . . ;- get data fields
. . . . S DGSTRING=$G(@DGTEMP@(DGSUB,DGAIEN,DGSIEN,DGLIEN))
. . . . S DGPNAME=$P(DGSTRING,U,2)
. . . . S DGSSN=$E($P(DGSTRING,U,3),6,9)
. . . . S DGACKDT=$$FMTE^XLFDT($P(DGSTRING,U,4)\1,"2Z")
. . . . S DGSITE=$E($P(DGSTRING,U,5),1,27)
. . . . ;- increment line counter
. . . . S DGLINE=DGLINE+1
. . . . ;- set line into list area
. . . . ;- format of display line, 2 spaces between columns
. . . . ; 1-3 6-35 38-41 44-51 54-80
. . . . ; line# patient ssn Reject_date Transmit_to
. . . . D SET(DGARY,DGLINE,DGLINE,1,,,.DGCNT)
. . . . D SET(DGARY,DGLINE,DGPNAME,6,,,.DGCNT)
. . . . D SET(DGARY,DGLINE,DGSSN,38,,,.DGCNT)
. . . . D SET(DGARY,DGLINE,DGACKDT,44,,,.DGCNT)
. . . . D SET(DGARY,DGLINE,DGSITE,54,,,.DGCNT)
. . . . ;
. . . . ;- associate "IDX" list item entry with the pointer's
. . . . ; back to ^TMP("DGPFSORT",$J,0,DGAIEN,DGSITE,DGLIEN) global:
. . . . ; <assignment ien>^<site ien>^<HL7 log ien>^<patient dfn>^pat name^site name
. . . . S ^TMP(DGARY,$J,"IDX",DGLINE,DGLINE)=DGAIEN_U_DGSIEN_U_DGLIEN_U_$P(DGSTRING,U,1)_U_DGPNAME_U_$P(DGSTRING,U,5)
;
;cleanup temp sort global
K @DGTEMP
Q
;
;
SET(DGARY,DGLINE,DGTEXT,DGCOL,DGON,DGOFF,DGCNT) ;Setup display detail lines
;
; Input:
; DGARY - subscript name for temp global
; DGLINE - line number
; DGTEXT - text
; DGCOL - starting column
; DGON - highlighting on
; DGOFF - highlighting off
;
; Output:
; DGARY - temp global array of LM detail lines
; DGCNT - number of lines in the list
;
N DGX ;string to insert new text into
;
S DGX=$S($D(^TMP(DGARY,$J,DGLINE,0)):^(0),1:"")
S DGCNT=DGLINE
;
S ^TMP(DGARY,$J,DGLINE,0)=$$SETSTR^VALM1(DGTEXT,DGX,DGCOL,$L(DGTEXT))
;
D:$G(DGON)]""!($G(DGOFF)]"") CNTRL^VALM10(DGLINE,DGCOL,$L(DGTEXT),$G(DGON),$G(DGOFF))
;
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGPFLMT1 9220 printed Oct 16, 2024@18:49 Page 2
DGPFLMT1 ;ALB/RBS - PRF TRANSMISSION ERRORS BUILD LIST AREA ; 6/10/05 11:38am
+1 ;;5.3;Registration;**650,960**;Aug 13, 1993;Build 22
+2 ; Last Edited: SHRPE/SGM - Jun 7, 2018 13:50
+3 ;
+4 ; DG*5.3*960 - filter for only active and locally owned assignments
+5 ; GET modified for filters BLD modified for additional columns
+6 ;
+7 ;no direct entry
+8 QUIT
+9 ;
+10 ;
EN(DGARY,DGSRTBY,DGCNT) ;Entry point to build list area
+1 ;
+2 ;The following input variables are 'system wide variables' in the
+3 ;DGPF TRANSMISSION ERRORS List Manager screen:
+4 ;
+5 ; Input:
+6 ; DGARY - subscript name for temp global
+7 ; DGSRTBY - list sort by criteria
+8 ; "N" = Patient Name
+9 ; "D" = Date/Time Error Received
+10 ; Output:
+11 ; DGCNT - number of lines in the list
+12 ; DGARY - ^TMP(DGARY,$J) - display list
+13 ; - ^TMP("DGPFSORT",$J) - used to create final DGARY list
+14 ;
+15 ;display wait msg
+16 DO WAIT^DICD
+17 ;
+18 ;retrieve and sort
+19 DO GET(DGSRTBY)
+20 ;
+21 ;build list
+22 DO BLD(DGARY,DGSRTBY,.DGCNT)
+23 ;
+24 ;if no entries in list, display message
+25 IF 'DGCNT
Begin DoDot:1
+26 DO SET(DGARY,1,"",1,,,.DGCNT)
+27 DO SET(DGARY,2,"There are no transmission error messages on file.",3,$GET(IOINHI),$GET(IOINORM),.DGCNT)
End DoDot:1
+28 ;
+29 QUIT
+30 ;
+31 ;
GET(DGSRTBY) ;Get "RJ" status entries.
+1 ;
+2 ; Input:
+3 ; DGSRTBY - list sort by value
+4 ;
+5 ; Output:
+6 ; ^TMP("DGPFSORT",$J,0,<assignment ien>,<site ien>,<HL7 log ien>)=""
+7 ;
+8 ;The 0 node is created to group each patient's PRF Assignment record
+9 ;with each Site Transmitted To that is rejecting the update with all
+10 ;of the pointed to HL7 transmission log records.
+11 ;Only the most recent transmission log entry will be displayed.
+12 ;
+13 ;assignment ien
NEW DGAIEN
+14 ;original transmission date
NEW DGDAT
+15 ;HL7 log record ien
NEW DGLIEN
+16 ;assignment array
NEW DGPFA
+17 ;assignment history data array
NEW DGPFAH
+18 ;HL7 transmission log data array
NEW DGPFL
+19 ;patient data array
NEW DGPFPAT
+20 ;site transmitted to ien
NEW DGSITE
+21 ;patient ssn
NEW DGSSN
+22 ;
+23 ;loop through ASTAT index of transmission date/times
+24 SET DGDAT=0
+25 FOR
SET DGDAT=$ORDER(^DGPF(26.17,"ASTAT",DGDAT))
if 'DGDAT
QUIT
Begin DoDot:1
+26 if '$DATA(^DGPF(26.17,"ASTAT",DGDAT,"RJ"))
QUIT
+27 SET DGLIEN=0
+28 FOR
SET DGLIEN=$ORDER(^DGPF(26.17,"ASTAT",DGDAT,"RJ",DGLIEN))
if 'DGLIEN
QUIT
Begin DoDot:2
+29 KILL DGPFL,DGPFAH
+30 ;- retrieve HL7 log data
+31 if '$$GETLOG^DGPFHLL(DGLIEN,.DGPFL)
QUIT
+32 if '+DGPFL("ASGNHIST")
QUIT
+33 SET DGSITE=$PIECE($GET(DGPFL("SITE")),U,1)
+34 if DGSITE']""
QUIT
+35 ;- retrieve assignment history data to get PRF Assignment ien
+36 if '$$GETHIST^DGPFAAH(+DGPFL("ASGNHIST"),.DGPFAH)
QUIT
+37 SET DGAIEN=$PIECE($GET(DGPFAH("ASSIGN")),U,1)
+38 if 'DGAIEN
QUIT
+39 ;
+40 ;- create 0 node by patient assignment, site ien and log ien
+41 SET ^TMP("DGPFSORT",$JOB,0,DGAIEN,DGSITE,DGLIEN)=""
End DoDot:2
End DoDot:1
+42 ;
+43 ;quit if nothing setup
if '$ORDER(^TMP("DGPFSORT",$JOB,0,""))
QUIT
+44 ;
+45 ;- now loop the sorted 0 node and only use the most recent HL7 error
+46 ; record to create the List Manager display temp file.
+47 ;
+48 SET DGAIEN=0
+49 FOR
SET DGAIEN=$ORDER(^TMP("DGPFSORT",$JOB,0,DGAIEN))
if DGAIEN=""
QUIT
Begin DoDot:1
+50 SET DGSITE=0
+51 FOR
SET DGSITE=$ORDER(^TMP("DGPFSORT",$JOB,0,DGAIEN,DGSITE))
if DGSITE=""
QUIT
Begin DoDot:2
+52 NEW X,Y
+53 KILL DGPFL,DGPFAH,DGPFA,DGPFPAT
+54 ;- get most recent record ien
SET DGLIEN=0
+55 SET DGLIEN=$ORDER(^TMP("DGPFSORT",$JOB,0,DGAIEN,DGSITE,""),-1)
+56 if DGLIEN=""
QUIT
+57 ;- retrieve HL7 log data
+58 if '$$GETLOG^DGPFHLL(DGLIEN,.DGPFL)
QUIT
+59 ;- retrieve assignment file data to get Owner Site
+60 if '$$GETASGN^DGPFAA(DGAIEN,.DGPFA)
QUIT
+61 ;- retrieve patient data to get ssn
+62 if '$$GETPAT^DGPFUT2(+DGPFA("DFN"),.DGPFPAT)
QUIT
+63 SET DGSSN=$GET(DGPFPAT("SSN"))
if 'DGSSN
SET DGSSN="UNKNOWN"
+64 ;- add ssn to existing array
+65 SET DGPFA("SSN")=DGSSN
+66 ;- retrieve assignment history data
+67 if '$$GETHIST^DGPFAAH(+DGPFL("ASGNHIST"),.DGPFAH)
QUIT
+68 ;
+69 ;- DG*5.3*960 - FILTER check
+70 ; STAT: 1:active; 0:inactive
+71 ; OWN: 1:Owner local facility; 0:Owner not local
+72 ; FLAG: "A" or flag variable pointer
+73 SET X=$GET(DGSORT("STAT"))
IF X?1N
IF +DGPFA("STATUS")'=X
QUIT
+74 SET X=$GET(DGSORT("OWN"))
IF X?1N
Begin DoDot:3
+75 SET Y=+DGPFA("OWNER")
SET Y=$SELECT(Y<1:0,1:$$ISDIV^DGPFUT(Y))
+76 IF X=1
IF Y>0
QUIT
+77 IF X=0
SET Y=$SELECT(Y>0:0,1:1)
+78 QUIT
End DoDot:3
if 'Y
QUIT
+79 SET X=$GET(DGSORT("FLAG"))
IF +X
IF $PIECE(X,U)'=$PIECE(DGPFA("FLAG"),U)
QUIT
+80 ;
+81 ;- setup output array
+82 DO SORT(DGLIEN,DGSRTBY,.DGPFA,.DGPFAH,.DGPFL)
+83 QUIT
End DoDot:2
+84 QUIT
End DoDot:1
+85 ;
+86 QUIT
+87 ;
+88 ;
SORT(DGLIEN,DGSRTBY,DGPFA,DGPFAH,DGPFL) ;Setup output global
+1 ;
+2 ; Input:
+3 ; DGLIEN - ien of HL7 log record
+4 ; DGSRTBY - list sort value
+5 ; DGPFA - assignment array
+6 ; DGPFAH - assignment history array
+7 ; DGPFL - HL7 log array
+8 ;
+9 ; Output:
+10 ; ^TMP("DGPFSORT",$J,1,S4,S5,S6,S7) = data string values
+11 ; Subscript's are as follows for each sort by:
+12 ;
+13 ; List by patient name List by HL7 received d/t
+14 ; Sort="N" Sort="D"
+15 ; -------------------- ------------------------
+16 ; S4 patient_name ack_received_d/t
+17 ; S5 assignment_ien assignment_ien
+18 ; S6 site_ien site_transmitted_to
+19 ; S7 HL7_log_ien HL7_log_ien
+20 ;
+21 ; The data string value consists of 5 "^"-pieces
+22 ; DFN ^ Patient_name ^ SSN ^ Ack_received_dt ^ Site_transmitted_to
+23 ;
+24 ;d/t error msg received
NEW DGACKDT
+25 ;assignment ien
NEW DGAIEN
+26 ;patient name
NEW DGPNAME
+27 ;site transmitted to ien
NEW DGSITE
+28 ;detail line
NEW DGSTRING
+29 ;subscript var
NEW DGSUB
+30 ;
+31 ;- subscript setup
+32 SET DGACKDT=$PIECE($GET(DGPFL("ACKDT")),U)
if DGACKDT=""
SET DGACKDT="UNKNOWN"
+33 SET DGAIEN=$PIECE($GET(DGPFAH("ASSIGN")),U)
if DGAIEN=""
SET DGAIEN="UNKNOWN"
+34 SET DGPNAME=$PIECE($GET(DGPFA("DFN")),U,2)
if DGPNAME=""
SET DGPNAME="UNKNOWN"
+35 SET DGSITE=$PIECE($GET(DGPFL("SITE")),U)
+36 ;
+37 ;- data string setup -
+38 SET DGSTRING=$PIECE($GET(DGPFA("DFN")),U)
+39 SET $PIECE(DGSTRING,U,2)=DGPNAME
+40 SET $PIECE(DGSTRING,U,3)=$PIECE($GET(DGPFA("SSN")),U)
+41 SET $PIECE(DGSTRING,U,4)=DGACKDT
+42 SET $PIECE(DGSTRING,U,5)=$PIECE($GET(DGPFL("SITE")),U,2)
+43 ;
+44 ;- patient name sort
+45 IF DGSRTBY="N"
SET DGSUB=DGPNAME
+46 ;- date/time error received type sort
+47 IF DGSRTBY="D"
SET DGSUB=DGACKDT
+48 ;
+49 SET ^TMP("DGPFSORT",$JOB,1,DGSUB,DGAIEN,DGSITE,DGLIEN)=DGSTRING
+50 QUIT
+51 ;
+52 ;
BLD(DGARY,DGSRTBY,DGCNT) ;Build list area
+1 ;
+2 ; Input:
+3 ; DGARY - subscript name for temp global
+4 ; DGSRTBY - list sort by value
+5 ;
+6 ; Output:
+7 ; DGCNT - number of lines in the list
+8 ; DGARY - display list - ^TMP(DGARY,$J)
+9 ;
+10 ;d/t error msg received
NEW DGACKDT
+11 ;assignment ien
NEW DGAIEN
+12 ;date of last activation action
NEW DGLAST
+13 ;log record ien
NEW DGLIEN
+14 ;line counter
NEW DGLINE
+15 ;original assignment date
NEW DGORIG
+16 ;owner of assignment
NEW DGOWNER
+17 ;patient name
NEW DGPNAME
+18 ;site ien
NEW DGSIEN
+19 ;site transmitted to name
NEW DGSITE
+20 ;patient ssn
NEW DGSSN
+21 ;detail line
NEW DGSTRING
+22 ;loop var
NEW DGSUB
+23 ;sort array root
NEW DGTEMP
+24 ;
+25 SET DGTEMP=$NAME(^TMP("DGPFSORT",$JOB,1))
+26 SET DGSUB=""
SET DGLINE=0
+27 ;
+28 FOR
SET DGSUB=$ORDER(@DGTEMP@(DGSUB))
if DGSUB=""
QUIT
Begin DoDot:1
+29 SET DGAIEN=0
+30 FOR
SET DGAIEN=$ORDER(@DGTEMP@(DGSUB,DGAIEN))
if 'DGAIEN
QUIT
Begin DoDot:2
+31 SET DGORIG=$$GETADT^DGPFAAH(DGAIEN)
+32 SET DGSIEN=0
+33 FOR
SET DGSIEN=$ORDER(@DGTEMP@(DGSUB,DGAIEN,DGSIEN))
if 'DGSIEN
QUIT
Begin DoDot:3
+34 SET DGLIEN=0
+35 FOR
SET DGLIEN=$ORDER(@DGTEMP@(DGSUB,DGAIEN,DGSIEN,DGLIEN))
if 'DGLIEN
QUIT
Begin DoDot:4
+36 NEW X
+37 ;- get data fields
+38 SET DGSTRING=$GET(@DGTEMP@(DGSUB,DGAIEN,DGSIEN,DGLIEN))
+39 SET DGPNAME=$PIECE(DGSTRING,U,2)
+40 SET DGSSN=$EXTRACT($PIECE(DGSTRING,U,3),6,9)
+41 SET DGACKDT=$$FMTE^XLFDT($PIECE(DGSTRING,U,4)\1,"2Z")
+42 SET DGSITE=$EXTRACT($PIECE(DGSTRING,U,5),1,27)
+43 ;- increment line counter
+44 SET DGLINE=DGLINE+1
+45 ;- set line into list area
+46 ;- format of display line, 2 spaces between columns
+47 ; 1-3 6-35 38-41 44-51 54-80
+48 ; line# patient ssn Reject_date Transmit_to
+49 DO SET(DGARY,DGLINE,DGLINE,1,,,.DGCNT)
+50 DO SET(DGARY,DGLINE,DGPNAME,6,,,.DGCNT)
+51 DO SET(DGARY,DGLINE,DGSSN,38,,,.DGCNT)
+52 DO SET(DGARY,DGLINE,DGACKDT,44,,,.DGCNT)
+53 DO SET(DGARY,DGLINE,DGSITE,54,,,.DGCNT)
+54 ;
+55 ;- associate "IDX" list item entry with the pointer's
+56 ; back to ^TMP("DGPFSORT",$J,0,DGAIEN,DGSITE,DGLIEN) global:
+57 ; <assignment ien>^<site ien>^<HL7 log ien>^<patient dfn>^pat name^site name
+58 SET ^TMP(DGARY,$JOB,"IDX",DGLINE,DGLINE)=DGAIEN_U_DGSIEN_U_DGLIEN_U_$PIECE(DGSTRING,U,1)_U_DGPNAME_U_$PIECE(DGSTRING,U,5)
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+59 ;
+60 ;cleanup temp sort global
+61 KILL @DGTEMP
+62 QUIT
+63 ;
+64 ;
SET(DGARY,DGLINE,DGTEXT,DGCOL,DGON,DGOFF,DGCNT) ;Setup display detail lines
+1 ;
+2 ; Input:
+3 ; DGARY - subscript name for temp global
+4 ; DGLINE - line number
+5 ; DGTEXT - text
+6 ; DGCOL - starting column
+7 ; DGON - highlighting on
+8 ; DGOFF - highlighting off
+9 ;
+10 ; Output:
+11 ; DGARY - temp global array of LM detail lines
+12 ; DGCNT - number of lines in the list
+13 ;
+14 ;string to insert new text into
NEW DGX
+15 ;
+16 SET DGX=$SELECT($DATA(^TMP(DGARY,$JOB,DGLINE,0)):^(0),1:"")
+17 SET DGCNT=DGLINE
+18 ;
+19 SET ^TMP(DGARY,$JOB,DGLINE,0)=$$SETSTR^VALM1(DGTEXT,DGX,DGCOL,$LENGTH(DGTEXT))
+20 ;
+21 if $GET(DGON)]""!($GET(DGOFF)]"")
DO CNTRL^VALM10(DGLINE,DGCOL,$LENGTH(DGTEXT),$GET(DGON),$GET(DGOFF))
+22 ;
+23 QUIT