PXBAPI1 ;ISL/JVS,dee - PCE's API - interview questions ;10/15/96
;;1.0;PCE PATIENT CARE ENCOUNTER;**1,9,23,56,104,111,113,122**;Aug 12, 1996
;;
Q
;
PROCESS(PXBEXIT) ;
I WHAT="INTV" D
. ;-- Interview is all of the questions
. D ADQ(.PXBEXIT) I PXBEXIT<1 Q
1 . D PRV(.PXBEXIT) I PXBEXIT<1 Q
3 . D POV(.PXBEXIT) I PXBEXIT<1 Q
2 . D CPT(.PXBEXIT) I PXBEXIT<1 Q
. I $P($G(^AUPNVSIT($G(PXBVST),150)),"^",3)="O" S PXBEXIT=0 Q
. I '$$DISPOSIT^PXUTL1($G(PXBPAT),$P($G(^AUPNVSIT(PXBVST,0)),"^",1),$G(PXBVST)) D STP(.PXBEXIT) I PXBEXIT<1 Q
E I WHAT="ADDEDIT" D
. D ADDEDIT
E I WHAT="ADQ" D
. ;-- Adminstrative questions
. D ADQ(.PXBEXIT)
E I WHAT="CODT" D
. ;-- Check out Date/Time
. D CODT(.PXBEXIT)
. Q:PXBEXIT<1
. D VISIT(.PXBEXIT)
. I PXBVST'>0 S PXBEXIT=-2 Q
E I WHAT="SCC" D
. ;-- Service connected conditions
. D SCC(.PXBEXIT)
. Q:PXBEXIT<1
. D VISIT(.PXBEXIT)
. I PXBVST'>0 S PXBEXIT=-2 Q
E I WHAT="PRV" D
. ;-- Providers
. D PRV(.PXBEXIT)
E I WHAT="CPT" D
. ;-- Providers and CPT codes
. D CPT(.PXBEXIT)
E I WHAT="POV" D
. ;-- Diagnoses
. D POV(.PXBEXIT)
E I WHAT="STP" D
. ;-- Stop Codes
. D STP(.PXBEXIT)
E S PXBEXIT=-3 W !,"Procedure ""INTV^PXAPI"" was called incorrectly, contact IRM."
Q
;
ADDEDIT ;
N ANS
ADDEDIT1 ;
D ADQ(.PXBEXIT)
G:PXBEXIT<1 ADDEDIT2
D PRV(.PXBEXIT)
G:PXBEXIT<1 ADDEDIT2
D POV(.PXBEXIT)
G:PXBEXIT<1 ADDEDIT2
;
;Call to CPT is not determined by a credit stop code any more
;
D CPT(.PXBEXIT)
G:PXBEXIT<1 ADDEDIT2
ADDEDIT2 ;
I PXBVST>0,'$D(^AUPNVCPT("AD",PXBVST)),'$D(^AUPNVSIT("AD",PXBVST)) D I ANS'=1 S PXBEXIT=1 G ADDEDIT1
. N DIR,X,Y
. W !!
. S DIR(0)="Y"
. S DIR("A",1)="Must have a STOP CODE or a PROCEDURE to complete this action."
. S DIR("A")="Do you want to delete this encounter"
. S DIR("B")="NO"
. D ^DIR
. S ANS=Y
. Q:ANS'=1
. I $$DELVFILE^PXAPIDEL("ALL",PXBVST,"","","","","")=1 S PXBEXIT=-1
I PXBVST>0,'$D(^AUPNVSIT(PXBVST,0)) S PXBVST=""
Q
;
ADQ(PXBEXIT) ;Ask the Administration questions
I PXBVST'>0 D
. ;This is only done for new visits
. I PXBPAT'>0 S PXBPAT=$$ASKPAT I PXBPAT'>0 S PXBEXIT=-1 Q
. S DFN=PXBPAT
. I PXBHLOC'>0 S PXBHLOC=$$ASKHL I PXBHLOC'>0 S PXBEXIT=-1 Q
. S PXBVSTDT=$S(PXBAPPT>0:PXBAPPT,1:$$ASKDT) I PXBVSTDT'>0 S PXBEXIT=-1 Q
. I PXBAPPT'>0&PXBHLOC'=+$G(^DPT(PXBPAT,"S",PXBVSTDT,0)) D
.. ;This is only done if there is no appointment.
.. S PXELAP=$$ELAP^SDPCE(PXBPAT,PXBHLOC)
I PXBEXIT'<1,PXBHLOC'>0 S PXBHLOC=$$ASKHL I PXBHLOC'>0 S PXBEXIT=-1 Q
I PXBEXIT'<1 D CODT(.PXBEXIT)
I PXBEXIT'<1 D SCC(.PXBEXIT)
I PXBEXIT'<1 D
. D VISIT(.PXBEXIT)
. I PXBVST'>0 S PXBEXIT=-2 Q
Q
;
ASKPAT() ;Ask user for a patient
;DIC on file 9000001
N DIR,DIC,Y,X,DA
S DIR(0)="P^9000001:AEMQ"
S DIR("A")="Patient Name"
D ^DIR
Q $S(+Y>0:+Y,1:-1)
;
ASKHL() ;Ask user for a Hospital Location
ASKHL2 ;DIC on file 44
N DIR,DIC,Y,X,DA
S DIR(0)="PA^44:AEMQ"
S DIR("A")="Clinic: "
; not occasion of service and not dispositioning
I PXALHLOC S DIR("S")="I '+$G(^(""OOS""))&'$O(^PX(815,1,""DHL"",""B"",Y,0))"
; only clinic that are not occasion of service and not dispositioning
E S DIR("S")="I $P(^(0),U,3)=""C""&'+$G(^(""OOS""))&'$O(^PX(815,1,""DHL"",""B"",Y,0))"
D ^DIR
I $D(^PX(815,1,"DHL","B",+Y)) D HELPDISP^PXCEVSIT W !,$C(7) G ASKHL2
Q $S(+Y>0:+Y,1:-1)
;
ASKDT() ;Ask user for the encounter Date/Time
N DIR,Y,X,DA
S DIR(0)="D^"_$S(PXLIMDT>2960000:PXLIMDT,1:"")_":"_(DT+.24)_":AEPRSX"
S DIR("A")="Encounter Date and Time"
S DIR("?")="Enter the Date and Time of this encounter"
D ^DIR
Q $S(+Y>0:+Y,1:-1)
;
CODT(PXBEXIT) ;Ask the user the Check out Date/Time
N PXCHKOUT
D CHIKOUT^PXBAPI2("",PXBPAT,PXBHLOC,PXBVSTDT)
S PXBCODT=PXCHKOUT
S:PXCHKOUT=-1 PXBCODT=""
;; PX*1*113 - Change for EAS*1*3 Appointment processing removed
;S X="EASMTCHK" X ^%ZOSF("TEST") I $T D Q:PXBEXIT<1
;. S:$G(EASACT)'="W" EASACT="C"
;. I $$MT^EASMTCHK(PXBPAT,"",EASACT,PXBVSTDT) D S PXBEXIT=-1
;. . D PAUSE^VALM1
I WHAT'["ADDEDIT",PXCHKOUT=-1 S PXBEXIT=-1
I $G(PXBVST),$$DISPOSIT^PXUTL1(DFN,$P($G(^AUPNVSIT(PXBVST,0)),"^",1),PXBVST) S PXBEXIT=1
Q
;
SCC(PXBEXIT) ;Ask the user the Service connected conditions
N PXBDATA,PXBCLASS,PXBOUTEN
S PXBOUTEN=""
;I $$APPOINT^PXUTL1(PXBPAT,PXBVSTDT,PXBHLOC) D
;. S PXBOUTEN=$P($G(^DPT(+PXBPAT,"S",+PXBVSTDT,0)),"^",20)
;E I $$DISPOSIT^PXUTL1(PXBPAT,PXBVSTDT,PXBVST) D
;. S PXBOUTEN=+$P($G(^DPT(+PXBPAT,"DIS",9999999-PXBVSTDT,0)),"^",18)
;I 'PXBOUTEN,$G(PXBVST)>0 S PXBOUTEN=$O(^SCE("AVSIT",PXBVST,0))
;D CLASS^PXBAPI21(PXBOUTEN,PXBPAT,PXBVSTDT,PXBHLOC)
D CLASS^PXBAPI21(PXBOUTEN,PXBPAT,PXBVSTDT,PXBHLOC,PXBVST)
;PX*1*111 - Add HNC
F PXBCLASS=1:1:6 I $G(PXBDATA("ERR",PXBCLASS))=4 S PXBEXIT=-1 Q ; changed 6/17/98 for MST enhancement
Q:PXBEXIT<1
S PXB800(1)=$P($G(PXBDATA(3)),"^",2)
S PXB800(2)=$P($G(PXBDATA(1)),"^",2)
S PXB800(3)=$P($G(PXBDATA(2)),"^",2)
S PXB800(4)=$P($G(PXBDATA(4)),"^",2)
S PXB800(5)=$P($G(PXBDATA(5)),"^",2) ;added 6/17/98 for MST enhancement
;PX*1*111 - Add HNC
S PXB800(6)=$P($G(PXBDATA(6)),"^",2)
Q
;
VISIT(PXBEXIT) ;Creat or edit the Visit
;Set up ^TMP("PXK",$J and call PXK
I PXBVST>0 L +^AUPNVSIT(PXBVST):10 E W !!,$C(7),"Cannot edit at this time, try again later." D WAIT^PXCEHELP S PXBEXIT=-2 Q
K ^TMP("PXK",$J)
N PXBNODE,PXBAFTER,PXKERROR
F PXBNODE=0,21,150,800,811,812 D
. S PXBAFTER(PXBNODE)=$S(PXBVST>0:$G(^AUPNVSIT(PXBVST,PXBNODE)),1:"")
. S ^TMP("PXK",$J,"VST",1,PXBNODE,"BEFORE")=PXBAFTER(PXBNODE)
I PXBVST'>0 D
. S $P(PXBAFTER(0),"^",1)=PXBVSTDT
. S $P(PXBAFTER(0),"^",5)=PXBPAT
. S $P(PXBAFTER(0),"^",8)=$P(^SC(PXBHLOC,0),"^",7)
. S:PXBAPPT>0 $P(PXBAFTER(0),"^",16)="A"
. S $P(PXBAFTER(150),"^",3)="P"
. S $P(PXBAFTER(812),"^",2)=PXBPKG
. S $P(PXBAFTER(812),"^",3)=PXBSOURC
S $P(PXBAFTER(0),"^",18)=$G(PXBCODT)
S:$P(PXBAFTER(0),"^",22)="" $P(PXBAFTER(0),"^",22)=PXBHLOC
S $P(PXBAFTER(800),"^",1)=$G(PXB800(1))
S $P(PXBAFTER(800),"^",2)=$G(PXB800(2))
S $P(PXBAFTER(800),"^",3)=$G(PXB800(3))
S $P(PXBAFTER(800),"^",4)=$G(PXB800(4))
S $P(PXBAFTER(800),"^",5)=$G(PXB800(5)) ;added 6/17/98 for MST emhancement
;PX*1*111 - Add HNC
S $P(PXBAFTER(800),"^",6)=$G(PXB800(6))
I $D(PXELAP)#2 D
. S $P(PXBAFTER(0),"^",21)=+PXELAP
F PXBNODE=0,21,150,800,811,812 D
. S ^TMP("PXK",$J,"VST",1,PXBNODE,"AFTER")=PXBAFTER(PXBNODE)
S ^TMP("PXK",$J,"VST",1,"IEN")=$S(PXBVST>0:PXBVST,1:"")
S ^TMP("PXK",$J,"SOR")=PXBSOURC
D EN1^PXKMAIN
I PXBVST>0 L -^AUPNVSIT(PXBVST):5
S PXBVST=$G(^TMP("PXK",$J,"VST",1,"IEN"))
Q
;
CPT(PXBEXIT) ;Ask the user Providers and CTPs
D CPT^PXBMCPT(PXBVST) K PRVDR
Q
;
POV(PXBEXIT) ;Ask the user Diagnoses
D POV^PXBMPOV(PXBVST) K PRVDR
Q
;
PRV(PXBEXIT) ;Ask the user Providers
D PRV^PXBMPRV(PXBVST,"PRV") K PRVDR
Q
;
STP(PXBEXIT) ;Ask the user Stop Codes
I $L($T(DATE^SCDXUTL)),$$DATE^SCDXUTL(+$G(^AUPNVSIT(PXBVST,0))) Q
D STP^PXBMSTP(PXBVST) K PRVDR
Q
;
PXBAPI1 ;ISL/JVS,dee - PCE's API - interview questions ;10/15/96
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**1,9,23,56,104,111,113,122**;Aug 12, 1996
+2 ;;
+3 QUIT
+4 ;
PROCESS(PXBEXIT) ;
+1 IF WHAT="INTV"
Begin DoDot:1
+2 ;-- Interview is all of the questions
+3 DO ADQ(.PXBEXIT)
IF PXBEXIT<1
QUIT
1 DO PRV(.PXBEXIT)
IF PXBEXIT<1
QUIT
3 DO POV(.PXBEXIT)
IF PXBEXIT<1
QUIT
2 DO CPT(.PXBEXIT)
IF PXBEXIT<1
QUIT
+1 IF $PIECE($GET(^AUPNVSIT($GET(PXBVST),150)),"^",3)="O"
SET PXBEXIT=0
QUIT
+2 IF '$$DISPOSIT^PXUTL1($GET(PXBPAT),$PIECE($GET(^AUPNVSIT(PXBVST,0)),"^",1),$GET(PXBVST))
DO STP(.PXBEXIT)
IF PXBEXIT<1
QUIT
End DoDot:1
+3 IF '$TEST
IF WHAT="ADDEDIT"
Begin DoDot:1
+4 DO ADDEDIT
End DoDot:1
+5 IF '$TEST
IF WHAT="ADQ"
Begin DoDot:1
+6 ;-- Adminstrative questions
+7 DO ADQ(.PXBEXIT)
End DoDot:1
+8 IF '$TEST
IF WHAT="CODT"
Begin DoDot:1
+9 ;-- Check out Date/Time
+10 DO CODT(.PXBEXIT)
+11 IF PXBEXIT<1
QUIT
+12 DO VISIT(.PXBEXIT)
+13 IF PXBVST'>0
SET PXBEXIT=-2
QUIT
End DoDot:1
+14 IF '$TEST
IF WHAT="SCC"
Begin DoDot:1
+15 ;-- Service connected conditions
+16 DO SCC(.PXBEXIT)
+17 IF PXBEXIT<1
QUIT
+18 DO VISIT(.PXBEXIT)
+19 IF PXBVST'>0
SET PXBEXIT=-2
QUIT
End DoDot:1
+20 IF '$TEST
IF WHAT="PRV"
Begin DoDot:1
+21 ;-- Providers
+22 DO PRV(.PXBEXIT)
End DoDot:1
+23 IF '$TEST
IF WHAT="CPT"
Begin DoDot:1
+24 ;-- Providers and CPT codes
+25 DO CPT(.PXBEXIT)
End DoDot:1
+26 IF '$TEST
IF WHAT="POV"
Begin DoDot:1
+27 ;-- Diagnoses
+28 DO POV(.PXBEXIT)
End DoDot:1
+29 IF '$TEST
IF WHAT="STP"
Begin DoDot:1
+30 ;-- Stop Codes
+31 DO STP(.PXBEXIT)
End DoDot:1
+32 IF '$TEST
SET PXBEXIT=-3
WRITE !,"Procedure ""INTV^PXAPI"" was called incorrectly, contact IRM."
+33 QUIT
+34 ;
ADDEDIT ;
+1 NEW ANS
ADDEDIT1 ;
+1 DO ADQ(.PXBEXIT)
+2 IF PXBEXIT<1
GOTO ADDEDIT2
+3 DO PRV(.PXBEXIT)
+4 IF PXBEXIT<1
GOTO ADDEDIT2
+5 DO POV(.PXBEXIT)
+6 IF PXBEXIT<1
GOTO ADDEDIT2
+7 ;
+8 ;Call to CPT is not determined by a credit stop code any more
+9 ;
+10 DO CPT(.PXBEXIT)
+11 IF PXBEXIT<1
GOTO ADDEDIT2
ADDEDIT2 ;
+1 IF PXBVST>0
IF '$DATA(^AUPNVCPT("AD",PXBVST))
IF '$DATA(^AUPNVSIT("AD",PXBVST))
Begin DoDot:1
+2 NEW DIR,X,Y
+3 WRITE !!
+4 SET DIR(0)="Y"
+5 SET DIR("A",1)="Must have a STOP CODE or a PROCEDURE to complete this action."
+6 SET DIR("A")="Do you want to delete this encounter"
+7 SET DIR("B")="NO"
+8 DO ^DIR
+9 SET ANS=Y
+10 IF ANS'=1
QUIT
+11 IF $$DELVFILE^PXAPIDEL("ALL",PXBVST,"","","","","")=1
SET PXBEXIT=-1
End DoDot:1
IF ANS'=1
SET PXBEXIT=1
GOTO ADDEDIT1
+12 IF PXBVST>0
IF '$DATA(^AUPNVSIT(PXBVST,0))
SET PXBVST=""
+13 QUIT
+14 ;
ADQ(PXBEXIT) ;Ask the Administration questions
+1 IF PXBVST'>0
Begin DoDot:1
+2 ;This is only done for new visits
+3 IF PXBPAT'>0
SET PXBPAT=$$ASKPAT
IF PXBPAT'>0
SET PXBEXIT=-1
QUIT
+4 SET DFN=PXBPAT
+5 IF PXBHLOC'>0
SET PXBHLOC=$$ASKHL
IF PXBHLOC'>0
SET PXBEXIT=-1
QUIT
+6 SET PXBVSTDT=$SELECT(PXBAPPT>0:PXBAPPT,1:$$ASKDT)
IF PXBVSTDT'>0
SET PXBEXIT=-1
QUIT
+7 IF PXBAPPT'>0&PXBHLOC'=+$GET(^DPT(PXBPAT,"S",PXBVSTDT,0))
Begin DoDot:2
+8 ;This is only done if there is no appointment.
+9 SET PXELAP=$$ELAP^SDPCE(PXBPAT,PXBHLOC)
End DoDot:2
End DoDot:1
+10 IF PXBEXIT'<1
IF PXBHLOC'>0
SET PXBHLOC=$$ASKHL
IF PXBHLOC'>0
SET PXBEXIT=-1
QUIT
+11 IF PXBEXIT'<1
DO CODT(.PXBEXIT)
+12 IF PXBEXIT'<1
DO SCC(.PXBEXIT)
+13 IF PXBEXIT'<1
Begin DoDot:1
+14 DO VISIT(.PXBEXIT)
+15 IF PXBVST'>0
SET PXBEXIT=-2
QUIT
End DoDot:1
+16 QUIT
+17 ;
ASKPAT() ;Ask user for a patient
+1 ;DIC on file 9000001
+2 NEW DIR,DIC,Y,X,DA
+3 SET DIR(0)="P^9000001:AEMQ"
+4 SET DIR("A")="Patient Name"
+5 DO ^DIR
+6 QUIT $SELECT(+Y>0:+Y,1:-1)
+7 ;
ASKHL() ;Ask user for a Hospital Location
ASKHL2 ;DIC on file 44
+1 NEW DIR,DIC,Y,X,DA
+2 SET DIR(0)="PA^44:AEMQ"
+3 SET DIR("A")="Clinic: "
+4 ; not occasion of service and not dispositioning
+5 IF PXALHLOC
SET DIR("S")="I '+$G(^(""OOS""))&'$O(^PX(815,1,""DHL"",""B"",Y,0))"
+6 ; only clinic that are not occasion of service and not dispositioning
+7 IF '$TEST
SET DIR("S")="I $P(^(0),U,3)=""C""&'+$G(^(""OOS""))&'$O(^PX(815,1,""DHL"",""B"",Y,0))"
+8 DO ^DIR
+9 IF $DATA(^PX(815,1,"DHL","B",+Y))
DO HELPDISP^PXCEVSIT
WRITE !,$CHAR(7)
GOTO ASKHL2
+10 QUIT $SELECT(+Y>0:+Y,1:-1)
+11 ;
ASKDT() ;Ask user for the encounter Date/Time
+1 NEW DIR,Y,X,DA
+2 SET DIR(0)="D^"_$SELECT(PXLIMDT>2960000:PXLIMDT,1:"")_":"_(DT+.24)_":AEPRSX"
+3 SET DIR("A")="Encounter Date and Time"
+4 SET DIR("?")="Enter the Date and Time of this encounter"
+5 DO ^DIR
+6 QUIT $SELECT(+Y>0:+Y,1:-1)
+7 ;
CODT(PXBEXIT) ;Ask the user the Check out Date/Time
+1 NEW PXCHKOUT
+2 DO CHIKOUT^PXBAPI2("",PXBPAT,PXBHLOC,PXBVSTDT)
+3 SET PXBCODT=PXCHKOUT
+4 IF PXCHKOUT=-1
SET PXBCODT=""
+5 ;; PX*1*113 - Change for EAS*1*3 Appointment processing removed
+6 ;S X="EASMTCHK" X ^%ZOSF("TEST") I $T D Q:PXBEXIT<1
+7 ;. S:$G(EASACT)'="W" EASACT="C"
+8 ;. I $$MT^EASMTCHK(PXBPAT,"",EASACT,PXBVSTDT) D S PXBEXIT=-1
+9 ;. . D PAUSE^VALM1
+10 IF WHAT'["ADDEDIT"
IF PXCHKOUT=-1
SET PXBEXIT=-1
+11 IF $GET(PXBVST)
IF $$DISPOSIT^PXUTL1(DFN,$PIECE($GET(^AUPNVSIT(PXBVST,0)),"^",1),PXBVST)
SET PXBEXIT=1
+12 QUIT
+13 ;
SCC(PXBEXIT) ;Ask the user the Service connected conditions
+1 NEW PXBDATA,PXBCLASS,PXBOUTEN
+2 SET PXBOUTEN=""
+3 ;I $$APPOINT^PXUTL1(PXBPAT,PXBVSTDT,PXBHLOC) D
+4 ;. S PXBOUTEN=$P($G(^DPT(+PXBPAT,"S",+PXBVSTDT,0)),"^",20)
+5 ;E I $$DISPOSIT^PXUTL1(PXBPAT,PXBVSTDT,PXBVST) D
+6 ;. S PXBOUTEN=+$P($G(^DPT(+PXBPAT,"DIS",9999999-PXBVSTDT,0)),"^",18)
+7 ;I 'PXBOUTEN,$G(PXBVST)>0 S PXBOUTEN=$O(^SCE("AVSIT",PXBVST,0))
+8 ;D CLASS^PXBAPI21(PXBOUTEN,PXBPAT,PXBVSTDT,PXBHLOC)
+9 DO CLASS^PXBAPI21(PXBOUTEN,PXBPAT,PXBVSTDT,PXBHLOC,PXBVST)
+10 ;PX*1*111 - Add HNC
+11 ; changed 6/17/98 for MST enhancement
FOR PXBCLASS=1:1:6
IF $GET(PXBDATA("ERR",PXBCLASS))=4
SET PXBEXIT=-1
QUIT
+12 IF PXBEXIT<1
QUIT
+13 SET PXB800(1)=$PIECE($GET(PXBDATA(3)),"^",2)
+14 SET PXB800(2)=$PIECE($GET(PXBDATA(1)),"^",2)
+15 SET PXB800(3)=$PIECE($GET(PXBDATA(2)),"^",2)
+16 SET PXB800(4)=$PIECE($GET(PXBDATA(4)),"^",2)
+17 ;added 6/17/98 for MST enhancement
SET PXB800(5)=$PIECE($GET(PXBDATA(5)),"^",2)
+18 ;PX*1*111 - Add HNC
+19 SET PXB800(6)=$PIECE($GET(PXBDATA(6)),"^",2)
+20 QUIT
+21 ;
VISIT(PXBEXIT) ;Creat or edit the Visit
+1 ;Set up ^TMP("PXK",$J and call PXK
+2 IF PXBVST>0
LOCK +^AUPNVSIT(PXBVST):10
IF '$TEST
WRITE !!,$CHAR(7),"Cannot edit at this time, try again later."
DO WAIT^PXCEHELP
SET PXBEXIT=-2
QUIT
+3 KILL ^TMP("PXK",$JOB)
+4 NEW PXBNODE,PXBAFTER,PXKERROR
+5 FOR PXBNODE=0,21,150,800,811,812
Begin DoDot:1
+6 SET PXBAFTER(PXBNODE)=$SELECT(PXBVST>0:$GET(^AUPNVSIT(PXBVST,PXBNODE)),1:"")
+7 SET ^TMP("PXK",$JOB,"VST",1,PXBNODE,"BEFORE")=PXBAFTER(PXBNODE)
End DoDot:1
+8 IF PXBVST'>0
Begin DoDot:1
+9 SET $PIECE(PXBAFTER(0),"^",1)=PXBVSTDT
+10 SET $PIECE(PXBAFTER(0),"^",5)=PXBPAT
+11 SET $PIECE(PXBAFTER(0),"^",8)=$PIECE(^SC(PXBHLOC,0),"^",7)
+12 IF PXBAPPT>0
SET $PIECE(PXBAFTER(0),"^",16)="A"
+13 SET $PIECE(PXBAFTER(150),"^",3)="P"
+14 SET $PIECE(PXBAFTER(812),"^",2)=PXBPKG
+15 SET $PIECE(PXBAFTER(812),"^",3)=PXBSOURC
End DoDot:1
+16 SET $PIECE(PXBAFTER(0),"^",18)=$GET(PXBCODT)
+17 IF $PIECE(PXBAFTER(0),"^",22)=""
SET $PIECE(PXBAFTER(0),"^",22)=PXBHLOC
+18 SET $PIECE(PXBAFTER(800),"^",1)=$GET(PXB800(1))
+19 SET $PIECE(PXBAFTER(800),"^",2)=$GET(PXB800(2))
+20 SET $PIECE(PXBAFTER(800),"^",3)=$GET(PXB800(3))
+21 SET $PIECE(PXBAFTER(800),"^",4)=$GET(PXB800(4))
+22 ;added 6/17/98 for MST emhancement
SET $PIECE(PXBAFTER(800),"^",5)=$GET(PXB800(5))
+23 ;PX*1*111 - Add HNC
+24 SET $PIECE(PXBAFTER(800),"^",6)=$GET(PXB800(6))
+25 IF $DATA(PXELAP)#2
Begin DoDot:1
+26 SET $PIECE(PXBAFTER(0),"^",21)=+PXELAP
End DoDot:1
+27 FOR PXBNODE=0,21,150,800,811,812
Begin DoDot:1
+28 SET ^TMP("PXK",$JOB,"VST",1,PXBNODE,"AFTER")=PXBAFTER(PXBNODE)
End DoDot:1
+29 SET ^TMP("PXK",$JOB,"VST",1,"IEN")=$SELECT(PXBVST>0:PXBVST,1:"")
+30 SET ^TMP("PXK",$JOB,"SOR")=PXBSOURC
+31 DO EN1^PXKMAIN
+32 IF PXBVST>0
LOCK -^AUPNVSIT(PXBVST):5
+33 SET PXBVST=$GET(^TMP("PXK",$JOB,"VST",1,"IEN"))
+34 QUIT
+35 ;
CPT(PXBEXIT) ;Ask the user Providers and CTPs
+1 DO CPT^PXBMCPT(PXBVST)
KILL PRVDR
+2 QUIT
+3 ;
POV(PXBEXIT) ;Ask the user Diagnoses
+1 DO POV^PXBMPOV(PXBVST)
KILL PRVDR
+2 QUIT
+3 ;
PRV(PXBEXIT) ;Ask the user Providers
+1 DO PRV^PXBMPRV(PXBVST,"PRV")
KILL PRVDR
+2 QUIT
+3 ;
STP(PXBEXIT) ;Ask the user Stop Codes
+1 IF $LENGTH($TEXT(DATE^SCDXUTL))
IF $$DATE^SCDXUTL(+$GET(^AUPNVSIT(PXBVST,0)))
QUIT
+2 DO STP^PXBMSTP(PXBVST)
KILL PRVDR
+3 QUIT
+4 ;