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

ANSQSP1.m

Go to the documentation of this file.
ANSQSP1 ;IHS/OIRM/DSD/CSC - PRINT NURSE STAFFING STATS; [ 02/25/98  10:32 AM ]
 ;;3.0;NURSING PATIENT ACUITY;;APR 01, 1996
 ;;PRINT NURSE STAFFING STATS
EN ;CHECK THROUGH EACH DAY OF THE REPORT GLOBAL
 S ANSD=0
 F  S ANSD=$O(^TMP("ANS",$J,ANSD)) Q:'ANSD!$D(DTOUT)!$D(DUOUT)  D EN1
 I ANSD<1 D C1 Q
 I ANSPO="D" D B1 Q
 Q
EN1 ;PROCESS INFO FOR EACH DAY
 I ANSPO="D" D B1 Q
 I ANSIOT,$Y>$S(ANSPO="S":18,1:23) D
 .D PAUSE^ANSDIC
 .W:$D(IOF) @IOF
 .D HEAD^ANSQSP
 I $Y>54 D
 .D HEAD^ANSQSP
 S ANSSH=0
 F  S ANSSH=$O(^TMP("ANS",$J,ANSD,ANSSH)) Q:'ANSSH!$D(DTOUT)!$D(DUOUT)  D
 .F I="A","O","H" S @I=$G(^TMP("ANS",$J,ANSD,ANSSH,I))
 .S L="",T=0
 .F I=1:1:6 S Y=$P(O,U,I) I Y S T=T+Y,$P(L,U,I+4)=Y
 .S $P(L,U,4)=$P(O,U,7)
 .S N=0
 .F I=1:1:6 S Y=$P(A,U,I) I Y S N=N+Y
 .S $P(L,U)=T,$P(L,U,2)=T,$P(L,U,3)=N,X=$P(H,U)-$P(H,U,2),Y=$P(H,U,3),E=""
 .I X S E=Y/X
 .S $P(L,U,11)=Y,$P(L,U,12)=X,$P(L,U,13)=E*100
 .S ANSWX=$E(ANSD,4,7)
 .D SBW
 I ANSSH<1 D B1 Q
 Q
B1 ;PRINT THE DAILY SUMMARY
 S L="",ANSPTC=ANSPTC+1
 I $D(^TMP("ANS",$J,ANSD,"T")) S L=^("T"),X=$P(L,U,11),Y=$P(L,U,12),E="" I Y S E=X/Y*100,$P(L,U,13)=E
 D:ANSPO="S" H9^ANSQSP
 S ANSWX=$S(ANSPO="S":"Daily",1:$E(ANSD,4,7))
 D SBW
 F I=1,3:1:13 S N=$P(L,U,I) S A(I)=$G(A(I))+N
 S N=$P(L,U,2)
 I N>$G(A(2)) S A(2)=N
 W:ANSPO="S" !
 Q
C1 ;PRINT OUT THE SUMMARY TOTALS FOR ALL DAYS SELECTED
 D H9^ANSQSP
 S L=""
 F I=1:1:12 S $P(L,U,I)=$G(A(I))
 S X=$P(L,U,11),Y=$P(L,U,12)
 I Y S E=X/Y*100,$P(L,U,13)=E
 S ANSWX="Total"
 D SBW
 Q
SBW ;WRITE OUT INFO FOR EACH SHIFT AND DAILY SUMMARY
 W !,ANSWX," "
 I $D(ANSSH),ANSSH S X=$T(@ANSNS) W $P(X,";;",ANSSH+1)
 F I=1:1:13 S N=$P(L,U,I) D
 .S N=$J(N,1,1),D=$P(N,".",2),N=$P(N,".",1)
 .D WRT
 Q
WRT ;WRITE EACH COLUMN OF EACH LINE OF THE REPORT
 S T=$P(ANSTAB,";;",I+1),W=$P(ANSWTH,";;",I+1)
 W ?T,"|",$J(N,W)
 I D W ".",D
 I I=13,'D W ".0"
 Q
2 ;;D;;N
3 ;;D;;E;;N