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

SRSWLST.m

Go to the documentation of this file.
  1. SRSWLST ;B'HAM ISC/MAM - PRINT SURGERY WAITING LIST ; 17 OCT 89 7:05 AM
  1. ;;3.0; Surgery ;;24 Jun 93
  1. S SOPT="",SSOPT="",SRSS=""
  1. N DFN
  1. ;
  1. S RH="Surgery Waiting List Reports"
  1. W !!," A Alphabetical Order by Patient",!," T Tentative Date of Operation",!," D Date Entered on the Waiting List"
  1. ;
  1. S SRSOUT=0 W !!,"Enter Selection (A,T, or D): " R SOPT:DTIME I '$T!(SOPT["^")!(SOPT="") S SRSOUT=1 W @IOF G END
  1. ;
  1. S SOPT=$E(SOPT) I "ATDatd"'[SOPT!(SOPT="") W !!,"Enter one of the letters, A, T, or D or ^ to exit. ",!!,"Press RETURN to continue " R X:DTIME G MENU
  1. ;
  1. ;
  1. SPEC S SRSOUT=0 W @IOF,!,"Do you want to print the waiting list for all specialties ? YES// " R SRYN:DTIME I '$T!(SRYN["^") S SRSOUT=1 G END
  1. ;
  1. SORTOP I "Aa"[SOPT,"Yy"[SRYN W !!,"Do you want this alphabetic list to be sorted by surgical specialty ? YES// " R SSOPT:DTIME I '$T!(SSOPT["^") S SRSOUT=1 G END
  1. S SSOPT=$E(SSOPT)
  1. S:SSOPT="" SSOPT="Y" I "YyNn"'[SSOPT W !!,"Enter YES to generate the list sorted first by surgical specialty ",!,"and then alphabetic by patient name. Enter NO to sort only by patient name.",!!,"Press RETURN to continue " R X:DTIME G SORTOP
  1. S SRYN=$E(SRYN) S:SRYN="" SRYN="Y" I "YyNn"'[SRYN W !!,"Enter 'YES' if you want to generate the list for all surgical",!,"specialties, or 'NO' to select a specific specialty.",!!,"Press RETURN to continue " R X:DTIME G SPEC
  1. ;
  1. I "Nn"[SRYN W ! K DIC S DIC=133.8,DIC(0)="QEAMZ",DIC("A")="Select Surgical Specialty: " D ^DIC I Y<0 S SRSOUT=1 G END
  1. I "Nn"[SRYN S SRSS=+Y,SRSNM=$P(Y(0),"^") S SRSNM=$P(^SRO(137.45,SRSNM,0),"^") S ZTSAVE("SRSNM")=SRSNM,ZTSAVE("SRSS")=SRSS
  1. ;
  1. I "Yy"[SRYN S SRSS="ALL"
  1. FORM ; brief or extended
  1. ;
  1. W !!,"Do you want to print the brief form ? YES// " R SRYN:DTIME I '$T!(SRYN["^") S SRSOUT=1 G END
  1. ;
  1. S SRYN=$E(SRYN) I SRYN="" S SRYN="Y"
  1. ;
  1. I "YyNn"'[SRYN W !!,"Enter 'NO' if you want to print the extended form of the waiting list",!,"containing demographic information, or 'YES' to print the brief form.",! G FORM
  1. ;
  1. S SRFORM=$S("Yy"[SRYN:"B",1:"E")
  1. ;
  1. ;;; Sort by Patient within All Specialties displaying brief form.
  1. I "Aa"[SOPT,SRSS="ALL","Yy"[SSOPT,SRFORM="B" G ^SRSWL6
  1. ;;; Sort by Patient within All Specialties displaying extended form.
  1. I "Aa"[SOPT,SRSS="ALL","Yy"[SSOPT G ^SRSWL7
  1. ;;; Sort by Patient Only, displaying All Specialties, in brief form.
  1. I "Aa"[SOPT,SRSS="ALL",SRFORM="B" G ^SRSWL8
  1. ;;; Sort by Patient Only, displaying All Specialties, extended form.
  1. I "Aa"[SOPT,SRSS="ALL" G ^SRSWL9
  1. ;;; Sort by Patient Only, displaying One Specialty, in brief form.
  1. I "Aa"[SOPT,SRSS'="ALL",SRFORM="B" G ^SRSWL10
  1. ;;; Sort by Patient Only, displaying One Specialty, in extended form.
  1. I "Aa"[SOPT,SRSS'="ALL" G ^SRSWL11
  1. ;;; Sort by Tentative Date of Operation within All Specialties Brief.
  1. I "Tt"[SOPT,SRSS="ALL",SRFORM="B" G ^SRSWL12
  1. ;;; Sort by Tentative Date of Operation within All Specialties Extend.
  1. I "Tt"[SOPT,SRSS="ALL" G ^SRSWL13
  1. ;;; Sort by Tentative Date of Operation for one Specialty, Brief form.
  1. I "Tt"[SOPT,SRFORM="B" G ^SRSWL14
  1. ;;; Sort by Tentative Date of Operation for one Specialty, Extended.
  1. I "Tt"[SOPT G ^SRSWL15
  1. ;;; Sort by Date entered on the List with All specailties,brief form.
  1. I "Dd"[SOPT,SRSS="ALL",SRFORM="B" G ^SRSWL1
  1. ;;; Sort by Date entered on the List with All specailties, extended.
  1. I "Dd"[SOPT,SRSS="ALL" G ^SRSWL3
  1. ;;; Sort by Date entered on the List for one specailty, brief form.
  1. I "Dd"[SOPT,SRFORM="B" G ^SRSWL2
  1. ;;; Sort by Date entered on the List for one specialty, extended.
  1. I "Dd"[SOPT G ^SRSWL4
  1. ;
  1. END I $E(IOST)="P" S SRSOUT=1 W @IOF
  1. I $D(ZTQUEUED) K ^TMP("SR",$J) Q:$G(ZTSTOP) S ZTREQ="@" Q
  1. I 'SRSOUT W !!,"Press RETURN to continue " R X:DTIME W @IOF
  1. D ^%ZISC,^SRSKILL
  1. K SRTN
  1. Q
  1. OLD ; check for operations by same specialty
  1. ;
  1. S SRTN=0 F S SRTN=$O(^SRF("B",DFN,SRTN)) Q:'SRTN S SROLDDT=$P(^SRF(SRTN,0),"^",9) D CHK
  1. Q
  1. CHK ;
  1. S X1=DT,X2=-30 D C^%DTC I SROLDDT<X Q
  1. ;
  1. I $D(^SRF(SRTN,.2)),$P(^(.2),"^",12) S Y=SROLDDT D D^DIQ S SROLD("DATE")=$P(Y,"@"),SROLD=SRTN
  1. Q