Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: AUPNVSIT

AUPNVSIT.m

Go to the documentation of this file.
  1. AUPNVSIT ;OHPRD/LAB - EDITS FOR AUPNVSIT (VISIT:9000010) ;10/25/96
  1. ;;1.0;PCE PATIENT CARE ENCOUNTER;**204**;Aug 12, 1996;Build 14
  1. ;
  1. ; Patch PX*1*204 changes the 2nd line of this routine to reflect the
  1. ; incorporation of the module into PCE. For historical reference,
  1. ; the old (VISIT TRACKING) 2nd line is included below to reference VSIT
  1. ; patches. This is the same as what patch PX*1*76 did for the VSIT* routines.
  1. ;
  1. ;;2.0;VISIT TRACKING;**1**;Aug 12, 1996
  1. ;;93.2;IHS PATIENT DICTIONARIES.;;JUL 01, 1993
  1. ;
  1. VSIT01 ;EP;9000010,.01 (VISIT,VISIT/ADMIT DATE&TIME)
  1. I '$D(AUPNPAT) W:'$D(AUPNTALK)&('$D(ZTQUEUED)) " <No direct entry allowed>" K X Q
  1. I $D(AUPNDOB),$D(AUPNDOD),AUPNDOB,$D(DT),DT D VSIT01B Q
  1. I '$D(AUPNTALK),'$D(ZTQUEUED) W " <Required variables do not exist>"
  1. K X
  1. Q
  1. VSIT01B ;
  1. I DT_".9999"<X W:'$D(AUPNTALK)&('$D(ZTQUEUED)) " <Future dates not allowed>" K X Q
  1. I DUZ("AG")="I",AUPNDOD,$P(X,".",1)>AUPNDOD W:'$D(AUPNTALK)&('$D(ZTQUEUED)) " <Patient died before this date>" K X Q
  1. I $P(X,".",1)<AUPNDOB W:'$D(AUPNTALK)&('$D(ZTQUEUED)) " <Patient born after this date>" K X Q
  1. Q
  1. ;
  1. POSTSLCT ;
  1. S AUPNVSIT=+Y,AUPNY=Y
  1. I '$D(AUPNPAT),$P(^AUPNVSIT(AUPNVSIT,0),U,5) S Y=$P(^(0),U,5) D ^AUPNPAT
  1. S Y=AUPNY K AUPNY
  1. Q
  1. ;
  1. ADD ; ADD TO DEPENDENCY COUNT
  1. S ^XTMP("AUPNVSIT",0)=$$FMADD^XLFDT(DT,1)_U_DT_U_"section ADD of AUPNVSIT and section KILL of VSITKIL communication",^XTMP("AUPNVSIT",X)=1 ;PX*1*204 - added
  1. I '($D(^AUPNVSIT(X,0))#2) K ^XTMP("AUPNVSIT",X) Q ;PX*1*204 added kill of ^XTMP
  1. L +^AUPNVSIT(X,0):60 ;E W:'$D(ZTQUEUED) !!,"VISIT locked. Notify programmer!",! Q
  1. S:$P(^AUPNVSIT(X,0),U,9)<0 $P(^(0),U,9)=0
  1. S $P(^AUPNVSIT(X,0),U,9)=$P(^AUPNVSIT(X,0),U,9)+1 ;,$P(^(0),U,11)="" ;*** WILL NOT UNDELETE ***
  1. ;The next two lines are not used in the VA
  1. ;I $D(^AUPNVSIT("AMFI",X)),^AUPNVSIT("AMFI",X)="M"
  1. ;E I DUZ'=".5",$D(^AUTTSITE(1,0)),$P(^AUTTSITE(1,0),U,16)="V",$P(^AUPNVSIT(X,0),U,15)'="A",$P(^(0),U,15)'="D" S $P(^AUPNVSIT(X,0),U,15)="M",^AUPNVSIT("AMFI",X)="M"
  1. L -^AUPNVSIT(X,0)
  1. K ^XTMP("AUPNVSIT",X) ;PX*1*204 - added
  1. Q
  1. SUB ; SUBTRACT FROM DEPENDENCY COUNT
  1. Q:'($D(^AUPNVSIT(X,0))#2)
  1. L +^AUPNVSIT(X,0):60 ;E W:'$D(ZTQUEUED) !!,"VISIT locked. Notify programmer!",! Q
  1. S $P(^AUPNVSIT(X,0),U,9)=$P(^AUPNVSIT(X,0),U,9)-1 ;S:$P(^(0),U,9)<1 $P(^(0),U,11)=1 *** DON'T DELETE ***
  1. I $P(^AUPNVSIT(X,0),U,9)<0 S $P(^(0),U,9)=0 ; Should not happen but does
  1. ;The next two lines are not used in the VA
  1. ;I $P(^AUPNVSIT(X,0),U,15)="A"
  1. ;E I DUZ'=.5,$D(^AUTTSITE(1,0)),$P(^AUTTSITE(1,0),U,16)="V" S $P(^AUPNVSIT(X,0),U,15)="D",^AUPNVSIT("AMFI",X)="D"
  1. L -^AUPNVSIT(X,0)
  1. Q
  1. ;
  1. MOD ;EP;MODIFY A VISIT OR V FILE ENTRY
  1. ;*******CANNOT BE CALLED FROM DIE **********CALLS DIE
  1. N X I X ;this line was added so that it will error if this entry is ever called so that you will know that this code was commented out for the VA.
  1. ;S DA=AUPNVSIT,DIE="^AUPNVSIT(",DR=".13////"_DT D ^DIE K DA,DIE,DIU,DIV,DR
  1. ;the following updates MFI information **** NOT DONE IN THE VA ****
  1. ;Q:'$D(^AUTTSITE(1,0))
  1. ;Q:$P(^AUTTSITE(1,0),U,16)'="V"
  1. ;Q:DUZ=.5
  1. ;I $P(^AUPNVSIT(AUPNVSIT,0),U,15)'="A",$P(^(0),U,15)'="D" S DR=".15///M",DA=AUPNVSIT,DIE="^AUPNVSIT(" D ^DIE
  1. ;K DIE,DA,DR,DIU,DIV
  1. Q
  1. ;*******CANNOT BE CALLED FROM DIE**********CALLS DIE
  1. DEL ;EP;*** EXTERNAL ENTRY POINT *** SET DELETE FLAG
  1. N X I X ;this line was added so that it will error if this entry is ever called so that you will know that this code was commented out for the VA.
  1. ; The following exclusive NEW excepted from SAC by the Director, DSD. Request dated 12.14.92. No suspense was mandated.
  1. ;N (DT,DUZ,AUPNVSIT,U)
  1. ;I $P(^AUPNVSIT(AUPNVSIT,0),U,9) S AUPNVSIT=-1 Q
  1. ;S DIK="^AUPNVSIT(",DA=AUPNVSIT,X=2 D DD^DIK,1^DIK1
  1. ;S DA=AUPNVSIT,DR=".11///1",DIE="^AUPNVSIT(" D ^DIE K DA,DIE,DR
  1. ;I DUZ'=.5,$D(^AUTTSITE(1,0)),$P(^AUTTSITE(1,0),U,16)="V",$P(^AUPNVSIT(AUPNVSIT,0),U,15)="A" S DA=AUPNVSIT,DR=".15///@",DIE="^AUPNVSIT(" D ^DIE K DA,DIE,DR Q
  1. ;I DUZ'=.5,$D(^AUTTSITE(1,0)),$P(^AUTTSITE(1,0),U,16)="V",$P(^AUPNVSIT(AUPNVSIT,0),U,15)'="A" S DA=AUPNVSIT,DR=".15///D",DIE="^AUPNVSIT(" D ^DIE K DA,DIE,DR Q
  1. Q