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

ONCOAS.m

Go to the documentation of this file.
  1. ONCOAS ;Hines OIFO/GWB - [SE Add/Edit/Delete 'Suspense' Case] ;05/30/00
  1. ;;2.2;ONCOLOGY;**1**;Jul 31, 2013;Build 8
  1. ;
  1. PAT ;[SE Add/Edit/Delete 'Suspense' Case]
  1. W ! S DIC="^ONCO(160,",DIC(0)="AEZML",DLAYGO=160 D ^DIC G:Y<0 EX
  1. S (D0,ONCOD0)=+Y
  1. N Y K DIQ,ONC S DIC="^ONCO(160,",DR=".01;16;15;15.2",DA=ONCOD0,DIQ="ONC"
  1. D EN^DIQ1 W !
  1. W !?1,"Patient Name.................: ",ONC(160,ONCOD0,.01)
  1. W !?1,"Date of Last Contact or Death: ",ONC(160,ONCOD0,16)
  1. W !?1,"Vital Status.................: ",ONC(160,ONCOD0,15)
  1. W !?1,"Follow-Up Status.............: ",ONC(160,ONCOD0,15.2)
  1. D SDD^ONCOCOM
  1. I $D(^ONCO(160,ONCOD0,"SUS","C",DUZ(2))) D D DEL G PAT
  1. .S SUSIEN=$O(^ONCO(160,ONCOD0,"SUS","C",DUZ(2),0))
  1. .S DIE="^ONCO(160,"_ONCOD0_",""SUS"",",DA(1)=ONCOD0,DA=SUSIEN
  1. .S DR=".01;3" D ^DIE
  1. S DA(1)=ONCOD0,DIC="^ONCO(160,"_ONCOD0_",""SUS"",",DIC(0)="QEAL"
  1. S DIC("A")="SUSPENSE DATE: "
  1. S DIC("S")="I $P(^ONCO(160,DA(1),""SUS"",Y,0),U,4)=DUZ(2)"
  1. D ^DIC I Y=-1 K DIC,DA D DEL G PAT
  1. S DIE=DIC K DIC
  1. S DA=+Y,DR="1///^S X=DT;2///^S X=""SE"";3////^S X=DUZ(2)"
  1. S ONCOL=0 L +^ONCO(160,DA):0 I $T D ^DIE L -^ONCO(160,DA) S ONCOL=1
  1. I 'ONCOL W !,"This patient is being edited by another user." G PAT
  1. K ONCOL,DIE,DR,DA,Y
  1. D DEL G PAT
  1. ;
  1. EX ;Exit
  1. K X,Y,D0,DA,DIC,DIE,DIK,DIQ,DLAYGO,DR
  1. K ONC,ONCOD0,ONCOL,SUSIEN
  1. Q
  1. ;
  1. DEL ;Delete patients who are not on suspense and have no primaries
  1. I $O(^ONCO(160,ONCOD0,"SUS",0))="",'$D(^ONCO(165.5,"C",ONCOD0)) D
  1. .N DIK,DA S DIK="^ONCO(160,",DA=ONCOD0 D ^DIK
  1. .W !!?3,*7,"This patient is not on suspense and has no primaries."
  1. .W !?3,"This patient's record has been deleted."
  1. Q
  1. ;
  1. PURGE ;PSR Purge Suspense Records [ONCO UTIL-PURGE SUSPENSE]
  1. W !
  1. W !," This option will purge suspense records. The user may purge ALL suspense"
  1. W !," records or the suspense records for a selected SUSPENSE DATE range."
  1. W !
  1. W !," NOTE: Only suspense records which belong to your division will be purged."
  1. W !
  1. W !," If, after the suspense record purge, the patient has no suspense records"
  1. W !," and no primaries (for any division), the tumor registry patient record"
  1. W !," will also be purged."
  1. W !
  1. K DIR
  1. S DIR("A")=" Select purge option"
  1. S DIR(0)="SO^1:ALL suspense records for your division;2:Range of suspense records by SUSPENSE DATE"
  1. D ^DIR K DIR Q:$D(DIRUT)
  1. I Y=1 S ANS="YES" G PSR
  1. I Y=2 S ANS="NO"
  1. K DIR
  1. W !
  1. S DIR(0)="D"
  1. S DIR("A")=" Start Suspense Date"
  1. S DIR("?")=" "
  1. S DIR("?",1)=" Enter the SUSPENSE DATE of the first suspense record you would like to purge."
  1. D ^DIR I $D(DIRUT) Q
  1. S SDT=Y
  1. S DIR("A")=" End Suspense Date"
  1. S DIR("?",1)=" Enter the SUSPENSE DATE of the last suspense record you would like to purge."
  1. D ^DIR I $D(DIRUT) Q
  1. S EDT=Y
  1. PSR W !
  1. K DIR,ONC
  1. S DIR("A")=" Are you sure you want to purge suspense records"
  1. S DIR("B")="No"
  1. S DIR(0)="Y" D ^DIR
  1. I Y=0 Q
  1. I ANS="YES" S X0=0,EDT=9999999
  1. I ANS="NO" S X0=SDT-1
  1. S CNT=0
  1. F S X0=$O(^ONCO(160,"ADX",X0)) Q:('X0)!(X0>EDT) S X1=0 F S X1=$O(^ONCO(160,"ADX",X0,X1)) Q:'X1 S X2=0 F S X2=$O(^ONCO(160,"ADX",X0,X1,X2)) Q:'X2 I $$SUSDIV^ONCFUNC(X1,X2)=DUZ(2) D
  1. .S DA(1)=X1,DA=X2,DIK="^ONCO(160,"_DA(1)_",""SUS""," D ^DIK
  1. .S CNT=CNT+1
  1. .S ONC(X1)=""
  1. .W "."
  1. S PATCNT=0,SUB=0 F S SUB=$O(ONC(SUB)) Q:'SUB D
  1. .I $O(^ONCO(160,SUB,"SUS",0))="",'$D(^ONCO(165.5,"C",SUB)) D
  1. ..N DIK,DA S DIK="^ONCO(160,",DA=SUB D ^DIK S PATCNT=PATCNT+1
  1. W !!,?3,CNT," Suspense ",$S(CNT=1:"record",1:"records")," purged"
  1. W !,?3,PATCNT," Tumor Registry patient ",$S(CNT=1:"record",1:"records")," purged"
  1. K ANS,CNT,EDT,ONC,PATCNT,SDT,X0,X1,X2,Y,DA,DIK,DIR
  1. Q