- PXCEINTR ;ISL/dee - PCE List Manager call to do interview questions ;7/9/96
- ;;1.0;PCE PATIENT CARE ENCOUNTER;;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=""
- I PXCEVIEN>0 D
- . S PXCEPAT=$P(^AUPNVSIT(PXCEVIEN,0),"^",5)
- . 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
- 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
- ;
- PXCEINTR ;ISL/dee - PCE List Manager call to do interview questions ;7/9/96
- +1 ;;1.0;PCE PATIENT CARE ENCOUNTER;;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 IF PXCEVIEN>0
- Begin DoDot:1
- +11 SET PXCEPAT=$PIECE(^AUPNVSIT(PXCEVIEN,0),"^",5)
- +12 SET PXCEHLOC=$PIECE(^AUPNVSIT(PXCEVIEN,0),"^",22)
- +13 IF $$VSTAPPT^PXUTL1(PXCEPAT,+^AUPNVSIT(PXCEVIEN,0),$PIECE(^(0),"^",22),PXCEVIEN)
- SET PXCEAPPM=+^AUPNVSIT(PXCEVIEN,0)
- SET PXCEWHAT="INTV"
- End DoDot:1
- +14 ;
- +15 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 IF 'PXCEVIEN
- Begin DoDot:1
- +8 IF PXCEWHAT'="INTV"
- IF PXCEWHAT'="ADQ"
- Begin DoDot:2
- +9 WRITE $CHAR(7),!,"There is no Encounter for this Appointment."
- +10 DO WAIT^PXCEHELP
- +11 KILL PXCEVIEN
- End DoDot:2
- +12 IF '$TEST
- SET PXCEVIEN=""
- End DoDot:1
- +13 IF '$DATA(PXCEVIEN)
- GOTO SDINTRVQ
- +14 NEW PXCERET
- +15 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 ;