source: FOIAVistA/trunk/r/ONCOLOGY-ONC/ONCEDIT.m@ 1674

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

initial load of FOIAVistA 6/30/08 version

File size: 9.1 KB
Line 
1ONCEDIT ;Hines OIFO/GWB - ONCOLOGY INTER-FIELD EDITS ;09/29/00
2 ;;2.11;ONCOLOGY;**27,28,34,36,39,42,43,45,46,47**;Mar 07, 1995;Build 19
3 ;
4 N X
5 K MSG
6 S RHSP=$$GET1^DIQ(165.5,PRM,.03,"I") ;REPORTING HOSPITAL
7 S COCI=$$GET1^DIQ(165.5,PRM,.04,"I") ;CLASS OF CASE
8 S COCE=$$GET1^DIQ(165.5,PRM,.04,"E")
9 S STAT=$$GET1^DIQ(165.5,PRM,.091) ;STATUS
10 S TRSI=$$GET1^DIQ(165.5,PRM,1.2,"I") ;TYPE OF REPORTING SOURCE
11 S TRSE=$$GET1^DIQ(165.5,PRM,1.2,"E")
12 S RFAC=$$GET1^DIQ(165.5,PRM,6,"I") ;FACILITY REFERRED FROM
13 S TFAC=$$GET1^DIQ(165.5,PRM,7,"I") ;FACILITY REFERRED TO
14 S TOPI=$$GET1^DIQ(165.5,PRM,20,"I") ;PRIMARY SITE
15 S TOPE=$$GET1^DIQ(165.5,PRM,20,"E")
16 S HSTI=$$HIST^ONCFUNC(PRM) ;HISTOLOGY
17 S HSTE=$$GET1^DIQ(165.5,PRM,HSTFLD,"E")
18 S BCOD=$E(HSTI,5) ;BEHAVIOR CODE
19 S SSTI=$$GET1^DIQ(165.5,PRM,35,"I") ;SUMMARY STAGE
20 S SSTE=$$GET1^DIQ(165.5,PRM,35,"E")
21 ;
22IF02 S SDX=""
23 S SDXI=$$GET1^DIQ(165.5,PRM,16,"I") ;STATE AT DX
24 S SDXE=$$GET1^DIQ(165.5,PRM,16,"E")
25 I SDXI'="" S SDX=$P(^ONCO(160.15,SDXI,0),U,1)
26 S PCDX=$$GET1^DIQ(165.5,PRM,9,"I") ;POSTAL CODE AT DX
27 I SDX="YY",PCDX'=888888888 D D ERRMSG
28 .S MSG(1)="STATE AT DX = YY ("_SDXE_")"
29 .S MSG(2)="POSTAL CODE AT DX must be 888888888"
30 I SDX="ZZ",PCDX'=999999999 D D ERRMSG
31 .S MSG(1)="STATE AT DX = ZZ ("_SDXE_")"
32 .S MSG(2)="POSTAL CODE AT DX must be 999999999"
33 K MSG,PCDX,SDX,SDXI,SDXE
34 ;
35IF03 I RHSP=RFAC D D ERRMSG
36 .S MSG(1)="REPORTING HOSPITAL = FACILITY REFERRED FROM"
37 I RHSP=TFAC D D ERRMSG
38 .S MSG(1)="REPORTING HOSPITAL = FACILITY REFERRED TO"
39 ;
40IF10 I ((COCI=2)!(COCI=3)),RFAC="" D D ERRMSG
41 .S MSG(1)="CLASS OF CASE = "_COCI_" ("_COCE_")"
42 .S MSG(2)="FACILITY REFERRED FROM may not be blank"
43 K MSG,RHSP,RFAC,TFAC
44 ;
45IF06 S DIAI=$$GET1^DIQ(165.5,PRM,155,"I") ;DATE OF FIRST CONTACT
46 S DIAE=$$GET1^DIQ(165.5,PRM,155,"E")
47 S DDXI=$$GET1^DIQ(165.5,PRM,3,"I") ;DATE DX
48 S DDXE=$$GET1^DIQ(165.5,PRM,3,"E")
49 I DIAE="99/99/9999" G IF06EX
50 S MSG(1)="CLASS OF CASE = "_COCI_" ("_COCE_")"
51 S MSG(2)="DATE OF FIRST CONTACT..: "_DIAE
52 S MSG(3)=" later than"
53 I COCI=0 D
54 .S SPSI=$$GET1^DIQ(165.5,PRM,50,"I") ;MOST DEFINITIVE SURG DATE
55 .S SPSE=$$GET1^DIQ(165.5,PRM,50,"E")
56 .S RADI=$$GET1^DIQ(165.5,PRM,51,"I") ;DATE RADIATION STARTED
57 .S RADE=$$GET1^DIQ(165.5,PRM,51,"E")
58 .S CNSI=$$GET1^DIQ(165.5,PRM,52,"I") ;RADIATION THERAPY TO CNS DATE
59 .S CNSE=$$GET1^DIQ(165.5,PRM,52,"E")
60 .S CHMI=$$GET1^DIQ(165.5,PRM,53,"I") ;CHEMOTHERAPY DATE
61 .S CHME=$$GET1^DIQ(165.5,PRM,53,"E")
62 .S HORI=$$GET1^DIQ(165.5,PRM,54,"I") ;HORMONE THERAPY DATE
63 .S HORE=$$GET1^DIQ(165.5,PRM,54,"E")
64 .S BRMI=$$GET1^DIQ(165.5,PRM,55,"I") ;IMMUNOTHERAPY DATE
65 .S BRME=$$GET1^DIQ(165.5,PRM,55,"E")
66 .S OTHI=$$GET1^DIQ(165.5,PRM,57,"I") ;OTHER TREATMENT START DATE
67 .S OTHE=$$GET1^DIQ(165.5,PRM,57,"E")
68 .I SPSI'="0000000",DIAI>SPSI D D ERRMSG
69 ..S MSG(4)="MOST DEFINITIVE SURG DATE....: "_SPSE
70 .I RADI'="0000000",DIAI>RADI D D ERRMSG
71 ..S MSG(4)="DATE RADIATION STARTED.......: "_RADE
72 .I DDXI<2960000,CNSI'="0000000",DIAI>CNSI D D ERRMSG
73 ..S MSG(4)="RADIATION THERAPY TO CNS DATE: "_CNSE
74 .I CHMI'="0000000",DIAI>CHMI D D ERRMSG
75 ..S MSG(4)="CHEMOTHERAPY DATE............: "_CHME
76 .I HORI'="0000000",DIAI>HORI D D ERRMSG
77 ..S MSG(4)="HORMONE THERAPY DATE.........: "_HORE
78 .I BRMI'="0000000",DIAI>BRMI D D ERRMSG
79 ..S MSG(4)="IMMUNOTHERAPY DATE...........: "_BRME
80 .I OTHI'="0000000",DIAI>OTHI D D ERRMSG
81 ..S MSG(4)="OTHER TREATMENT START DATE...: "_OTHE
82IF06EX K MSG,DIAI,DIAE
83 K SPSI,SPSE,RADI,RADE,CNSI,CNSE,CHMI,CHME,HORI,HORE,BRMI,BRME,OTHI,OTHE
84 ;
85IF0708 S DXCF=$$GET1^DIQ(165.5,PRM,26,"I") ;DIAGNOSTIC CONFIRMATION
86 S SEQ=$$GET1^DIQ(165.5,PRM,.06,"I") ;SEQUENCE NUMBER
87 S SEQN=+$$GET1^DIQ(165.5,PRM,.06,"I")
88 S PRIM=$$GET1^DIQ(165.5,PRM,20,"I") ;PRIMARY SITE
89 S OVER=$$GET1^DIQ(165.5,PRM,223,"I") ;OVERRIDE HOSPSEQ/DXCONF
90 I TRSI=6,COCI'=5 D D ERRMSG
91 .S MSG(1)="TYPE OF REPORTING SOURCE = 6 ("_TRSE_")"
92 .S MSG(2)="CLASS OF CASE must be 5 (Dx at autopsy)"
93 I COCI=5,TRSI'=6 D D ERRMSG
94 .S MSG(1)="CLASS OF CASE = 5 ("_COCE_")"
95 .S MSG(2)="TYPE OF REPORTING SOURCE must be 6 (Autopsy only)"
96 I TRSI=7,DXCF'=9 D D ERRMSG
97 .S MSG(1)="TYPE OF REPORTING SOURCE = 7 ("_TRSE_")"
98 .S MSG(2)="DIAGNOSTIC CONFIRMATION must be 9 (Unk if microscopically confirmed)"
99 I TRSI=6,((DXCF'=1)&(DXCF'=6)) D D ERRMSG
100 .S MSG(1)="TYPE OF REPORTING SOURCE = 6 ("_TRSE_")"
101 .S MSG(2)="DIAGNOSTIC CONFIRMATION must be 1 (Pos histology) or"
102 .S MSG(3)=" 6 (Direct visualization)"
103 I ($E(PRIM,3,4)=76)!(PRIM=67809) G IF11
104 I DXCF>5,((SEQN>0)&(SEQN<60))!(SEQN>88),OVER="" D D ERRMSG K DIR S DIR(0)="YA",DIR("A")="Do you wish to set the OVERRIDE HOSPSEQ/DXCONF flag to 'Reviewed'? ",DIR("B")="Y" D ^DIR W ! I Y=1 S $P(^ONCO(165.5,PRM,"OVRD"),U,19)=1,CMPLT=SAVCMPLT
105 .S SAVCMPLT=CMPLT
106 .S MSG(1)="DIAGNOSTIC CONFIRMATION > 5 ("_DXCF_")"
107 .S MSG(2)="SEQUENCE NUMBER > 00 ("_SEQ_")"
108 .S MSG(3)="OVERRIDE HOSPSEQ/DXCONF is required"
109 K MSG,DXCF,SEQN,PRIM,OVER,SAVCMPLT,DIR
110 ;
111IF11 G:TOPI="" IF11EX
112 S PORG=$$GET1^DIQ(164,TOPI,.07,"I") ;PAIRED ORGAN
113 S LTRL=$$GET1^DIQ(165.5,PRM,28,"I") ;LATERALITY
114 I PORG=1,LTRL=0,DDXI>3031231 D D ERRMSG
115 .S MSG(1)=TOPE_" is a paired site"
116 .S MSG(2)="LATERALITY must be provided for specified paired organs/sites"
117 .S MSG(3)=""
118 .S:TOPI=67300 MSG(4)="NOTE: If NASAL CARTILAGE or NASAL SEPTUM, override this warning."
119 .S:TOPI=67340 MSG(4)="NOTE: If CARINA, override this warning."
120 .S:TOPI=67413 MSG(4)="NOTE: If STERNUM, override this warning."
121 .S:TOPI=67414 MSG(4)="NOTE: If SACRUM, COCCYX or SYMPHYSIS PUBIS, override this warning."
122 I PORG=1,LTRL="" D D ERRMSG
123 .S MSG(1)=TOPE_" is a paired site"
124 .S MSG(2)="LATERALITY must be provided for specified paired organs/sites"
125 I PORG="",LTRL'=0 D D ERRMSG
126 .S MSG(1)=TOPE_" is an unpaired site"
127 .S MSG(2)="LATERALITY must be 0 (Not a paired site)"
128IF11EX K MSG,PORG,LTRL
129 ;
130 S RADI=$$GET1^DIQ(165.5,PRM,51.2,"I") ;RADIATION
131 S RADE=$$GET1^DIQ(165.5,PRM,51.2,"E")
132 S LRTI=$$GET1^DIQ(165.5,PRM,126,"I") ;LOCATION OF RADIATION TX
133 I RADI'=0,LRTI=0 D D ERRMSG
134 .S MSG(1)="RADIATION = "_RADI_" ("_RADE_")"
135 .S MSG(2)="LOCATION OF RADIATION TX cannot be 0 (No radiation tx)"
136 K MSG,RADI,RADE,LRTI
137 ;
138 ;Treatment codes of 88 or dates of 88/88/8888 will prohibit 'Completion'
139 S DRS=$$GET1^DIQ(165.5,PRM,51,"E") ;DATE RADIATION STARTED
140 S DRSFAC=$$GET1^DIQ(165.5,PRM,51.5,"E") ;RADIATION @FACILITY DATE
141 S DRE=$$GET1^DIQ(165.5,PRM,361,"E") ;DATE RADIATION ENDED
142 S CI=$$GET1^DIQ(165.5,PRM,53.2,"I") ;CHEMOTHERAPY
143 S CE=$$GET1^DIQ(165.5,PRM,53.2,"E")
144 S CFACI=$$GET1^DIQ(165.5,PRM,53.3,"I") ;CHEMOTHERAPY @FAC
145 S CFACE=$$GET1^DIQ(165.5,PRM,53.3,"E") ;CHEMOTHERAPY @FAC
146 S CD=$$GET1^DIQ(165.5,PRM,53,"E") ;CHEMOTHERAPY DATE
147 S CFACD=$$GET1^DIQ(165.5,PRM,53.4,"E") ;CHEMOTHERAPY @FAC DATE
148 S HTI=$$GET1^DIQ(165.5,PRM,54.2,"I") ;HORMONE THERAPY
149 S HTE=$$GET1^DIQ(165.5,PRM,54.2,"E")
150 S HTFACI=$$GET1^DIQ(165.5,PRM,54.3,"I") ;HORMONE THERAPY @FAC
151 S HTFACE=$$GET1^DIQ(165.5,PRM,54.3,"E")
152 S HTD=$$GET1^DIQ(165.5,PRM,54,"E") ;HORMONE THERAPY DATE
153 S HTFACD=$$GET1^DIQ(165.5,PRM,54.4,"E") ;HORMONE THERAPY @FAC DATE
154 S ITI=$$GET1^DIQ(165.5,PRM,55.2,"I") ;IMMUNOTHERAPY
155 S ITE=$$GET1^DIQ(165.5,PRM,55.2,"E")
156 S ITFACI=$$GET1^DIQ(165.5,PRM,55.3,"I") ;IMMUNOTHERAPY @FAC
157 S ITFACE=$$GET1^DIQ(165.5,PRM,55.3,"E")
158 S ITD=$$GET1^DIQ(165.5,PRM,55,"E") ;IMMUNOTHERAPY DATE
159 S ITFACD=$$GET1^DIQ(165.5,PRM,55.4,"E") ;IMMUNOTHERAPY @FAC DATE
160 S HTEPI=$$GET1^DIQ(165.5,PRM,153,"I") ;HEMA TRANS/ENDOCRINE PROC
161 S HTEPE=$$GET1^DIQ(165.5,PRM,153,"E")
162 S HTEPD=$$GET1^DIQ(165.5,PRM,153.1,"E") ;HEMA TRANS/ENDOCRINE PROC DATE
163 I DRS="88/88/8888" D D TXDT88,ERRMSG
164 .S MSG(1)="DATE RADIATION STARTED = "_DRS
165 I DRSFAC="88/88/8888" D D ERRMSG
166 .S MSG(1)="RADIATION @FACILITY DATE = "_DRSFAC
167 I DRE="88/88/8888" D D ERRMSG
168 .S MSG(1)="DATE RADIATION ENDED = "_DRE
169 I CI=88 D D ERRMSG
170 .S MSG(1)="CHEMOTHERAPY = "_CI_" ("_CE_")"
171 I CD="88/88/8888" D D ERRMSG
172 .S MSG(1)="CHEMOTHERAPY DATE = "_CD
173 I CFACI=88 D D ERRMSG
174 .S MSG(1)="CHEMOTHERAPY @FAC = "_CFACI_" ("_CFACE_")"
175 I CFACD="88/88/8888" D D ERRMSG
176 .S MSG(1)="CHEMOTHERAPY @FAC DATE = "_CFACD
177 I HTI=88 D D ERRMSG
178 .S MSG(1)="HORMONE THERAPY = "_HTI_" ("_HTE_")"
179 I HTD="88/88/8888" D D ERRMSG
180 .S MSG(1)="HORMONE THERAPY DATE = "_HTD
181 I HTFACI=88 D D ERRMSG
182 .S MSG(1)="HORMONE THERAPY @FAC = "_HTFACI_" ("_HTFACE_")"
183 I HTFACD="88/88/8888" D D ERRMSG
184 .S MSG(1)="HORMONE THERAPY @FAC DATE = "_HTFACD
185 I ITI=88 D D ERRMSG
186 .S MSG(1)="IMMUNOTHERAPY = "_ITI_" ("_ITE_")"
187 I ITD="88/88/8888" D D ERRMSG
188 .S MSG(1)="IMMUNOTHERAPY DATE = "_ITD
189 I ITFACI=88 D D ERRMSG
190 .S MSG(1)="IMMUNOTHERAPY @FAC = "_ITFACI_" ("_ITFACE_")"
191 I ITFACD="88/88/8888" D D ERRMSG
192 .S MSG(1)="IMMUNOTHERAPY @FAC DATE = "_ITFACD
193 I HTEPI=12 D D ERRMSG
194 .S MSG(1)="HEMA TRANS/ENDOCRINE PROC = 88 ("_HTEPE_")"
195 I HTEPD="88/88/8888" D D ERRMSG
196 .S MSG(1)="HEMA TRANS/ENDOCRINE PROC DATE = "_HTEPD
197 G ^ONCEDIT2
198 ;
199ERRMSG ;Error message
200 S CMPLT=0
201 W !," WARNING: "
202 S MSGSUB=0 F S MSGSUB=$O(MSG(MSGSUB)) Q:MSGSUB'>0 W ?10,MSG(MSGSUB),!
203 R Z:10
204 Q
205 ;
206TXDT88 ;Treatment date = 88/88/8888 error message
207 S MSG(2)="This abstract cannot be 'Complete' without a valid treatment date."
208 S MSG(3)="This inter-field edit WARNING may not be overridden."
209 S OVERRIDE="NO"
210 Q
Note: See TracBrowser for help on using the repository browser.