LRUDPT ;AVAMC/REG - POW PTS ;2/18/93 12:36 ;
;;5.2;LAB SERVICE;;Sep 27, 1994
D XR^LRU
W !!?25,LRAA(1)," SEARCH FOR",!?28,"PRISONER OF WAR VETS",!!
D B^LRU Q:Y<0 S LRSDT=LRSDT-.01,LRLDT=LRLDT+.99
DEV S ZTRTN="QUE^LRUDPT" D BEG^LRUTL Q:POP!($D(ZTSK))
QUE U IO K ^TMP($J) S Z(4)=0 D L^LRU,HDR
F A=0:0 S LRSDT=$O(^LR(LRXR,LRSDT)) Q:LRSDT<1!(LRSDT>LRLDT) D LRDFN
D WRT W:IO'=IO(0) @IOF K N,P,LRP,LRXREF,LRXR,^TMP($J) D END^LRUTL Q
LRDFN F LRDFN=0:0 S LRDFN=$O(^LR(LRXR,LRSDT,LRDFN)) Q:LRDFN<1 D CK
Q
CK Q:$P(^LR(LRDFN,0),"^",2)'=2 S DFN=$P(^(0),"^",3),S(4)=""
POW I $D(^DPT(DFN,.52)),$P(^(.52),"^",5)="Y" S X=$P(^(.52),"^",6) S:X X=$S($D(^DIC(22,X,0)):$P(^(0),"^"),1:"") S S(4)=S(4)_"POW " S:$L(X) S(4)=S(4)_" PERIOD "_X
D:$Y>60 HDR I $L(S(4)) S X=^DPT(DFN,0),LRDPF=2,LRP=$P(X,"^"),SSN=$P(X,"^",9),Y=$P(X,"^",3) D D^LRU,SSN^LRU S ^TMP($J,LRP,SSN)=Y_"^"_S(4)
Q
HDR S Z(4)=Z(4)+1,%DT="T",X="N" D ^%DT,D^LRU W @IOF,!?23,"LABORATORY SERVICE ",$$INS^LRU,!,Y,?22,LRAA(1)," Special patients ",?73,"Pg: ",Z(4),!,"From: ",LRSTR," to ",LRLST,!
W !,"Patient",?40,"DOB",?60,"ID",!,LR("%") Q
WRT S N=0 F A=0:0 S N=$O(^TMP($J,N)) Q:N="" S I=0 F B=0:0 S I=$O(^TMP($J,N,I)) Q:I="" S P=^(I) D:$Y>60 HDR W !,N,?40,$P(P,"^"),?60,I,!?5,$P(P,"^",2)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLRUDPT 1263 printed Dec 13, 2024@02:21:27 Page 2
LRUDPT ;AVAMC/REG - POW PTS ;2/18/93 12:36 ;
+1 ;;5.2;LAB SERVICE;;Sep 27, 1994
+2 DO XR^LRU
+3 WRITE !!?25,LRAA(1)," SEARCH FOR",!?28,"PRISONER OF WAR VETS",!!
+4 DO B^LRU
if Y<0
QUIT
SET LRSDT=LRSDT-.01
SET LRLDT=LRLDT+.99
DEV SET ZTRTN="QUE^LRUDPT"
DO BEG^LRUTL
if POP!($DATA(ZTSK))
QUIT
QUE USE IO
KILL ^TMP($JOB)
SET Z(4)=0
DO L^LRU
DO HDR
+1 FOR A=0:0
SET LRSDT=$ORDER(^LR(LRXR,LRSDT))
if LRSDT<1!(LRSDT>LRLDT)
QUIT
DO LRDFN
+2 DO WRT
if IO'=IO(0)
WRITE @IOF
KILL N,P,LRP,LRXREF,LRXR,^TMP($JOB)
DO END^LRUTL
QUIT
LRDFN FOR LRDFN=0:0
SET LRDFN=$ORDER(^LR(LRXR,LRSDT,LRDFN))
if LRDFN<1
QUIT
DO CK
+1 QUIT
CK if $PIECE(^LR(LRDFN,0),"^",2)'=2
QUIT
SET DFN=$PIECE(^(0),"^",3)
SET S(4)=""
POW IF $DATA(^DPT(DFN,.52))
IF $PIECE(^(.52),"^",5)="Y"
SET X=$PIECE(^(.52),"^",6)
if X
SET X=$SELECT($DATA(^DIC(22,X,0)):$PIECE(^(0),"^"),1:"")
SET S(4)=S(4)_"POW "
if $LENGTH(X)
SET S(4)=S(4)_" PERIOD "_X
+1 if $Y>60
DO HDR
IF $LENGTH(S(4))
SET X=^DPT(DFN,0)
SET LRDPF=2
SET LRP=$PIECE(X,"^")
SET SSN=$PIECE(X,"^",9)
SET Y=$PIECE(X,"^",3)
DO D^LRU
DO SSN^LRU
SET ^TMP($JOB,LRP,SSN)=Y_"^"_S(4)
+2 QUIT
HDR SET Z(4)=Z(4)+1
SET %DT="T"
SET X="N"
DO ^%DT
DO D^LRU
WRITE @IOF,!?23,"LABORATORY SERVICE ",$$INS^LRU,!,Y,?22,LRAA(1)," Special patients ",?73,"Pg: ",Z(4),!,"From: ",LRSTR," to ",LRLST,!
+1 WRITE !,"Patient",?40,"DOB",?60,"ID",!,LR("%")
QUIT
WRT SET N=0
FOR A=0:0
SET N=$ORDER(^TMP($JOB,N))
if N=""
QUIT
SET I=0
FOR B=0:0
SET I=$ORDER(^TMP($JOB,N,I))
if I=""
QUIT
SET P=^(I)
if $Y>60
DO HDR
WRITE !,N,?40,$PIECE(P,"^"),?60,I,!?5,$PIECE(P,"^",2)
+1 QUIT