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