source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SDASO.m@ 1259

Last change on this file since 1259 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.1 KB
Line 
1SDASO ;MAN/GRR - APPEND TESTS TO PENDING APPOINTMENT ; 22 DEC 83 11:02 am
2 ;;5.3;Scheduling;;Aug 13, 1993
3 S:'$D(DTIME) DTIME=300 D:'$D(DT) DT^SDUTL S HDT=DT,APL=""
4RD S DIC="^DPT(",DIC(0)="AEQM",CNT=0 D ^DIC G:"^"[X END I Y<0 W !,*7,*7,"PATIENT NOT FOUND",*7,*7 G RD
5 S DFN=+Y,NAME=$P(Y,"^",2) W ! I $N(^DPT(DFN,"S",HDT))'>0 G NO
6 S NDT=HDT,L=0 F J=1:1 S NDT=$N(^DPT(DFN,"S",NDT)) Q:NDT'>0 I $S($P(^(NDT,0),"^",2)']"":1,$P(^(0),"^",2)["I":1,1:0) D CHKSO S SC=+^(0),L=L+1 D FLEN S Z(L)=NDT_"^"_SC_"^"_APL_"^"_COMMENT
7 G:L'>0 NO F ZZ=1:1:L W !!,ZZ,") " S Y=$P($P(Z(ZZ),"^",1),".",1) D DT^SDM0 S X=$P(Z(ZZ),"^",1) X ^DD("FUNC",2,1) W " ",$J(X,8)," (",$P(Z(ZZ),"^",3)," MINUTES) ",$P(^SC($P(Z(ZZ),"^",2),0),"^",1)," ",$P(Z(ZZ),"^",4)
8WH R !!,"SCHEDULE TESTS FOR WHICH NUMBERED APPOINTMENT: ",APP:DTIME G:APP=""!(APP="^") RD I APP?."?" D HLP G WH
9 I APP'?1N.N W !,"INVALID ENTRY, MUST BE NUMERIC" G WH
10 I $L(APP)>5 W !,"ENTER A NUMBER BETWEEN 1 AND ",ZZ G WH
11 I APP<1!(APP>ZZ) W !,"ENTER A NUMBER BETWEEN 1 AND ",ZZ G WH
12 I $$CO(DFN,+Z(APP),"add") G WH
13 S SD=$P(Z(APP),"^",1) S CNT=CNT+1,Y=SD D DTS^SDUTL S SODT=Y,SDWR=0,(LAB,XRAY,EKG)="" D ORD^SDM3 G RD
14NOPE W:'CNT !,*7,"NOTHING SCHEDULED" G RD
15NO W !,"NO PENDING APPOINTMENTS",*7,*7,*7
16 G RD
17FLEN I $D(^SC(SC,"S",NDT)) F ZL=0:0 S ZL=$N(^SC(SC,"S",NDT,1,ZL)) Q:ZL<0 I +^(ZL,0)=DFN S APL=$P(^SC(SC,"S",NDT,1,ZL,0),"^",2) Q
18 Q
19CHKSO S COMMENT="",SDAPAV=^(0),SDANAM="LAB"_U_"XRAY"_U_"EKG" F SDJ=3,4,5 I $P(SDAPAV,"^",SDJ)]"" S:$L(COMMENT) COMMENT=COMMENT_"," S COMMENT=COMMENT_$S(SDJ=3:"LAB",SDJ=4:"XRAY",1:"EKG"),@($P(SDANAM,U,SDJ-2))=$P(SDAPAV,U,SDJ)
20 ;NAKED REFERENCE - ^DPT(DFN,"S",Date,0)
21 S:$L(COMMENT) COMMENT="("_COMMENT_" TEST SCHEDULED)" Q
22END K CNT,NDT,L,J,HDT,SC,SD,APL,COMMENT,Z,ZZ,APP,ZL,SDJ,X,%DT,DIC,DFN,NAME,Y,POP,SDAPAV,SDTY Q
23HLP W !,"Enter the number that corresponds to the appointment." Q
24 ;
25CO(DFN,SDT,ACTION) ; -- can action be performed ; has appt been co'ed
26 N Y
27 S Y=0
28 I $P($G(^SCE(+$P(^DPT(DFN,"S",SDT,0),U,20),0)),U,12)=2 D
29 .S Y=1
30 .W !,*7,"This appointment has been checked out!"
31 .W !,"Please use Add/Edit stop code functionality to ",ACTION," the appropriate test."
32 Q Y
Note: See TracBrowser for help on using the repository browser.