source: WorldVistAEHR/trunk/r/NURSING_SERVICE-NUR/NURCES0.m@ 1604

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

initial load of WorldVistAEHR

File size: 4.1 KB
RevLine 
[613]1NURCES0 ;HIRMFO/YH,RM,FT,YH-END OF SHIFT REPORT PART 1/1 ;6/25/97 14:35
2 ;;4.0;NURSING SERVICE;**2**;Apr 25, 1997
3EN1 ;132 COLUMN FORMAT OF REPORT
4 S NOPT=1,NURS132=1
5START0 G:'$D(^DIC(213.9,1,"OFF")) QUIT2 G:$P(^DIC(213.9,1,"OFF"),"^",1)=1 QUIT2
6 I '$D(^GMRD(126.95,1,1)) W !,"The Nursing shift parameters in ^GMRD(126.95) must be completed.",!,"Please contact the Nursing ADP Coordinator",! G QUIT2
7 S NURQUIT=0 K DIR
8 S DIR("A")="Please enter the character of your choice: "
9 S DIR("A",1)="Select shift for the report"
10 S DIR("A",2)=" "
11 S DIR("A",3)=" N - night"
12 S DIR("A",4)=" D - day"
13 S DIR("A",5)=" E - evening"
14 S DIR("A",6)=" "
15 S DIR(0)="SMA^N:night;D:day;E:evening"
16 D ^DIR K DIR I $D(DIRUT) G QUIT2
17 S NX=Y,GMRDAY=$P(^GMRD(126.95,1,1),"^",2),GMREVE=$P(^(1),"^",3),GMRNIT=$P(^(1),"^")
18 I GMRDAY=""!(GMREVE="")!(GMRNIT="") W !,"The Nursing shift parameters in ^GMRD(126.95) must be completed.",!,"Please contact the Nursing ADP Coordinator",! G QUIT2
19 S GMRSTRT=$S(NX="N":DT,NX="D":DT_"."_GMRDAY,NX="E":DT_"."_GMREVE,1:"") G:GMRSTRT="" QUIT S GMRFIN=$S(NX="N":DT_"."_GMRDAY,NX="D":DT_"."_GMREVE,NX="E":DT_".2400",1:"") G:GMRFIN="" QUIT
20 S:NX'="N" GMRFIN=GMRFIN-0.0001
21 I NX="N",GMRNIT>2000 S X1=DT,X2=-1 D C^%DTC K %DTC S GMRSTRT=X_"."_GMRNIT
22 W ! D WARDPAT^NURCUT0 S:NUREDB="" NUROUT=1 G:NURQUIT QUIT S:"Pp"'[NUREDB NURORDR=$$SORT^NURCES5("")
23 G:NURQUIT QUIT D EN6^NURSUT0 G:NURQUIT QUIT W:NOPT=1 !,"THIS REPORT REQUIRES AN 132 COLUMN DEVICE - LAND!"
24 W ! S ZTRTN="START^NURCES0",ZTDESC="NURSING END-OF-SHIFT REPORT" D EN7^NURSUT0 G:POP!($D(ZTSK)) QUIT
25START ;
26 S GPACK=1,X="GMRYRP0" X ^%ZOSF("TEST") S:'$T GPACK=0 S GFH=1,X="FHWHEA" X ^%ZOSF("TEST") S:'$T GFH=0 S $P(NURX,"-",130)="" D NOW^%DTC S NURNOW=%,Y=$E(%,1,12) X ^DD("DD") S NURDT=Y
27 S NURNOW(1)=$$FMADD^XLFDT(NURNOW,-1)
28 I $E(IOST)="P",NCOPY>1 D
29 . F NURI=1:1 Q:NURI>NCOPY D REPORT W:NURI<NCOPY @IOF
30 . Q
31 E D REPORT
32QUIT ; KILL LOCAL VARIABLES
33 D CLOSE^NURSUT1 K NURNOW,NURORDR
34QUIT2 K ^TMP($J) D KVAR^VADPT,^NURCKILL K NURMDSW
35 Q
36REPORT U IO S (NURSW1,NURPAGE)=0 K ^TMP($J),^TMP("DIQ1",$J)
37 D ^NURCAS2
38 I '$D(^TMP($J,"NURCEN")) D HEADER^NURCES2 W $C(7),!,"NO PATIENTS IN SELECTED ROOM(S) ON "_NPWARD Q
39PRINT ;PRINT ROUTINE
40 I "Pp"[NUREDB S (NURWARD,NPWARD)=+$P(^NURSF(214,+DFN,0),"^",3) D:NPWARD>0 EN6^NURSAUTL S NURORDR="SORT1"
41 D @NURORDR
42 Q
43SORT1 ;
44 S NBED="" F S NBED=$O(^TMP($J,"NURCEN",NBED)) Q:NBED=""!(NURQUIT) I NBED'="GMRY" S NBED(0)="" F S NBED(0)=$O(^TMP($J,"NURCEN",NBED,NBED(0))) Q:NBED(0)=""!(NURQUIT) D
45 . D:'NURSW1 HEADER^NURCES2 S N1="" F S N1=$O(^TMP($J,"NURCEN",NBED,NBED(0),N1)) Q:N1=""!(NURQUIT) K NPT,NSS,NADM,NCL,NPR S NDATA=^(N1),DFN=$P(NDATA,"^"),NSSN=$P(NDATA,"^",2) D PRINT1^NURCES01 K ^TMP($J,"GMRY")
46 Q
47EN2 ;80 COLUMN FORMAT REPORT
48 S NOPT=2 K NURS132 G START0
49 ;
50SORT2 ;RESORT BY PATIENT NAME
51 S NBED="" F S NBED=$O(^TMP($J,"NURCEN",NBED)) Q:NBED="" D
52 . S NBED(0)="" F S NBED(0)=$O(^TMP($J,"NURCEN",NBED,NBED(0))) Q:NBED(0)="" D
53 . . S N1="" F S N1=$O(^TMP($J,"NURCEN",NBED,NBED(0),N1)) Q:N1="" S ^TMP($J,"NSORT",N1,$P(NBED,"-"),NBED(0))=^TMP($J,"NURCEN",NBED,NBED(0),N1)
54 S N1="" F S N1=$O(^TMP($J,"NSORT",N1)) Q:N1=""!(NURQUIT) I N1'="GMRY" S NBED="" F S NBED=$O(^TMP($J,"NSORT",N1,NBED)) Q:NBED=""!(NURQUIT) D
55 . D:'NURSW1 HEADER^NURCES2 Q:NURQUIT S NBED(0)="" F S NBED(0)=$O(^TMP($J,"NSORT",N1,NBED,NBED(0))) Q:NBED(0)=""!(NURQUIT) K NPT,NSS,NADM,NCL,NPR S NDATA=^(NBED(0)),DFN=$P(NDATA,"^"),NSSN=$P(NDATA,"^",2) D PRINT1^NURCES01 K ^TMP($J,"GMRY")
56 Q
57SORT3 ;RESORT BY BED ORDER
58 S NBED="" F S NBED=$O(^TMP($J,"NURCEN",NBED)) Q:NBED="" D
59 . S NBED(0)="" F S NBED(0)=$O(^TMP($J,"NURCEN",NBED,NBED(0))) Q:NBED(0)="" D
60 . . S N1="" F S N1=$O(^TMP($J,"NURCEN",NBED,NBED(0),N1)) Q:N1="" S ^TMP($J,"NSORT",NBED(0),$P(NBED,"-"),N1)=^TMP($J,"NURCEN",NBED,NBED(0),N1)
61 S NBED(0)="" F S NBED(0)=$O(^TMP($J,"NSORT",NBED(0))) Q:NBED(0)=""!(NURQUIT) I NBED(0)'="GMRY" S NBED="" F S NBED=$O(^TMP($J,"NSORT",NBED(0),NBED)) Q:NBED=""!(NURQUIT) D
62 . D:'NURSW1 HEADER^NURCES2 Q:NURQUIT S N1="" F S N1=$O(^TMP($J,"NSORT",NBED(0),NBED,N1)) Q:N1=""!(NURQUIT) K NPT,NSS,NADM,NCL,NPR S NDATA=^(N1),DFN=$P(NDATA,"^"),NSSN=$P(NDATA,"^",2) D PRINT1^NURCES01 K ^TMP($J,"GMRY")
63 Q
Note: See TracBrowser for help on using the repository browser.