LRBEBA31 ;DALOI/JAH/FHS - ORDERING AND RESULTING OUTPATIENT ;8/10/04
;;5.2;LAB SERVICE;**291**;Sep 27, 1994
;
DADD(LRODT,LRSN,LRBETN,LRXDA,LRTS,LRBERF) ; Take care of ADDs to accession
N LRBEALO,LRBEAALO,LRBEFN,LRBEX,LRBEVAL,LRBEXD,LRBEQT,LRBESPEC,LRBESAMP
Q:'$$CIDC^IBBAPI(DFN)
S LRBERF=$G(LRBERF)
S LRBEVAL=$D(^XUSEC("PROVIDER",DUZ))
S LRBEFN="O",LRBEDFN=DFN
S X=^LRO(69,LRODT,1,LRSN,0),LRBESAMP=$P(X,"^",3) K X
S LRBESPEC=$O(^LRO(69,LRODT,1,LRSN,4,0))
S LRBESPEC=$S(LRBESPEC>0:$P(^LRO(69,LRODT,1,LRSN,4,LRBESPEC,0),"^",1),1:"")
I LRBERF=1 D
. D QRYADD^LRBEBA3(LRODT,LRSN,LRBETN,LRBEDFN,LRBESAMP,LRBESPEC,LRTS,.LRBEX)
. D SACC^LRBEBA2(LRODT,LRSN,LRXDA,LRBESAMP,LRBESPEC,LRTS,.LRBEX)
I LRBEVAL,LRBERF=0 D
. D ELIG^LRBEBA3(LRBEDFN)
. S LRBEQT=$$QUES^LRBEBA(LRBEDFN,LRBESAMP,LRBESPEC,LRTS,LRODT,.LRBEX)
. D:'LRBEQT SACC^LRBEBA2(LRODT,LRSN,LRXDA,LRBESAMP,LRBESPEC,LRTS,.LRBEX)
Q
;
SBA(LRDFN,LRBEX,LRBEQT,LROT) ; billing questions
N LRBECNT,LRBEST,LRBEDFN,LRBESMP,LRBESPC,LRBEY,LRBETN,LRBEQT
N LRBEOT,LRBETS,LRBEMSG,LRBEPTDT
I '$D(DFN) S LRBEDFN=$$GET1^DIQ(63,LRDFN,.03,"I")
S:$D(DFN) LRBEDFN=DFN
D:$G(LRBEAT)=1 ELIG^LRBEBA3(LRBEDFN)
S LRBEST=1,LRBEQT=0
S LRBESMP="" F S LRBESMP=$O(LROT(LRBESMP)) Q:LRBESMP=""!(LRBEQT) D
.S LRBESPC="" F S LRBESPC=$O(LROT(LRBESMP,LRBESPC)) Q:LRBESPC="" D
..S LRBEY="" F S LRBEY=$O(LROT(LRBESMP,LRBESPC,LRBEY)) Q:LRBEY="" D
...S LRBEOT(LRBEY,LRBESMP,LRBESPC)=""
S LRBEY="" F S LRBEY=$O(LRBEOT(LRBEY)) Q:LRBEY="" D
.S LRBESMP="" F S LRBESMP=$O(LRBEOT(LRBEY,LRBESMP)) Q:LRBESMP=""!(LRBEQT) D
..S LRBESPC="" F S LRBESPC=$O(LRBEOT(LRBEY,LRBESMP,LRBESPC)) Q:LRBESPC="" D
...S LRBEPTDT=$G(LROT(LRBESMP,LRBESPC,LRBEY)),LRBETS=$P(LRBEPTDT,U,1)
...S LRBETN=$$GET1^DIQ(60,LRBETS_",",.01)
...S LRBEMSG="Enter information for "_LRBETN D EN^DDIOL(LRBEMSG,"","!")
...S:$G(LRBEAT)'=1 LRBEALO=1
...S LRBEQT=$$QUES^LRBEBA(LRBEDFN,LRBESMP,LRBESPC,LRBETS,LRODT,.LRBEX)
...S:LRBEQT LRBEST=0 Q:LRBEQT
...D EN^DDIOL("","","!")
Q LRBEST
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLRBEBA31 2038 printed Dec 13, 2024@02:10 Page 2
LRBEBA31 ;DALOI/JAH/FHS - ORDERING AND RESULTING OUTPATIENT ;8/10/04
+1 ;;5.2;LAB SERVICE;**291**;Sep 27, 1994
+2 ;
DADD(LRODT,LRSN,LRBETN,LRXDA,LRTS,LRBERF) ; Take care of ADDs to accession
+1 NEW LRBEALO,LRBEAALO,LRBEFN,LRBEX,LRBEVAL,LRBEXD,LRBEQT,LRBESPEC,LRBESAMP
+2 if '$$CIDC^IBBAPI(DFN)
QUIT
+3 SET LRBERF=$GET(LRBERF)
+4 SET LRBEVAL=$DATA(^XUSEC("PROVIDER",DUZ))
+5 SET LRBEFN="O"
SET LRBEDFN=DFN
+6 SET X=^LRO(69,LRODT,1,LRSN,0)
SET LRBESAMP=$PIECE(X,"^",3)
KILL X
+7 SET LRBESPEC=$ORDER(^LRO(69,LRODT,1,LRSN,4,0))
+8 SET LRBESPEC=$SELECT(LRBESPEC>0:$PIECE(^LRO(69,LRODT,1,LRSN,4,LRBESPEC,0),"^",1),1:"")
+9 IF LRBERF=1
Begin DoDot:1
+10 DO QRYADD^LRBEBA3(LRODT,LRSN,LRBETN,LRBEDFN,LRBESAMP,LRBESPEC,LRTS,.LRBEX)
+11 DO SACC^LRBEBA2(LRODT,LRSN,LRXDA,LRBESAMP,LRBESPEC,LRTS,.LRBEX)
End DoDot:1
+12 IF LRBEVAL
IF LRBERF=0
Begin DoDot:1
+13 DO ELIG^LRBEBA3(LRBEDFN)
+14 SET LRBEQT=$$QUES^LRBEBA(LRBEDFN,LRBESAMP,LRBESPEC,LRTS,LRODT,.LRBEX)
+15 if 'LRBEQT
DO SACC^LRBEBA2(LRODT,LRSN,LRXDA,LRBESAMP,LRBESPEC,LRTS,.LRBEX)
End DoDot:1
+16 QUIT
+17 ;
SBA(LRDFN,LRBEX,LRBEQT,LROT) ; billing questions
+1 NEW LRBECNT,LRBEST,LRBEDFN,LRBESMP,LRBESPC,LRBEY,LRBETN,LRBEQT
+2 NEW LRBEOT,LRBETS,LRBEMSG,LRBEPTDT
+3 IF '$DATA(DFN)
SET LRBEDFN=$$GET1^DIQ(63,LRDFN,.03,"I")
+4 if $DATA(DFN)
SET LRBEDFN=DFN
+5 if $GET(LRBEAT)=1
DO ELIG^LRBEBA3(LRBEDFN)
+6 SET LRBEST=1
SET LRBEQT=0
+7 SET LRBESMP=""
FOR
SET LRBESMP=$ORDER(LROT(LRBESMP))
if LRBESMP=""!(LRBEQT)
QUIT
Begin DoDot:1
+8 SET LRBESPC=""
FOR
SET LRBESPC=$ORDER(LROT(LRBESMP,LRBESPC))
if LRBESPC=""
QUIT
Begin DoDot:2
+9 SET LRBEY=""
FOR
SET LRBEY=$ORDER(LROT(LRBESMP,LRBESPC,LRBEY))
if LRBEY=""
QUIT
Begin DoDot:3
+10 SET LRBEOT(LRBEY,LRBESMP,LRBESPC)=""
End DoDot:3
End DoDot:2
End DoDot:1
+11 SET LRBEY=""
FOR
SET LRBEY=$ORDER(LRBEOT(LRBEY))
if LRBEY=""
QUIT
Begin DoDot:1
+12 SET LRBESMP=""
FOR
SET LRBESMP=$ORDER(LRBEOT(LRBEY,LRBESMP))
if LRBESMP=""!(LRBEQT)
QUIT
Begin DoDot:2
+13 SET LRBESPC=""
FOR
SET LRBESPC=$ORDER(LRBEOT(LRBEY,LRBESMP,LRBESPC))
if LRBESPC=""
QUIT
Begin DoDot:3
+14 SET LRBEPTDT=$GET(LROT(LRBESMP,LRBESPC,LRBEY))
SET LRBETS=$PIECE(LRBEPTDT,U,1)
+15 SET LRBETN=$$GET1^DIQ(60,LRBETS_",",.01)
+16 SET LRBEMSG="Enter information for "_LRBETN
DO EN^DDIOL(LRBEMSG,"","!")
+17 if $GET(LRBEAT)'=1
SET LRBEALO=1
+18 SET LRBEQT=$$QUES^LRBEBA(LRBEDFN,LRBESMP,LRBESPC,LRBETS,LRODT,.LRBEX)
+19 if LRBEQT
SET LRBEST=0
if LRBEQT
QUIT
+20 DO EN^DDIOL("","","!")
End DoDot:3
End DoDot:2
End DoDot:1
+21 QUIT LRBEST