source: WorldVistAEHR/trunk/r/WOMENS_HEALTH-WV/WV14PST1.m

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

initial load of WorldVistAEHR

File size: 5.4 KB
Line 
1WV14PST1 ;HCIOFO/FT-WV*1*14/Print Sexual Trauma Data Transfer to DG MST Module (cont.) ;4/3/01 16:11
2 ;;1.0;WOMEN'S HEALTH;**14**;Sep 30, 1998
3 ;
4EMAIL ; Create report in mail message
5 S WVDASHES=$$REPEAT^XLFSTR("-",79) ;line of dashes
6 S WVSPACES=$$REPEAT^XLFSTR(" ",79) ;line of spaces
7 S WVDATE=$$FMTE^XLFDT($$NOW^XLFDT(),"2") ;current date & time
8 S WVUSER=$$PERSON^WVUTL1(DUZ) ;user's name
9 D INTRO
10 D HDRY
11 I '$D(^TMP($J,"WVYES")) D NONEY
12 I $D(^TMP($J,"WVYES")) D YES
13 D HDRN
14 I '$D(^TMP($J,"WVNO")) D NONEN
15 I $D(^TMP($J,"WVNO")) D NO
16 D SEND
17 Q
18HDRY ; header for entries added to MST
19 S ^TMP($J,"WVMSG",+$$LINE())=" "
20 S ^TMP($J,"WVMSG",+$$LINE())="Patient Data Added to MST Module"
21 S ^TMP($J,"WVMSG",+$$LINE())="Report Run by: "_WVUSER
22 S ^TMP($J,"WVMSG",+$$LINE())=" Run Date: "_WVDATE
23 S ^TMP($J,"WVMSG",+$$LINE())=$$FILLER(55,0)_"DETERMINING"
24 S WVX=" PATIENT"
25 S WVX=WVX_$$FILLER(34,$L(WVX))_"WH VALUE"
26 S WVX=WVX_$$FILLER(44,$L(WVX))_"MST VALUE"
27 S WVX=WVX_$$FILLER(55,$L(WVX))_"PROVIDER"
28 S ^TMP($J,"WVMSG",+$$LINE())=WVX
29 S ^TMP($J,"WVMSG",+$$LINE())=WVDASHES
30 Q
31HDRN ; header for entries not added to MST
32 S ^TMP($J,"WVMSG",+$$LINE())=" "
33 S ^TMP($J,"WVMSG",+$$LINE())=" "
34 S ^TMP($J,"WVMSG",+$$LINE())="Patient Data Not Added to MST Module"
35 S ^TMP($J,"WVMSG",+$$LINE())="Report Run by: "_WVUSER
36 S ^TMP($J,"WVMSG",+$$LINE())=" Run Date: "_WVDATE
37 S ^TMP($J,"WVMSG",+$$LINE())=" "
38 S WVX=" PATIENT"
39 S WVX=WVX_$$FILLER(34,$L(WVX))_"WH VALUE"
40 S WVX=WVX_$$FILLER(44,$L(WVX))_"REASON DATA NOT ADDED"
41 S ^TMP($J,"WVMSG",+$$LINE())=WVX
42 S ^TMP($J,"WVMSG",+$$LINE())=WVDASHES
43 Q
44NONEY ; no wh patient data was added to MST module
45 S ^TMP($J,"WVMSG",+$$LINE())="<No Women's Health patient data was added to the MST module>"
46 S ^TMP($J,"WVMSG",+$$LINE())="<of the Registration package.>"
47 Q
48NONEN ; no unsuccessful attempts to add MST data
49 S ^TMP($J,"WVMSG",+$$LINE())="<All Women's Health patient data that could be added to the MST>"
50 S ^TMP($J,"WVMSG",+$$LINE())="<module was added successfully.>"
51 Q
52YES ; List patient data successfully added to MST module
53 S (WVMGRN,WVMGRO)=""
54 F S WVMGRN=$O(^TMP($J,"WVYES",WVMGRN)) Q:WVMGRN="" S WVMGR=0 F S WVMGR=$O(^TMP($J,"WVYES",WVMGRN,WVMGR)) Q:'WVMGR D
55 .I WVMGRN'=WVMGRO S ^TMP($J,"WVMSG",+$$LINE())="CASE MGR: "_WVMGRN S WVMGRO=WVMGRN ;identify cm
56 .S WVNAME=""
57 .F S WVNAME=$O(^TMP($J,"WVYES",WVMGRN,WVMGR,WVNAME)) Q:WVNAME="" S WVDFN=0 F S WVDFN=$O(^TMP($J,"WVYES",WVMGRN,WVMGR,WVNAME,WVDFN)) Q:'WVDFN D
58 ..S WVNODE=^TMP($J,"WVYES",WVMGRN,WVMGR,WVNAME,WVDFN)
59 ..S WVST=$P(WVNODE,U,1),WVDGMST=$P(WVNODE,U,2),WVPROV=$P(WVNODE,U,3)
60 ..S WVSSN=$P(WVNODE,U,4)
61 ..S WVX=" "_WVNAME
62 ..S WVX=WVX_$$FILLER(34,$L(WVX))_WVST
63 ..S WVX=WVX_$$FILLER(44,$L(WVX))_WVDGMST
64 ..S WVX=WVX_$$FILLER(54,$L(WVX))_WVPROV
65 ..S ^TMP($J,"WVMSG",+$$LINE())=WVX
66 ..S ^TMP($J,"WVMSG",+$$LINE())=" ("_WVSSN_")"
67 ..Q
68 .Q
69 Q
70NO ; List patient data not added to MST module and reason it wasn't added
71 S (WVMGRN,WVMGRO)=""
72 F S WVMGRN=$O(^TMP($J,"WVNO",WVMGRN)) Q:WVMGRN="" S WVMGR=0 F S WVMGR=$O(^TMP($J,"WVNO",WVMGRN,WVMGR)) Q:'WVMGR D
73 .I WVMGRN'=WVMGRO D
74 ..S ^TMP($J,"WVMSG",+$$LINE())="CASE MGR: "_WVMGRN S WVMGRO=WVMGRN ;identify cm
75 .S WVNAME=""
76 .F S WVNAME=$O(^TMP($J,"WVNO",WVMGRN,WVMGR,WVNAME)) Q:WVNAME="" S WVDFN=0 F S WVDFN=$O(^TMP($J,"WVNO",WVMGRN,WVMGR,WVNAME,WVDFN)) Q:'WVDFN D
77 ..S WVNODE=^TMP($J,"WVNO",WVMGRN,WVMGR,WVNAME,WVDFN)
78 ..S WVST=$P(WVNODE,U,1),WVSSN=$P(WVNODE,U,4),WVREASON=$P(WVNODE,U,5)
79 ..S WVX=" "_WVNAME
80 ..S WVX=WVX_$$FILLER(34,$L(WVX))_WVST
81 ..S WVX=WVX_$$FILLER(44,$L(WVX))_WVREASON
82 ..S ^TMP($J,"WVMSG",+$$LINE())=WVX
83 ..S ^TMP($J,"WVMSG",+$$LINE())=" ("_WVSSN_")"
84 ..Q
85 .Q
86 Q
87LINE() ; Increment line counter by 1
88 S WVLINE=+$G(WVLINE)+1
89 Q WVLINE
90 ;
91FILLER(L,S) ; Returns the number of spaces desired.
92 ; L - larger number
93 ; S - smaller number
94 ; WVSPACES must be defined.
95 I '$D(WVSPACES) Q ""
96 Q $E(WVSPACES,1,L-S)
97 ;
98SEND ; Send mail message to case managers
99 S XMDUZ=.5 ;message sender
100 S XMSUB="Women's Health patch #14 installed"
101 S XMTEXT="^TMP($J,""WVMSG"","
102 D ^XMD
103 Q
104INTRO ; Set message introduction text
105 S ^TMP($J,"WVMSG",+$$LINE())="Patch WV*1*14 for the Women's Health (WH) package was installed. This patch"
106 S ^TMP($J,"WVMSG",+$$LINE())="modifies the way the WH package stores and retrieves Military Sexual Trauma"
107 S ^TMP($J,"WVMSG",+$$LINE())="(MST) data. MST data that was stored in the WH package is now stored in the"
108 S ^TMP($J,"WVMSG",+$$LINE())="Registration package. This message identifies WH patients whose MST data was"
109 S ^TMP($J,"WVMSG",+$$LINE())="successfully added to the Registration package and those WH patients whose"
110 S ^TMP($J,"WVMSG",+$$LINE())="MST data could not be added to the Registration package. If the patient's"
111 S ^TMP($J,"WVMSG",+$$LINE())="WH sexual trauma status matched the MST status in the Registration package,"
112 S ^TMP($J,"WVMSG",+$$LINE())="then no additional entry was made in the Registration package. MST data was"
113 S ^TMP($J,"WVMSG",+$$LINE())="transferred to the Registration package for veterans only. All MST data"
114 S ^TMP($J,"WVMSG",+$$LINE())="has been deleted from the WH package. Civilian Sexual Trauma (CST) data"
115 S ^TMP($J,"WVMSG",+$$LINE())="continues to be stored in the WH package."
116 S ^TMP($J,"WVMSG",+$$LINE())=" "
117 S ^TMP($J,"WVMSG",+$$LINE())="To see what other changes were made to the WH reports and displays, please"
118 S ^TMP($J,"WVMSG",+$$LINE())="contact your IRMS support person for the WH User Manual changes concerning"
119 S ^TMP($J,"WVMSG",+$$LINE())="this patch."
120 Q
Note: See TracBrowser for help on using the repository browser.