source: FOIAVistA/trunk/r/ONCOLOGY-ONC/ONCOTNO.m@ 1783

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

initial load of FOIAVistA 6/30/08 version

File size: 3.0 KB
Line 
1ONCOTNO ;Hines OIFO/GWB - ONCOLOGY - Convert AJCC stage for output ;10/03/00
2 ;;2.11;ONCOLOGY;**1,6,7,11,15,27,32,35,47**;Mar 07, 1995;Build 19
3 ;
4SGOUT(IEN) ;AJCC stage formatted for display
5 N XX,XXX,SG
6 S XX=$G(^ONCO(165.5,D0,2))
7 I STGIND="C" D
8 .S XXX=$G(^ONCO(165.5,D0,2))
9 .S SG=$P(XXX,U,20)
10 I STGIND="P" D
11 .S XXX=$G(^ONCO(165.5,D0,2.1))
12 .S SG=$P(XXX,U,4)
13 I STGIND="O" D
14 .S XXX=$G(^ONCO(165.5,D0,2.1))
15 .S SG=$P(XXX,U,9)
16 I STGIND="R" D
17 .S XXX=$G(^ONCO(165.5,D0,23,DA,0))
18 .S SG=$P(XXX,U,9)
19 N ONCOZ,XSG S ONCOZ=$E(SG),XSG=$S(ONCOZ=1:"I",ONCOZ=2:"II",ONCOZ=3:"III",ONCOZ=4:"IV",ONCOZ=8:8,ONCOZ=9:9,1:ONCOZ),XSG=XSG_$E(SG,2,$L(SG))
20 S SG=XSG_" ("_$$TNMOUT(IEN)_")"
21 I ($G(SP)=67400)!($G(SP)=67490) D ;Bone and Soft Tissue Sarcoma Histopathologic Grade "G" prefix
22 .S:($G(G)=9)!($G(G)="") G="X"
23 .S SG=XSG_" (G"_G_" "_$$TNMOUT(IEN)_")"
24 Q SG
25 ;
26TNMOUT(IEN) ;TNM coding formatted for display
27 N XXX,II,ONCOTNM
28 S ONCOTNM=""
29 S TOP=$P($G(^ONCO(165.5,IEN,2)),U,1)
30 I STGIND="C" D
31 .S XXX(2)=$G(^ONCO(165.5,IEN,2))
32 .S XXX(3)=$G(^ONCO(165.5,IEN,3))
33 .S ONCOT=$P(XXX(2),U,25)
34 .S ONCON=$P(XXX(2),U,26)
35 .S ONCOM=$P(XXX(2),U,27)
36 I STGIND="P" D
37 .S XXX(2)=$G(^ONCO(165.5,IEN,2.1))
38 .S XXX(3)=$G(^ONCO(165.5,IEN,3))
39 .S ONCOT=$P(XXX(2),U,1)
40 .S ONCON=$P(XXX(2),U,2)
41 .S ONCOM=$P(XXX(2),U,3)
42 .I $G(CMPFLG)'="COMPUTING TNM" Q
43 .S:$E(ONCOM,1)'=1 ONCOM=$P($G(^ONCO(165.5,IEN,2)),U,27)
44 I STGIND="O" D
45 .S XXX(2)=$G(^ONCO(165.5,IEN,2.1))
46 .S XXX(3)=$G(^ONCO(165.5,IEN,3))
47 .S ONCOT=$P(XXX(2),U,6)
48 .S ONCON=$P(XXX(2),U,7)
49 .S ONCOM=$P(XXX(2),U,8)
50 I STGIND="R" D
51 .S XXX(2)=$G(^ONCO(165.5,IEN,23,DA,0))
52 .S XXX(3)=$G(^ONCO(165.5,IEN,3))
53 .S ONCOT=$P(XXX(2),U,6)
54 .S ONCON=$P(XXX(2),U,7)
55 .S ONCOM=$P(XXX(2),U,8)
56 I ONCOT'="" D
57 .S ONCOTNM="T"_ONCOT
58 .N ONCOMULT S ONCOMULT=$P($G(^ONCO(165.5,D0,2)),U,31) ;multiple tumors
59 .I ONCOMULT S ONCOTNM=ONCOTNM_"m" S:ONCOMULT>1 ONCOTNM=ONCOTNM_ONCOMULT
60 .N ONCOMT S ONCOMT=""
61 .I STGIND="C" D
62 ..S:$P($G(^ONCO(165.5,D0,0)),U,16)<2980000 ONCOMT=$P($G(^ONCO(165.5,D0,7)),U,16)
63 .I STGIND="P" D
64 ..S ONCOMT=$P($G(^ONCO(165.5,D0,7)),U,17)
65 .S COC=$P($G(^ONCO(165.5,D0,0)),U,4)
66 .I COC=5 S ONCOTNM="a"_ONCOTNM ;a Prefix
67 .I ONCOMT="Y" S ONCOTNM="y"_ONCOTNM ;Multimodality therapy
68 .I TOP=67692,$P(XXX(2),U,32) S ONCOTNM=ONCOTNM_"f" ;Family History
69 .I TOP=67692,$P(XXX(3),U,30) S ONCOTNM=ONCOTNM_"d" ;Diffuse Retinal Involvement
70 S:(ONCOTNM'="")&(ONCON'="") ONCOTNM=ONCOTNM_" "
71 S:ONCON'="" ONCOTNM=ONCOTNM_"N"_ONCON
72 S:(ONCOTNM'="")&(ONCOM'="") ONCOTNM=ONCOTNM_" "
73 S:ONCOM'="" ONCOTNM=ONCOTNM_"M"_ONCOM
74 I TOP=67619 S G=$P(^ONCO(165.5,D0,2),U,5),ONCOTNM=ONCOTNM_" G"_G
75 I $$GTT^ONCOU55(D0) D K RF
76 .S:$G(STGIND)="C" RF=$$GET1^DIQ(165.5,D0,134,"I")
77 .S:$G(STGIND)="P" RF=$$GET1^DIQ(165.5,D0,135,"I")
78 .S:$G(STGIND)="O" RF=$$GET1^DIQ(165.5,D0,134,"I")
79 .S RF=$S(RF=0:"0RF",(RF=1)!(RF=2):"1RF",RF=3:"2RF",RF="U":"Unknown",RF="L":"Low risk",RF="H":"High risk",1:RF)
80 .S ONCOTNM=ONCOTNM_" "_RF
81 I $$T^ONCOU55(D0) D K STM
82 .S STM=$P($G(^ONCO(165.5,D0,24)),U,8)
83 .S ONCOTNM=ONCOTNM_" "_STM
84 Q ONCOTNM
Note: See TracBrowser for help on using the repository browser.