SROPRIT ;B'HAM ISC/MAM - TOTAL OPERATIONS (BY PRIORITY) ; [ 09/22/98 11:36 AM ]
;;3.0; Surgery ;**77,50**;24 Jun 93
BEG W @IOF,!,"Report of Surgical Priorities",!
DATE D DATE^SROUTL(.SRSD,.SRED,.SRSOUT) G:SRSOUT END
S SRD=SRSD-.0001
CHOICE W !!,"Do you want to review this information sorted by Surgical Specialty ? YES// " R SRYN:DTIME I '$T!(SRYN["^") S SRSOUT=1 G END
S SRYN=$E(SRYN) I "YyNn"'[SRYN W !!,"Enter RETURN if you want the totals for each Surgical Specialty, or 'NO' to",!,"display the total cases sorted by surgical priority for the entire Medical",!,"Center." G CHOICE
S SRSS="" I "Yy"[SRYN S SRSS="ALL" D SPEC I SRSOUT G END
W ! K IOP,%ZIS,POP,IO("Q") S %ZIS("A")="Print the Report on which Device: ",%ZIS="Q" D ^%ZIS G:POP END
I $D(IO("Q")) K IO("Q") S ZTDESC="LIST OF OPERATIONS",ZTRTN="EN^SROPRIT",(ZTSAVE("SRD"),ZTSAVE("SRED"),ZTSAVE("SRSD"),ZTSAVE("SRSITE*"),ZTSAVE("SRSS"))="",%ZIS="QM" D ^%ZTLOAD G END
EN ; entry when queued
N SRFRTO S Y=SRSD X ^DD("DD") S SRFRTO="FROM: "_Y_" TO: ",Y=SRED X ^DD("DD") S SRFRTO=SRFRTO_Y,Y=DT X ^DD("DD") S SRPRINT="DATE PRINTED: "_Y
S SRINST=SRSITE("SITE"),SRD=SRSD-.0001,SRED1=SRED+.9999,SRSOUT=0
I SRSS D ^SROPRI1 G END
D ^SROPRI2
END I $E(IOST)="P" W @IOF
K ^TMP("SRLIST",$J) I $D(ZTQUEUED) Q:$G(ZTSTOP) S ZTREQ="@" Q
D ^%ZISC W @IOF D ^SRSKILL K SRTN
Q
PLIST ;; get list of priorities
N SRLIST,SRC,SRP,I,J,X,Y D HELP^DIE(130,"",.035,"S","SRLIST")
F I=2:1:SRLIST("DIHELP") S X=SRLIST("DIHELP",I),Y=$F(X," "),SRC=$E(X,1,Y-2) F J=Y:1 I $E(X,J)'=" " S SRP=$E(X,J,99),SRCODE(SRC)=SRP Q
S SRCODE("ZZ")="PRIORITY NOT ENTERED"
S X="",Y=1 F S X=$O(SRCODE(X)) Q:X="" S SRCODE(X)=Y_". "_SRCODE(X),Y=Y+1
Q
SPEC ; select specialty
W !!,"Do you want to print this report for all Surgical Specialties ? YES// " R SRYN:DTIME I '$T!(SRYN["^") S SRSOUT=1 Q
S SRYN=$E(SRYN) I "YyNn"'[SRYN W !!,"Enter 'YES' to print this report for all specialties, or 'NO' to select a",!,"specific specialty." G SPEC
I "Yy"[SRYN Q
K DIC S DIC("S")="I '$P(^(0),""^"",3)",DIC=137.45,DIC(0)="QEAMZ",DIC("A")="Print the report for which Surgical Specialty ? " W ! D ^DIC I Y<0 S SRSOUT=1 Q
S SRSS=+Y
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSROPRIT 2191 printed Nov 22, 2024@17:55:14 Page 2
SROPRIT ;B'HAM ISC/MAM - TOTAL OPERATIONS (BY PRIORITY) ; [ 09/22/98 11:36 AM ]
+1 ;;3.0; Surgery ;**77,50**;24 Jun 93
BEG WRITE @IOF,!,"Report of Surgical Priorities",!
DATE DO DATE^SROUTL(.SRSD,.SRED,.SRSOUT)
if SRSOUT
GOTO END
+1 SET SRD=SRSD-.0001
CHOICE WRITE !!,"Do you want to review this information sorted by Surgical Specialty ? YES// "
READ SRYN:DTIME
IF '$TEST!(SRYN["^")
SET SRSOUT=1
GOTO END
+1 SET SRYN=$EXTRACT(SRYN)
IF "YyNn"'[SRYN
WRITE !!,"Enter RETURN if you want the totals for each Surgical Specialty, or 'NO' to",!,"display the total cases sorted by surgical priority for the entire Medical",!,"Center."
GOTO CHOICE
+2 SET SRSS=""
IF "Yy"[SRYN
SET SRSS="ALL"
DO SPEC
IF SRSOUT
GOTO END
+3 WRITE !
KILL IOP,%ZIS,POP,IO("Q")
SET %ZIS("A")="Print the Report on which Device: "
SET %ZIS="Q"
DO ^%ZIS
if POP
GOTO END
+4 IF $DATA(IO("Q"))
KILL IO("Q")
SET ZTDESC="LIST OF OPERATIONS"
SET ZTRTN="EN^SROPRIT"
SET (ZTSAVE("SRD"),ZTSAVE("SRED"),ZTSAVE("SRSD"),ZTSAVE("SRSITE*"),ZTSAVE("SRSS"))=""
SET %ZIS="QM"
DO ^%ZTLOAD
GOTO END
EN ; entry when queued
+1 NEW SRFRTO
SET Y=SRSD
XECUTE ^DD("DD")
SET SRFRTO="FROM: "_Y_" TO: "
SET Y=SRED
XECUTE ^DD("DD")
SET SRFRTO=SRFRTO_Y
SET Y=DT
XECUTE ^DD("DD")
SET SRPRINT="DATE PRINTED: "_Y
+2 SET SRINST=SRSITE("SITE")
SET SRD=SRSD-.0001
SET SRED1=SRED+.9999
SET SRSOUT=0
+3 IF SRSS
DO ^SROPRI1
GOTO END
+4 DO ^SROPRI2
END IF $EXTRACT(IOST)="P"
WRITE @IOF
+1 KILL ^TMP("SRLIST",$JOB)
IF $DATA(ZTQUEUED)
if $GET(ZTSTOP)
QUIT
SET ZTREQ="@"
QUIT
+2 DO ^%ZISC
WRITE @IOF
DO ^SRSKILL
KILL SRTN
+3 QUIT
PLIST ;; get list of priorities
+1 NEW SRLIST,SRC,SRP,I,J,X,Y
DO HELP^DIE(130,"",.035,"S","SRLIST")
+2 FOR I=2:1:SRLIST("DIHELP")
SET X=SRLIST("DIHELP",I)
SET Y=$FIND(X," ")
SET SRC=$EXTRACT(X,1,Y-2)
FOR J=Y:1
IF $EXTRACT(X,J)'=" "
SET SRP=$EXTRACT(X,J,99)
SET SRCODE(SRC)=SRP
QUIT
+3 SET SRCODE("ZZ")="PRIORITY NOT ENTERED"
+4 SET X=""
SET Y=1
FOR
SET X=$ORDER(SRCODE(X))
if X=""
QUIT
SET SRCODE(X)=Y_". "_SRCODE(X)
SET Y=Y+1
+5 QUIT
SPEC ; select specialty
+1 WRITE !!,"Do you want to print this report for all Surgical Specialties ? YES// "
READ SRYN:DTIME
IF '$TEST!(SRYN["^")
SET SRSOUT=1
QUIT
+2 SET SRYN=$EXTRACT(SRYN)
IF "YyNn"'[SRYN
WRITE !!,"Enter 'YES' to print this report for all specialties, or 'NO' to select a",!,"specific specialty."
GOTO SPEC
+3 IF "Yy"[SRYN
QUIT
+4 KILL DIC
SET DIC("S")="I '$P(^(0),""^"",3)"
SET DIC=137.45
SET DIC(0)="QEAMZ"
SET DIC("A")="Print the report for which Surgical Specialty ? "
WRITE !
DO ^DIC
IF Y<0
SET SRSOUT=1
QUIT
+5 SET SRSS=+Y
+6 QUIT