VistA-WorldVistAEHR/r/ONCOLOGY-ONC/ONCOPOS.m

101 lines
4.2 KiB
Mathematica

ONCOPOS ;HIRMFO/GWB-POST-INSTALL ROUTINE FOR PATCH ONC*2.11*5 05/06/96
;;2.11;ONCOLOGY;**5**;Mar 07, 1995
;
ITEM1 ;Re-point DEFAULT PRIMARY SITE GROUP (#164,102) pointers from TONGUE (2)
;to ORAL CAVITY (9)
S IEN=0 F S IEN=$O(^ONCO(164,IEN)) Q:IEN'>0 I $P(^ONCO(164,IEN,0),"^",13)=2 S $P(^ONCO(164,IEN,0),"^",13)=9
;
ITEM2 ;Re-point SITE/GP (#165.5,.01) pointers from TONGUE (2) to either ORAL
;CAVITY (9) or PHARYNX (13)
S IEN=0 F S IEN=$O(^ONCO(165.5,IEN)) Q:IEN'>0 I $P(^ONCO(165.5,IEN,0),"^",1)=2 D
.S DIE="^ONCO(165.5,",DA=IEN
.I $D(^ONCO(165.5,IEN,2)),$P(^ONCO(165.5,IEN,2),"^",1)=67019 S DR=".01///13" D ^DIE Q
.S DR=".01///9" D ^DIE
ITEM3 ;Delete TONGUE (2) from SITE-GROUP FOR ONCOLOGY (#164.2) file
S DIK="^ONCO(164.2,",DA=2 D ^DIK
ITEM4 ;Set ONCOLOGY PRINT and SORT templates' READ ACCESS to null and WRITE
;ACCESS to @
D ^ONCOPOS1
D ^ONCOPOS2
ITEM5 ;Reindex new "D" uppercase cross-reference on the DEFINITION (#1) field
;of the TYPE OF RECURRENCE (#160.12) file
S DIK="^ONCO(160.12,",DIK(1)="1^D" D ENALL^DIK
K DIK
ITEM6 ;If treatments are "None" (0) set treatment dates to 00/00/00
;If treatments are "Unknown" (8 or 9) set treatment dates to 99/99/99
S IEN=0,CNT=0 F S IEN=$O(^ONCO(165.5,IEN)) Q:IEN'>0 I $D(^ONCO(165.5,IEN,3)) D
.S DATEDX=$P(^ONCO(165.5,IEN,0),U,16),NODE3=^ONCO(165.5,IEN,3),CNT=CNT+1
.
.S NCDS=$P(NODE3,U,27),NCDSDT=$P(NODE3,U,31)
.S CDS=$P(NODE3,U,38),CDSDT=$P(NODE3,U,1)
.I DATEDX<2960101 D
..I (+NCDS>0)&(CDS="00"),CDSDT>2000000 D
...I (NCDSDT="")!(NCDSDT=2000000) S DIE="^ONCO(165.5,",DA=IEN,DR="58.3////"_CDSDT D ^DIE
..I (NCDS=0)&(+CDS>0) D
...S $P(^ONCO(165.5,IEN,3),U,27)="",NCDS=""
...S DIE="^ONCO(165.5,",DA=IEN,DR="58.3////@" D ^DIE
..I $E(CDS,1)=0,$E(CDS,2)'=0 S $P(^ONCO(165.5,IEN,3),U,27)=CDS,CDS="00",$P(^ONCO(165.5,IEN,3),U,38)="00"
.
.I (NCDS=0)!(NCDS="00") S DIE="^ONCO(165.5,",DA=IEN,DR="58.3////2000000" D ^DIE
.I (NCDS=9)!(NCDS="09") S DIE="^ONCO(165.5,",DA=IEN,DR="58.3////2999999" D ^DIE
.
.I CDS="00" S DIE="^ONCO(165.5,",DA=IEN,DR="50////2000000" D ^DIE
.
.S RAD=$P(NODE3,U,6)
.I RAD=0 S DIE="^ONCO(165.5,",DA=IEN,DR="51////2000000" D ^DIE
.I (RAD=8)!(RAD=9) S DIE="^ONCO(165.5,",DA=IEN,DR="51////2999999" D ^DIE
.
.S RADCNS=$P(NODE3,U,10)
.I RADCNS=0 S DIE="^ONCO(165.5,",DA=IEN,DR="52////2000000" D ^DIE
.I RADCNS=9 S DIE="^ONCO(165.5,",DA=IEN,DR="52////2999999" D ^DIE
.
.S CHE=$P(NODE3,U,13)
.I CHE=0 S DIE="^ONCO(165.5,",DA=IEN,DR="53////2000000" D ^DIE
.I (CHE=8)!(CHE=9) S DIE="^ONCO(165.5,",DA=IEN,DR="53////2999999" D ^DIE
.
.S HOR=$P(NODE3,U,16)
.I HOR=0 S DIE="^ONCO(165.5,",DA=IEN,DR="54////2000000" D ^DIE
.I (HOR=8)!(HOR=9) S DIE="^ONCO(165.5,",DA=IEN,DR="54////2999999" D ^DIE
.
.S IMM=$P(NODE3,U,19)
.I IMM=6 S DIE="^ONCO(165.5,",DA=IEN,DR="55////2000000" D ^DIE
.I (IMM=8)!(IMM=9) S DIE="^ONCO(165.5,",DA=IEN,DR="55////2999999" D ^DIE
.
.S OTH=$P(NODE3,U,25)
.I OTH=0 S DIE="^ONCO(165.5,",DA=IEN,DR="57////2000000" D ^DIE
.I (OTH=8)!(OTH=9) S DIE="^ONCO(165.5,",DA=IEN,DR="57////2999999" D ^DIE
.W:CNT#100=0 "."
.
.I $D(^ONCO(165.5,IEN,4)) S SCT=0 F S SCT=$O(^ONCO(165.5,IEN,4,SCT)) Q:SCT'>0 D
..S NODE40=^ONCO(165.5,IEN,4,SCT,0)
..S NODE43="" I $D(^ONCO(165.5,IEN,4,SCT,3)) S NODE43=^ONCO(165.5,IEN,4,SCT,3)
..
..S CDS=$P(NODE40,U,4)
..I CDS="00" S $P(^ONCO(165.5,IEN,4,SCT,0),U,11)=2000000
..
..S RAD=$P(NODE40,U,5)
..I RAD=0 S $P(^ONCO(165.5,IEN,4,SCT,0),U,12)=2000000
..I RAD=9 S $P(^ONCO(165.5,IEN,4,SCT,0),U,12)=2999999
..
..S CHE=$P(NODE40,U,6)
..I CHE=0 S $P(^ONCO(165.5,IEN,4,SCT,0),U,13)=2000000
..I CHE=9 S $P(^ONCO(165.5,IEN,4,SCT,0),U,13)=2999999
..
..S HOR=$P(NODE40,U,7)
..I HOR=0 S $P(^ONCO(165.5,IEN,4,SCT,0),U,14)=2000000
..I HOR=9 S $P(^ONCO(165.5,IEN,4,SCT,0),U,14)=2999999
..
..S IMM=$P(NODE43,U,19)
..I IMM=6 S $P(^ONCO(165.5,IEN,4,SCT,0),U,15)=2000000
..I (IMM=8)!(IMM=9) S $P(^ONCO(165.5,IEN,4,SCT,0),U,15)=2999999
..
..S OTH=$P(NODE40,U,9)
..I OTH=0 S $P(^ONCO(165.5,IEN,4,SCT,0),U,16)=2000000
..I (OTH=8)!(OTH=9) S $P(^ONCO(165.5,IEN,4,SCT,0),U,16)=2999999
..
..S RADCNS=$P(NODE40,U,10)
..I RADCNS=0 S $P(^ONCO(165.5,IEN,4,SCT,0),U,17)=2000000
..I RADCNS=9 S $P(^ONCO(165.5,IEN,4,SCT,0),U,17)=2999999
K IEN,NODE3,NCDS,CDS,RAD,RADCNS,CHE,HOR,IMM,OTH,DIE,DA,DR
K SCT,NODE40,NODE43,DATEDX