source: WorldVistAEHR/trunk/r/IMAGING-MAG-ZMAG/MAGJORD.m@ 1482

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

initial load of WorldVistAEHR

File size: 4.0 KB
RevLine 
[613]1MAGJORD ;WIRMFO/JHC-Display Rad Exam Order info ; 29 Jul 2003 10:02 AM
2 ;;3.0;IMAGING;**16,22,18**;Mar 07, 2006
3 ;; +---------------------------------------------------------------+
4 ;; | Property of the US Government. |
5 ;; | No permission to copy or redistribute this software is given. |
6 ;; | Use of unreleased versions of this software requires the user |
7 ;; | to execute a written test agreement with the VistA Imaging |
8 ;; | Development Office of the Department of Veterans Affairs, |
9 ;; | telephone (301) 734-0100. |
10 ;; | |
11 ;; | The Food and Drug Administration classifies this software as |
12 ;; | a medical device. As such, it may not be changed in any way. |
13 ;; | Modifications to this software may result in an adulterated |
14 ;; | medical device under 21CFR820, the use of which is considered |
15 ;; | to be a violation of US Federal Statutes. |
16 ;; +---------------------------------------------------------------+
17 ;;
18 Q
19ORD(MAGRPTY,DATA) ; Radiology Order Display
20 ; RPC Call: MAGJ RADORDERDISP
21 ; MAGRPTY holds indirect reference to returned data
22 ;
23 S MAGRPTY=$NA(^TMP($J,"WSDAT")) K @MAGRPTY
24 N $ETRAP,$ESTACK S $ETRAP="D ERRA^MAGJORD"
25 N RARPT,RADFN,RADTI,RACNI,RAPGE,RAX,RAOIFN
26 N REPLY,POP,DFN,COMPLIC,XX,HDR,MAGRET,REQONLY
27 S REPLY="0^4~Attempting to display order info"
28 D OPENDEV
29 I POP S REPLY="0^4~Unable to open device 'IMAGING WORKSTATION'" G ORDZ
30 S RADFN=$P(DATA,U),RADTI=$P(DATA,U,2),RACNI=$P(DATA,U,3)
31 S RARPT=+$P(DATA,U,4),REQONLY=+$P(DATA,U,1,5)
32 I RADFN,RADTI,RACNI
33 E S REPLY="0^4~Request Contains Invalid Case Pointer ("_RADFN_" "_RADTI_" "_RACNI_" "_RARPT_")." G ORDZ
34 S RAOIFN=$P($G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0)),U,11)
35 I RAOIFN,$D(^RAO(75.1,RAOIFN,0))
36 E S REPLY="0^2~Order Information is NOT Available for this exam." G ORDZ
37 ; Check for Database integrity problems ONLY if Req was explicitly
38 ; requested (No check for Auto_Display of Req, cuz Exam Open does ck)
39 D GETEXAM2^MAGJUTL1(RADFN,RADTI,RACNI,"",.MAGRET)
40 S RADATA=$G(^TMP($J,"MAGRAEX",1,1)),XX=$G(^(2)),HDR=""
41 S COMPLIC=$P(XX,U,4) ; Complications text
42 F I=4,12,9 S HDR=HDR_$P(RADATA,U,I)_" " ; PtName, Case #, Procedure
43 I REQONLY D CKINTEG^MAGJRPT(.REPLY,RADFN,RADTI,RACNI,RARPT,RADATA) I REPLY]"" S REPLY="0^7~"_REPLY G ORDZ ; Database integrity problems
44 S RAX="",RAPGE=0 D ^RAORD5
45 D:IO'=IO(0) ^%ZISC
46 S @MAGRPTY@(1)="REQ: "_HDR
47 D COMMENTS(RADFN,RADTI,RACNI,MAGRPTY,2,COMPLIC)
48 S REPLY="1^OK"
49 K ^TMP($J,"MAGRAEX")
50ORDZ S @MAGRPTY@(0)=REPLY
51 Q
52 ;
53COMMENTS(RADFN,RADTI,RACNI,MAGRPTY,DNODE,COMPLIC) ; add Complications & Tech Comments to output report
54 ; also called by Rad Report display (magjlst1)
55 ; RADFN, RADTI, & RACNI identify exam
56 ; MAGRPTY is indirect reference wher output lines are to be stored
57 ; DNODE holds reference for starting node for lines of output
58 ; COMPLIC passes in complications data reference
59 ;
60 I +MAGJOB("USER",1) ; Radiologist
61 E I $D(^VA(200,"ARC","T",+DUZ)) ; Rad Tech
62 E Q ; Don't display for any other user type
63 N QTMP,CT,XX S CT=0
64 S @MAGRPTY@(DNODE)=" ",CT=CT+.01,@MAGRPTY@(DNODE+CT)="Complications: "_$S(COMPLIC:$P($G(^RA(78.1,+COMPLIC,0)),U),1:"")
65 S X=$P(COMPLIC,"~",2)
66 I X S CT=CT+.01,@MAGRPTY@(DNODE+CT)=" "_$P($G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"COMP")),U)
67 K ^TMP($J,"RAE2") D SVTCOM^RAUTL11(RADFN,RADTI,RACNI)
68 S QTMP="^TMP($J,""RAE2"")"
69 F S QTMP=$Q(@QTMP) Q:QTMP="" Q:QTMP'["RAE2" I QTMP["TCOM" D
70 . S XX=@(QTMP) N HI,TXT,LINE1 S LINE1=0
71 . F Q:XX="" S HI=$L(XX) S:HI>63 HI=63 F I=HI:-1:0 S:'I XX="" I HI<63!($E(XX,I)=" ") D Q
72 .. S TXT=$S('LINE1:"Tech Comments: ",1:" ")_$E(XX,1,I),XX=$E(XX,I+1,999),LINE1=1
73 .. I XX]"" F I=1:1:999 I $E(XX,I)'=" " S XX=$E(XX,I,999) Q
74 .. S CT=CT+.01,@MAGRPTY@(DNODE+CT)=TXT
75 K ^TMP($J,"RAE2")
76 Q
77 ;
78OPENDEV ;
79 S IOP="IMAGING WORKSTATION",%ZIS=0 D ^%ZIS
80 I POP
81 E U IO
82 Q
83ERRA ;
84 S @MAGRPTY@(0)="0^ERROR "_$$EC^%ZOSV
85 D @^%ZOSF("ERRTN")
86 Q:$Q 1 Q
87END ;
Note: See TracBrowser for help on using the repository browser.