source: FOIAVistA/trunk/r/SURGERY-SR/SR95UTL.m@ 1404

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

initial load of FOIAVistA 6/30/08 version

File size: 7.4 KB
Line 
1SR95UTL ;BIR/ADM-Utility routine for patch SR*3*95; [09/01/00 10:33 AM ]
2 ;;3.0; Surgery ;**95**;24 Jun 93
3 ;
4 ; Reference to ^DGPM("APTT1" supported by DBIA #565
5 ;
6 Q
7PRE ; pre-install action for SR*3*95
8 ; add new entried to file 136.5
9 S ^SRO(136.5,33,0)="TRACHEOSTOMY^^^Y",^SRO(136.5,33,1,0)="^^4^4^3000711^"
10 S ^SRO(136.5,33,1,1,0)="This category should be selected if a procedure to cut into the trachea"
11 S ^SRO(136.5,33,1,2,0)="and insert a tube to overcome tracheal obstruction, or to facilitate"
12 S ^SRO(136.5,33,1,3,0)="extended mechanical ventilation, was performed during the postoperative"
13 S ^SRO(136.5,33,1,4,0)="hospitalization."
14 S ^SRO(136.5,34,0)="NEW MECHANICAL CIRCULATORY SUPPORT^^^Y"
15 S ^SRO(136.5,34,1,0)="^^5^5^3000711^"
16 S ^SRO(136.5,34,1,1,0)="This category should be selected if the patient left the operating suite"
17 S ^SRO(136.5,34,1,2,0)="while dependent upon IABP or VAD for circulatory support postoperatively,"
18 S ^SRO(136.5,34,1,3,0)="even if the pump is only used for a short time postoperatively. However,"
19 S ^SRO(136.5,34,1,4,0)="this category is only appropriate if the patient did not enter the OR"
20 S ^SRO(136.5,34,1,5,0)="with mechanical circulatory support."
21 S ^SRO(136.5,"B","TRACHEOSTOMY",33)=""
22 S ^SRO(136.5,"B","NEW MECHANICAL CIRCULATORY SUP",34)=""
23 S ^SRO(136.5,0)="PERIOPERATIVE OCCURRENCE CATEGORY^136.5I^34^34"
24 ; add new entries to file 139.2
25 I $G(^SRO(139.2,21,0))'="HDL" D
26 .F DA=21,22,23,24 S DIK="^SRO(139.2," D ^DIK
27 .S ^SRO(139.2,21,0)="HDL",^SRO(139.2,21,2)=72
28 .S ^SRO(139.2,22,0)="TRIGLYCERIDE",^SRO(139.2,22,2)=72
29 .S ^SRO(139.2,23,0)="LDL",^SRO(139.2,23,2)=72
30 .S ^SRO(139.2,24,0)="CHOLESTEROL",^SRO(139.2,24,2)=72
31 .S DIK="^SRO(139.2,",DIK(1)=".01" D ENALL^DIK K DA,DIK
32LETR ; add text of 30-day letter to file 133
33 N I,SRDIV,SRLINE,X S SRDIV=0 F S SRDIV=$O(^SRO(133,SRDIV)) Q:'SRDIV D
34 .S ^SRO(133,SRDIV,5,0)="^133.031^40^40^3000818^^^^"
35 .F I=1:1:40 S X=$T(DAY30+I),SRLINE=$P(X,";;",2) S ^SRO(133,SRDIV,5,I,0)=SRLINE
36CLEAN ; delete file 132.8 if test site
37 I $D(^SRO(132.8)) S DIU="^SRO(132.8,",DIU(0)="DT" D EN^DIU2
38 Q
39EN1 ; ASA Class conversion from set of codes to file
40 S SRTN=0 F S SRTN=$O(^SRF(SRTN)) Q:'SRTN S (SRASA,SRNEW)=$P($G(^SRF(SRTN,1.1)),"^",3) I SRASA'="" D
41 .I SRASA=1!(SRASA=2)!(SRASA=3)!(SRASA=4)!(SRASA=5) Q
42 .I SRASA="1E" S SRNEW=7
43 .I SRASA="2E" S SRNEW=8
44 .I SRASA="3E" S SRNEW=9
45 .I SRASA="4E" S SRNEW=10
46 .I SRASA="5E" S SRNEW=11
47 .I SRNEW'=SRASA S $P(^SRF(SRTN,1.1),"^",3)=SRNEW
48 K SRASA,SRNEW,SRTN
49MSG ; send mail message notification that conversion is completed
50 S XMY(DUZ)="",XMSUB="SR*3*95 - ASA Class Conversion Completed"
51 S SRTXT(1)="Surgery ASA Class conversion is completed."
52 S XMDUZ=.5,XMTEXT="SRTXT("
53 N I D ^XMD S ZTREQ="@"
54 Q
55QR ; transmit quarterly reports for FY2000
56 S (SRFLG,SRT)=1 D NOW^%DTC S SRNOW=$E(%,1,12)
57 S SRSTART=2991001,SREND=2991231 D TSK
58 S SRSTART=3000101,SREND=3000331 D TSK
59 S SRSTART=3000401,SREND=3000630 D TSK
60 I DT>3001113 S SRSTART=3000701,SREND=3000930 D TSK
61 S ZTREQ="@"
62 Q
63TSK S ZTDTH=SRNOW,ZTIO="",ZTDESC="Surgery Quarterly Report",(ZTSAVE("SRSTART"),ZTSAVE("SREND"),ZTSAVE("SRFLG"),ZTSAVE("SRT"))="",ZTRTN="EN^SROQT" D ^%ZTLOAD
64 Q
65POST ; post-install action for SR*3*95
66 D NOW^%DTC S (SRNOW,ZTDTH)=$E(%,1,12),ZTRTN="EN1^SR95UTL",ZTDESC="Surgery ASA Class Conversion",ZTIO="" D ^%ZTLOAD
67 D MES^XPDUTL(" ASA Class conversion process queued...")
68 ;
69 N SRD S SRD=^XMB("NETNAME") I SRD["TST."!(SRD["TEST")!(SRD["UTL.")!(SRD["TRAIN")!(SRD[".IHS.GOV")!(SRD["CPRS") Q
70 S ZTDTH=SRNOW,ZTRTN="TN1^SR95UTL",ZTDESC="Surgery Risk Assessment Retransmission",ZTIO="" D ^%ZTLOAD
71 S ZTDTH=SRNOW,ZTRTN="QR^SR95UTL",ZTDESC="Surgery Quarterly Report",ZTIO="" D ^%ZTLOAD
72 K SRNOW
73 Q
74TN1 ; transmit historical data
75 K ^TMP("SRA",$J) S SRASITE=+$P($$SITE^SROVAR,"^",3),SRACNT=1
76 S SRADFN=0 F S SRADFN=$O(^SRF("ARS","C","T",SRADFN)) Q:'SRADFN S SRTN=0 F S SRTN=$O(^SRF("ARS","C","T",SRADFN,SRTN)) Q:'SRTN S ^TMP("SRA",$J,SRTN)=""
77 S SRTN=0 F S SRTN=$O(^TMP("SRA",$J,SRTN)) Q:'SRTN D STUFF
78 I SRACNT=1 G END
79 D TMSG
80END K ^TMP("SRA",$J),DA,DFN,I,ISC,NAME,SR,SRA,SRACNT,SRADFN,SRACE,SRASITE,SRD,SRSDATE,SRTN,X,XMSUB,XMTEXT,VA S ZTREQ="@"
81 Q
82STUFF ; stuff entries into ^TMP("SRA"
83 S SR=^SRF(SRTN,0),SRA(208)=$G(^SRF(SRTN,208)),DFN=$P(SR,"^"),SRSDATE=$P(SR,"^",9) D DEM^VADPT
84 N VAINDT,X,SRDISTYP,SRPTF,SRRES,SRICD9,SRPICD9,SRX,SRY
85 S SRACE=$P(SRA(208),"^",10) I 'SRACE S SRX=$P(VADM(8),"^") I SRX K DA,DIC,DIQ,DR S DIC=10,DR=2,DA=SRX,DIQ="SRY",DIQ(0)="I" D EN^DIQ1 S SRACE=SRY(10,SRX,2,"I")
86 S X=$P(SRA(208),"^",15) D:X="" DSCHG S VAINDT=X-.0001
87 D INP^VADPT S SRPTF=VAIN(10)
88 S SRRES="" D RPC^DGPTFAPI(.SRRES,SRPTF)
89 S SRPICD9=$P($G(SRRES(1)),U,3)
90 I '$D(SRRES(2)) S SRICD9="^^^^^^^^"
91 E S SRICD9="" F I=1:1:$L(SRRES(2),"^") S X=$P(SRRES(2),"^",I) D
92 .I I=1 S SRICD9=X Q
93 .S SRICD9=SRICD9_"^"_X
94 S X=$$SITE^SROUTL0(SRTN),SRDIV=$S(X:$P(^SRO(133,X,0),"^"),1:""),SRP(3)=$S(SRDIV:$$GET1^DIQ(4,SRDIV,99),1:SRASITE)
95 S X=$P($G(SRRES(1)),U)
96 S SRDISTYP=$S(X="REGULAR":1,X="NBC OR WHILE ASIH":2,X="EXPIRATION 6 MONTH LIMIT":3,X="IRREGULAR":4,X="TRANSFER":5,X="DEATH WITH AUTOPSY":6,X="DEATH WITHOUT AUTOPSY":7,1:"")
97 S ^TMP("SRA",$J,SRACNT)=SRASITE_"^"_SRTN_"^1^"_$E(SRSDATE,1,7)_"^"_VA("PID")_"^"_SRP(3)_"^^"_SRACE_"^"_SRPICD9_"^",SRACNT=SRACNT+1
98 S ^TMP("SRA",$J,SRACNT)=SRASITE_"^"_SRTN_"^2^"_SRDISTYP_"^"_SRICD9_"^",SRACNT=SRACNT+1
99 Q
100DSCHG ; find discharge date
101 S VAIP("D")=SRSDATE D IN5^VADPT
102 I 'VAIP(13) S X1=$P($G(^SRF(SRTN,.2)),"^",12),X2=1 D C^%DTC S SR24=X,SRDT=$O(^DGPM("APTT1",DFN,SRSDATE)) G:'SRDT!(SRDT>SR24) NODS S VAIP("D")=SRDT D IN5^VADPT
103 I VAIP(17) S X=$E($P(VAIP(17,1),"^"),1,12) Q
104NODS S X=""
105 Q
106TMSG ; create mail message to Denver
107 S ISC=0,NAME=$G(^XMB("NETNAME")) I NAME["FORUM"!(NAME["ISC-")!($E(NAME,1,3)="ISC")!(NAME["ISC.") S ISC=1
108 I ISC S XMY("G.RISK ASSESSMENT@"_^XMB("NETNAME"))=""
109 I 'ISC S (XMY("G.CARDIAC RISK ASSESSMENTS@DENVER.VA.GOV"),XMY("G.SRCARDIAC@ISC-CHICAGO.VA.GOV"))=""
110 S SRD=^XMB("NETNAME") S XMSUB="** SR*3*95 FROM VAMC-"_SRASITE_" **",XMDUZ=$S($D(DUZ):DUZ,1:.5)
111 S XMTEXT="^TMP(""SRA"",$J," N I D ^XMD
112 Q
113DAY30 ;;
114 ;;One month ago, you had an operation at the VA Medical Center. We are
115 ;;interested in how you feel. Have you had any health problems since your
116 ;;operation ? We would like to hear from you. Please take a few minutes
117 ;;to answer these questions and return this letter in the self-addressed
118 ;;stamped envelope.
119 ;;
120 ;;Have you been to a hospital or seen a doctor for any reason since your
121 ;;operation ? ___ Yes ___ No
122 ;;
123 ;;If you answered NO, you do not need to answer any more questions. Please
124 ;;return this sheet in the self-addressed stamped envelope.
125 ;;
126 ;;If you have answered YES, please answer the following questions.
127 ;;
128 ;; 1) Have you been seen in an outpatient clinic or doctor's office ?
129 ;; ___ Yes ___ No
130 ;;
131 ;; Why did you go to the clinic or doctor's office ? ________________
132 ;;
133 ;; Where ? (name and location) _____________________ Date ? ________
134 ;;
135 ;; Who was your doctor ? ____________________________________________
136 ;;
137 ;;
138 ;; 2) Were you admitted to a hospital ? ___ Yes ___ No
139 ;;
140 ;; Why did you go to the hospital ? _________________________________
141 ;;
142 ;; Where ? (name and location) _____________________ Date ? ________
143 ;;
144 ;; Who was your doctor ? ____________________________________________
145 ;;
146 ;;
147 ;;Please return this letter whether or not you have had any medical
148 ;;problems. Your health and opinion are important to us. Thank You.
149 ;;
150 ;;Sincerely,
151 ;;
152 ;;
153 ;;Surgical Clinical Nurse Reviewer
Note: See TracBrowser for help on using the repository browser.