source: WorldVistAEHR/trunk/r/ONCOLOGY-ONC/ONCOAIS.m@ 1036

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

initial load of WorldVistAEHR

File size: 2.3 KB
Line 
1ONCOAIS ;Hines OIFO/GWB - POST FOLLOW-UP UPDATE PRIMARY CANCER STATUS ;07/12/00
2 ;;2.11;ONCOLOGY;**25,26,44,45**;Mar 07, 1995
3 ;
4PRI ;TUMOR STATUS - from template [ONCO FOLLOWUP]
5 I $D(^ONCO(165.5,"C",DA(1))) D
6 .N XDA1,XY,K S XDA1=DA(1)
7 .D FINDEM,EDITEM
8 .S DA(1)=XDA1
9 E W !,"Patient has no primary registered",!!
10 Q
11 ;
12FINDEM ;Setup/fetch the tumor status subentries from the primary file
13 N FOLDAT,PRIMIEN
14 S K=0,PRIMIEN=0,FOLDAT=$P($G(^ONCO(160,DA(1),"F",DA,0)),U,1)
15 F S PRIMIEN=$O(^ONCO(165.5,"C",DA(1),PRIMIEN)) Q:PRIMIEN="" D
16 .N DATEDX,TOPOG,TSIEN
17 .S TOPOG=$P($G(^ONCO(165.5,PRIMIEN,0)),U)
18 .S DATEDX=$P($G(^ONCO(165.5,PRIMIEN,0)),U,16)
19 .I TOPOG,DATEDX,DATEDX'>FOLDAT D FINDSET
20 Q
21 ;
22FINDSET ;Find/setup tumor status corresponding to this follow-up
23 N TSIEN S TSIEN=$O(^ONCO(165.5,PRIMIEN,"TS","B",FOLDAT,0))
24 I TSIEN,$D(^ONCO(165.5,PRIMIEN,"TS",TSIEN,0))
25 E S TSIEN=$$SETTS^ONCOU55(PRIMIEN,FOLDAT)
26 S K=K+1,XY(K)=PRIMIEN_U_TSIEN
27 Q
28 ;
29EDITEM ;Edit Tumor Status for each primary during a follow-up
30 N Q,XD0,DIE,DR,KK
31 S Q=0,XD0=DA(1)
32 S DIE("NO^")=1
33 S DR=.02
34 F KK=1:1:K D EDITONE
35 Q
36 ;
37EDITONE ;CANCER STATUS (165.573,.02)
38 S DR=.02
39 N DA
40 S DA(1)=$P(XY(KK),U),DA=$P(XY(KK),U,2)
41 I DUZ(2)'=$P($G(^ONCO(165.5,DA(1),"DIV")),U,1) Q
42 S DIE="^ONCO(165.5,"_DA(1)_",""TS"","
43 W !!,"Updating CANCER STATUS for "_$P($G(^ONCO(164,+$P($G(^ONCO(165.5,DA(1),2)),U),0)),U)_"..."
44 N DG,DIC,DI,%,DP,DM,DK,DH,DQ,DIEL,DL,DC,X,Y
45 L +^ONCO(165.5,DA(1)):0 I $T D ^DIE L -^ONCO(165.5,DA(1)) D Q
46 .S TOFRE=$$GET1^DIQ(165.5,DA(1),71,"E")
47 .S TOFR=$$GET1^DIQ(165.5,DA(1),71,"I")
48 .I TOFR'="" S TOFR=$P($G(^ONCO(160.12,TOFR,0)),U,1)
49 .S LTS=$$GET1^DIQ(165.5,DA(1),95,"I")
50 .I TOFR="00",LTS'=1 D W ! D ERRMSG^ONCEDIT
51 ..S MSG(1)="TYPE OF FIRST RECURRENCE = 00 ("_TOFRE_")"
52 ..S MSG(2)="CANCER STATUS must be 1 (No evidence of this tumor)"
53 .I TOFR=70,LTS'=2 D W ! D ERRMSG^ONCEDIT
54 ..S MSG(1)="TYPE OF FIRST RECURRENCE = 70 ("_TOFRE_")"
55 ..S MSG(2)="CANCER STATUS must be 2 (Evidence of this tumor)"
56 .I TOFR=99,LTS'=9 D W ! D ERRMSG^ONCEDIT
57 ..S MSG(1)="TYPE OF FIRST RECURRENCE = 99 ("_TOFRE_")"
58 ..S MSG(2)="CANCER STATUS must be 9 (Unknown if recurred or disease-free"
59 W !,"This primary is being edited by another user."
60 Q
61 ;
62TEMP451 ;Point of entry from input template [ONCO FOLLOWUP]
63 S (ONCOVS,VS)=X
64 D PRI
65 S Y="@1001"
66 Q
Note: See TracBrowser for help on using the repository browser.