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

SROPRI1.m

Go to the documentation of this file.
SROPRI1 ;B'HAM ISC/MAM - TOTAL OPERATIONS (BY PRIORITY) ; [ 07/27/98   2:33 PM ]
 ;;3.0; Surgery ;**50**;24 Jun 93
 U IO K ^TMP("SRLIST",$J) S ^TMP("SRLIST",$J)=0 D PLIST^SROPRIT
 S X="" F  S X=$O(SRCODE(X)) Q:X=""  S ^TMP("SRLIST",$J,SRCODE(X))=0
 S SRLINE="" F X=1:1:80 S SRLINE=SRLINE_"_"
 F  S SRD=$O(^SRF("AC",SRD)) Q:SRD=""!(SRD>SRED1)  S SRTN=0 F  S SRTN=$O(^SRF("AC",SRD,SRTN)) Q:SRTN=""  I $D(^SRF(SRTN,0)),$$DIV^SROUTL0(SRTN) D UTIL
 I ^TMP("SRLIST",$J,"6. PRIORITY NOT ENTERED")=0 K ^TMP("SRLIST",$J,"6. PRIORITY NOT ENTERED")
 S SRSS=$P(^SRO(137.45,SRSS,0),"^")
 D HDR Q:SRSOUT  S X=0 F  S X=$O(^TMP("SRLIST",$J,X)) Q:X=""  W !,?24,X,?50,$J(^(X),6)
 W !!!,?24,"TOTAL SURGICAL CASES: ",?50,$J(^TMP("SRLIST",$J),6)
 I $E(IOST)'="P" W !!!! K DIR S DIR(0)="FOA",DIR("A")="  Press RETURN to continue. " D ^DIR
 Q
UTIL ; set UTILITY("SRLIST",$J
 Q:$P($G(^SRF(SRTN,.2)),"^",12)=""
 S SR(0)=^SRF(SRTN,0),X=$P(SR(0),"^",10) S:X="" X="ZZ" S X=SRCODE(X)
 S SP=$P(SR(0),"^",4) I SP'=SRSS Q
 S ^TMP("SRLIST",$J,X)=^TMP("SRLIST",$J,X)+1,^TMP("SRLIST",$J)=^TMP("SRLIST",$J)+1
 Q
HDR ; print heading
 I $D(ZTQUEUED) D ^SROSTOP I SRHALT S SRSOUT=1 Q
 W:$Y @IOF W !,?(80-$L(SRINST)\2),SRINST,!,?32,"SURGICAL SERVICE",!,?21,"TOTAL OPERATIONS BY SURGICAL PRIORITY"
 W !,?(80-$L(SRFRTO)\2),SRFRTO W:$E(IOST)="P" !,?28,SRPRINT W !,SRLINE,!
 W !,?(80-$L(SRSS)\2),SRSS,!
 Q