source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAORD.m@ 1270

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

initial load of WorldVistAEHR

File size: 6.9 KB
Line 
1RAORD ;HISC/CAH,FPT,GJC AISC/RMO-Rad/NM Order Entry Main Menu ;3/13/98 12:16
2 ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
32 ;;Schedule a Request
4 N RAPTLOCK
521 ; Patient lookup
6 S DIC="^DPT(",DIC(0)="AEMQ" W ! D ^DIC K DIC G Q2:Y<0
7 I $$ORVR^RAORDU()'<3 D G:'RAPTLOCK 21
8 . S RAPTLOCK=$$LK^RAUTL19(+Y_";DPT(")
9 . Q
10 S RADFN=+Y,RANME=$S($D(^DPT(RADFN,0)):$P(^(0),"^"),1:"Unknown")
11 S (RAOFNS,RAOPTN)="Schedule",RAOVSTS="3;5"
12 W ! D ^RAORDS G Q2:'$D(RAORDS)
13 S %DT("A")="Schedule Request Date/Time: ",%DT="AEFXT"
14 W ! D ^%DT K %DT G Q2:Y<0 S RAOSCH=Y,RAOLP=0
15 F S RAOLP=+$O(RAORDS(RAOLP)) Q:'RAOLP!('+$G(RAORDS(RAOLP))) D
16 . S RAOIFN=$G(RAORDS(RAOLP)),RAOSTS=8 D ^RAORDU
17 . Q
18 D Q2 G 21
19Q2 ; Unlock if appropriate, kill vars
20 I $$ORVR^RAORDU()'<3,(+$G(RAPTLOCK)),(+$G(RADFN)) D
21 . D ULK^RAUTL19(RADFN_";DPT(")
22 K %DT,C,D,D0,DA,I,RADFN,RADIV,RANME,RAOFNS,RAOIFN,RAOLP,RAORDS,RAOSCH
23 K RAOPTN,RAOSTS,RAOVSTS,X,Y
24 K RAPARENT
25 K A1,D1,DDER,DDH,DI,DIPGM,POP,^TMP($J,"PRO-ORD")
26 Q
27 ;
283 ;;Cancel a Request
29 N RAPTLOCK,RAXIT S RAXIT=0,RAPKG=""
3031 ; Patient lookup
31 S DIC="^DPT(",DIC(0)="AEMQ" W ! D ^DIC K DIC G Q3:Y<0
32 I $$ORVR^RAORDU()'<3 D G:'RAPTLOCK 31
33 . S RAPTLOCK=$$LK^RAUTL19(+Y_";DPT(")
34 . Q
35 S RADFN=+Y,RANME=$S($D(^DPT(RADFN,0)):$P(^(0),"^"),1:"Unknown")
36 S (RAOFNS,RAOPTN)="Cancel"
37 D CHKUSR^RAUTL2 S RAOVSTS=$S(RAMSG:"3;5;8",1:"5")
38 W ! D ^RAORDS G Q3:'$D(RAORDS)
39 D REASON G Q3:RAXIT!(+$G(OREND))
40ENCAN ;OE/RR Entry Point for the CANCEL ACTION Option
41 K ORSTRT,ORSTOP,ORTO,ORTX,ORIT,ORCOST,ORPURG
42 I $D(RAPKG) W !?3,"...will now 'CANCEL' selected request(s)..."
43 S RAOLP=0
44 F S RAOLP=+$O(RAORDS(RAOLP)) Q:'RAOLP!('+$G(RAORDS(RAOLP))) D
45 . S RAOIFN=$G(RAORDS(RAOLP)),RAOSTS=1 D ^RAORDU
46 . I $D(RAPKG),$D(^RAO(75.1,RAOIFN,0)),$D(^RAMIS(71,+$P(^(0),"^",2),0)) W !?10,"...",$P(^(0),"^")," cancelled..."
47 . ; Print Cancelled Requests if appropriate
48 . K RA751,RA791 S RA751=$G(^RAO(75.1,RAOIFN,0))
49 . S RA791=$G(^RA(79.1,+$P(RA751,"^",20),0))
50 . I $P(RA791,"^",24)]""!(+$P($G(^RA(79.1,+$O(^RA(79.1,0)),0)),"^",24)) D
51 .. K RACRHD,RAION,RAPGE,RAX S RAPGE=0,(RACRHD,RAX)=""
52 .. ; RAOIFN already defined, RADFN may/maynot be defined!
53 .. I '$D(RADFN) N RADFN S RADFN=+$P(RA751,"^")
54 .. S RAION=$S($P(RA791,"^",24)]"":$P(RA791,"^",24),1:+$P($G(^RA(79.1,+$O(^RA(79.1,0)),0)),"^",24))
55 .. S RAION=$$GET1^DIQ(3.5,RAION_",",.01)
56 .. D PCR ; Print Cancelled Request subroutine
57 .. K RACRHD,RAION,RAPGE,RAX
58 .. Q
59 . K RA751,RA791
60 . Q
61Q3 ; unlock if appropriate, kill variables
62 I $$ORVR^RAORDU()'<3,(+$G(RAPTLOCK)),(+$G(RADFN)) D
63 . D ULK^RAUTL19(RADFN_";DPT(")
64 K %,%DT,C,D,D0,DA,POP,RADFN,RADIV,RAMSG,RANME,RAOFNS,RAOIFN,RAOLP
65 K RAOPTN,RAORDS,RAOSTS,RAOVSTS I $D(RAPKG) K OREND,RAPKG
66 I '$D(N)!($D(RAOREA)<10) K RAPARENT,X,Y
67 I '$D(N)!($D(RAOREA)<10) K RAOREA G Q35
68 I $D(RAOREA)>1,$G(N) K RAOREA(N),N I $D(RAOREA)<10 K RAOREA
69 K RAPARENT,X,Y
70Q35 K DIPGM,I
71 Q
72CHECK ; Check on the status of the order
73 S OREND=$S(ORSTS=5:0,ORSTS=11:0,1:1) W:OREND !!,"Only orders in a Pending or Unreleased status can be cancelled.",$C(7)
74 Q
75REASON ; Select a Cancel Reason
76 S DIC("A")="Select CANCEL REASON: ",DIC("S")="I $P(^(0),U,2)=1!($P(^(0),U,2)=9)",DIC="^RA(75.2,",DIC(0)="AEMQ"
77 W ! D ^DIC K DIC
78 I +Y<0,(X["^") S RAXIT=1 Q
79 I +Y<0 W !!?3,"A Cancel Reason is required to proceed." G REASON
80 S OREND=0,RAOREA($S($D(ORPK):ORPK,$D(ORIFN):ORIFN,1:1))=+Y
81 Q
824 ;;Hold a Request
83 N RAPTLOCK
8440 ; Patient lookup
85 S DIC="^DPT(",DIC(0)="AEMQ" W ! D ^DIC K DIC G Q4:Y<0
86 I $$ORVR^RAORDU()'<3 D G:'RAPTLOCK 40
87 . S RAPTLOCK=$$LK^RAUTL19(+Y_";DPT(")
88 . Q
89 S RADFN=+Y,RANME=$S($D(^DPT(RADFN,0)):$P(^(0),"^"),1:"Unknown")
90 S (RAOFNS,RAOPTN)="Hold",RAOVSTS="5;8"
91 W ! D ^RAORDS G Q4:'$D(RAORDS)
9241 ; Select a Hold Reason
93 S DIC("A")="Select HOLD REASON: ",DIC("S")="I $P(^(0),U,2)=3!($P(^(0),U,2)=9)",DIC="^RA(75.2,",DIC(0)="AEMQ" W ! D ^DIC K DIC
94 I +Y<0,(X["^") D Q4 Q
95 I +Y<0 W !!?3,"A Hold Reason is required to proceed." G 41
96 S RAOREA=+Y
97 W !?3,"...will now 'HOLD' selected request(s)..." S RAOLP=0
98 F S RAOLP=+$O(RAORDS(RAOLP)) Q:'RAOLP!('+$G(RAORDS(RAOLP))) D
99 . S RAOIFN=$G(RAORDS(RAOLP)),RAOSTS=3 D ^RAORDU
100 . I $D(^RAO(75.1,RAOIFN,0)),$D(^RAMIS(71,+$P(^(0),"^",2),0)) W !?10,"...",$P(^(0),"^")," held..."
101 . Q
102 D Q4 G 40
103Q4 ; unlock if appropriate, kill variables
104 I $$ORVR^RAORDU()'<3,(+$G(RAPTLOCK)),(+$G(RADFN)) D
105 . D ULK^RAUTL19(RADFN_";DPT(")
106 K %DT,C,D,D0,DA,I,POP,RADFN,RADIV,RANME,RAOFNS,RAOIFN,RAOLP,RAORDS
107 K RAOPTN,RAOREA,RAOSTS,RAOVSTS,X,Y
108 K D1,DDER,DI,DIPGM,DISYS,DUOUT,RAPARENT,^TMP($J,"PRO-ORD"),^("XQALSET")
109 Q
110 ;
1119 ;;Print Selected Requests by Patient
112 K ^TMP($J,"RA PRINT HS BY PAT")
113 S DIC="^DPT(",DIC(0)="AEMQ" W ! D ^DIC K DIC G Q9:Y<0 S RADFN=+Y,RANME=$S($D(^DPT(RADFN,0)):$P(^(0),"^"),1:"Unknown"),RAOFNS="Print",RAOVSTS="1;2;3;5;6;8" W ! D ^RAORDS G Q9:'$D(RAORDS)
114 S RAOIFNS="" F RAOLP=1:1 Q:'$D(RAORDS(RAOLP)) S RAOIFNS=RAOIFNS_+RAORDS(RAOLP)_";"
115 W ! K DIR,DIROUT,DIRUT,DTOUT,DUOUT
116 S DIR(0)="Y",DIR("B")="No"
117 S DIR("?")="Answer 'Y'es to print the report, 'N'o to quit."
118 S DIR("A")="Do you wish to generate a Health Summary Report"
119 D ^DIR G:$D(DIRUT) Q9 S RAGMTS=+Y
120 S ZTRTN="START9^RAORD",ZTSAVE("RADFN")="",ZTSAVE("RAOIFNS")=""
121 S ZTSAVE("RAGMTS")="" S:$D(RAOPT) ZTSAVE("RAOPT(")=""
122 W ! D ZIS^RAUTL G Q9:RAPOP
123 ;
124START9 ; Start printing requests
125 U IO S RAX="" N RA751
126 F RAOLP=1:1 S RAOIFN=$P(RAOIFNS,";",RAOLP) Q:'RAOIFN!(RAX["^") D
127 . S RAPGE=0 D ^RAORD5 Q:RAX["^"
128 . D CRCHK^RAORD6 Q:RAX["^"
129 . Q:'RAGMTS ; quit if 'No' to 'generate a Health Summary Report'.
130 . S RA751(0)=$G(^RAO(75.1,RAOIFN,0)),RA751(2)=$P(RA751(0),"^",2)
131 . S GMTSTYP=$P($G(^RAMIS(71,+RA751(2),0)),"^",13)
132 . I GMTSTYP>0,('$D(^TMP($J,"RA PRINT HS BY PAT",GMTSTYP,RADFN))) D
133 .. W:$Y>0 @IOF D ENX^GMTSDVR(RADFN,GMTSTYP)
134 .. S ^TMP($J,"RA PRINT HS BY PAT",GMTSTYP,RADFN)=""
135 .. Q
136 . Q
137Q9 K %DT,C,D,D0,DA,DFN,GMTSTYP,I,POP,RACNI,RADFN,RADIV,RADTI,RANME,RAOFNS
138 K RAOIFN,RAOIFNS,RAOLP,RAORDS,RAOSTS,RAOVSTS,RAPARENT,RAPGE,RAPOP,RAX
139 K RAGMTS,VAI,VAIN,X,Y,Z,^TMP($J,"RA PRINT HS BY PAT")
140 K RAMES,ZTDESC,ZTRTN,ZTSAVE
141 K DIR,DIROUT,DIRUT,DTOUT,DUOUT
142 K DIPGM,DISYS,DIW,DIWT,DN,RA6,RA7,^TMP($J,"PRO-ORD")
143 W ! D CLOSE^RAUTL
144 Q
145KILL ; kill variables - called from RAORD1
146 K %,%DT,D,D0,D1,DA,DFN,DIC,DIK,DIROUT,DIRUT,DIV,DR,DTOUT,DUOUT,DWPK,J,OREND,RABLNK,RACNT,RACT,RADIV,RAEXMUL,RAFIN,RAFIN1,RAI,RAILOC,RAIMGTYI,RAIP,RAJ,RAL0,RALOC,RALIFN,RALOCFLG
147 K RAMOD,RAMT,RANUM,RAOIFN,RAORD0,RAOUT,RAPIFN,RAPRC,RAPRI,RAPREG,RAPREOP1,RAREASK,RAREQDT,RAREQPRT,RARU,RARX,RASEQ,RAS3,RASEX,RASKPREG,RASTOP,RASX,RAWHEN,RAX,VAERR,VA200,VAI,VAIP,X,Y
148 K RAACI
149 I '$D(RAPKG),$G(XQORS)>1,$G(^TMP("XQORS",$J,XQORS-1,"ITM"))'=$G(^("TOT")) Q ;don't kill clin hist if order entry quick orders not all proccessed
150 K ^TMP($J,"RAWP")
151 Q
152PCR ; Print Cancelled Requests. Called from the 'Cancel A Request' option.
153 N I,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE,ZTSK
154 S ZTDESC="Rad/Nuc Med Cancelled Request Print",ZTDTH=$H,ZTIO=RAION
155 S ZTRTN="^RAORD5"
156 F I="RACRHD","RADFN","RAOIFN","RAPGE","RAX" S ZTSAVE(I)=""
157 D ^%ZTLOAD W:$D(ZTSK) !!?3,$C(7),"Task "_ZTSK_": cancellation queued to print on device ",RAION,!
158 D HOME^%ZIS
159 Q
Note: See TracBrowser for help on using the repository browser.