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

SDWLR.m

Go to the documentation of this file.
SDWLR ;;IOFO BAY PINES/TEH - WAIT LIST - SDM1 DISPOSITION;06/12/2002 ; 20 Aug 2002  2:10 PM
 ;;5.3;scheduling;**263,1015**;AUG 13 1993;Build 21
 ;
 ;
 ;
 ;
 ;
 ;
 ;
EN ;
 I '$D(^SDWL(409.3,"B",DFN)) Q
 N DA,SDWLCOM
 S SDWLERR=0,SDWLCN=0
 D SB0 G END:'SDWLASK
 W !!,"THIS PATIENT IS CURRENTLY ON THE WAITING LIST FOR THIS CLINIC/SPECIALTY"
 S X=$G(^SDWL(409.3,SDWLDA,0)),SDWLIN=$P(X,U,3),SDWLCL=$P(X,U,4),SDWLTY=$P(X,U,5),SDWLPRI=$P(X,U,11)
 S SDWLDSP=$P(X,U,17)
 S SDWLDT=$P(X,U,16),SDWLTYN=$$EXTERNAL^DILFD(409.3,4,,SDWLTY),SDWLPRIN=$$EXTERNAL^DILFD(409.3,10,,SDWLPRI)
 S SDWLSTO=$P(X,U,22),SDWLSPO=$P(X,U,23),SDWLSSO=$P(X,U,24),SDWLSCO=$P(X,U,25)
 S SDWLST=$P(X,U,6),SDWLSP=$P(X,U,7),SDWLSS=$P(X,U,8),SDWLSC=$P(X,U,9),SDWLWR="" D
 .I SDWLST'="" S SDWLWR=$$EXTERNAL^DILFD(409.3,5,,SDWLST)
 .I SDWLSTO["Y" S SDWLWR="OPEN"
 .I SDWLSP'="" S SDWLWR=$$EXTERNAL^DILFD(409.3,6,,SDWLSP)
 .I SDWLSPO["Y" S SDWLWR="OPEN"
 .I SDWLSS'="" S SDWLWR=$$EXTERNAL^DILFD(409.3,7,,SDWLSS)
 .I SDWLSSO["Y" S SDWLWR="OPEN"
 .I SDWLSC'="" S SDWLWR=$$EXTERNAL^DILFD(409.3,8,,SDWLSC)
 .I SDWLSCO["^" S SDWLWR="OPEN"
 S YY=$E(SDWLDT,1,3)+1700,YY=$E(YY,3,4),MM=$E(SDWLDT,4,5),DD=$E(SDWLDT,6,7),SDWLDTP=MM_DD_YY
 S SDWLCLN="" I $D(^SC(+SDWLCL,0)) S SDWLCLN=$$GET1^DIQ(44,SDWLCL_",",1,,)
 S SDWLINN=$E($P($G(^DIC(4,+SDWLIN,0)),U,1),1,8)
 S SDWLDIS=$P($G(^SDWL(409.3,SDWLDA,"DIS")),U,3),SDWLDISN=$$EXTERNAL^DILFD(409.3,21,,SDWLDIS)
 W !,$E(SDWLTYN,1,14),?22,SDWLPRI,?25,$E(SDWLWR,1,19),?51,$E(SDWLINN,1,14) W:$D(SDWLDISC) ?67,SDWLDSP
 W ?73,SDWLDTP
 W !,"DO YOU WISH TO REMOVE FROM LIST " S %=1
 D YN^DICN I %=1 D SB1 Q
 K DIR,X
 S DIR(0)="S0^1:APPOINTMENT CRITERIA NOT MEET;2:PATIENT WANT ANOTHER APPOINTMENT;3:PROVIDER WANTS ANOTHER APPOINTMENT;4:OTHER"
 S DIR("L",1)="SELECT ONE OF THE FOLLOWING REASONS:",DIR("L",2)=""
 S DIR("L",3)="1. APPOINTMENT CRITERIA NOT MEET",DIR("L",4)="2. PATIENT WANTS ANOTHER APPOINTMENT"
 S DIR("L",5)="3. PROVIDER WANTS ANOTHER APPOINTMENT",DIR("L")="4. OTHER"
 D ^DIR
 S SDWLX=$S(X="O":X="0",X="o":X=4,X="pr":X="PR",X="p":"P",X="a":"A",X=1:"A",X=2:"P",X=3:"PR",X=4:"O",X["A":"A",X="P":"P",X["^":"^",X="":"")
 G EN:SDWLX["^",END:SDWLX=""
 I SDWLX="O" D
 .S DIR(0)="FAO^^",DIR("A")="Comments: " D ^DIR Q:X["^"
 .S SDWLCOM=X,DA=SDWLDA,DIE="^SDWL(409.3,",DR="18.1////^S X=SDWLCOM" D ^DIE
 S DA=SDWLDA
 S DIE="^SDWL(409.3,",DR="18////^S X=SDWLX" D ^DIE
 S DR="17////^S X=DUZ" D ^DIE
 S DR="16////^S X=DT" D ^DIE
 K SDWLERR,DIR,DR,DIE,X,SDWLX,SDWLDSS,SDWLASK,SDWLDA,SDWLCOM
 Q
SB0 ;-Screen Appointment for valid clinic and/or service/specialty.
 S SDWLDSS=+$P(^SC(+SC,0),U,7),SDWLASK=0
 S SDWLDA="" F  S SDWLDA=$O(^SDWL(409.3,"B",DFN,SDWLDA)) Q:SDWLDA=""  S SDWLDA(SDWLDA)=""
 I $D(^SDWL(409.3,"SC",+SC)) S SDWLDA="" F  S SDWLDA=$O(SDWLDA(SDWLDA)) Q:SDWLDA=""  I $D(^SDWL(409.3,"SC",+SC,SDWLDA)) S SDWLASK=1,SDWLDAV=SDWLDA Q
 I $D(^SDWL(409.3,"SS",DFN,SDWLDSS)) S SDWLDA="" F  S SDWLDA=$O(SDWLDA(SDWLDA)) Q:SDWLDA=""  I $D(^SDWL(409.3,"SS",DFN,SDWLDSS,SDWLDA)) S SDWLASK=2,SDWLDAV=SDWLDA
 I $D(SDWLDAV) S SDWLDA=SDWLDAV K SDWLDAV
 Q
SB1 ;-wants to remove patient from the wait list. Set Disposition
 I $D(SDWLDA),'$D(^SDWL(409.3,+SDWLDA)),SDWLERR=1 Q
 S DA=SDWLDA
 S DIE="^SDWL(409.3,",DR="19////^S X=DT" D ^DIE
 S DR="20////^S X=DUZ" D ^DIE
 S DR="21////^S X=""SA""" D ^DIE
 S DR="23////^S X=""C""" D ^DIE
 I SDWLASK=1 K ^SDWL(409.3,"SC",SC,SDWLDA)
 I SDWLASK=2 K ^SDWL(409.3,"SS",DFN,SDWLDSS,SDWLDA)
END K SDWLDT,SDWLIN,SDWLCL,SDWLTY,SDWLPRI,SDWLPRIN,SDWLTYN,SDWLST,SDWLSP,SDWLCLN,SDWLDTP,SDWLINN,SDWLDISN
 K SDWLPRI,SDWLWR,SDWLDA,SDWLSC,SDWLSS
 Q