1 | YTQKIL ;ASF/ALB MHA3 DELETES ; 10/31/07 12:54pm
|
---|
2 | ;;5.01;MENTAL HEALTH;**85**;Dec 30, 1994;Build 48
|
---|
3 | Q
|
---|
4 | EN ;
|
---|
5 | N DIR,DIRUT,YS71,YSAD,YSANS,YSASNOW,YSGIVEN,YSORD,YSORDID,YSSITE,YSTST,G,N,X,YSGIVEFM
|
---|
6 | I '$D(^YTT(601.84,"C",YSDFN)) W !,"No MHA3 data exits for this patient." H 4 Q
|
---|
7 | K YSDATA
|
---|
8 | S YS("DFN")=YSDFN,YS("COMPLETE")="Y" D ADMINS^YTQAPI5(.YSDATA,.YS)
|
---|
9 | S N=2 F S N=$O(YSDATA(N)) Q:N'>0!($G(DIRUT)) D
|
---|
10 | . S G=YSDATA(N)
|
---|
11 | . S YSAD=$P(G,U) Q:YSAD'?1N.N ;-->out
|
---|
12 | . S YSTST=$P(G,U,2)
|
---|
13 | . S YSGIVEN=$$GET1^DIQ(601.84,YSAD_",",3)
|
---|
14 | . S YSGIVEFM=$$GET1^DIQ(601.84,YSAD_",",3,"I")
|
---|
15 | . S YSGIVEFM=$$FMTHL7^XLFDT(YSGIVEFM)
|
---|
16 | . S YSORD=$$GET1^DIQ(601.84,YSAD_",",5)
|
---|
17 | . S YSORDID=$$GET1^DIQ(601.84,YSAD_",",5,"I")
|
---|
18 | . S YS71=$O(^YTT(601.71,"B",YSTST,0))
|
---|
19 | . W !,YSTST_" on "_YSGIVEN_" by "_YSORD
|
---|
20 | . S DIR(0)="Y",DIR("A")="Delete",DIR("B")="No" D ^DIR
|
---|
21 | . D:Y EMAIL,DEL
|
---|
22 | Q
|
---|
23 | DEL ;delete admin
|
---|
24 | S DIR(0)="Y",DIR("A")="Are you sure",DIR("B")="No" D ^DIR
|
---|
25 | Q:'Y
|
---|
26 | K DIK
|
---|
27 | S DIK="^YTT(601.84,",DA=YSAD D ^DIK
|
---|
28 | S YSANS=0 F S YSANS=$O(^YTT(601.85,"AD",YSAD,YSANS)) Q:YSANS'>0 D
|
---|
29 | . S DIK="^YTT(601.85,",DA=YSANS D ^DIK
|
---|
30 | W " ***Deleted"
|
---|
31 | Q
|
---|
32 | EMAIL ;send message
|
---|
33 | N XMDUZ,XMTEXT,XMY,XMZ,XMSUB
|
---|
34 | K ^TMP($J,"YTQKIL")
|
---|
35 | S YSSITE=$$KSP^XUPARAM("INST")
|
---|
36 | S ^TMP($J,"YTQKIL",1,0)="#Delete#"_U_YSSITE_U_YSAD_U_YSTST_U_YS71_U_YSGIVEN_U_YSGIVEFM_U_YSORD_U_YSORDID
|
---|
37 | S ^TMP($J,"YTQKIL",2,0)=" "
|
---|
38 | S ^TMP($J,"YTQKIL",3,0)="Please delete this entry."
|
---|
39 | ;
|
---|
40 | XMIT ;transmit
|
---|
41 | K XMZ S %DT="T",X="NOW" D ^%DT,DD^%DT
|
---|
42 | S YSASNOW=Y
|
---|
43 | K XMY S XMY("mhadelete@mentalhealth.med.va.gov")=""
|
---|
44 | S XMDUZ=DUZ,XMTEXT="^TMP($J,""YTQKIL"",",XMSUB="Delete mha3 Admin from: "_YSSITE_" on "_YSASNOW D ^XMD
|
---|
45 | K ^TMP($J,"YTQKIL")
|
---|
46 | Q
|
---|