NURSAUTL ;HIRMFO/MD/JH-SECURITY ROUTINE FOR THE NURSING ADMIN REPORTS ;9/7/90 12:59
;;4.0;NURSING SERVICE;;Apr 25, 1997
EN1 ; SET SECURITY ACCESS LEVEL FOR ADMIN REPORTS
I $S('$D(^VA(200,+DUZ,0)):1,1:0) W !,$C(7),"**** INCOMPLETE NEW PERSON DATA -- NOTIFY NURSING ADP COORDINATOR **** " S NUROUT=1 Q
S (NURMDSW,NURPLSW)=0 D EN9^NURSAGSP
S NURSZDA=+$O(^NURSF(210,"B",DUZ,"")) I DUZ(0)["n"!(DUZ(0)="@") S NURSZAP=0,NURSZSP=0 Q
I '$D(^NURSF(210,+NURSZDA,0)) G INCOMPL
S DA=NURSZDA D EN3^NURSUT0 G:NOD1="" INCOMPL
I $S('$D(^NURSF(211.8,NOD1,0)):1,'$O(^NURSF(211.4,"B",+$P(^NURSF(211.8,NOD1,0),"^"),"")):1,$P(^NURSF(211.8,NOD1,1,NOD2,0),"^",3)'="":0,1:1) G INCOMPL
S NURSZSP=$P(^NURSF(211.8,NOD1,1,NOD2,0),"^",3)
F X=0:0 S X=$O(^NURSF(211.8,"C",DUZ,X)) Q:X'>0 F Z=0:0 S Z=$O(^NURSF(211.8,"C",DUZ,X,Z)) Q:Z'>0 I '($P(^NURSF(211.8,X,1,Z,0),U)>DT),('$P(^(0),U,6)!($P(^(0),U,6)'
7,NURSZDA'=DA S NURSZORT=0 Q
D EN2^NURSUT0 S NURSZSP=NPSPOS(0) I $S(NURSZSP="":1,$D(^NURSF(211.3,NURSZSP,0)):0,1:1) S NURSZORT=0 D Q2 Q
S NURSYAP=$S($P(^NURSF(211.3,NURSZSP,0),"^",5)'="R":16,$P(^(0),"^",4)="":"",$D(^NURSF(211.7,$P(^NURSF(211.3,NURSZSP,0),"^",4),0)):$P(^(0),"^",3),1:"")
I $S(NURSYAP="":1,NURSYAP'0 S Y=$O(^NURSF(211.4,"B",Z,"")) K:$S(Y'>0:0,'$D(NURSZLO(Y)):1,1:0) ^TMP($J,X)
K X,Y Q
EN5 ;ENTRY FROM NURS-P-STAFF TO CHECK MILITARY STATUS
W ! S D1=0 F S D1=$O(^NURSF(210,D0,10,D1)) Q:D1'>0 D
. S NDATA=$G(^NURSF(210,D0,10,D1,0))
. I $P(NDATA,U)'="" W !,?6,"MILITARY EXPERIENCE: ",$S($P(NDATA,U)="R":"(RETIRED/DISC)",$P(NDATA,U)="A":"(ACT RESV)",$P(NDATA,U)="IRR":"(IND RDY RESV)",$P(NDATA,U)="IMA":"(IND MOBIL AUGM)",1:"")
. I $P(NDATA,U,2)'="" W ?44,"BRANCH OF SERVICE: ",$E($P(^DIC(23,+$P(NDATA,U,2),0),U),1,20)
. Q
Q
EN6 ; ENTRY FROM NURSING ROUTINES TO CONVERT PTR TO 211.4 FILE TO
; DATA STORED IN 44 FILE. NPWARD COMES IN AS PTR AND LEAVES
; AS FREE TEXT OR NULL.
S:'$D(NPWARD) NPWARD=""
S NPWARD=$S(NPWARD="":"",'$D(^NURSF(211.4,NPWARD,0)):"",$P(^(0),"^")="":"",$D(^SC($P(^NURSF(211.4,NPWARD,0),"^"),0)):$P(^(0),"^"),1:"")
S NPWARD=$S(NPWARD?1"NUR ".E:$P(NPWARD,"NUR ",2),1:NPWARD)
Q
EN7 ; ENTRY FROM NURSING ROUTINES TO CONVERT PTR TO 211.8 FILE TO DATA
; STORED IN 44 FILE. NPWARD COMES IN AS PTR AND LEAVES AS FREE
; TEXT OR NULL.
S:'$D(NPWARD) NPWARD=""
S NPWARD=$S(NPWARD="":"",$D(^SC(NPWARD,0)):$P(^(0),"^"),1:"")
S NPWARD=$S(NPWARD?1"NUR ".E:$P(NPWARD,"NUR ",2),1:NPWARD)
Q