VSITPUT1 ;ISD/RJP - Continued...Verify/set fields and file visit record ;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;**3**;Aug 12, 1996;
;
;Routine called by ^VSITPUT
K DD,DO,DA,DIC,DIK,X,Y,DLAYGO
L +^XTMP("VSIT CREATE",+$G(VSIT("PAT")),+VSIT("VDT")):0 Q:'$T
D:+$G(DINUM)
. S DLAYGO=9000010
. S DIC="^AUPNVSIT("
. S DIC(0)=""
. S X=+VSIT("VDT")
. D FILE^DICN
. L:+Y>0 +^AUPNVSIT(+Y)
. K DLAYGO,DIC,DD,DO,X
D:'+$G(DINUM)
. N VSITI
. S VSITI=$P(^AUPNVSIT(0),"^",3)
. F S VSITI=VSITI+1 L +^AUPNVSIT(VSITI):1 Q:$T&'$D(^AUPNVSIT(VSITI)) L -^AUPNVSIT(VSITI)
. S ^AUPNVSIT(VSITI,0)=VSIT("VDT")
. S ^AUPNVSIT("B",VSIT("VDT"),VSITI)=""
. L +^AUPNVSIT(0)
. S ^AUPNVSIT(0)=$P(^AUPNVSIT(0),"^",1,2)_"^"_VSITI_"^"_($P(^(0),"^",4)+1)
. L -^AUPNVSIT(0)
. L:VSITI'>0 -^AUPNVSIT(VSITI)
. S Y=VSITI_"^"_VSIT("VDT")_"^1"
D:Y>0
. S VSIT("IEN")=Y
. S $P(^AUPNVSIT(+Y,0),"^",2,99)=$P(VSITREC(0),"^",2,99)
. S:$G(VSITREC(21))]"" ^AUPNVSIT(+Y,21)=VSITREC(21)
. S:$G(VSITREC(150))]"" ^AUPNVSIT(+Y,150)=VSITREC(150)
. S:$G(VSITREC(800))]"" ^AUPNVSIT(+Y,800)=VSITREC(800)
. S:$G(VSITREC(811))]"" ^AUPNVSIT(+Y,811)=VSITREC(811)
. S:$G(VSITREC(812))]"" ^AUPNVSIT(+Y,812)=VSITREC(812)
. S DA=+Y,DIK="^AUPNVSIT(" D IX1^DIK K DIK
. L -^AUPNVSIT(DA)
L -^XTMP("VSIT CREATE",+$G(VSIT("PAT")),+VSIT("VDT"))
K DD,DO,DA,DIC,DIK,X,Y,DLAYGO
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HVSITPUT1 1656 printed Dec 13, 2024@02:32:40 Page 2
VSITPUT1 ;ISD/RJP - Continued...Verify/set fields and file visit record ;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;**3**;Aug 12, 1996;
+8 ;
+9 ;Routine called by ^VSITPUT
+10 KILL DD,DO,DA,DIC,DIK,X,Y,DLAYGO
+11 LOCK +^XTMP("VSIT CREATE",+$GET(VSIT("PAT")),+VSIT("VDT")):0
if '$TEST
QUIT
+12 if +$GET(DINUM)
Begin DoDot:1
+13 SET DLAYGO=9000010
+14 SET DIC="^AUPNVSIT("
+15 SET DIC(0)=""
+16 SET X=+VSIT("VDT")
+17 DO FILE^DICN
+18 if +Y>0
LOCK +^AUPNVSIT(+Y)
+19 KILL DLAYGO,DIC,DD,DO,X
End DoDot:1
+20 if '+$GET(DINUM)
Begin DoDot:1
+21 NEW VSITI
+22 SET VSITI=$PIECE(^AUPNVSIT(0),"^",3)
+23 FOR
SET VSITI=VSITI+1
LOCK +^AUPNVSIT(VSITI):1
if $TEST&'$DATA(^AUPNVSIT(VSITI))
QUIT
LOCK -^AUPNVSIT(VSITI)
+24 SET ^AUPNVSIT(VSITI,0)=VSIT("VDT")
+25 SET ^AUPNVSIT("B",VSIT("VDT"),VSITI)=""
+26 LOCK +^AUPNVSIT(0)
+27 SET ^AUPNVSIT(0)=$PIECE(^AUPNVSIT(0),"^",1,2)_"^"_VSITI_"^"_($PIECE(^(0),"^",4)+1)
+28 LOCK -^AUPNVSIT(0)
+29 if VSITI'>0
LOCK -^AUPNVSIT(VSITI)
+30 SET Y=VSITI_"^"_VSIT("VDT")_"^1"
End DoDot:1
+31 if Y>0
Begin DoDot:1
+32 SET VSIT("IEN")=Y
+33 SET $PIECE(^AUPNVSIT(+Y,0),"^",2,99)=$PIECE(VSITREC(0),"^",2,99)
+34 if $GET(VSITREC(21))]""
SET ^AUPNVSIT(+Y,21)=VSITREC(21)
+35 if $GET(VSITREC(150))]""
SET ^AUPNVSIT(+Y,150)=VSITREC(150)
+36 if $GET(VSITREC(800))]""
SET ^AUPNVSIT(+Y,800)=VSITREC(800)
+37 if $GET(VSITREC(811))]""
SET ^AUPNVSIT(+Y,811)=VSITREC(811)
+38 if $GET(VSITREC(812))]""
SET ^AUPNVSIT(+Y,812)=VSITREC(812)
+39 SET DA=+Y
SET DIK="^AUPNVSIT("
DO IX1^DIK
KILL DIK
+40 LOCK -^AUPNVSIT(DA)
End DoDot:1
+41 LOCK -^XTMP("VSIT CREATE",+$GET(VSIT("PAT")),+VSIT("VDT"))
+42 KILL DD,DO,DA,DIC,DIK,X,Y,DLAYGO
+43 QUIT