179 lines
5.9 KiB
Mathematica
179 lines
5.9 KiB
Mathematica
ONCOAIF ;Hines OIFO/GWB - POST FOLLOW-UP; 07/12/00
|
|
;;2.11;ONCOLOGY;**11,15,16,24,25,26,27,28,37,45,47**;Mar 07, 1995;Build 19
|
|
;
|
|
BEG W @IOF,!," Post/Edit Follow-up"
|
|
W !," -------------------",!
|
|
Q
|
|
;
|
|
PAT ;[PF Post/Edit Follow-up]
|
|
N ONCDUZ,ONCDT
|
|
S ONCDUZ=DUZ,ONCDT=DT
|
|
D BEG
|
|
S DIC("A")=" Post/Edit Follow-Up for patient: "
|
|
S DIC="^ONCO(160,",DIC(0)="AEMQZ" D ^DIC K DIC
|
|
G EX:Y<0
|
|
S (ONCOD0,DA,D0)=+Y,ONCONM=Y(0,0)
|
|
D SUM,LST^ONCODLF G DIE
|
|
;
|
|
LST ;Follow-Up
|
|
W @IOF,!!," **********FOLLOW-UP**********",!!
|
|
W " Patient: ",ONCONM
|
|
W:$D(XDD) !," Date of Inpatient Discharge: ",XDD
|
|
Q
|
|
;
|
|
EN ;FOLLOW-UP entry when patient has been pre-selected
|
|
K F,DIC,DO,ONCOD1,LC,VS,NF,XDT,XDD,XR
|
|
S ONCDUZ=DUZ,ONCDT=DT
|
|
S PRESEL=1
|
|
S XDT=$S('$D(ONCOD0P):"",1:$$GET1^DIQ(165.5,ONCOD0P,1.1,"I"))
|
|
I (XDT="")!(XDT="0000000")!(XDT="9999999") D LST G DIE
|
|
D DD S F=$P($G(^ONCO(160,ONCOD0,"F",0)),U,4)
|
|
I F<1 D DLC,LST S F=1 G DIE
|
|
RF S D0=ONCOD0 W !! K DXS,DIOT D BEG W ! D LST^ONCODLF G DIE
|
|
;
|
|
DIE K DXS S ONCOSTAT=1,DA=ONCOD0,DR="[ONCO FOLLOWUP]",DIE="^ONCO(160,",FG=0
|
|
W ! D ^DIE
|
|
I 'FG S ONCOVS="" D UPOUT,CHKCMP I $G(FOLINP)="YES" G DIE
|
|
I $O(^ONCO(160,ONCOD0,"F",0))="" Q
|
|
D CHKCHG
|
|
I 'FG Q
|
|
;
|
|
UPDAT S D0=ONCOD0 K DXS,DIOT W ! D LST^ONCODLF,UPD^ONCOCRF
|
|
N Y K DIQ,ONC S DIC="^ONCO(160,",DR=".01;16;15;15.2",DA=ONCOD0,DIQ="ONC"
|
|
D EN^DIQ1 W !
|
|
W !," Name..: ",ONC(160,ONCOD0,.01)
|
|
W ?35,"Date Last Contact: ",ONC(160,ONCOD0,16)
|
|
W !," Status: ",ONC(160,ONCOD0,15)
|
|
W ?35,"Follow-Up Status.: ",ONC(160,ONCOD0,15.2)
|
|
D SUM
|
|
C K DIR S DIR("A")="DATA OK",DIR("B")="Yes",DIR(0)="Y"
|
|
D ^DIR Q:(Y=U)!(Y="") G DIE:'Y
|
|
I ONCOVS G EX:$D(PRESEL) G PAT:'$D(REC),REC
|
|
W !! D DEAD^ONCOFDP
|
|
Q:$D(ONCOAI) G REC:$D(REC) D KIL K ONCONM S ONCOD=1 G PAT:'$D(QA) Q
|
|
;
|
|
UPOUT ;Uparrow out check before deleting
|
|
Q:'$D(ONCOD1)
|
|
Q:'$D(^ONCO(160,ONCOD0,"F",ONCOD1,0))
|
|
Q:$P(^(0),U,8)=1
|
|
D DEL
|
|
Q
|
|
;
|
|
DEL ;Delete FOLLOW-UP entry
|
|
S DA(1)=ONCOD0,DA=ONCOD1,DIK="^ONCO(160,"_DA(1)_",""F"","
|
|
D ^DIK S ONCOVS=""
|
|
W:$D(^ONCO(160,ONCOD0,"F",ONCOD1,0)) $P(^(0),U,8)
|
|
W !!," *********************ENTRY DELETED*************************"
|
|
W !!," You have not entered all of the required information."
|
|
W !!,"(Last Tumor Status(es) have been reset for this patient's primary site(s).)",!!
|
|
H 1
|
|
Q
|
|
;
|
|
CHKCMP ;Check for 'Complete" abstracts with no follow-up
|
|
K ASTAT,FOLINP
|
|
Q:$O(^ONCO(160,ONCOD0,"F",0))'=""
|
|
S PRIM=0 F S PRIM=$O(^ONCO(165.5,"C",ONCOD0,PRIM)) Q:PRIM'>0 D
|
|
.I $P($G(^ONCO(165.5,PRIM,7)),U,2)=3 S ASTAT(PRIM)=""
|
|
Q:'$D(ASTAT)
|
|
W !
|
|
W !," There is no follow-up information for this patient."
|
|
W !," This patient has a 'Complete' abstract."
|
|
W !," A 'Complete' abstract requires at least one follow-up."
|
|
W !
|
|
K DIR
|
|
S DIR("A")=" Do you wish to enter a follow-up at this time"
|
|
S DIR("B")="YES",DIR(0)="Y" D ^DIR
|
|
I Y=1 S FOLINP="YES" Q
|
|
S PRIM=0 F S PRIM=$O(ASTAT(PRIM)) Q:PRIM'>0 D
|
|
.S DIE="^ONCO(165.5,"
|
|
.S DA=PRIM
|
|
.S DR="90///@;91///0;92///@;197///@"
|
|
.D ^DIE
|
|
W !!," The ABSTRACT STATUS has been changed to 0 (Incomplete)"
|
|
W !," for the following abstracts:",!
|
|
S PRIM=0 F S PRIM=$O(ASTAT(PRIM)) Q:PRIM'>0 D
|
|
.S PN=$$GET1^DIQ(165.5,PRIM,.02)
|
|
.S AN=$$GET1^DIQ(165.5,PRIM,.05)
|
|
.S SEQ=$$GET1^DIQ(165.5,PRIM,.06)
|
|
.S PID=$$GET1^DIQ(165.5,PRIM,61)
|
|
.S PSCODE=$$GET1^DIQ(165.5,PRIM,20.1)
|
|
.W !?1,PID," ",PSCODE," ",AN,"/",SEQ
|
|
.W !
|
|
K DIR S DIR(0)="E" D ^DIR
|
|
Q
|
|
;
|
|
CHKCHG ;Check for checksum changes to 'Complete' abstracts
|
|
S CNT=0 W !!," Checking for changes to 'Complete' abstracts" S PRIM=0 F S PRIM=$O(^ONCO(165.5,"C",ONCOD0,PRIM)) Q:PRIM'>0 D
|
|
.W "."
|
|
.I $P($G(^ONCO(165.5,PRIM,7)),U,2)=3 D
|
|
..S EDITS="NO" S D0=PRIM D NAACCR^ONCGENED K EDITS
|
|
..S CHECKSUM=$$CRC32^ONCSNACR(.ONCDST)
|
|
..I CHECKSUM'=$P($G(^ONCO(165.5,PRIM,"EDITS")),U,1) D
|
|
...S $P(^ONCO(165.5,PRIM,"EDITS"),U,1)=CHECKSUM
|
|
...W !!," Re-computing checksum value for 'Complete' abstract ",$$GET1^DIQ(165.5,PRIM,.061)
|
|
...S CNT=CNT+1
|
|
W:CNT=0 " No changes found."
|
|
Q
|
|
;
|
|
REC ;[RF Recurrence/Sub Tx Follow-up]
|
|
K ^DISV(DUZ,"^ONCO(165.5,")
|
|
N ONCDUZ,ONCDT
|
|
S ONCDUZ=DUZ,ONCDT=DT
|
|
S XR=1,REC="" W @IOF,!," Recurrence/Sub Tx Follow-up"
|
|
W !," ---------------------------",!
|
|
S DIC("A")="Select Patient for Recurrence: "
|
|
S DIC="^ONCO(160,",DIC(0)="AEQMZ" D ^DIC K DIC
|
|
G EX:Y<0
|
|
S (D0,ONCOD0)=+Y,ONCONM=Y(0,0)
|
|
N Y
|
|
K DIQ,ONC S DIC="^ONCO(160,",DR=".01;2;3;8;10;15",DA=ONCOD0,DIQ="ONC"
|
|
D EN^DIQ1 W !
|
|
W !?2,"Name.........: ",ONC(160,ONCOD0,.01)
|
|
W ?35,"Race.........: ",ONC(160,ONCOD0,8)
|
|
W !?2,"SSN..........: ",ONC(160,ONCOD0,2)
|
|
W ?35,"Sex..........: ",ONC(160,ONCOD0,10)
|
|
W !?2,"Date of Birth: ",ONC(160,ONCOD0,3)
|
|
W ?35,"Status.......: ",ONC(160,ONCOD0,15)
|
|
D SUM
|
|
K DIC W !?1,"Select Primary for Recurrence: ",!
|
|
S D="C",DIC="^ONCO(165.5,",X=ONCOD0,DIC(0)="EFZ" D IX^DIC G:Y<0 REC
|
|
I Y'=" " S (ONCOD0P,DA)=+Y,DR="[ONCO RECURRENCE FOLLOWUP]",DIE="^ONCO(165.5,",DATEDX=$P(^ONCO(165.5,DA,0),U,16),TX=$P($G(^ONCO(165.5,DA,2)),U,1) D ^DIE D CHKCHG S AB=2,ONCOD0P=D0 G EN
|
|
;
|
|
RE ;Recurrence
|
|
W !!," Recurrence"
|
|
W !," ----------"
|
|
Q
|
|
;
|
|
STX ;Subsequent Course of Treatment
|
|
W !!," Subsequent Course of Treatment"
|
|
W !," ------------------------------"
|
|
Q
|
|
;
|
|
KIL ;Kill variables
|
|
K ONCOSTAT,XR,ED0,DA,DIC,DIE,DIK,DIOT,DIR,DO,DR,DQ,DXS,F,FDOC,FG,FS
|
|
K ONCOD1,ONCOLC,TM,TS,CS,K,I,XY,XX,XDA,XD1,XD0,LC,ONCONF,ONCOVS,REC
|
|
K AB,DATEDX,PRESEL
|
|
Q
|
|
;
|
|
EX ;Exit
|
|
D KIL Q
|
|
;
|
|
DD ;Date format
|
|
S XDD=$E(XDT,4,5)_"/"_$E(XDT,6,7)_"/"_($E(XDT,1,3)+1700) Q
|
|
;
|
|
DLC ;Create FOLLOW-UP
|
|
K DA
|
|
S DA(1)=ONCOD0,DIC="^ONCO(160,"_DA(1)_","_"""F"""_","
|
|
S DLAYGO=160,X=XDT,DIC(0)="ZL"
|
|
I '$D(^ONCO(160,DA(1),"F")) S ^ONCO(160,DA(1),"F",0)="^160.04DAI^^"
|
|
D FILE^DICN S ONCOLC=XDT,DIE=DIC,DR="1////1;2////2;" D ^DIE
|
|
K DA,DIC,DLAYGO,DIE
|
|
Q
|
|
;
|
|
SUM ;Primary summary
|
|
S XD0=D0
|
|
N J,XD1,LINE W !!
|
|
S LINE=" ------------- -------------------- ----------------- ---------- ---- -----"
|
|
S J=0,XD1=0 F S XD1=$O(^ONCO(165.5,"C",XD0,XD1)) Q:XD1'>0 I $D(^ONCO(165.5,XD1,0)) S J=J+1 W:J=1 " Acc/Sequence",?15,"Topography",?37,"Last Tumor Status",?56,"Date DX",?68,"Stat",?74,"Div",!,LINE,! D FU^ONCOCOML
|
|
Q
|