source: FOIAVistA/trunk/r/MENTAL_HEALTH-YS-RUCL-YI-YT/YTQKIL.m@ 711

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

initial load of FOIAVistA 6/30/08 version

File size: 1.6 KB
Line 
1YTQKIL ;ASF/ALB MHA3 DELETES ; 10/31/07 12:54pm
2 ;;5.01;MENTAL HEALTH;**85**;Dec 30, 1994;Build 48
3 Q
4EN ;
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
23DEL ;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
32EMAIL ;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 ;
40XMIT ;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
Note: See TracBrowser for help on using the repository browser.