Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ONC2PS06

ONC2PS06.m

Go to the documentation of this file.
ONC2PS06 ;Hines OIFO/RTK - Post-Install Routine for Patch ONC*2.2*6 ;08/31/16
 ;;2.2;ONCOLOGY;**6**;Jul 31, 2013;Build 10
 ;
 ;N RC
 ;NEW Washington DC production server.
 S RC=$$UPDCSURL^ONCSAPIU("http://127.0.0.1:83/cgi_bin/oncsrv.exe")
 ;NEW Washington DC test server, comment out for final release.
 ;S RC=$$UPDCSURL^ONCSAPIU("http://127.0.0.1:81/cgi_bin/oncsrv.exe")
 ;
 D CNVSBY,CNVTNM
 Q
CNVSBY ;Conversion of TNM Clin Staged By and TNM Path Staged By codes
 ;
 D BMES^XPDUTL("Begin re-indexing of 'STAGED BY CLINICAL' [#165.5,#19]")
 D MES^XPDUTL("and 'STAGED BY PATHOLOGIC' [#165.5,#89] fields...")
 N IEN,ONCCLSBY,ONCPASBY S ZZDOTS=0
 F IEN=0:0 S IEN=$O(^ONCO(165.5,IEN)) Q:IEN'>0  D
 .I $P($G(^ONCO(165.5,IEN,25)),U,19)="Y" Q  ;check if already converted
 .S ONCCLSBY=$P($G(^ONCO(165.5,IEN,3)),U,32) I ONCCLSBY'="" D CLINSB
 .S ONCPASBY=$P($G(^ONCO(165.5,IEN,2.1)),U,5) I ONCPASBY'="" D PATHSB
 .S $P(^ONCO(165.5,IEN,25),U,19)="Y"  ;set new converted field
 .S ZZDOTS=ZZDOTS+1 I ZZDOTS#500=0 W "."
 .Q
 D MES^XPDUTL("Completed...")
 K ONCLINT,ONCLINN,ONCLINM,ONCLINSG,ONCPATHT,ONCPATHN,ONCPATHM,ONCPATHG
 K ZZDOTS Q
 ;
CLINSB ;
 I ONCCLSBY=0 S $P(^ONCO(165.5,IEN,3),U,32)=1 Q
 I ONCCLSBY=1!(ONCCLSBY=4) S $P(^ONCO(165.5,IEN,3),U,32)=2 Q
 I ONCCLSBY=2 S $P(^ONCO(165.5,IEN,3),U,32)=6 Q
 I ONCCLSBY=3 S $P(^ONCO(165.5,IEN,3),U,32)=7 Q
 I ONCCLSBY=5 S $P(^ONCO(165.5,IEN,3),U,32)=8 Q
 I ONCCLSBY=6 S $P(^ONCO(165.5,IEN,3),U,32)=9 Q
 I ONCCLSBY=7 S $P(^ONCO(165.5,IEN,3),U,32)=11 Q
 I ONCCLSBY=8 S $P(^ONCO(165.5,IEN,3),U,32)=13 Q
 I ONCCLSBY=9 D
 .S ONCLINT=$P($G(^ONCO(165.5,IEN,2)),U,25)
 .S ONCLINN=$P($G(^ONCO(165.5,IEN,2)),U,26)
 .S ONCLINM=$P($G(^ONCO(165.5,IEN,2)),U,27)
 .S ONCLINSG=$P($G(^ONCO(165.5,IEN,2)),U,20)
 .I ONCLINT="",ONCLINN="",ONCLINM="",ONCLINSG="" S $P(^ONCO(165.5,IEN,3),U,32)=1 Q
 .I ONCLINT="X",ONCLINN="X",ONCLINM="X",ONCLINSG=99 S $P(^ONCO(165.5,IEN,3),U,32)=1 Q
 .I ONCLINT=88,ONCLINN=88,ONCLINM=88,ONCLINSG=88 S $P(^ONCO(165.5,IEN,3),U,32)=13 Q
 .S $P(^ONCO(165.5,IEN,3),U,32)=14 Q
 .Q
 Q
 ;
PATHSB ;
 I ONCPASBY=0 S $P(^ONCO(165.5,IEN,2.1),U,5)=1 Q
 I ONCPASBY=1!(ONCPASBY=4) S $P(^ONCO(165.5,IEN,2.1),U,5)=2 Q
 I ONCPASBY=2 S $P(^ONCO(165.5,IEN,2.1),U,5)=6 Q
 I ONCPASBY=3 S $P(^ONCO(165.5,IEN,2.1),U,5)=7 Q
 I ONCPASBY=5 S $P(^ONCO(165.5,IEN,2.1),U,5)=8 Q
 I ONCPASBY=6 S $P(^ONCO(165.5,IEN,2.1),U,5)=9 Q
 I ONCPASBY=7 S $P(^ONCO(165.5,IEN,2.1),U,5)=11 Q
 I ONCPASBY=8 S $P(^ONCO(165.5,IEN,2.1),U,5)=13 Q
 I ONCPASBY=9 D
 .S ONCPATHT=$P($G(^ONCO(165.5,IEN,2.1)),U,1)
 .S ONCPATHN=$P($G(^ONCO(165.5,IEN,2.1)),U,2)
 .S ONCPATHM=$P($G(^ONCO(165.5,IEN,2.1)),U,3)
 .S ONCPATHG=$P($G(^ONCO(165.5,IEN,2.1)),U,4)
 .I ONCPATHT="",ONCPATHN="",ONCPATHM="",ONCPATHG="" S $P(^ONCO(165.5,IEN,2.1),U,5)=1 Q
 .I ONCPATHT="X",ONCPATHN="X",ONCPATHM="X",ONCPATHG=99 S $P(^ONCO(165.5,IEN,2.1),U,5)=1 Q
 .I ONCPATHT=88,ONCPATHN=88,ONCPATHM=88,ONCPATHG=88 S $P(^ONCO(165.5,IEN,2.1),U,5)=13 Q
 .S $P(^ONCO(165.5,IEN,2.1),U,5)=14 Q
 .Q
 Q
 ;
CNVTNM ;
 ;
 D BMES^XPDUTL("Begin re-indexing of CLINICAL and PATHOLOGIC TNM fields")
 N IEN,CLINT,CLINN,CLINM,PATHT,PATHN,PATHM S ZZDOTS=0
 F IEN=0:0 S IEN=$O(^ONCO(165.5,IEN)) Q:IEN'>0  D
 .I $P($G(^ONCO(165.5,IEN,25)),U,20)="Y" Q  ;check if already converted
 .S CLINT=$P($G(^ONCO(165.5,IEN,2)),U,25) I CLINT'="",CLINT'=88 D CT
 .S CLINN=$P($G(^ONCO(165.5,IEN,2)),U,26) I CLINN'="",CLINN'=88 D CN
 .S CLINM=$P($G(^ONCO(165.5,IEN,2)),U,27) I CLINM'="",CLINM'=88 D CM
 .S PATHT=$P($G(^ONCO(165.5,IEN,2.1)),U,1) I PATHT'="",PATHT'=88 D PT
 .S PATHN=$P($G(^ONCO(165.5,IEN,2.1)),U,2) I PATHN'="",PATHN'=88 D PN
 .S PATHM=$P($G(^ONCO(165.5,IEN,2.1)),U,3) I PATHM'="",PATHM'=88 D PM
 .S $P(^ONCO(165.5,IEN,25),U,20)="Y"  ;set new converted field
 .S ZZDOTS=ZZDOTS+1 I ZZDOTS#500=0 W "."
 D MES^XPDUTL("...Completed...")
 K CLINT,CLINN,CLINM,PATHT,PATHN,PATHM,ZZDOTS Q
 ;
CT ;
 I CLINT="A" S $P(^ONCO(165.5,IEN,2),U,25)="pA" Q
 I CLINT="IS" S $P(^ONCO(165.5,IEN,2),U,25)="pIS" Q
 I CLINT="ISPU"!(CLINT="SU") S $P(^ONCO(165.5,IEN,2),U,25)="pISU" Q
 I CLINT="ISPD"!(CLINT="SD") S $P(^ONCO(165.5,IEN,2),U,25)="pISD" Q
 S $P(^ONCO(165.5,IEN,2),U,25)="c"_CLINT Q
 Q
 ;
CN ;
 S $P(^ONCO(165.5,IEN,2),U,26)="c"_CLINN Q
 Q
 ;
CM ;
 S $P(^ONCO(165.5,IEN,2),U,27)="c"_CLINM Q
 Q
 ;
PT ;
 I PATHT="ISPU"!(PATHT="SU") S $P(^ONCO(165.5,IEN,2.1),U,1)="pISU" Q
 I PATHT="ISPD"!(PATHT="SD") S $P(^ONCO(165.5,IEN,2.1),U,1)="pISD" Q
 S $P(^ONCO(165.5,IEN,2.1),U,1)="p"_PATHT Q
 Q
 ;
PN ;
 I PATHN="0(I-)" S $P(^ONCO(165.5,IEN,2.1),U,2)="p0I-" Q
 I PATHN="0(I+)" S $P(^ONCO(165.5,IEN,2.1),U,2)="p0I+" Q
 I PATHN="0(MOL-)" S $P(^ONCO(165.5,IEN,2.1),U,2)="p0M-" Q
 I PATHN="0(MOL+)" S $P(^ONCO(165.5,IEN,2.1),U,2)="p0M+" Q
 S $P(^ONCO(165.5,IEN,2.1),U,2)="p"_PATHN Q
 Q
PM ;
 I PATHM=0 S $P(^ONCO(165.5,IEN,2.1),U,3)="c0" Q
 S $P(^ONCO(165.5,IEN,2.1),U,3)="p"_PATHM Q
 Q