source: WorldVistAEHR/trunk/r/ONCOLOGY-ONC/ONCOAS.m@ 1211

Last change on this file since 1211 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.5 KB
Line 
1ONCOAS ;Hines OIFO/GWB - [SE Add/Edit/Delete 'Suspense' Case] ;05/30/00
2 ;;2.11;ONCOLOGY;**25,26,27,41**;Mar 07, 1995
3 ;
4PAT ;[SE Add/Edit/Delete 'Suspense' Case]
5 W ! S DIC="^ONCO(160,",DIC(0)="AEZML",DLAYGO=160 D ^DIC G:Y<0 EX
6 S (D0,ONCOD0)=+Y
7 N Y K DIQ,ONC S DIC="^ONCO(160,",DR=".01;16;15;15.2",DA=ONCOD0,DIQ="ONC"
8 D EN^DIQ1 W !
9 W !?1,"Patient Name.................: ",ONC(160,ONCOD0,.01)
10 W !?1,"Date of Last Contact or Death: ",ONC(160,ONCOD0,16)
11 W !?1,"Vital Status.................: ",ONC(160,ONCOD0,15)
12 W !?1,"Follow-Up Status.............: ",ONC(160,ONCOD0,15.2)
13 D SDD^ONCOCOM
14 I $D(^ONCO(160,ONCOD0,"SUS","C",DUZ(2))) D D DEL G PAT
15 .S SUSIEN=$O(^ONCO(160,ONCOD0,"SUS","C",DUZ(2),0))
16 .S DIE="^ONCO(160,"_ONCOD0_",""SUS"",",DA(1)=ONCOD0,DA=SUSIEN
17 .S DR=".01;3" D ^DIE
18 S DA(1)=ONCOD0,DIC="^ONCO(160,"_ONCOD0_",""SUS"",",DIC(0)="QEAL"
19 S DIC("A")="SUSPENSE DATE: "
20 S DIC("S")="I $P(^ONCO(160,DA(1),""SUS"",Y,0),U,4)=DUZ(2)"
21 D ^DIC I Y=-1 K DIC,DA D DEL G PAT
22 S DIE=DIC K DIC
23 S DA=+Y,DR="1///^S X=DT;2///^S X=""SE"";3////^S X=DUZ(2)"
24 S ONCOL=0 L +^ONCO(160,DA):0 I $T D ^DIE L -^ONCO(160,DA) S ONCOL=1
25 I 'ONCOL W !,"This patient is being edited by another user." G PAT
26 K ONCOL,DIE,DR,DA,Y
27 D DEL G PAT
28 ;
29EX ;Exit
30 K X,Y,D0,DA,DIC,DIE,DIK,DIQ,DLAYGO,DR
31 K ONC,ONCOD0,ONCOL,SUSIEN
32 Q
33 ;
34DEL ;Delete patients who are not on suspense and have no primaries
35 I $O(^ONCO(160,ONCOD0,"SUS",0))="",'$D(^ONCO(165.5,"C",ONCOD0)) D
36 .N DIK,DA S DIK="^ONCO(160,",DA=ONCOD0 D ^DIK
37 .W !!?3,*7,"This patient is not on suspense and has no primaries."
38 .W !?3,"This patient's record has been deleted."
39 Q
40 ;
41PURGE ;PSR Purge Suspense Records [ONCO UTIL-PURGE SUSPENSE]
42 W !
43 W !," This option will purge suspense records. The user may purge ALL suspense"
44 W !," records or the suspense records for a selected SUSPENSE DATE range."
45 W !
46 W !," NOTE: Only suspense records which belong to your division will be purged."
47 W !
48 W !," If, after the suspense record purge, the patient has no suspense records"
49 W !," and no primaries (for any division), the tumor registry patient record"
50 W !," will also be purged."
51 W !
52 K DIR
53 S DIR("A")=" Select purge option"
54 S DIR(0)="SO^1:ALL suspense records for your division;2:Range of suspense records by SUSPENSE DATE"
55 D ^DIR K DIR Q:$D(DIRUT)
56 I Y=1 S ANS="YES" G PSR
57 I Y=2 S ANS="NO"
58 K DIR
59 W !
60 S DIR(0)="D"
61 S DIR("A")=" Start Suspense Date"
62 S DIR("?")=" "
63 S DIR("?",1)=" Enter the SUSPENSE DATE of the first suspense record you would like to purge."
64 D ^DIR I $D(DIRUT) Q
65 S SDT=Y
66 S DIR("A")=" End Suspense Date"
67 S DIR("?",1)=" Enter the SUSPENSE DATE of the last suspense record you would like to purge."
68 D ^DIR I $D(DIRUT) Q
69 S EDT=Y
70PSR W !
71 K DIR,ONC
72 S DIR("A")=" Are you sure you want to purge suspense records"
73 S DIR("B")="No"
74 S DIR(0)="Y" D ^DIR
75 I Y=0 Q
76 I ANS="YES" S X0=0,EDT=9999999
77 I ANS="NO" S X0=SDT-1
78 S CNT=0
79 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
80 .S DA(1)=X1,DA=X2,DIK="^ONCO(160,"_DA(1)_",""SUS""," D ^DIK
81 .S CNT=CNT+1
82 .S ONC(X1)=""
83 .W "."
84 S PATCNT=0,SUB=0 F S SUB=$O(ONC(SUB)) Q:'SUB D
85 .I $O(^ONCO(160,SUB,"SUS",0))="",'$D(^ONCO(165.5,"C",SUB)) D
86 ..N DIK,DA S DIK="^ONCO(160,",DA=SUB D ^DIK S PATCNT=PATCNT+1
87 W !!,?3,CNT," Suspense ",$S(CNT=1:"record",1:"records")," purged"
88 W !,?3,PATCNT," Tumor Registry patient ",$S(CNT=1:"record",1:"records")," purged"
89 K ANS,CNT,EDT,ONC,PATCNT,SDT,X0,X1,X2,Y,DA,DIK,DIR
90 Q
Note: See TracBrowser for help on using the repository browser.