OOPSGUIU ;WIOFO/LLH-RPC Broker calls for GUI ;03/25/04
;;2.0;ASISTS;**11**;Jun 03, 2002
;
SERVICE ; calling this Service report but it really is Location
; of injury and detail location of injury report
; Note: to sort this report by station, add DSTXT as the first
; subscript in ARR
N DLOC,DLSTAIEN,DLOCTX,DS,DSTXT,LOC,LOCTX,TI
S LOC=$$GET1^DIQ(2260,IEN,27,"I"),LOCTX=$$GET1^DIQ(2260,IEN,27)
S DLOC=$$GET1^DIQ(2260,IEN,348),DS=$$GET1^DIQ(2260,IEN,13,"I")
S DSTXT=$$GET1^DIQ(2260,IEN,13)
S TI=$$GET1^DIQ(2260,IEN,3)
I ($G(TI)="") Q
I $G(LOCTX)="" S LOCTX="No Location Text,Loc Code ="_LOC
I LOC="" S ARR(TI,"NO LOC ENTERED"," - ")=$G(ARR(TI,"NO LOC ENTERED"," - "),0)+1 Q
I DLOC="" S ARR(TI,LOCTX,"NO DETAIL ENTERED")=$G(ARR(TI,LOCTX,"NO DETAIL ENTERED"),0)+1 Q
I DLOC'="" D
.S DLSTAIEN=$O(^OOPS(2261.4,LOC,1,"B",DS,""))
.I DLSTAIEN="" S ARR(TI,LOCTX,"STADET NO ENT")=$G(ARR(TI,LOCTX,"STADET NO ENT"),0)+1
.S DLOCTX=$G(^OOPS(2261.4,LOC,1,DLSTAIEN,1,DLOC,0),"BAD DATA")
.S ARR(TI,LOCTX,DLOCTX)=$G(ARR(TI,LOCTX,DLOCTX),0)+1
Q
CMPLSRV ; move data from ARR to ^TMP($J,"SERVICE"
N N1,N2,N3,N4,CN
S CN=0,N1=""
F S N1=$O(ARR(N1)) Q:N1="" S N2="" D
.F S N2=$O(ARR(N1,N2)) Q:N2="" S N3="" D
..F S N3=$O(ARR(N1,N2,N3)) Q:N3="" S N4="" D
...;add line below back in if sorting by station
...;F S N4=$O(ARR(N1,N2,N3,N4)) Q:N4="" D
...S ^TMP($J,TAG,CN)=N1_U_N2_U_N3_U_N4_U_ARR(N1,N2,N3),CN=CN+1
Q
DSPUTE ; from OOPSGUIR, set temp global from compiled data
; this should only be called from DSPUTE^OOPSGUIR
N IEN,CN,FI,LT,NLT
S IEN=0 F S IEN=$O(^OOPS(2262.8,IEN)) Q:(IEN'>0) D
.S FI=$P($G(^OOPS(2262.8,IEN,0)),U) I '$D(ARR(FI)) S ARR(FI,"NLT")=0
S FI="",CN=1
F S FI=$O(ARR(FI)) Q:FI="" D
.S LT=$G(ARR(FI,"LT"),0),NLT=$G(ARR(FI,"NLT"),0)
.S ^TMP($J,TAG,CN)=FI_U_LT_U_NLT,CN=CN+1
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HOOPSGUIU 1864 printed Oct 16, 2024@17:40:05 Page 2
OOPSGUIU ;WIOFO/LLH-RPC Broker calls for GUI ;03/25/04
+1 ;;2.0;ASISTS;**11**;Jun 03, 2002
+2 ;
SERVICE ; calling this Service report but it really is Location
+1 ; of injury and detail location of injury report
+2 ; Note: to sort this report by station, add DSTXT as the first
+3 ; subscript in ARR
+4 NEW DLOC,DLSTAIEN,DLOCTX,DS,DSTXT,LOC,LOCTX,TI
+5 SET LOC=$$GET1^DIQ(2260,IEN,27,"I")
SET LOCTX=$$GET1^DIQ(2260,IEN,27)
+6 SET DLOC=$$GET1^DIQ(2260,IEN,348)
SET DS=$$GET1^DIQ(2260,IEN,13,"I")
+7 SET DSTXT=$$GET1^DIQ(2260,IEN,13)
+8 SET TI=$$GET1^DIQ(2260,IEN,3)
+9 IF ($GET(TI)="")
QUIT
+10 IF $GET(LOCTX)=""
SET LOCTX="No Location Text,Loc Code ="_LOC
+11 IF LOC=""
SET ARR(TI,"NO LOC ENTERED"," - ")=$GET(ARR(TI,"NO LOC ENTERED"," - "),0)+1
QUIT
+12 IF DLOC=""
SET ARR(TI,LOCTX,"NO DETAIL ENTERED")=$GET(ARR(TI,LOCTX,"NO DETAIL ENTERED"),0)+1
QUIT
+13 IF DLOC'=""
Begin DoDot:1
+14 SET DLSTAIEN=$ORDER(^OOPS(2261.4,LOC,1,"B",DS,""))
+15 IF DLSTAIEN=""
SET ARR(TI,LOCTX,"STADET NO ENT")=$GET(ARR(TI,LOCTX,"STADET NO ENT"),0)+1
+16 SET DLOCTX=$GET(^OOPS(2261.4,LOC,1,DLSTAIEN,1,DLOC,0),"BAD DATA")
+17 SET ARR(TI,LOCTX,DLOCTX)=$GET(ARR(TI,LOCTX,DLOCTX),0)+1
End DoDot:1
+18 QUIT
CMPLSRV ; move data from ARR to ^TMP($J,"SERVICE"
+1 NEW N1,N2,N3,N4,CN
+2 SET CN=0
SET N1=""
+3 FOR
SET N1=$ORDER(ARR(N1))
if N1=""
QUIT
SET N2=""
Begin DoDot:1
+4 FOR
SET N2=$ORDER(ARR(N1,N2))
if N2=""
QUIT
SET N3=""
Begin DoDot:2
+5 FOR
SET N3=$ORDER(ARR(N1,N2,N3))
if N3=""
QUIT
SET N4=""
Begin DoDot:3
+6 ;add line below back in if sorting by station
+7 ;F S N4=$O(ARR(N1,N2,N3,N4)) Q:N4="" D
+8 SET ^TMP($JOB,TAG,CN)=N1_U_N2_U_N3_U_N4_U_ARR(N1,N2,N3)
SET CN=CN+1
End DoDot:3
End DoDot:2
End DoDot:1
+9 QUIT
DSPUTE ; from OOPSGUIR, set temp global from compiled data
+1 ; this should only be called from DSPUTE^OOPSGUIR
+2 NEW IEN,CN,FI,LT,NLT
+3 SET IEN=0
FOR
SET IEN=$ORDER(^OOPS(2262.8,IEN))
if (IEN'>0)
QUIT
Begin DoDot:1
+4 SET FI=$PIECE($GET(^OOPS(2262.8,IEN,0)),U)
IF '$DATA(ARR(FI))
SET ARR(FI,"NLT")=0
End DoDot:1
+5 SET FI=""
SET CN=1
+6 FOR
SET FI=$ORDER(ARR(FI))
if FI=""
QUIT
Begin DoDot:1
+7 SET LT=$GET(ARR(FI,"LT"),0)
SET NLT=$GET(ARR(FI,"NLT"),0)
+8 SET ^TMP($JOB,TAG,CN)=FI_U_LT_U_NLT
SET CN=CN+1
End DoDot:1
+9 QUIT