PXCEINTR ;ISL/dee - PCE List Manager call to do interview questions ;7/9/96
;;1.0;PCE PATIENT CARE ENCOUNTER;**172**;Aug 12, 1996
;
Q
;
GETVIEN() ;Ask the user which visit or to add a new one.
N PXCEVIDX,PXCEVIEN
S PXCEVIDX=$$SEL1^PXCE("",1)
Q:PXCEVIDX="A" ""
Q:PXCEVIDX'>0 -1
S PXCEVIEN=$G(^TMP("PXCEIDX",$J,PXCEVIDX))
;Check that it is not related to a no show or canceled apppointment
D APPCHECK^PXCESDAM(.PXCEVIEN)
Q:'$D(PXCEVIEN) -1
;Cannot edit future visits
I $P(+^AUPNVSIT(PXCEVIEN,0),".")>DT D Q -1
. W !!,$C(7),"Can not update future encounters."
. D WAIT^PXCEHELP
. K PXCEVIEN
I $P(^AUPNVSIT(PXCEVIEN,0),"^",7)="E" D Q -1
. W !!,"You can not do the Checkout Interview on an Historical encounter."
. D WAIT^PXCEHELP
Q PXCEVIEN
;
INTRVIEW ;Do Interview form Encounter List.
; Allows the adding of new encounters.
N PXCEVIEN
S PXCEVIEN=$$GETVIEN
Q:PXCEVIEN=-1
;
N PXCEAPPM,PXCERET,PXCEWHAT
S PXCEWHAT="ADDEDIT"
I '$D(PXCEPAT) N PXCEPAT S PXCEPAT=""
I '$D(PXCEHLOC) N PXCEHLOC S PXCEHLOC=""
N PXREC S PXREC=0 ; PX*1.0*172 new logic added to dot structure below
I PXCEVIEN>0 D G:PXREC INTRVQ
. S PXCEPAT=$P(^AUPNVSIT(PXCEVIEN,0),"^",5)
. N PXDUZ,PXPTSSN S PXDUZ=DUZ,PXPTSSN=$P($G(^DPT(PXCEPAT,0)),U,9)
. D SEC^PXCEEXP(.PXREC,PXDUZ,PXPTSSN)
. I PXREC W !!,"Security regulations prohibit computer access to your own medical record." H 3 Q
. S PXCEHLOC=$P(^AUPNVSIT(PXCEVIEN,0),"^",22)
. I $$VSTAPPT^PXUTL1(PXCEPAT,+^AUPNVSIT(PXCEVIEN,0),$P(^(0),"^",22),PXCEVIEN) S PXCEAPPM=+^AUPNVSIT(PXCEVIEN,0),PXCEWHAT="INTV"
S PXCERET=$$INTV^PXAPI(PXCEWHAT,"PX","PXCE DATA ENTRY",.PXCEVIEN,.PXCEHLOC,.PXCEPAT,$G(PXCEAPPM))
INTRVQ Q
;
SDINTRVW(PXCEWHAT) ;Do Interview form Appointment List.
N PXCEVIEN
N PXCEAPDT S PXCEAPDT=""
I '$D(PXCEPAT) N PXCEPAT S PXCEPAT=""
I '$D(PXCEHLOC) N PXCEHLOC S PXCEHLOC=""
S PXCEVIEN=$$SELAPPM^PXCESDAM
Q:PXCEVIEN=-1
; next 3 lines added per PX*1.0*172
N PXREC,PXDUZ,PXPTSSN S PXDUZ=DUZ,PXPTSSN=$TR($G(PXCEPAT("SSN")),"-")
D SEC^PXCEEXP(.PXREC,PXDUZ,PXPTSSN)
I PXREC W !!,"Security regulations prohibit computer access to your own medical record." H 3 G SDINTRVQ
I 'PXCEVIEN D
. I PXCEWHAT'="INTV",PXCEWHAT'="ADQ" D
.. W $C(7),!,"There is no Encounter for this Appointment."
.. D WAIT^PXCEHELP
.. K PXCEVIEN
. E S PXCEVIEN=""
I '$D(PXCEVIEN) G SDINTRVQ
N PXCERET
S PXCERET=$$INTV^PXAPI(PXCEWHAT,"PX","PXCE DATA ENTRY",.PXCEVIEN,.PXCEHLOC,.PXCEPAT,PXCEAPDT)
SDINTRVQ Q
;
UPDATENC ;From the Update Encounter Screen
I $P(^AUPNVSIT(PXCEVIEN,0),"^",7)="E" D Q
. W !!,"You can not do the Checkout Interview on an Historical encounter."
. D WAIT^PXCEHELP
D FULL^VALM1
I $$INTV^PXAPI($S($$VSTAPPT^PXUTL1(PXCEPAT,+^AUPNVSIT(PXCEVIEN,0),+$G(PXCEHLOC),PXCEVIEN):"INTV",1:"ADDEDIT"),"PX","PXCE DATA ENTRY",PXCEVIEN,PXCEHLOC,PXCEPAT)
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXCEINTR 2898 printed Oct 16, 2024@18:28:48 Page 2
PXCEINTR ;ISL/dee - PCE List Manager call to do interview questions ;7/9/96
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**172**;Aug 12, 1996
+2 ;
+3 QUIT
+4 ;
GETVIEN() ;Ask the user which visit or to add a new one.
+1 NEW PXCEVIDX,PXCEVIEN
+2 SET PXCEVIDX=$$SEL1^PXCE("",1)
+3 if PXCEVIDX="A"
QUIT ""
+4 if PXCEVIDX'>0
QUIT -1
+5 SET PXCEVIEN=$GET(^TMP("PXCEIDX",$JOB,PXCEVIDX))
+6 ;Check that it is not related to a no show or canceled apppointment
+7 DO APPCHECK^PXCESDAM(.PXCEVIEN)
+8 if '$DATA(PXCEVIEN)
QUIT -1
+9 ;Cannot edit future visits
+10 IF $PIECE(+^AUPNVSIT(PXCEVIEN,0),".")>DT
Begin DoDot:1
+11 WRITE !!,$CHAR(7),"Can not update future encounters."
+12 DO WAIT^PXCEHELP
+13 KILL PXCEVIEN
End DoDot:1
QUIT -1
+14 IF $PIECE(^AUPNVSIT(PXCEVIEN,0),"^",7)="E"
Begin DoDot:1
+15 WRITE !!,"You can not do the Checkout Interview on an Historical encounter."
+16 DO WAIT^PXCEHELP
End DoDot:1
QUIT -1
+17 QUIT PXCEVIEN
+18 ;
INTRVIEW ;Do Interview form Encounter List.
+1 ; Allows the adding of new encounters.
+2 NEW PXCEVIEN
+3 SET PXCEVIEN=$$GETVIEN
+4 if PXCEVIEN=-1
QUIT
+5 ;
+6 NEW PXCEAPPM,PXCERET,PXCEWHAT
+7 SET PXCEWHAT="ADDEDIT"
+8 IF '$DATA(PXCEPAT)
NEW PXCEPAT
SET PXCEPAT=""
+9 IF '$DATA(PXCEHLOC)
NEW PXCEHLOC
SET PXCEHLOC=""
+10 ; PX*1.0*172 new logic added to dot structure below
NEW PXREC
SET PXREC=0
+11 IF PXCEVIEN>0
Begin DoDot:1
+12 SET PXCEPAT=$PIECE(^AUPNVSIT(PXCEVIEN,0),"^",5)
+13 NEW PXDUZ,PXPTSSN
SET PXDUZ=DUZ
SET PXPTSSN=$PIECE($GET(^DPT(PXCEPAT,0)),U,9)
+14 DO SEC^PXCEEXP(.PXREC,PXDUZ,PXPTSSN)
+15 IF PXREC
WRITE !!,"Security regulations prohibit computer access to your own medical record."
HANG 3
QUIT
+16 SET PXCEHLOC=$PIECE(^AUPNVSIT(PXCEVIEN,0),"^",22)
+17 IF $$VSTAPPT^PXUTL1(PXCEPAT,+^AUPNVSIT(PXCEVIEN,0),$PIECE(^(0),"^",22),PXCEVIEN)
SET PXCEAPPM=+^AUPNVSIT(PXCEVIEN,0)
SET PXCEWHAT="INTV"
End DoDot:1
if PXREC
GOTO INTRVQ
+18 SET PXCERET=$$INTV^PXAPI(PXCEWHAT,"PX","PXCE DATA ENTRY",.PXCEVIEN,.PXCEHLOC,.PXCEPAT,$GET(PXCEAPPM))
INTRVQ QUIT
+1 ;
SDINTRVW(PXCEWHAT) ;Do Interview form Appointment List.
+1 NEW PXCEVIEN
+2 NEW PXCEAPDT
SET PXCEAPDT=""
+3 IF '$DATA(PXCEPAT)
NEW PXCEPAT
SET PXCEPAT=""
+4 IF '$DATA(PXCEHLOC)
NEW PXCEHLOC
SET PXCEHLOC=""
+5 SET PXCEVIEN=$$SELAPPM^PXCESDAM
+6 if PXCEVIEN=-1
QUIT
+7 ; next 3 lines added per PX*1.0*172
+8 NEW PXREC,PXDUZ,PXPTSSN
SET PXDUZ=DUZ
SET PXPTSSN=$TRANSLATE($GET(PXCEPAT("SSN")),"-")
+9 DO SEC^PXCEEXP(.PXREC,PXDUZ,PXPTSSN)
+10 IF PXREC
WRITE !!,"Security regulations prohibit computer access to your own medical record."
HANG 3
GOTO SDINTRVQ
+11 IF 'PXCEVIEN
Begin DoDot:1
+12 IF PXCEWHAT'="INTV"
IF PXCEWHAT'="ADQ"
Begin DoDot:2
+13 WRITE $CHAR(7),!,"There is no Encounter for this Appointment."
+14 DO WAIT^PXCEHELP
+15 KILL PXCEVIEN
End DoDot:2
+16 IF '$TEST
SET PXCEVIEN=""
End DoDot:1
+17 IF '$DATA(PXCEVIEN)
GOTO SDINTRVQ
+18 NEW PXCERET
+19 SET PXCERET=$$INTV^PXAPI(PXCEWHAT,"PX","PXCE DATA ENTRY",.PXCEVIEN,.PXCEHLOC,.PXCEPAT,PXCEAPDT)
SDINTRVQ QUIT
+1 ;
UPDATENC ;From the Update Encounter Screen
+1 IF $PIECE(^AUPNVSIT(PXCEVIEN,0),"^",7)="E"
Begin DoDot:1
+2 WRITE !!,"You can not do the Checkout Interview on an Historical encounter."
+3 DO WAIT^PXCEHELP
End DoDot:1
QUIT
+4 DO FULL^VALM1
+5 IF $$INTV^PXAPI($SELECT($$VSTAPPT^PXUTL1(PXCEPAT,+^AUPNVSIT(PXCEVIEN,0),+$GET(PXCEHLOC),PXCEVIEN):"INTV",1:"ADDEDIT"),"PX","PXCE DATA ENTRY",PXCEVIEN,PXCEHLOC,PXCEPAT)
+6 QUIT
+7 ;