LRMIVER1 ;SLC/CJS/BA- MICRO CHART COPY APPROVAL CONT. ;2/19/91 11:01 ;
;;5.2;LAB SERVICE;**1030,1031**;NOV 01, 1997
;
;;VA LR Patche(s): 295
;
;from LRMIVER
APPROVE I '$O(^LRO(68,"AVS",LRAA,0)) W !,"No data." Q
; F I=0:0 W !!,"Do you wish to review the data as the (W)ards will see it, as the (L)ab",!,"will see it, or (N)ot review the data? N// " R X:DTIME S:'$T X=U S:'$L(X) X="N" Q:X[U!("WLN"[X&($L(X)=1)) D INFO^LRMINEW
F I=0:0 W !!,"Do you wish to review the data as the (W)ards will see it,",!,?31,"as the (L)ab will see it, or",!?38,"(N)ot review the data? N// " R X:DTIME S:'$T X=U S:'$L(X) X="W" Q:X[U!("WLN"[X&($L(X)=1)) D INFO^LRMINEW ; LR*5.2*1030
Q:X[U I X="N" D ACCEPT Q
; S:X="W" LRWRDVEW="" F I=0:0 W !,"Do you want to queue the data to print and approve it later" S %=1 D YN^DICN Q:% W !,"Answer 'Y'es or 'N'o"
S:X="W" LRWRDVEW="" F I=0:0 W !,"Do you want to queue the data to print and approve it later" S %=2 D YN^DICN Q:% W !,"Answer 'Y'es or 'N'o" ; IHS/OIT/MKK - LR*5.2*1030
Q:%<1 S ZTRTN="DQ^LRMIVER1" I %=1 S %ZIS="QM",%ZIS("B")="",IOP="Q"
D IO^LRWU
Q
DQ S:$D(ZTQUEUED) ZTREQ="@" U IO
S LREND=0,LRSB=0 K ^TMP($J) S LRAD=0 F I=0:0 S LRAD=+$O(^LRO(68,"AVS",LRAA,LRAD)) Q:LRAD<1 D SORT Q:LREND
S LRONESPC="",LRONETST="" D PRINT
Q
SORT S LRAN=0 F I=0:0 S LRAN=+$O(^LRO(68,"AVS",LRAA,LRAD,LRAN)) Q:LRAN<1 D S1
Q
S1 S LRDFN=+^LRO(68,"AVS",LRAA,LRAD,LRAN),LRIDT=$P(^(LRAN),U,2)
; I $D(^LR(LRDFN,"MI",LRIDT,0)) S LRVLOC=$S($L($P(^(0),U,8)):$P(^(0),U,8),1:0),^TMP($J,LRVLOC,LRDFN,LRIDT)=^(0)
; S ^TMP($J,LRVLOC,LRDFN,LRIDT,1)=LRAD
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; Sort by LRAN
I $D(^LR(LRDFN,"MI",LRIDT,0)) S LRVLOC=$S($L($P(^(0),U,8)):$P(^(0),U,8),1:0),^TMP($J,LRAN,LRDFN,LRIDT)=^(0)
S ^TMP($J,LRAN,LRDFN,LRIDT,1)=LRAD
; ----- END IHS/OIT/MKK - LR*5.2*1030
Q
PRINT ; S LRVLOC="" F LRLCNT=0:0 S LRVLOC=$O(^TMP($J,LRVLOC)) Q:LRVLOC="" S LRLTR=$E(LRVLOC,1,4) W @IOF D ^LRLTR:$E(IOST,1,2)'="C-",P1 Q:LREND
; S LRAN="" F LRLCNT=0:0 S LRAN=$O(^TMP($J,LRAN)) Q:LRAN="" W @IOF D ^LRLTR:$E(IOST,1,2)'="C-",P1 Q:LREND ; IHS/OIT/MKK - LR*5.2*1030 - LRAN Sort
S LRAN="" F LRLCNT=0:0 S LRAN=$O(^TMP($J,LRAN)) Q:LRAN="" D P1 Q:LREND ; IHS/MSC/MKK - LR*5.2*1031 - Removed W @IOF and the call to LRLTR -- not needed
Q
P1 ; S LRDFN=0 F I=0:0 S LRDFN=+$O(^TMP($J,LRVLOC,LRDFN)) Q:LRDFN<1 D P2 Q:LREND
S LRDFN=0 F I=0:0 S LRDFN=+$O(^TMP($J,LRAN,LRDFN)) Q:LRDFN<1 D P2 Q:LREND ; IHS/OIT/MKK - LR*5.2*1030 - LRAN Sort
Q
P2 ; S LRIDT=0 F I=0:0 S LRIDT=+$O(^TMP($J,LRVLOC,LRDFN,LRIDT)) Q:LRIDT<1 D P3 Q:LREND
S LRIDT=0 F I=0:0 S LRIDT=+$O(^TMP($J,LRAN,LRDFN,LRIDT)) Q:LRIDT<1 D P3 Q:LREND ; IHS/OIT/MKK - LR*5.2*1030 - LRAN Sort
Q
P3 ; S LRWLSAVE=LRAA,LRLLT=^TMP($J,LRVLOC,LRDFN,LRIDT),LRACC=$P(LRLLT,U,6),LRAD=$E(LRLLT)_$P(LRACC," ",2)_"0000",X=$P(LRACC," "),DIC=68,DIC(0)="M"
; D ^DIC S LRAA=+Y,LRAN=$P(LRACC," ",3),LRCMNT=$S($D(^LR(LRDFN,"MI",LRIDT,99)):^(99),1:""),LRPG=0 D EN^LRMIPSZ1 S LRAA=LRWLSAVE Q:LREND
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; LRAN Sort -- and Don't reset LRAN after D ^DIC call
S LRWLSAVE=LRAA,LRLLT=^TMP($J,LRAN,LRDFN,LRIDT),LRACC=$P(LRLLT,U,6),LRAD=$E(LRLLT)_$P(LRACC," ",2)_"0000",X=$P(LRACC," "),DIC=68,DIC(0)="M"
D ^DIC S LRAA=+Y,LRCMNT=$S($D(^LR(LRDFN,"MI",LRIDT,99)):^(99),1:""),LRPG=0 D EN^LRMIPSZ1 S LRAA=LRWLSAVE Q:LREND
; ----- END IHS/OIT/MKK - LR*5.2*1030
Q
ACCEPT W !!,"Indicate those you wish to exclude from verification." D LRAN^LRMIUT
S LRAN=0 F I=0:0 S LRAN=+$O(LRAN(LRAN)) Q:LRAN<1 S LRAD=0 F I=0:0 S LRAD=+$O(^LRO(68,"AVS",LRAA,LRAD)) Q:LRAD<1 K ^LRO(68,"AVS",LRAA,LRAD,LRAN)
F I=0:0 W !,"Ready to approve" S %=2 D YN^DICN Q:% W !,"Answer 'Y'es or 'N'o"
Q:%'=1 W !
S LRAD=0 F I=0:0 S LRAD=+$O(^LRO(68,"AVS",LRAA,LRAD)) Q:LRAD<1 D LRAD
K LRWRDVEW,LRAD,LRAN,LRTK,Z
Q
LRAD S LRAN=0 F I=0:0 S LRAN=+$O(^LRO(68,"AVS",LRAA,LRAD,LRAN)) Q:LRAN<1 D STUFF
Q
STUFF S LRDFN=+^LRO(68,"AVS",LRAA,LRAD,LRAN),LRIDT=$P(^(LRAN),U,2)
; D UPDATE^LRPXRM(LRDFN,"MI",LRIDT) ; IHS/OIT/MKK - LR*5.2*1030 - RPMS Does NOT use Clinical Reminders
I $$PATCH^BLRUTIL4("PXRM*1.5*12") D UPDATE^LRPXRM(LRDFN,"MI",LRIDT) ; IHS/MSC/MKK - LR*5.2*1031
I $D(^LRO(68,LRAA,1,LRAD,1,LRAN,0)) S LRODT=$P(^(0),U,4),LRSN=$P(^(0),U,5),LRLLOC=$P(^(0),U,7),DFN=$P(^LR(LRDFN,0),U,3),LRDPF=$P(^(0),U,2),LRCDT=9999999-LRIDT D PT^LRX S Y=DT D VT^LRMIUT1
S ^LR(LRDFN,"MI",LRIDT,0)=$P(^LR(LRDFN,"MI",LRIDT,0),U,1,2)_U_LRNT_U_DUZ_U_$P(^(0),U,5,99)
S LRSET=1,II=0 F I=0:0 S II=+$O(^LRO(68,LRAA,1,LRAD,1,LRAN,4,II)) Q:I<1 I '$L($P(^(II,0),U,5)) S LRSET=0
S:LRSET $P(^LRO(68,LRAA,1,LRAD,1,LRAN,3),U,4)=LRNT W "."
F II=1,5,8,11,16 I $D(^LR(LRDFN,"MI",LRIDT,II)),$P(^(II),U) K ^LRO(68,LRAA,1,LRAD,"AC",II,LRAN)
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
; Per appendix A of RPMS Lab E-Sig Enhancement V 5.2 Technical manual
I $$ADDON^BLRUTIL("LR*5.2*1013","BLRALAF",DUZ(2)) D ^BLRALAF
; ----- END IHS/OIT/MKK - LR*5.2*1030
Q
LRMIVER1 ;SLC/CJS/BA- MICRO CHART COPY APPROVAL CONT. ;2/19/91 11:01 ;
+1 ;;5.2;LAB SERVICE;**1030,1031**;NOV 01, 1997
+2 ;
+3 ;;VA LR Patche(s): 295
+4 ;
+5 ;from LRMIVER
APPROVE IF '$ORDER(^LRO(68,"AVS",LRAA,0))
WRITE !,"No data."
QUIT
+1 ; F I=0:0 W !!,"Do you wish to review the data as the (W)ards will see it, as the (L)ab",!,"will see it, or (N)ot review the data? N// " R X:DTIME S:'$T X=U S:'$L(X) X="N" Q:X[U!("WLN"[X&($L(X)=1)) D INFO^LRMINEW
+2 ; LR*5.2*1030
FOR I=0:0
WRITE !!,"Do you wish to review the data as the (W)ards will see it,",!,?31,"as the (L)ab will see it, or",!?38,"(N)ot review the data? N// "
READ X:DTIME
IF '$TEST
SET X=U
IF '$LENGTH(X)
SET X="W"
IF X[U!("WLN"[X&($LENGTH(X)=1))
QUIT
DO INFO^LRMINEW
+3 IF X[U
QUIT
IF X="N"
DO ACCEPT
QUIT
+4 ; S:X="W" LRWRDVEW="" F I=0:0 W !,"Do you want to queue the data to print and approve it later" S %=1 D YN^DICN Q:% W !,"Answer 'Y'es or 'N'o"
+5 ; IHS/OIT/MKK - LR*5.2*1030
IF X="W"
SET LRWRDVEW=""
FOR I=0:0
WRITE !,"Do you want to queue the data to print and approve it later"
SET %=2
DO YN^DICN
IF %
QUIT
WRITE !,"Answer 'Y'es or 'N'o"
+6 IF %<1
QUIT
SET ZTRTN="DQ^LRMIVER1"
IF %=1
SET %ZIS="QM"
SET %ZIS("B")=""
SET IOP="Q"
+7 DO IO^LRWU
+8 QUIT
DQ IF $DATA(ZTQUEUED)
SET ZTREQ="@"
USE IO
+1 SET LREND=0
SET LRSB=0
KILL ^TMP($JOB)
SET LRAD=0
FOR I=0:0
SET LRAD=+$ORDER(^LRO(68,"AVS",LRAA,LRAD))
IF LRAD<1
QUIT
DO SORT
IF LREND
QUIT
+2 SET LRONESPC=""
SET LRONETST=""
DO PRINT
+3 QUIT
SORT SET LRAN=0
FOR I=0:0
SET LRAN=+$ORDER(^LRO(68,"AVS",LRAA,LRAD,LRAN))
IF LRAN<1
QUIT
DO S1
+1 QUIT
S1 SET LRDFN=+^LRO(68,"AVS",LRAA,LRAD,LRAN)
SET LRIDT=$PIECE(^(LRAN),U,2)
+1 ; I $D(^LR(LRDFN,"MI",LRIDT,0)) S LRVLOC=$S($L($P(^(0),U,8)):$P(^(0),U,8),1:0),^TMP($J,LRVLOC,LRDFN,LRIDT)=^(0)
+2 ; S ^TMP($J,LRVLOC,LRDFN,LRIDT,1)=LRAD
+3 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+4 ; Sort by LRAN
+5 IF $DATA(^LR(LRDFN,"MI",LRIDT,0))
SET LRVLOC=$SELECT($LENGTH($PIECE(^(0),U,8)):$PIECE(^(0),U,8),1:0)
SET ^TMP($JOB,LRAN,LRDFN,LRIDT)=^(0)
+6 SET ^TMP($JOB,LRAN,LRDFN,LRIDT,1)=LRAD
+7 ; ----- END IHS/OIT/MKK - LR*5.2*1030
+8 QUIT
PRINT ; S LRVLOC="" F LRLCNT=0:0 S LRVLOC=$O(^TMP($J,LRVLOC)) Q:LRVLOC="" S LRLTR=$E(LRVLOC,1,4) W @IOF D ^LRLTR:$E(IOST,1,2)'="C-",P1 Q:LREND
+1 ; S LRAN="" F LRLCNT=0:0 S LRAN=$O(^TMP($J,LRAN)) Q:LRAN="" W @IOF D ^LRLTR:$E(IOST,1,2)'="C-",P1 Q:LREND ; IHS/OIT/MKK - LR*5.2*1030 - LRAN Sort
+2 ; IHS/MSC/MKK - LR*5.2*1031 - Removed W @IOF and the call to LRLTR -- not needed
SET LRAN=""
FOR LRLCNT=0:0
SET LRAN=$ORDER(^TMP($JOB,LRAN))
IF LRAN=""
QUIT
DO P1
IF LREND
QUIT
+3 QUIT
P1 ; S LRDFN=0 F I=0:0 S LRDFN=+$O(^TMP($J,LRVLOC,LRDFN)) Q:LRDFN<1 D P2 Q:LREND
+1 ; IHS/OIT/MKK - LR*5.2*1030 - LRAN Sort
SET LRDFN=0
FOR I=0:0
SET LRDFN=+$ORDER(^TMP($JOB,LRAN,LRDFN))
IF LRDFN<1
QUIT
DO P2
IF LREND
QUIT
+2 QUIT
P2 ; S LRIDT=0 F I=0:0 S LRIDT=+$O(^TMP($J,LRVLOC,LRDFN,LRIDT)) Q:LRIDT<1 D P3 Q:LREND
+1 ; IHS/OIT/MKK - LR*5.2*1030 - LRAN Sort
SET LRIDT=0
FOR I=0:0
SET LRIDT=+$ORDER(^TMP($JOB,LRAN,LRDFN,LRIDT))
IF LRIDT<1
QUIT
DO P3
IF LREND
QUIT
+2 QUIT
P3 ; S LRWLSAVE=LRAA,LRLLT=^TMP($J,LRVLOC,LRDFN,LRIDT),LRACC=$P(LRLLT,U,6),LRAD=$E(LRLLT)_$P(LRACC," ",2)_"0000",X=$P(LRACC," "),DIC=68,DIC(0)="M"
+1 ; D ^DIC S LRAA=+Y,LRAN=$P(LRACC," ",3),LRCMNT=$S($D(^LR(LRDFN,"MI",LRIDT,99)):^(99),1:""),LRPG=0 D EN^LRMIPSZ1 S LRAA=LRWLSAVE Q:LREND
+2 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+3 ; LRAN Sort -- and Don't reset LRAN after D ^DIC call
+4 SET LRWLSAVE=LRAA
SET LRLLT=^TMP($JOB,LRAN,LRDFN,LRIDT)
SET LRACC=$PIECE(LRLLT,U,6)
SET LRAD=$EXTRACT(LRLLT)_$PIECE(LRACC," ",2)_"0000"
SET X=$PIECE(LRACC," ")
SET DIC=68
SET DIC(0)="M"
+5 DO ^DIC
SET LRAA=+Y
SET LRCMNT=$SELECT($DATA(^LR(LRDFN,"MI",LRIDT,99)):^(99),1:"")
SET LRPG=0
DO EN^LRMIPSZ1
SET LRAA=LRWLSAVE
IF LREND
QUIT
+6 ; ----- END IHS/OIT/MKK - LR*5.2*1030
+7 QUIT
ACCEPT WRITE !!,"Indicate those you wish to exclude from verification."
DO LRAN^LRMIUT
+1 SET LRAN=0
FOR I=0:0
SET LRAN=+$ORDER(LRAN(LRAN))
IF LRAN<1
QUIT
SET LRAD=0
FOR I=0:0
SET LRAD=+$ORDER(^LRO(68,"AVS",LRAA,LRAD))
IF LRAD<1
QUIT
KILL ^LRO(68,"AVS",LRAA,LRAD,LRAN)
+2 FOR I=0:0
WRITE !,"Ready to approve"
SET %=2
DO YN^DICN
IF %
QUIT
WRITE !,"Answer 'Y'es or 'N'o"
+3 IF %'=1
QUIT
WRITE !
+4 SET LRAD=0
FOR I=0:0
SET LRAD=+$ORDER(^LRO(68,"AVS",LRAA,LRAD))
IF LRAD<1
QUIT
DO LRAD
+5 KILL LRWRDVEW,LRAD,LRAN,LRTK,Z
+6 QUIT
LRAD SET LRAN=0
FOR I=0:0
SET LRAN=+$ORDER(^LRO(68,"AVS",LRAA,LRAD,LRAN))
IF LRAN<1
QUIT
DO STUFF
+1 QUIT
STUFF SET LRDFN=+^LRO(68,"AVS",LRAA,LRAD,LRAN)
SET LRIDT=$PIECE(^(LRAN),U,2)
+1 ; D UPDATE^LRPXRM(LRDFN,"MI",LRIDT) ; IHS/OIT/MKK - LR*5.2*1030 - RPMS Does NOT use Clinical Reminders
+2 ; IHS/MSC/MKK - LR*5.2*1031
IF $$PATCH^BLRUTIL4("PXRM*1.5*12")
DO UPDATE^LRPXRM(LRDFN,"MI",LRIDT)
+3 IF $DATA(^LRO(68,LRAA,1,LRAD,1,LRAN,0))
SET LRODT=$PIECE(^(0),U,4)
SET LRSN=$PIECE(^(0),U,5)
SET LRLLOC=$PIECE(^(0),U,7)
SET DFN=$PIECE(^LR(LRDFN,0),U,3)
SET LRDPF=$PIECE(^(0),U,2)
SET LRCDT=9999999-LRIDT
DO PT^LRX
SET Y=DT
DO VT^LRMIUT1
+4 SET ^LR(LRDFN,"MI",LRIDT,0)=$PIECE(^LR(LRDFN,"MI",LRIDT,0),U,1,2)_U_LRNT_U_DUZ_U_$PIECE(^(0),U,5,99)
+5 SET LRSET=1
SET II=0
FOR I=0:0
SET II=+$ORDER(^LRO(68,LRAA,1,LRAD,1,LRAN,4,II))
IF I<1
QUIT
IF '$LENGTH($PIECE(^(II,0),U,5))
SET LRSET=0
+6 IF LRSET
SET $PIECE(^LRO(68,LRAA,1,LRAD,1,LRAN,3),U,4)=LRNT
WRITE "."
+7 FOR II=1,5,8,11,16
IF $DATA(^LR(LRDFN,"MI",LRIDT,II))
IF $PIECE(^(II),U)
KILL ^LRO(68,LRAA,1,LRAD,"AC",II,LRAN)
+8 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
+9 ; Per appendix A of RPMS Lab E-Sig Enhancement V 5.2 Technical manual
+10 IF $$ADDON^BLRUTIL("LR*5.2*1013","BLRALAF",DUZ(2))
DO ^BLRALAF
+11 ; ----- END IHS/OIT/MKK - LR*5.2*1030
+12 QUIT