source: FOIAVistA/trunk/r/NURSING_SERVICE-NUR/NURSEPML.m@ 1717

Last change on this file since 1717 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 4.7 KB
Line 
1NURSEPML ;HIRMFO/MD,FT-TRAINING REPORT BY LOCATION ;6/5/97
2 ;;4.0;NURSING SERVICE;**2,3,10,12,13**;Apr 25, 1997
3EN1 S X=$G(^PRSE(452.7,1,"OFF")) Q:X=""!(X=1)
4 S X=$G(^DIC(213.9,1,"OFF")) Q:X=""!(X=1)
5 S (NURHOSP,NURQUEUE,NUROUT,NURSW1,NURPAGE,NUROUT)=0,NSW2=1
6 D EN1^NURSAUTL G QUIT:$G(NUROUT)
7 I NURPLSW=1 D EN13^NURSAGSP G:$G(NUROUT) QUIT
8 I NURMDSW S DIC(0)="AEQMZ",NURPLSCR=1 D EN5^NURSAGSP G:$G(NUROUT) QUIT
9 I NURMDSW=0,NURPLSW=1 S NURPLSCR=1 D PRD^NURSAGSP K NURPLSCR I $G(NUROUT) G QUIT
10 D EN10^NURSUT3($G(DUZ)),DATSEL^NURSAGP2 G QUIT:$G(NUROUT) D INS^NURSAGP2 G QUIT:$G(NUROUT)
11 I NURPLSW=0!($G(NURSEL(1))=1)!($G(NURSEL(1))="") W ! D EN1^NURSAGSP G QUIT:$G(NUROUT)
12 I $G(NURSEL(1))=2 W ! D EN3^NURSAGSP G QUIT:$G(NUROUT)
13 D EN5^NURSAGP1 G QUIT:$G(NUROUT)
14 W ! S ZTDESC="Nursing Training Report by Location",ZTRTN="START^NURSEPML" D EN7^NURSUT0 G:POP!($D(ZTSK)) QUIT
15START ;
16 K ^TMP("NURE",$J),^TMP("NURLOC",$J) S (HOLD,HOLD(1),HOLD(2),HOLD(3))=1,(PCNT,SCNT,RCNT,SHRS,SHRS("CON"),SHRS("CEU"),RHRS,RHRS("CON"),RHRS("CEU"),PHRS,PHRS("CON"),PHRS("CEU"))=0
17 S NURS132=$S(IOM'<132:1,1:0) F NDA=0:0 S NDA=$O(^NURSF(211.8,"C",NDA)) Q:NDA'>0 F NURNODE4=0:0 S NURNODE4=$O(^NURSF(211.8,"C",NDA,NURNODE4)) Q:NURNODE4'>0 D
18 .K NURNODE4(1),NURNODE4(2) Q:'$D(^NURSF(211.8,NURNODE4,0))
19 .S NURNODE4(1)=+$P(^NURSF(211.8,NURNODE4,0),"^") Q:NURNODE4(1)'>0 Q:'$D(^NURSF(211.4,"B",NURNODE4(1)))
20 .S NURNODE4(2)=$O(^NURSF(211.4,"B",NURNODE4(1),0)) Q:'$D(^NURSF(211.4,NURNODE4(2),"I")) Q:$E($P(^("I"),"^"))="I"
21 .F NURNODE5=0:0 S NURNODE5=$O(^NURSF(211.8,"C",NDA,NURNODE4,NURNODE5)) Q:NURNODE5'>0 I $P($G(^NURSF(211.8,NURNODE4,1,NURNODE5,0)),U)'>DT&(('$P($G(^(0)),U,6))!($P($G(^(0)),U,6)'<DT)) D
22 ..S DA=$O(^NURSF(210,"B",NDA,0)) I $P($G(^NURSF(210,+DA,0)),U,2)'="",$P($G(^(0)),U,2)'="R",$D(^VA(200,NDA,0)) W:$R(500)&$E(IOST)="C" "." D SORT
23 ..Q
24 .Q
25 I $O(^TMP("NURE",$J,""))="",'$D(NURSNLOC) S NUROUT=1 S NURPROG=$S($G(NURPROG)=0:NURPROG(1),1:""),NURFAC=$S($G(NURFAC)=0:NURFAC(1),1:"") D NHDR^NURSEPL1 W !!,"THERE IS NO DATA FOR THIS REPORT"
26 I $O(^TMP("NURE",$J,""))="",$D(NURSNLOC) S NUROUT=1 S NURPROG=$S($G(NURPROG)=0:NURPROG(1),1:""),NURFAC=$S($G(NURFAC)=0:NURFAC(1),1:"") D NHDR^NURSEPL1 S NL1="" F S NL1=$O(NURSNLOC(NL1)) Q:NL1="" D NODATA^NURSUT1
27 I $O(^TMP("NURE",$J,""))'="",$D(NURSNLOC) S NURSPEC="" D I NURSW1=1 D ENDPG^NURSUT1 S NURSW1=0
28 . S (NURY,NURZ,NURX)="" F S NURY=$O(^TMP("NURE",$J,"L",NURY)) Q:NURY="" F S NURZ=$O(^TMP("NURE",$J,"L",NURY,NURZ)) Q:NURZ="" F S NURX=$O(^TMP("NURE",$J,"L",NURY,NURZ,NURX)) Q:NURX="" S ^TMP("NURLOC",$J,NURX)=""
29 . S NL1="" F S NL1=$O(NURSNLOC(NL1)) Q:NL1="" I '$D(^TMP("NURLOC",$J,NL1)) D
30 . . S NURPROG=$S($G(NURPROG)=0:NURPROG(1),1:""),NURFAC=$S($G(NURFAC)=0:NURFAC(1),1:"") D:NURSW1=0 NHDR^NURSEPL1 D NODATA^NURSUT1
31 . . Q
32 . Q
33 D NPRINT^NURSEPL1
34QUIT K ^TMP("NURE",$J) D CLOSE^NURSUT1,^NURSKILL
35 K NATTEND,NMHOLD Q
36SORT ; SORT MI DATA
37 Q:NURSZAP>7&(NURSZDA'=DA) S NURSZORT=1 D EN3^NURSAUTL:NURSZAP>6,EN2^NURSAUTL:NURSZORT&NURSZAP Q:'NURSZORT
38 S NURNEN=$S($G(NURSEL(1))=2:1,1:3) D SETPROG^NURAAGS1,SETFAC^NURAAGS1
39 W:$E(IOST)="C"&($R(2000)) "." S N1=$S($P(^VA(200,NDA,0),"^")="":"VA # "_NDA,1:$P(^(0),"^"))
40 S NLO=$S($D(^NURSF(211.8,+NURNODE4,0)):$P(^(0),U),1:" BLANK")
41 D EN2^NURSUT0 Q:$G(NPSPOS(1))="" S NURCAT=NPSPOS(1)
42 S NPWARD=NLO D EN7^NURSAUTL Q:NPWARD="" S NL1=$E(NPWARD,1,10)
43 S NURSPEC=$S($G(NURSEL(1))=2:$$CAT^NURSUT2(NPSPOS(1)),1:$E(NPWARD,1,10)),NURSPEC(1)=$S($G(NURSEL(1))=2:$E(NPWARD,1,10),1:$$CAT^NURSUT2(NPSPOS(1)))
44 I $G(NURSEL(1))'=2,$G(NURHOSP)=0,'$D(NURSNLOC(NL1)) Q
45 I $G(NURSEL(1))=2,'$D(^TMP("NURSCAT",$J,NPSPOS(1))) Q
46 I NURMDSW,'$G(NURFAC),$G(NURFAC(1))'=$G(NURFAC(2)) Q
47 I NURPLSW,'$G(NURPROG),$G(NURPROG(1))'=$G(NURPROG(2)) Q
48 S:NURPROG(2)="NURSING" NURPROG(2)=" "_NURPROG(2)
49 S NIC2="" F S NIC2=$O(^PRSE(452,"AA",NIC2)) Q:NIC2="" S NIC1="" F S NIC1=$O(^PRSE(452,"AA",NIC2,NDA,NIC1)) Q:NIC1="" D
50 . I NURSEL'="A"&(NURSEL'=NIC2) Q
51 . I NSW2'=1 S NCD=$O(^PRSE(452,"AA",NIC2,DA(1),NIC1,"")),DA(2)=$O(^PRSE(452,"AA",NIC2,DA(1),NIC1,NCD,"")) D SAVE
52 . E F NCD1=0:0 S NCD1=$O(^PRSE(452,"AA",NIC2,NDA,NIC1,NCD1)) Q:NCD1'>0 F PDA=0:0 S PDA=$O(^PRSE(452,"AA",NIC2,NDA,NIC1,NCD1,PDA)) Q:PDA'>0 D SAVE
53 . Q
54 Q
55SAVE ;
56 S:$G(NURSORT)="" NURSORT=1
57 S NCD=$P($G(^PRSE(452,PDA,0)),U,3)
58 I NCD<YRST!(NCD>YREND) Q
59 I NSW2'=1 S ^TMP("NURE",$J,NURFAC(2),NURPROG(2),$E(NIC1,1,30),NCD,PDA)="" Q
60 E I $D(NSPC)#2,'(NSPC=NIC1) Q
61 S NURECLS(0)=$O(^PRSE(452.1,"B",NIC1,0))
62 N X S X=$G(^TMP("NURE",$J,"L",NURFAC(2),NURPROG(2),NURSPEC,NIC1))
63 I X="" S X=NURSORT,NURSORT=NURSORT+1,^TMP("NURE",$J,"L",NURFAC(2),NURPROG(2),NURSPEC,NIC1)=X
64 S DATA=$G(^PRSE(452,PDA,0)),^TMP("NURE",$J,"L1",X,N1,NURSPEC(1),NCD,PDA)=$P($G(DATA),U,16)_U_$P($G(^PRSE(452,PDA,6)),U,2)_U_$P($G(DATA),U,21)_U_$P($G(DATA),U,6)_U_$P($G(DATA),U,10)
65 Q
Note: See TracBrowser for help on using the repository browser.