VSITCK1 ;ISD/RJP - Visit Field Check (continued) ;6/20/96
;;1.0;PCE PATIENT CARE ENCOUNTER;**76**;Aug 12, 1996
; Patch PX*1*76 changes the 2nd line of all VSIT* routines to reflect
; the incorporation of the module into PCE. For historical reference,
; the old (VISIT TRACKING) 2nd line is included below to reference VSIT
; patches.
;
;;2.0;VISIT TRACKING;;Aug 12, 1996;
;
Q ; - not an entry point
;
IP(VDT,PAT) ; - check inpatient status
;
; - rtns <ien of patient movement>
;
N VADMVT,VAINDT,VAERR
N IPM,DFN
S VDT=$G(VDT),PAT=$G(PAT)
S VAINDT=VDT,DFN=+$G(PAT) D ADM^VADPT2
S IPM=$S(+VADMVT>0:+VADMVT,1:"")
; - dom pt is not an inpatient (from ^SDAM2)
I $P(^DG(43,1,0),"^",21),$P($G(^DIC(42,+$P($G(^DGPM(+VADMVT,0)),"^",6),0)),"^",3)="D" S IPM=""
Q IPM
;
INS4LOC(LOC) ; - Get Institution for a given Location
;
N INS S LOC=$G(LOC),INS=""
D:+LOC
. S INS=$P(^SC(LOC,0),"^",15)
. S:+INS INS=$P($G(^DG(40.8,INS,0)),"^",7)
. S INS=$S(+INS&$D(^DIC(4,+INS,0)):INS,1:"")
Q INS
;
DSS4LOC(LOC) ; - Get Clinic Stop Code for a given Location
;
N DSS S LOC=$G(LOC),DSS=""
D:+LOC
. S DSS=$P($G(^SC(LOC,0)),"^",7) S:DSS'=+DSS DSS=""
Q DSS
;
VSITCK1 ;ISD/RJP - Visit Field Check (continued) ;6/20/96
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**76**;Aug 12, 1996
+2 ; Patch PX*1*76 changes the 2nd line of all VSIT* routines to reflect
+3 ; the incorporation of the module into PCE. For historical reference,
+4 ; the old (VISIT TRACKING) 2nd line is included below to reference VSIT
+5 ; patches.
+6 ;
+7 ;;2.0;VISIT TRACKING;;Aug 12, 1996;
+8 ;
+9 ; - not an entry point
QUIT
+10 ;
IP(VDT,PAT) ; - check inpatient status
+1 ;
+2 ; - rtns <ien of patient movement>
+3 ;
+4 NEW VADMVT,VAINDT,VAERR
+5 NEW IPM,DFN
+6 SET VDT=$GET(VDT)
SET PAT=$GET(PAT)
+7 SET VAINDT=VDT
SET DFN=+$GET(PAT)
DO ADM^VADPT2
+8 SET IPM=$SELECT(+VADMVT>0:+VADMVT,1:"")
+9 ; - dom pt is not an inpatient (from ^SDAM2)
+10 IF $PIECE(^DG(43,1,0),"^",21)
IF $PIECE($GET(^DIC(42,+$PIECE($GET(^DGPM(+VADMVT,0)),"^",6),0)),"^",3)="D"
SET IPM=""
+11 QUIT IPM
+12 ;
INS4LOC(LOC) ; - Get Institution for a given Location
+1 ;
+2 NEW INS
SET LOC=$GET(LOC)
SET INS=""
+3 IF +LOC
Begin DoDot:1
+4 SET INS=$PIECE(^SC(LOC,0),"^",15)
+5 IF +INS
SET INS=$PIECE($GET(^DG(40.8,INS,0)),"^",7)
+6 SET INS=$SELECT(+INS&$DATA(^DIC(4,+INS,0)):INS,1:"")
End DoDot:1
+7 QUIT INS
+8 ;
DSS4LOC(LOC) ; - Get Clinic Stop Code for a given Location
+1 ;
+2 NEW DSS
SET LOC=$GET(LOC)
SET DSS=""
+3 IF +LOC
Begin DoDot:1
+4 SET DSS=$PIECE($GET(^SC(LOC,0)),"^",7)
IF DSS'=+DSS
SET DSS=""
End DoDot:1
+5 QUIT DSS
+6 ;