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

NURAMU3.m

Go to the documentation of this file.
NURAMU3 ;HIRMFO/MD-EMPLOYEE ACT/SEP BATCH JOB 9/20/96 ; 4/29/03 11:23am
 ;;4.0;NURSING SERVICE;**9,39**;Apr 25, 1997
EN1 ;BATCH RUN TO UPDATE STAFF SEP/ACT DATA IN 213.5 FILE AND STATUS IF APPROPRIATE
 S NURSDATE=RPTDATE,U="^" S:'$D(^DIC(213.9,1,"DATE")) ^DIC(213.9,1,"DATE")="" S $P(^DIC(213.9,1,"DATE"),U,9)=0
 F NUX=0:0 S NUX=$O(^NURSF(211.8,"ASD",NUX)) Q:NUX'>0  F NOD=0:0 S NOD=$O(^NURSF(211.8,"ASD",NUX,NOD)) Q:NOD'>0  F NDA=0:0 S NDA=$O(^NURSF(211.8,"ASD",NUX,NOD,NDA)) Q:NDA'>0  I $D(^NURSF(211.8,NOD,1,NDA,0)) S NURSEMP=+$P(^(0),U,2) D NURSCK
 S:'$D(^DIC(213.9,1,"DATE")) ^("DATE")="" S $P(^("DATE"),U,9)=1
QUIT ;
 K NEXCDA,NURSDATE,NUR,NURSPO,NURLOC,NURSEMP,NUX,DA,NOD,NDA,NURSDATE,%DT,NURSEL,I,X,Y Q
NURSCK ;
 W:'$D(ZTQUEUED) "." S DA(1)=NOD,DA=NDA
 I +NUX=2,+$P(^NURSF(211.8,DA(1),1,DA,0),U)'>NURSDATE D NURSBYP S DA(1)=NOD,DA=NDA,X=+$P(^NURSF(211.8,DA(1),1,DA,0),U),NUR=".01^1" D EN1B^NURSUT1
 I +NUX=1,+$P(^NURSF(211.8,DA(1),1,DA,0),U,6)'>NURSDATE D NURSBYP S DA(1)=NOD,DA=NDA,X=+$P(^NURSF(211.8,DA(1),1,DA,0),U,6),NUR="3^1" D EN1B^NURSUT1
 Q
NURSBYP ;
 I '$D(^NURSA(213.5,NEXCDA,2,0)) S ^(0)="^213.52P^^"
 S NURSPO=$G(^NURSF(211.8,NOD,0)),NURSPO(0)=$G(^NURSF(211.8,NOD,1,NDA,0)),NURLOC=$O(^NURSF(211.4,"B",+NURSPO,0))
 S NURSPO(1)=$S($D(^VA(200,+NURSEMP,0)):+NURSEMP,1:""),NURSPO(2)=$S(NUX=1:"S",NUX=2:"A",1:"")
 S NURSPO(3)=$S(NUX=1:$P(NURSPO(0),U,6),1:$P(NURSPO(0),U)),NURSPO(4)=$S($D(^NURSF(211.9,+$P(NURSPO(0),U,8),0)):+$P(NURSPO(0),U,8),1:""),NURSPO(5)=$S($D(^NURSF(211.3,+$P(NURSPO(0),U,3),0)):+$P(NURSPO(0),U,3),1:""),NURSPO(6)=+$P(NURSPO(0),U,4)
 S DA(1)=NEXCDA,Z=$P(^NURSA(213.5,DA(1),2,0),U,3,4)
 S DA=(+$P(Z,U)+1),^NURSA(213.5,DA(1),2,DA,0)=NURSPO(1)_U_NURSPO(2)_U_NURSPO(3)_U_$S(NUX=2:"",1:NURSPO(4))_U_NURLOC_U_NURSPO(5)_U_NURSPO(6),Z=DA_U_(+$P(Z,U,2)+1),$P(^NURSA(213.5,DA(1),2,0),U,3,4)=Z,DIK="^NURSA(213.5,DA(1),2," D IX1^DIK
 Q