[613] | 1 | DGPTMSGD ;ALB/JDS - PTF MULTIMESSAGE DELETE ; 19 DEC 84@ 0800
|
---|
| 2 | ;;5.3;Registration;;Aug 13, 1993
|
---|
| 3 | D LO^DGUTL
|
---|
| 4 | EN S Z="^PATIENT^NUMBER" R !!,"DELETE BY [P]ATIENT OR [N]UMBER: ",X:DTIME G Q:X=""!('$T)!(X="^") D IN^DGHELP G:%'=-1 @X W !!,"Enter 'P' to delete PTF messages by patient",!," or 'N' to delete PTF messages by number" G EN
|
---|
| 5 | P S DIC="^DPT(",DIC(0)="QEAM",DIC("S")="I $D(^DGM(""PT"",+Y))",DIC("A")="Select Patient whose messages you wish to check off: " D ^DIC G Q:+Y'>0 S DGPTF=+Y K DIC S %DT="XT",X="N" D ^%DT S NOW=+Y D READ G EN
|
---|
| 6 | LOOP F I=0:0 S I=$O(^DGM("PT",DGPTF,I)) Q:I'>0 W ! R:Z>20 "'^' TO STOP",X:DTIME D BACK:Z>20 Q:X["^" W I,?10 I $D(^DGM(I,"M",0)) D MES1
|
---|
| 7 | READ R !!,"Enter the message #'s you wish to release: ",X:DTIME G Q:X']""!('$T) G @($S(X["^":"Q",X["-":"THRU",X[",":"PICK",X?.N:"ONE",X="ALL"!(X="all"):"ALL",1:"HELP"))
|
---|
| 8 | THRU S DGFR=$P(X,"-",1),DGTO=$P(X,"-",2) D DEL G Q
|
---|
| 9 | DEL S DIK="^DGM(" F I=DGFR:1:DGTO I $D(^DGM(I,0)) I 'DGPTF!($P(^(0),U,2)=DGPTF) S DA=I D ^DIK W !,I,?10,"** Deleted **"
|
---|
| 10 | Q
|
---|
| 11 | ONE S DGFR=X,DGTO=X D DEL G Q
|
---|
| 12 | PICK S J=1,A=X
|
---|
| 13 | PICK1 S DGFR=$P(A,",",J) Q:DGFR'>0 S DGTO=DGFR D DEL S J=J+1 G PICK1
|
---|
| 14 | G Q
|
---|
| 15 | HELP W !!,"Enter:",!?10,"ALL to release all messages",!?10,"# to release a specific message",!?10,"#-# to release a range of messages",!?10,"#,#,#... to release a group of messages"
|
---|
| 16 | S Z=10 I X["??" W !,"Choose From:" G LOOP
|
---|
| 17 | W !!,"Do you want to see a list of messages for this patient" S %=1 D YN^DICN G Q:%<0,HELP:'%,LOOP:%'=2 G READ
|
---|
| 18 | ALL S J=0,DGALL=""
|
---|
| 19 | ALL1 S J=$O(^DGM("PT",DGPTF,J)) G Q:J'>0 S DGFR=J,DGTO=J D DEL G ALL1
|
---|
| 20 | Q
|
---|
| 21 | BACK S Z=0 F J=1:1:12 W $C(8)
|
---|
| 22 | Q
|
---|
| 23 | MES1 F J=0:0 S J=$O(^DGM(I,"M",J)) Q:J'>0 S L=^(J,0) W:J>1 ! D MESS
|
---|
| 24 | Q
|
---|
| 25 | MESS F K=0:1:2 I $L(L)>(65*K) W:K ! W ?13,$E(L,1+(K*65),65*(K+1)) S Z=Z+1
|
---|
| 26 | Q
|
---|
| 27 | N S DGPTF=0 R !!,"Enter the message #'s you wish to release: ",X:DTIME G Q:('$T) G @($S(X="":"EN",X["^":"Q",X["-":"THRU",X[",":"PICK",X?.N:"ONE",1:"HLPN"))
|
---|
| 28 | HLPN W !!,"Enter:",!?10,"# to release a specific message",!?10,"#-# to release a range of messages",!?10,"#,#,#... to release a group of messages",!
|
---|
| 29 | S DIC="^DGM(",DIC(0)="M" S:X'["?" X="?" D ^DIC G N
|
---|
| 30 | Q K %Y,L,K,DA,Z,Y,%,DGPTF,J,I,X,A,DIK,DIC,%DT,DGFR,DGTO Q
|
---|