source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAORDC.m@ 1096

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

initial load of WorldVistAEHR

File size: 3.5 KB
Line 
1RAORDC ;HISC/CAH,FPT,GJC,DAD AISC/RMO-Check Request Status against Exam Status ;4/9/97 12:06
2 ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
3 ;
4 ;The variables RADFN, RADTI and RACNI must be defined. The variable
5 ;RADELFLG is set when the exam is being deleted. This routine is
6 ;called after an exam status is updated, to update the order status.
7 ;Called from RAEDCN after exam cancel or delete, from RAESO after
8 ;override single exam to complete, from RASTED after exam status is
9 ;updated successfully, and from RAUTL1 after exam status update.
10 G Q:'$D(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0)) S RAEXM0=^(0),RAEXOR=$S($D(RADELFLG):0,$D(^RA(72,+$P(RAEXM0,"^",3),0)):$P(^(0),"^",3),1:""),RAOIFN=+$P(RAEXM0,"^",11) G Q:'$D(^RAO(75.1,RAOIFN,0)) S (RAORD0,RAORDB4)=^(0)
11 S RAOSTS=$S(RAEXOR=0:0,RAEXOR>0&(RAEXOR<9):6,RAEXOR=9:2,1:"") D EXMCAN:RAOSTS=0,EXMCOM:RAOSTS=2,^RAORDU:RAOSTS=6&(RAOSTS'=$P(RAORD0,"^",5))
12 I $P($G(RAORDB4),"^",5)=2,(RAOSTS'=2) D
13 . ; Prior request status complete ($P(RAORDB4,"^",5)=2), new request
14 . ; status (RAOSTS) not complete & OE/RR version not less than 3 issue
15 . ; roll back message
16 . D:$$ORVR^RAORDU()'<3 EN2^RAO7CH(RAOIFN)
17 . ; Delete 'V' file pointers if PCE installed & outpatient
18 . I $P(RAEXM0,"^",6)]"",($P(^DIC(42,$P(RAEXM0,"^",6),0),"^",3)'="D") Q
19 . D:$$PCE^RAWORK() UNCOMPL^RAPCE1(RADFN,RADTI,RACNI)
20 . Q
21Q K RABLNK,RACAT,RAEXM0,RAEXOR,RAILP,RAMIFN,RAMOD,RAMODA,RAMODD,RAOIFN,RAORD0,RAORDB4,RAOSTS,RAPRC,RARSH,RASHA,X
22 I '$D(N)!($D(RAOREA)<10) K RAOREA Q
23 I $D(RAOREA)>1,$G(N) K RAOREA(N) I $D(RAOREA)<10 K RAOREA
24 Q
25 ;
26EXMCAN ; Update request status to cancel or hold.
27 N RAXIT S RAXIT=0
28 S RAOREA=$S($D(RAOREA):RAOREA,1:$O(^RA(75.2,"B",$S($D(RADELFLG):"EXAM DELETED",1:"EXAM CANCELLED"),0)))
29 ;
30ASKCAN S RA=$O(^RADPT("AO",RAOIFN,RADFN,RADTI,0))
31 I RA,$O(^RADPT("AO",RAOIFN,RADFN,RADTI,RA)) D Q:RAXIT
32 . ; If # descendents > 1 do not allow order to be deleted or canceled
33 . N RAESTAT S RAESTAT=$$EN1^RASETU(RAOIFN,RADFN)
34 . Q:+$P(RAESTAT,"^",3) ; all other exams have been cancelled
35 . S RAXIT=1 ; if ramaining xams complete -or- at least one of the other
36 . ; xams not cancelled, take appropriate action, quit EXMCAN
37 . I +RAESTAT=9 S RAOSTS=2 D ^RAORDU S RAOSTS=0 Q ; all xams complete
38 . W !!?5,"Please note, however, that more than one procedure is associated"
39 . W !?5,"with the procedure's Parent request. The Parent request will not"
40 . W !?5,"be canceled or put or hold unless all the registered descendent"
41 . W !?5,"procedures are canceled or deleted.",!,$C(7)
42 . Q
43 W !!,"Do you want to cancel the request associated with this exam" S %=2 D YN^DICN S RAOSTS=$S(%=1:1,%=2:3,1:0) I 'RAOSTS W !!,"Required, enter 'YES' if the request should be cancelled or 'NO' to put",!,"it on hold." G ASKCAN
44 I RAOSTS=1,$D(RADELFLG) D
45 . ; Remove EXAM SET flag if parent order deleted
46 . N DA,DIE,DR
47 . S DIE="^RADPT("_RADFN_",""DT"",",DA(1)=RADFN,DA=RADTI,DR="5///@"
48 . D ^DIE
49 . Q
50 I RAOSTS=3 S (DIE,DIC)="^RAO(75.1,",DIC(0)="AEQM",DA=RAOIFN,DR="25" W ! D ^DIE K DIE,DIC,DA,DR
51 D ^RAORDU W !?10,"...request status updated to ",$S(RAOSTS=1:"discontinued",1:"hold"),"."
52 Q
53 ;
54EXMCOM ; Code moved to EXMCOM^RAORDC1 to save on space. To update request
55 ; statuses for complete exams.
56 D EXMCOM^RAORDC1 Q
57 ;
58DELMOD S DA(1)=RAOIFN,DA=RAMIFN,DIK="^RAO(75.1,"_DA(1)_",""M""," D ^DIK K DA,DIK S RAMODD=""
59 Q
60 ;
61ADDMOD S X=$S($D(^RAMIS(71.2,RAILP,0)):$P(^(0),"^"),1:"") I X'="" S:'$D(^RAO(75.1,RAOIFN,"M",0)) ^(0)="^75.1125PA^^" S DIC(0)="L",DLAYGO=75.1,DA(1)=RAOIFN,DIC="^RAO(75.1,RAOIFN,""M""," D ^DIC K DA,DIC S RAMODA=""
62 Q
Note: See TracBrowser for help on using the repository browser.