ONCEDIT ;HINES OIFO/GWB - Inter-field edits ;03/24/11
;;2.2;ONCOLOGY;**1,4,10,15**;Jul 31, 2013;Build 5
;
N BCOD,COCE,COCI,HSTE,HSTFLD,HSTI,SSTE,SSTI,STAT,TOPE,TOPI,TRSE,TRSI,X
K MSG
S RHSP=$$GET1^DIQ(165.5,PRM,.03,"I") ;REPORTING FACILITY
S COCI=$E($$GET1^DIQ(165.5,PRM,.04,"E"),1,2) ;CLASS OF CASE
S COCE=$$GET1^DIQ(165.5,PRM,.04,"E")
S STAT=$$GET1^DIQ(165.5,PRM,.091) ;STATUS
S TRSI=$$GET1^DIQ(165.5,PRM,1.2,"I") ;TYPE OF REPORTING SOURCE
S TRSE=$$GET1^DIQ(165.5,PRM,1.2,"E")
S RFAC=$$GET1^DIQ(165.5,PRM,6,"I") ;FACILITY REFERRED FROM
S TFAC=$$GET1^DIQ(165.5,PRM,7,"I") ;FACILITY REFERRED TO
S TOPI=$$GET1^DIQ(165.5,PRM,20,"I") ;PRIMARY SITE
S TOPE=$$GET1^DIQ(165.5,PRM,20,"E")
S HSTI=$$HIST^ONCFUNC(PRM,.HSTFLD) ;HISTOLOGY
S HSTE=$$GET1^DIQ(165.5,PRM,HSTFLD,"E")
S BCOD=$E(HSTI,5) ;BEHAVIOR CODE
I DTDX<3180000 S SSTI=$$GET1^DIQ(165.5,PRM,35,"I") ;SUMMARY STAGE 2000
I DTDX<3180000 S SSTE=$$GET1^DIQ(165.5,PRM,35,"E")
I DTDX>3171231 S SSTI=$$GET1^DIQ(165.5,PRM,1764,"I") ;SUMMARY STAGE 2018
I DTDX>3171231 S SSTE=$$GET1^DIQ(165.5,PRM,1764,"E")
;
IF02 ;S SDX=""
;S SDXI=$$GET1^DIQ(165.5,PRM,16,"I") ;STATE AT DX
;S SDXE=$$GET1^DIQ(165.5,PRM,16,"E")
;I SDXI'="" S SDX=$P(^DIC(5,SDXI,0),U,1)
;S PCDX=$$GET1^DIQ(165.5,PRM,9,"I") ;POSTAL CODE AT DX
;I SDX="YY",PCDX'=888888888 D D ERRMSG
;.S MSG(1)="STATE AT DX = YY ("_SDXE_")"
;.S MSG(2)="POSTAL CODE AT DX must be 888888888"
;I SDX="ZZ",PCDX'=999999999 D D ERRMSG
;.S MSG(1)="STATE AT DX = ZZ ("_SDXE_")"
;.S MSG(2)="POSTAL CODE AT DX must be 999999999"
;K MSG,PCDX,SDX,SDXI,SDXE
;
IF03 I RHSP=RFAC D D ERRMSG
.S MSG(1)="REPORTING HOSPITAL = FACILITY REFERRED FROM"
I RHSP=TFAC D D ERRMSG
.S MSG(1)="REPORTING HOSPITAL = FACILITY REFERRED TO"
;
IF10 I (COCI=20)!(COCI=21)!(COCI=22)!(COCI=30)!(COCI=31)!(COCI=32)!(COCI=33)!(COCI=36)!(COCI=37),RFAC="" D D ERRMSG
.S MSG(1)="CLASS OF CASE = "_COCI
.S MSG(2)="("_$E(COCE,4,99)_")"
.S MSG(3)="FACILITY REFERRED FROM may not be blank"
K MSG,RHSP,RFAC,TFAC
;
IF06 N DDXE,DDXI
S DIAI=$$GET1^DIQ(165.5,PRM,155,"I") ;DATE OF FIRST CONTACT
S DIAE=$$GET1^DIQ(165.5,PRM,155,"E")
S DDXI=$$GET1^DIQ(165.5,PRM,3,"I") ;DATE DX
S DDXE=$$GET1^DIQ(165.5,PRM,3,"E")
I DIAE="99/99/9999" G IF06EX
S MSG(1)="CLASS OF CASE = "_COCE
S MSG(2)="DATE OF FIRST CONTACT..: "_DIAE
S MSG(3)=" later than"
I COCI="00" D
.S SPSI=$$GET1^DIQ(165.5,PRM,50,"I") ;MOST DEFINITIVE SURG DATE
.S SPSE=$$GET1^DIQ(165.5,PRM,50,"E")
.S RADI=$$GET1^DIQ(165.5,PRM,51,"I") ;DATE RADIATION STARTED
.S RADE=$$GET1^DIQ(165.5,PRM,51,"E")
.S CNSI=$$GET1^DIQ(165.5,PRM,52,"I") ;RADIATION THERAPY TO CNS DATE
.S CNSE=$$GET1^DIQ(165.5,PRM,52,"E")
.S CHMI=$$GET1^DIQ(165.5,PRM,53,"I") ;CHEMOTHERAPY DATE
.S CHME=$$GET1^DIQ(165.5,PRM,53,"E")
.S HORI=$$GET1^DIQ(165.5,PRM,54,"I") ;HORMONE THERAPY DATE
.S HORE=$$GET1^DIQ(165.5,PRM,54,"E")
.S BRMI=$$GET1^DIQ(165.5,PRM,55,"I") ;IMMUNOTHERAPY DATE
.S BRME=$$GET1^DIQ(165.5,PRM,55,"E")
.S OTHI=$$GET1^DIQ(165.5,PRM,57,"I") ;OTHER TREATMENT START DATE
.S OTHE=$$GET1^DIQ(165.5,PRM,57,"E")
.I SPSI'="0000000",DIAI>SPSI D D ERRMSG
..S MSG(4)="MOST DEFINITIVE SURG DATE....: "_SPSE
.I RADI'="0000000",DIAI>RADI D D ERRMSG
..S MSG(4)="DATE RADIATION STARTED.......: "_RADE
.I DDXI<2960000,CNSI'="0000000",DIAI>CNSI D D ERRMSG
..S MSG(4)="RADIATION THERAPY TO CNS DATE: "_CNSE
.I CHMI'="0000000",DIAI>CHMI D D ERRMSG
..S MSG(4)="CHEMOTHERAPY DATE............: "_CHME
.I HORI'="0000000",DIAI>HORI D D ERRMSG
..S MSG(4)="HORMONE THERAPY DATE.........: "_HORE
.I BRMI'="0000000",DIAI>BRMI D D ERRMSG
..S MSG(4)="IMMUNOTHERAPY DATE...........: "_BRME
.I OTHI'="0000000",DIAI>OTHI D D ERRMSG
..S MSG(4)="OTHER TREATMENT START DATE...: "_OTHE
IF06EX K BRME,BRMI,CHME,CHMI,CNSE,CNSI,DIAI,DIAE,HORE,HORI,MSG,OTHE
K OTHI,RADE,RADI,SPSE,SPSI
;
IF0708 S DXCF=$$GET1^DIQ(165.5,PRM,26,"I") ;DIAGNOSTIC CONFIRMATION
S SEQ=$$GET1^DIQ(165.5,PRM,.06,"I") ;SEQUENCE NUMBER
S SEQN=+$$GET1^DIQ(165.5,PRM,.06,"I")
S PRIM=$$GET1^DIQ(165.5,PRM,20,"I") ;PRIMARY SITE
S OVER=$$GET1^DIQ(165.5,PRM,223,"I") ;OVER-RIDE HOSPSEQ/DXCONF
I TRSI=6,COCI'=38 D D ERRMSG
.S MSG(1)="TYPE OF REPORTING SOURCE = 6 ("_TRSE_")"
.S MSG(2)="CLASS OF CASE must be 38"
.S MSG(3)="(Dx by autopsy at rpt facility)"
I COCI=38,TRSI'=6 D D ERRMSG
.S MSG(1)="CLASS OF CASE = "_COCI
.S MSG(2)="("_$E(COCE,4,99)_")"
.S MSG(3)="TYPE OF REPORTING SOURCE must be 6 (Autopsy only)"
I TRSI=7,DXCF'=9 D D ERRMSG
.S MSG(1)="TYPE OF REPORTING SOURCE = 7 ("_TRSE_")"
.S MSG(2)="DIAGNOSTIC CONFIRMATION must be 9 (Unk if microscopically confirmed)"
I TRSI=6,((DXCF'=1)&(DXCF'=6)) D D ERRMSG
.S MSG(1)="TYPE OF REPORTING SOURCE = 6 ("_TRSE_")"
.S MSG(2)="DIAGNOSTIC CONFIRMATION must be 1 (Pos histology) or"
.S MSG(3)=" 6 (Direct visualization)"
I ($E(PRIM,3,4)=76)!(PRIM=67809) G IF11
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 OVER-RIDE 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
.S SAVCMPLT=CMPLT
.S MSG(1)="DIAGNOSTIC CONFIRMATION > 5 ("_DXCF_")"
.S MSG(2)="SEQUENCE NUMBER > 00 ("_SEQ_")"
.S MSG(3)="OVER-RIDE HOSPSEQ/DXCONF is required"
K MSG,DXCF,SEQ,SEQN,PRIM,OVER,SAVCMPLT,DIR,Y
;
IF11 G:TOPI="" IF11EX
S PORG=$$GET1^DIQ(164,TOPI,.07,"I") ;PAIRED ORGAN
S LTRL=$$GET1^DIQ(165.5,PRM,28,"I") ;LATERALITY
I PORG=1,LTRL=0,DDXI>3031231 D D ERRMSG
.S MSG(1)=TOPE_" is a paired site"
.S MSG(2)="LATERALITY must be provided for specified paired organs/sites"
.S MSG(3)=""
.S:TOPI=67300 MSG(4)="NOTE: If NASAL CARTILAGE or NASAL SEPTUM, override this warning."
.S:TOPI=67340 MSG(4)="NOTE: If CARINA, override this warning."
.S:TOPI=67413 MSG(4)="NOTE: If STERNUM, override this warning."
.S:TOPI=67414 MSG(4)="NOTE: If SACRUM, COCCYX or SYMPHYSIS PUBIS, override this warning."
I PORG=1,LTRL="" D D ERRMSG
.S MSG(1)=TOPE_" is a paired site"
.S MSG(2)="LATERALITY must be provided for specified paired organs/sites"
;I PORG="",LTRL'=0 D D ERRMSG
I PORG="",LTRL'=0,TOPI'=67444 D D ERRMSG
.S MSG(1)=TOPE_" is an unpaired site"
.S MSG(2)="LATERALITY must be 0 (Not a paired site)"
IF11EX K MSG,PORG,LTRL
;
S RADI=$$GET1^DIQ(165.5,PRM,51.2,"I") ;RADIATION
S RADE=$$GET1^DIQ(165.5,PRM,51.2,"E")
S LRTI=$$GET1^DIQ(165.5,PRM,126,"I") ;LOCATION OF RADIATION TX
I RADI'=0,LRTI=0 D D ERRMSG
.S MSG(1)="RADIATION = "_RADI_" ("_RADE_")"
.S MSG(2)="LOCATION OF RADIATION TX cannot be 0 (No radiation tx)"
K MSG,RADI,RADE,LRTI
;all 8's inter-field checks removed in p4
;Treatment codes of 88 or dates of 88/88/8888 will prohibit 'Completion'
;S DRS=$$GET1^DIQ(165.5,PRM,51,"E") ;DATE RADIATION STARTED
;S DRSFAC=$$GET1^DIQ(165.5,PRM,51.5,"E") ;RADIATION @FACILITY DATE
;S DRE=$$GET1^DIQ(165.5,PRM,361,"E") ;DATE RADIATION ENDED
;S CI=$$GET1^DIQ(165.5,PRM,53.2,"I") ;CHEMOTHERAPY
;S CE=$$GET1^DIQ(165.5,PRM,53.2,"E")
;S CFACI=$$GET1^DIQ(165.5,PRM,53.3,"I") ;CHEMOTHERAPY @FAC
;S CFACE=$$GET1^DIQ(165.5,PRM,53.3,"E") ;CHEMOTHERAPY @FAC
;S CD=$$GET1^DIQ(165.5,PRM,53,"E") ;CHEMOTHERAPY DATE
;S CFACD=$$GET1^DIQ(165.5,PRM,53.4,"E") ;CHEMOTHERAPY @FAC DATE
;S HTI=$$GET1^DIQ(165.5,PRM,54.2,"I") ;HORMONE THERAPY
;S HTE=$$GET1^DIQ(165.5,PRM,54.2,"E")
;S HTFACI=$$GET1^DIQ(165.5,PRM,54.3,"I") ;HORMONE THERAPY @FAC
;S HTFACE=$$GET1^DIQ(165.5,PRM,54.3,"E")
;S HTD=$$GET1^DIQ(165.5,PRM,54,"E") ;HORMONE THERAPY DATE
;S HTFACD=$$GET1^DIQ(165.5,PRM,54.4,"E") ;HORMONE THERAPY @FAC DATE
;S ITI=$$GET1^DIQ(165.5,PRM,55.2,"I") ;IMMUNOTHERAPY
;S ITE=$$GET1^DIQ(165.5,PRM,55.2,"E")
;S ITFACI=$$GET1^DIQ(165.5,PRM,55.3,"I") ;IMMUNOTHERAPY @FAC
;S ITFACE=$$GET1^DIQ(165.5,PRM,55.3,"E")
;S ITD=$$GET1^DIQ(165.5,PRM,55,"E") ;IMMUNOTHERAPY DATE
;S ITFACD=$$GET1^DIQ(165.5,PRM,55.4,"E") ;IMMUNOTHERAPY @FAC DATE
;S HTEPI=$$GET1^DIQ(165.5,PRM,153,"I") ;HEMA TRANS/ENDOCRINE PROC
;S HTEPE=$$GET1^DIQ(165.5,PRM,153,"E")
;S HTEPD=$$GET1^DIQ(165.5,PRM,153.1,"E") ;HEMA TRANS/ENDOCRINE PROC DATE
;I DRS="88/88/8888" D D TXDT88,ERRMSG
;.S MSG(1)="DATE RADIATION STARTED = "_DRS
;I DRSFAC="88/88/8888" D D ERRMSG
;.S MSG(1)="RADIATION @FACILITY DATE = "_DRSFAC
;I DRE="88/88/8888" D D ERRMSG
;.S MSG(1)="DATE RADIATION ENDED = "_DRE
;I CI=88 D D ERRMSG
;.S MSG(1)="CHEMOTHERAPY = "_CI_" ("_CE_")"
;I CD="88/88/8888" D D ERRMSG
;.S MSG(1)="CHEMOTHERAPY DATE = "_CD
;I CFACI=88 D D ERRMSG
;.S MSG(1)="CHEMOTHERAPY @FAC = "_CFACI_" ("_CFACE_")"
;I CFACD="88/88/8888" D D ERRMSG
;.S MSG(1)="CHEMOTHERAPY @FAC DATE = "_CFACD
;I HTI=88 D D ERRMSG
;.S MSG(1)="HORMONE THERAPY = "_HTI_" ("_HTE_")"
;I HTD="88/88/8888" D D ERRMSG
;.S MSG(1)="HORMONE THERAPY DATE = "_HTD
;I HTFACI=88 D D ERRMSG
;.S MSG(1)="HORMONE THERAPY @FAC = "_HTFACI_" ("_HTFACE_")"
;I HTFACD="88/88/8888" D D ERRMSG
;.S MSG(1)="HORMONE THERAPY @FAC DATE = "_HTFACD
;I ITI=88 D D ERRMSG
;.S MSG(1)="IMMUNOTHERAPY = "_ITI_" ("_ITE_")"
;I ITD="88/88/8888" D D ERRMSG
;.S MSG(1)="IMMUNOTHERAPY DATE = "_ITD
;I ITFACI=88 D D ERRMSG
;.S MSG(1)="IMMUNOTHERAPY @FAC = "_ITFACI_" ("_ITFACE_")"
;I ITFACD="88/88/8888" D D ERRMSG
;.S MSG(1)="IMMUNOTHERAPY @FAC DATE = "_ITFACD
;I HTEPI=12 D D ERRMSG
;.S MSG(1)="HEMA TRANS/ENDOCRINE PROC = 88 ("_HTEPE_")"
;I HTEPD="88/88/8888" D D ERRMSG
;.S MSG(1)="HEMA TRANS/ENDOCRINE PROC DATE = "_HTEPD
;K CD,CE,CFACD,CFACE,CFACI,CI,DRE,DRS,DRSFAC,HTD,HTE,HTEPD,HTEPE,HTEPI
;K HTFACD,HTFACE,HTFACI,HTI,ITD,ITE,ITFACD,ITFACE,ITFACI,ITI
;
FCTD ;
;N FCTD
;S FCTD=$$GET1^DIQ(165.5,PRM,49)
;I FCTD="00/00/0000",COCI'=38 D D ERRMSG
;.S MSG(1)="FIRST COURSE OF TREATMENT DATE = 00/00/0000"
;.S MSG(2)="CLASS OF CASE must be 38"
;.S MSG(3)="(Dx by autopsy at rpt facility)"
;I COCI=38,FCTD'="00/00/0000" D D ERRMSG
;.S MSG(1)="CLASS OF CASE = 38"
;.S MSG(2)="(Dx by autopsy at rpt facility)"
;.S MSG(3)="FIRST COURSE OF TREATMENT DATE must be 00/00/0000"
;
PHCSEQ S SEQ=$$GET1^DIQ(165.5,PRM,.06,"I")
S PHC=$$GET1^DIQ(165.5,PRM,148,"E")
;I PHC="Yes",SEQ="00" D D ERRMSG
;.S MSG(1)="OTHER CANCER = Yes"
;.S MSG(2)="SEQUENCE NUMBER = "_SEQ
;.S MSG(3)="SEQUENCE NUMBER cannot not be 00"
I PHC="No",(SEQ'="00")&(SEQ'=60) D D ERRMSG
.S MSG(1)="OTHER CANCER = No"
.S MSG(2)="SEQUENCE NUMBER = "_SEQ
.S MSG(3)="SEQUENCE NUMBER must be 00 or 60"
K SEQ,PHC,MSG
;
G ^ONCEDIT2
;
ERRMSG ;Error message
S CMPLT=0
W !," WARNING: "
S MSGSUB=0 F S MSGSUB=$O(MSG(MSGSUB)) Q:MSGSUB'>0 W ?10,MSG(MSGSUB),!
R Z:10
K MSGSUB,Z
Q
;
TXDT88 ;Treatment date = 88/88/8888 error message
S MSG(2)="This abstract cannot be 'Complete' without a valid treatment date."
S MSG(3)="This inter-field edit WARNING may not be overridden."
S OVERRIDE="NO"
Q
;
CLEANUP ;Cleanup
K CMPLT,OVERRIDE,PRM
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HONCEDIT 11214 printed Oct 16, 2024@18:23:31 Page 2
ONCEDIT ;HINES OIFO/GWB - Inter-field edits ;03/24/11
+1 ;;2.2;ONCOLOGY;**1,4,10,15**;Jul 31, 2013;Build 5
+2 ;
+3 NEW BCOD,COCE,COCI,HSTE,HSTFLD,HSTI,SSTE,SSTI,STAT,TOPE,TOPI,TRSE,TRSI,X
+4 KILL MSG
+5 ;REPORTING FACILITY
SET RHSP=$$GET1^DIQ(165.5,PRM,.03,"I")
+6 ;CLASS OF CASE
SET COCI=$EXTRACT($$GET1^DIQ(165.5,PRM,.04,"E"),1,2)
+7 SET COCE=$$GET1^DIQ(165.5,PRM,.04,"E")
+8 ;STATUS
SET STAT=$$GET1^DIQ(165.5,PRM,.091)
+9 ;TYPE OF REPORTING SOURCE
SET TRSI=$$GET1^DIQ(165.5,PRM,1.2,"I")
+10 SET TRSE=$$GET1^DIQ(165.5,PRM,1.2,"E")
+11 ;FACILITY REFERRED FROM
SET RFAC=$$GET1^DIQ(165.5,PRM,6,"I")
+12 ;FACILITY REFERRED TO
SET TFAC=$$GET1^DIQ(165.5,PRM,7,"I")
+13 ;PRIMARY SITE
SET TOPI=$$GET1^DIQ(165.5,PRM,20,"I")
+14 SET TOPE=$$GET1^DIQ(165.5,PRM,20,"E")
+15 ;HISTOLOGY
SET HSTI=$$HIST^ONCFUNC(PRM,.HSTFLD)
+16 SET HSTE=$$GET1^DIQ(165.5,PRM,HSTFLD,"E")
+17 ;BEHAVIOR CODE
SET BCOD=$EXTRACT(HSTI,5)
+18 ;SUMMARY STAGE 2000
IF DTDX<3180000
SET SSTI=$$GET1^DIQ(165.5,PRM,35,"I")
+19 IF DTDX<3180000
SET SSTE=$$GET1^DIQ(165.5,PRM,35,"E")
+20 ;SUMMARY STAGE 2018
IF DTDX>3171231
SET SSTI=$$GET1^DIQ(165.5,PRM,1764,"I")
+21 IF DTDX>3171231
SET SSTE=$$GET1^DIQ(165.5,PRM,1764,"E")
+22 ;
IF02 ;S SDX=""
+1 ;S SDXI=$$GET1^DIQ(165.5,PRM,16,"I") ;STATE AT DX
+2 ;S SDXE=$$GET1^DIQ(165.5,PRM,16,"E")
+3 ;I SDXI'="" S SDX=$P(^DIC(5,SDXI,0),U,1)
+4 ;S PCDX=$$GET1^DIQ(165.5,PRM,9,"I") ;POSTAL CODE AT DX
+5 ;I SDX="YY",PCDX'=888888888 D D ERRMSG
+6 ;.S MSG(1)="STATE AT DX = YY ("_SDXE_")"
+7 ;.S MSG(2)="POSTAL CODE AT DX must be 888888888"
+8 ;I SDX="ZZ",PCDX'=999999999 D D ERRMSG
+9 ;.S MSG(1)="STATE AT DX = ZZ ("_SDXE_")"
+10 ;.S MSG(2)="POSTAL CODE AT DX must be 999999999"
+11 ;K MSG,PCDX,SDX,SDXI,SDXE
+12 ;
IF03 IF RHSP=RFAC
Begin DoDot:1
+1 SET MSG(1)="REPORTING HOSPITAL = FACILITY REFERRED FROM"
End DoDot:1
DO ERRMSG
+2 IF RHSP=TFAC
Begin DoDot:1
+3 SET MSG(1)="REPORTING HOSPITAL = FACILITY REFERRED TO"
End DoDot:1
DO ERRMSG
+4 ;
IF10 IF (COCI=20)!(COCI=21)!(COCI=22)!(COCI=30)!(COCI=31)!(COCI=32)!(COCI=33)!(COCI=36)!(COCI=37)
IF RFAC=""
Begin DoDot:1
+1 SET MSG(1)="CLASS OF CASE = "_COCI
+2 SET MSG(2)="("_$EXTRACT(COCE,4,99)_")"
+3 SET MSG(3)="FACILITY REFERRED FROM may not be blank"
End DoDot:1
DO ERRMSG
+4 KILL MSG,RHSP,RFAC,TFAC
+5 ;
IF06 NEW DDXE,DDXI
+1 ;DATE OF FIRST CONTACT
SET DIAI=$$GET1^DIQ(165.5,PRM,155,"I")
+2 SET DIAE=$$GET1^DIQ(165.5,PRM,155,"E")
+3 ;DATE DX
SET DDXI=$$GET1^DIQ(165.5,PRM,3,"I")
+4 SET DDXE=$$GET1^DIQ(165.5,PRM,3,"E")
+5 IF DIAE="99/99/9999"
GOTO IF06EX
+6 SET MSG(1)="CLASS OF CASE = "_COCE
+7 SET MSG(2)="DATE OF FIRST CONTACT..: "_DIAE
+8 SET MSG(3)=" later than"
+9 IF COCI="00"
Begin DoDot:1
+10 ;MOST DEFINITIVE SURG DATE
SET SPSI=$$GET1^DIQ(165.5,PRM,50,"I")
+11 SET SPSE=$$GET1^DIQ(165.5,PRM,50,"E")
+12 ;DATE RADIATION STARTED
SET RADI=$$GET1^DIQ(165.5,PRM,51,"I")
+13 SET RADE=$$GET1^DIQ(165.5,PRM,51,"E")
+14 ;RADIATION THERAPY TO CNS DATE
SET CNSI=$$GET1^DIQ(165.5,PRM,52,"I")
+15 SET CNSE=$$GET1^DIQ(165.5,PRM,52,"E")
+16 ;CHEMOTHERAPY DATE
SET CHMI=$$GET1^DIQ(165.5,PRM,53,"I")
+17 SET CHME=$$GET1^DIQ(165.5,PRM,53,"E")
+18 ;HORMONE THERAPY DATE
SET HORI=$$GET1^DIQ(165.5,PRM,54,"I")
+19 SET HORE=$$GET1^DIQ(165.5,PRM,54,"E")
+20 ;IMMUNOTHERAPY DATE
SET BRMI=$$GET1^DIQ(165.5,PRM,55,"I")
+21 SET BRME=$$GET1^DIQ(165.5,PRM,55,"E")
+22 ;OTHER TREATMENT START DATE
SET OTHI=$$GET1^DIQ(165.5,PRM,57,"I")
+23 SET OTHE=$$GET1^DIQ(165.5,PRM,57,"E")
+24 IF SPSI'="0000000"
IF DIAI>SPSI
Begin DoDot:2
+25 SET MSG(4)="MOST DEFINITIVE SURG DATE....: "_SPSE
End DoDot:2
DO ERRMSG
+26 IF RADI'="0000000"
IF DIAI>RADI
Begin DoDot:2
+27 SET MSG(4)="DATE RADIATION STARTED.......: "_RADE
End DoDot:2
DO ERRMSG
+28 IF DDXI<2960000
IF CNSI'="0000000"
IF DIAI>CNSI
Begin DoDot:2
+29 SET MSG(4)="RADIATION THERAPY TO CNS DATE: "_CNSE
End DoDot:2
DO ERRMSG
+30 IF CHMI'="0000000"
IF DIAI>CHMI
Begin DoDot:2
+31 SET MSG(4)="CHEMOTHERAPY DATE............: "_CHME
End DoDot:2
DO ERRMSG
+32 IF HORI'="0000000"
IF DIAI>HORI
Begin DoDot:2
+33 SET MSG(4)="HORMONE THERAPY DATE.........: "_HORE
End DoDot:2
DO ERRMSG
+34 IF BRMI'="0000000"
IF DIAI>BRMI
Begin DoDot:2
+35 SET MSG(4)="IMMUNOTHERAPY DATE...........: "_BRME
End DoDot:2
DO ERRMSG
+36 IF OTHI'="0000000"
IF DIAI>OTHI
Begin DoDot:2
+37 SET MSG(4)="OTHER TREATMENT START DATE...: "_OTHE
End DoDot:2
DO ERRMSG
End DoDot:1
IF06EX KILL BRME,BRMI,CHME,CHMI,CNSE,CNSI,DIAI,DIAE,HORE,HORI,MSG,OTHE
+1 KILL OTHI,RADE,RADI,SPSE,SPSI
+2 ;
IF0708 ;DIAGNOSTIC CONFIRMATION
SET DXCF=$$GET1^DIQ(165.5,PRM,26,"I")
+1 ;SEQUENCE NUMBER
SET SEQ=$$GET1^DIQ(165.5,PRM,.06,"I")
+2 SET SEQN=+$$GET1^DIQ(165.5,PRM,.06,"I")
+3 ;PRIMARY SITE
SET PRIM=$$GET1^DIQ(165.5,PRM,20,"I")
+4 ;OVER-RIDE HOSPSEQ/DXCONF
SET OVER=$$GET1^DIQ(165.5,PRM,223,"I")
+5 IF TRSI=6
IF COCI'=38
Begin DoDot:1
+6 SET MSG(1)="TYPE OF REPORTING SOURCE = 6 ("_TRSE_")"
+7 SET MSG(2)="CLASS OF CASE must be 38"
+8 SET MSG(3)="(Dx by autopsy at rpt facility)"
End DoDot:1
DO ERRMSG
+9 IF COCI=38
IF TRSI'=6
Begin DoDot:1
+10 SET MSG(1)="CLASS OF CASE = "_COCI
+11 SET MSG(2)="("_$EXTRACT(COCE,4,99)_")"
+12 SET MSG(3)="TYPE OF REPORTING SOURCE must be 6 (Autopsy only)"
End DoDot:1
DO ERRMSG
+13 IF TRSI=7
IF DXCF'=9
Begin DoDot:1
+14 SET MSG(1)="TYPE OF REPORTING SOURCE = 7 ("_TRSE_")"
+15 SET MSG(2)="DIAGNOSTIC CONFIRMATION must be 9 (Unk if microscopically confirmed)"
End DoDot:1
DO ERRMSG
+16 IF TRSI=6
IF ((DXCF'=1)&(DXCF'=6))
Begin DoDot:1
+17 SET MSG(1)="TYPE OF REPORTING SOURCE = 6 ("_TRSE_")"
+18 SET MSG(2)="DIAGNOSTIC CONFIRMATION must be 1 (Pos histology) or"
+19 SET MSG(3)=" 6 (Direct visualization)"
End DoDot:1
DO ERRMSG
+20 IF ($EXTRACT(PRIM,3,4)=76)!(PRIM=67809)
GOTO IF11
+21 IF DXCF>5
IF ((SEQN>0)&(SEQN<60))!(SEQN>88)
IF OVER=""
Begin DoDot:1
+22 SET SAVCMPLT=CMPLT
+23 SET MSG(1)="DIAGNOSTIC CONFIRMATION > 5 ("_DXCF_")"
+24 SET MSG(2)="SEQUENCE NUMBER > 00 ("_SEQ_")"
+25 SET MSG(3)="OVER-RIDE HOSPSEQ/DXCONF is required"
End DoDot:1
DO ERRMSG
KILL DIR
SET DIR(0)="YA"
SET DIR("A")="Do you wish to set the OVER-RIDE HOSPSEQ/DXCONF flag to 'Reviewed'? "
SET DIR("B")="Y"
DO ^DIR
WRITE !
IF Y=1
SET $PIECE(^ONCO(165.5,PRM,"OVRD"),U,19)=1
SET CMPLT=SAVCMPLT
+26 KILL MSG,DXCF,SEQ,SEQN,PRIM,OVER,SAVCMPLT,DIR,Y
+27 ;
IF11 if TOPI=""
GOTO IF11EX
+1 ;PAIRED ORGAN
SET PORG=$$GET1^DIQ(164,TOPI,.07,"I")
+2 ;LATERALITY
SET LTRL=$$GET1^DIQ(165.5,PRM,28,"I")
+3 IF PORG=1
IF LTRL=0
IF DDXI>3031231
Begin DoDot:1
+4 SET MSG(1)=TOPE_" is a paired site"
+5 SET MSG(2)="LATERALITY must be provided for specified paired organs/sites"
+6 SET MSG(3)=""
+7 if TOPI=67300
SET MSG(4)="NOTE: If NASAL CARTILAGE or NASAL SEPTUM, override this warning."
+8 if TOPI=67340
SET MSG(4)="NOTE: If CARINA, override this warning."
+9 if TOPI=67413
SET MSG(4)="NOTE: If STERNUM, override this warning."
+10 if TOPI=67414
SET MSG(4)="NOTE: If SACRUM, COCCYX or SYMPHYSIS PUBIS, override this warning."
End DoDot:1
DO ERRMSG
+11 IF PORG=1
IF LTRL=""
Begin DoDot:1
+12 SET MSG(1)=TOPE_" is a paired site"
+13 SET MSG(2)="LATERALITY must be provided for specified paired organs/sites"
End DoDot:1
DO ERRMSG
+14 ;I PORG="",LTRL'=0 D D ERRMSG
+15 IF PORG=""
IF LTRL'=0
IF TOPI'=67444
Begin DoDot:1
+16 SET MSG(1)=TOPE_" is an unpaired site"
+17 SET MSG(2)="LATERALITY must be 0 (Not a paired site)"
End DoDot:1
DO ERRMSG
IF11EX KILL MSG,PORG,LTRL
+1 ;
+2 ;RADIATION
SET RADI=$$GET1^DIQ(165.5,PRM,51.2,"I")
+3 SET RADE=$$GET1^DIQ(165.5,PRM,51.2,"E")
+4 ;LOCATION OF RADIATION TX
SET LRTI=$$GET1^DIQ(165.5,PRM,126,"I")
+5 IF RADI'=0
IF LRTI=0
Begin DoDot:1
+6 SET MSG(1)="RADIATION = "_RADI_" ("_RADE_")"
+7 SET MSG(2)="LOCATION OF RADIATION TX cannot be 0 (No radiation tx)"
End DoDot:1
DO ERRMSG
+8 KILL MSG,RADI,RADE,LRTI
+9 ;all 8's inter-field checks removed in p4
+10 ;Treatment codes of 88 or dates of 88/88/8888 will prohibit 'Completion'
+11 ;S DRS=$$GET1^DIQ(165.5,PRM,51,"E") ;DATE RADIATION STARTED
+12 ;S DRSFAC=$$GET1^DIQ(165.5,PRM,51.5,"E") ;RADIATION @FACILITY DATE
+13 ;S DRE=$$GET1^DIQ(165.5,PRM,361,"E") ;DATE RADIATION ENDED
+14 ;S CI=$$GET1^DIQ(165.5,PRM,53.2,"I") ;CHEMOTHERAPY
+15 ;S CE=$$GET1^DIQ(165.5,PRM,53.2,"E")
+16 ;S CFACI=$$GET1^DIQ(165.5,PRM,53.3,"I") ;CHEMOTHERAPY @FAC
+17 ;S CFACE=$$GET1^DIQ(165.5,PRM,53.3,"E") ;CHEMOTHERAPY @FAC
+18 ;S CD=$$GET1^DIQ(165.5,PRM,53,"E") ;CHEMOTHERAPY DATE
+19 ;S CFACD=$$GET1^DIQ(165.5,PRM,53.4,"E") ;CHEMOTHERAPY @FAC DATE
+20 ;S HTI=$$GET1^DIQ(165.5,PRM,54.2,"I") ;HORMONE THERAPY
+21 ;S HTE=$$GET1^DIQ(165.5,PRM,54.2,"E")
+22 ;S HTFACI=$$GET1^DIQ(165.5,PRM,54.3,"I") ;HORMONE THERAPY @FAC
+23 ;S HTFACE=$$GET1^DIQ(165.5,PRM,54.3,"E")
+24 ;S HTD=$$GET1^DIQ(165.5,PRM,54,"E") ;HORMONE THERAPY DATE
+25 ;S HTFACD=$$GET1^DIQ(165.5,PRM,54.4,"E") ;HORMONE THERAPY @FAC DATE
+26 ;S ITI=$$GET1^DIQ(165.5,PRM,55.2,"I") ;IMMUNOTHERAPY
+27 ;S ITE=$$GET1^DIQ(165.5,PRM,55.2,"E")
+28 ;S ITFACI=$$GET1^DIQ(165.5,PRM,55.3,"I") ;IMMUNOTHERAPY @FAC
+29 ;S ITFACE=$$GET1^DIQ(165.5,PRM,55.3,"E")
+30 ;S ITD=$$GET1^DIQ(165.5,PRM,55,"E") ;IMMUNOTHERAPY DATE
+31 ;S ITFACD=$$GET1^DIQ(165.5,PRM,55.4,"E") ;IMMUNOTHERAPY @FAC DATE
+32 ;S HTEPI=$$GET1^DIQ(165.5,PRM,153,"I") ;HEMA TRANS/ENDOCRINE PROC
+33 ;S HTEPE=$$GET1^DIQ(165.5,PRM,153,"E")
+34 ;S HTEPD=$$GET1^DIQ(165.5,PRM,153.1,"E") ;HEMA TRANS/ENDOCRINE PROC DATE
+35 ;I DRS="88/88/8888" D D TXDT88,ERRMSG
+36 ;.S MSG(1)="DATE RADIATION STARTED = "_DRS
+37 ;I DRSFAC="88/88/8888" D D ERRMSG
+38 ;.S MSG(1)="RADIATION @FACILITY DATE = "_DRSFAC
+39 ;I DRE="88/88/8888" D D ERRMSG
+40 ;.S MSG(1)="DATE RADIATION ENDED = "_DRE
+41 ;I CI=88 D D ERRMSG
+42 ;.S MSG(1)="CHEMOTHERAPY = "_CI_" ("_CE_")"
+43 ;I CD="88/88/8888" D D ERRMSG
+44 ;.S MSG(1)="CHEMOTHERAPY DATE = "_CD
+45 ;I CFACI=88 D D ERRMSG
+46 ;.S MSG(1)="CHEMOTHERAPY @FAC = "_CFACI_" ("_CFACE_")"
+47 ;I CFACD="88/88/8888" D D ERRMSG
+48 ;.S MSG(1)="CHEMOTHERAPY @FAC DATE = "_CFACD
+49 ;I HTI=88 D D ERRMSG
+50 ;.S MSG(1)="HORMONE THERAPY = "_HTI_" ("_HTE_")"
+51 ;I HTD="88/88/8888" D D ERRMSG
+52 ;.S MSG(1)="HORMONE THERAPY DATE = "_HTD
+53 ;I HTFACI=88 D D ERRMSG
+54 ;.S MSG(1)="HORMONE THERAPY @FAC = "_HTFACI_" ("_HTFACE_")"
+55 ;I HTFACD="88/88/8888" D D ERRMSG
+56 ;.S MSG(1)="HORMONE THERAPY @FAC DATE = "_HTFACD
+57 ;I ITI=88 D D ERRMSG
+58 ;.S MSG(1)="IMMUNOTHERAPY = "_ITI_" ("_ITE_")"
+59 ;I ITD="88/88/8888" D D ERRMSG
+60 ;.S MSG(1)="IMMUNOTHERAPY DATE = "_ITD
+61 ;I ITFACI=88 D D ERRMSG
+62 ;.S MSG(1)="IMMUNOTHERAPY @FAC = "_ITFACI_" ("_ITFACE_")"
+63 ;I ITFACD="88/88/8888" D D ERRMSG
+64 ;.S MSG(1)="IMMUNOTHERAPY @FAC DATE = "_ITFACD
+65 ;I HTEPI=12 D D ERRMSG
+66 ;.S MSG(1)="HEMA TRANS/ENDOCRINE PROC = 88 ("_HTEPE_")"
+67 ;I HTEPD="88/88/8888" D D ERRMSG
+68 ;.S MSG(1)="HEMA TRANS/ENDOCRINE PROC DATE = "_HTEPD
+69 ;K CD,CE,CFACD,CFACE,CFACI,CI,DRE,DRS,DRSFAC,HTD,HTE,HTEPD,HTEPE,HTEPI
+70 ;K HTFACD,HTFACE,HTFACI,HTI,ITD,ITE,ITFACD,ITFACE,ITFACI,ITI
+71 ;
FCTD ;
+1 ;N FCTD
+2 ;S FCTD=$$GET1^DIQ(165.5,PRM,49)
+3 ;I FCTD="00/00/0000",COCI'=38 D D ERRMSG
+4 ;.S MSG(1)="FIRST COURSE OF TREATMENT DATE = 00/00/0000"
+5 ;.S MSG(2)="CLASS OF CASE must be 38"
+6 ;.S MSG(3)="(Dx by autopsy at rpt facility)"
+7 ;I COCI=38,FCTD'="00/00/0000" D D ERRMSG
+8 ;.S MSG(1)="CLASS OF CASE = 38"
+9 ;.S MSG(2)="(Dx by autopsy at rpt facility)"
+10 ;.S MSG(3)="FIRST COURSE OF TREATMENT DATE must be 00/00/0000"
+11 ;
PHCSEQ SET SEQ=$$GET1^DIQ(165.5,PRM,.06,"I")
+1 SET PHC=$$GET1^DIQ(165.5,PRM,148,"E")
+2 ;I PHC="Yes",SEQ="00" D D ERRMSG
+3 ;.S MSG(1)="OTHER CANCER = Yes"
+4 ;.S MSG(2)="SEQUENCE NUMBER = "_SEQ
+5 ;.S MSG(3)="SEQUENCE NUMBER cannot not be 00"
+6 IF PHC="No"
IF (SEQ'="00")&(SEQ'=60)
Begin DoDot:1
+7 SET MSG(1)="OTHER CANCER = No"
+8 SET MSG(2)="SEQUENCE NUMBER = "_SEQ
+9 SET MSG(3)="SEQUENCE NUMBER must be 00 or 60"
End DoDot:1
DO ERRMSG
+10 KILL SEQ,PHC,MSG
+11 ;
+12 GOTO ^ONCEDIT2
+13 ;
ERRMSG ;Error message
+1 SET CMPLT=0
+2 WRITE !," WARNING: "
+3 SET MSGSUB=0
FOR
SET MSGSUB=$ORDER(MSG(MSGSUB))
if MSGSUB'>0
QUIT
WRITE ?10,MSG(MSGSUB),!
+4 READ Z:10
+5 KILL MSGSUB,Z
+6 QUIT
+7 ;
TXDT88 ;Treatment date = 88/88/8888 error message
+1 SET MSG(2)="This abstract cannot be 'Complete' without a valid treatment date."
+2 SET MSG(3)="This inter-field edit WARNING may not be overridden."
+3 SET OVERRIDE="NO"
+4 QUIT
+5 ;
CLEANUP ;Cleanup
+1 KILL CMPLT,OVERRIDE,PRM