source: FOIAVistA/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAPROD.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 6.7 KB
Line 
1RAPROD ;HISC/FPT,GJC AISC/MJK-Detailed Exam View ;8/1/97 11:13
2 ;;5.0;Radiology/Nuclear Medicine;**10,35,45**;Mar 16, 1998
3START S RADI=^RADPT(RADFN,"DT",RADTI,0) S:$D(^("P",RACNI,"COMP")) RA("COMP")=^("COMP") S RA("REA")=$S($D(^("R")):^("R"),1:"")
4 S RA("TECH")=$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"TC",0)) I RA("TECH") S RA("TECH")=$S($D(^VA(200,+^(RA("TECH"),0),0)):$P(^(0),"^"),1:"")
5 S X=$P(Y(0),"^",4),RA("CAT")=$S(X="I":"INPATIENT",X="O":"OUTPATIENT",X="S":"SHARING",X="C":"CONTRACT",X="R":"RESEARCH",X="E":"EMPLOYEE",1:"UNKNOWN")
6 S X=$S($D(^RARPT(+RARPT,0)):$P(^(0),"^",5),1:""),RA("RST")=$S(X="D":"DRAFT",X="V":"VERIFIED",X="R":"RELEASED/NOT VERIFIED",X="PD":"PROBLEM DRAFT",1:"NO REPORT")
7 F I=1:1:13 S Y=$T(LIST+I),@$P(Y,";",3)=$S($D(@($P(Y,";",4)_+$P(@$P(Y,";",5),"^",$P(Y,";",6))_",0)")):$P(^(0),"^"),1:"")
8 ;
9 N RAOPRC ; this will be the Requested Procedure defined only if it
10 ; differs from the Registered Procedure
11 I +$P(Y(0),U,11),($$DPROC^RAUTL15(RADFN,RADTI,RACNI,+$P(Y(0),U,11))]"") D
12 . S RAOPRC=$$GET1^DIQ(75.1,+$P(Y(0),"^",11)_",",2)
13 . Q
14VIEW W @IOF S X="",$P(X,"=",80)="" W X K X
15 W !?2,"Name : ",RANME," ",RASSN
16 W !?2,"Division : ",$E(RA("DIV"),1,20),?40,"Category : ",RA("CAT")
17 W !?2,"Location : ",$S($D(^SC(+RA("LOC"),0)):$P(^(0),"^"),1:"Unknown"),?40,"Ward : ",$E(RA("WRD"),1,24)
18 W !?2,"Exam Date : ",RADATE,?40,"Service : ",$E(RA("SERV"),1,24)
19 W !?2,"Case No. : ",RACN W ?40,"Bedsection : ",$E(RA("BED"),1,24)
20 W !?40,"Clinic : ",$E(RA("CL"),1,24)
21 S Y=$E(RA("CAT")) I "CSR"[Y W !?40,$E($S("C"=Y:"Contract : "_RA("CONT"),"S"=Y:"Sharing : "_RA("CONT"),"R"=Y:"Research : "_RA("REA"),1:""),1,38)
22 W:$X>1 ! S X="",$P(X,"-",80)="" W X K X
23 W !?2,"Registered : ",$E(RAPRC,1,60) D PRCCPT
24 W:$G(RAOPRC)]"" !?2,"Requested : ",$E(RAOPRC,1,60)
25 W !?2,"Requesting Phy: ",$E(RA("PHY"),1,20),?40,"Exam Status : ",$S($D(^RA(72,RAST,0)):$E($P(^(0),"^"),1,24),1:"")
26 W !?2,"Int'g Resident: ",$E(RA("RES"),1,20),?40,"Report Status: ",$E(RA("RST"),1,21)
27 S RAPREVER=+$P($G(^RARPT(RARPT,0)),"^",13)
28 W !?2,"Pre-Verified : ",$E($S($D(^VA(200,RAPREVER,0)):$P(^(0),"^",1),1:"NO"),1,20),?40,"Cam/Equip/Rm : ",$E(RA("RM"),1,20) K RAPREVER
29 W !?2,"Int'g Staff : ",$E(RA("STAFF"),1,20),?40,"Diagnosis : ",$E(RA("DIA"),1,24)
30 W !?2,"Technologist : ",$E(RA("TECH"),1,20),?40,"Complication : ",$E(RA("CMP"),1,24)
31 I $D(RA("COMP")) W !?2,"Comment : " F I=1:60 Q:$E(RA("COMP"),I,I+59)']"" W ?18,$E(RA("COMP"),I,I+59),!
32 W:$X>1 !
33 K RAFL W ?40,"Films :" F I=0:0 S I=$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"F",I)) Q:I'>0 I $D(^(I,0)) S X=^(0) W ?55,$S($D(^RA(78.4,+$P(X,"^"),0)):$P(^(0),"^"),1:"Unknown")," - ",+$P(X,"^",2),!
34 W:$X>1 ! S X="",$P(X,"-",34)="" W X
35 W "Modifiers" W $E(X,1,32) K X
36 W !?2,"Proc Modifiers:" D MODS^RAUTL2 F I=1:1 Q:$P(Y,", ",I)']"" W ?18,$P(Y,", ",I),!
37 N J
38 W !?2,"CPT Modifiers : " W:Y(1)="None" Y(1),!
39 I Y(1)'="None" F I=1:1 Q:$P(Y(2),", ",I)']"" S J=$P(Y(2),", ",I),J=$$BASICMOD^RACPTMSC(J,DT) W ?18,$P(J,"^",2)," ",$P(J,"^",3),! I $Y>(IOSL-4) S RAXIT=$$EOS^RAUTL5() Q:RAXIT W @IOF W !
40 Q:+$G(RAXIT)
41 I $Y>(IOSL-4) S RAXIT=$$EOS^RAUTL5() Q:RAXIT W @IOF W !
42 Q:+$G(RAXIT)
43 ;
44 ;check for Contrast Media data, print it if it exists.
45 I $O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"CM",0)) D
46 .W !?2,"Contrast Media: " S RACM=1
47 .N DIWF,DIWL,DIWR,DIWT,X,Z
48 .S X=$$CM^RADEM1(RADFN,RADTI,RACNI),DIWL=20,DIWF="C50"
49 .D ^DIWP S Z=0
50 .F S Z=$O(^UTILITY($J,"W",DIWL,Z)) Q:'Z D
51 ..W ?18,^UTILITY($J,"W",DIWL,Z,0)
52 ..W:+$O(^UTILITY($J,"W",DIWL,Z)) !
53 ..Q
54 .K ^UTILITY($J,"W")
55 .Q
56 ;
57 I $O(^RADPT(RADFN,"DT",RADTI,"P",RACNI,"RX",0)) D PHARM^RAPROD2(RACNI_","_RADTI_","_RADFN_",") W ! ; display pharmaceutical data
58 I +$G(RAXIT) K RAXIT Q
59 I +$P($G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0)),"^",28) D RDIO^RAPROD2(+$P(^(0),"^",28)) W ! ; display radiopharm data
60 I +$G(RAXIT) K RAXIT Q
61 W:$X>1 ! S X="",$P(X,"=",80)="" W X K X
62 G ^RAPROD1
63 ;
64PRCCPT ; display Proc's abbrv, proc type, CPT
65 Q:$G(RADTI)="" Q:$G(RACNI)=""
66 ;
67 N RADISPLY
68 S RADISPLY=$G(^RAMIS(71,+$P($G(^RADPT(+RADFN,"DT",+RADTI,"P",+RACNI,0)),U,2),0)) ; set $ZR to file 71 before calling prccpt^radd1
69 S RADISPLY=$$PRCCPT^RADD1()
70 W ?54,RADISPLY
71 Q
72SETL ;Set long display preference
73 N RA1,RA2,DIR
74 S RA1=$O(^RA(79,0)) Q:'RA1
75 S RA2=$O(^RA(79,RA1,"LDIS","B",DUZ,0))
76 I RA2 D Q
77 . W !!,"Your preference for Long Display of Procedures has already been set."
78 . S DIR(0)="Y",DIR("A")="Do you want to delete your preference ",DIR("B")="No"
79 . S DIR("?",1)="If you answer 'Yes', then all Radiology reports requested by you will"
80 . S DIR("?",2)="will default to the condensed display, which means that repeated procedures"
81 . S DIR("?")="and associated modifiers will only be listed once."
82 . D ^DIR
83 . Q:'Y
84 . D DEL150
85 . Q
86 W !
87 S DIR(0)="Y",DIR("A",1)="Do you want to set your preference for Long Display of Procedures"
88 S DIR("A")="in all Radiology reports ",DIR("B")="No"
89 S DIR("?",1)="If you answer 'Yes', then all Radiology reports requested by you will"
90 S DIR("?",2)="list all repeated procedures and associated modifiers instead of"
91 S DIR("?")="listing repeated procedures only once, which is the condensed (default) format."
92 D ^DIR
93 Q:'Y
94 D STUF150
95 Q
96DEL150 ;Delete user ien from 1st record in file 79's field 150
97 ; note: DIK utility looks for DA(1) here
98 Q:'$D(DUZ)#2
99 S DA(1)=$O(^RA(79,0)) Q:'DA(1)
100 S DIK="^RA(79,"_DA(1)_",""LDIS"","
101 S DA=$O(^RA(79,DA(1),"LDIS","B",DUZ,0))
102 Q:'DA
103 D ^DIK
104 K DIK,DA
105 W !!,"Your preference for Long Display of Procedures has been removed.",!
106 Q
107STUF150 ;Stuff user ien into 1st record in file 79's field 150
108 Q:'$D(DUZ)#2
109 S RA1=$O(^RA(79,0)) Q:'RA1
110 K RAFDA,RAIEN,RAMSG
111 S RAFDA(79.03,"?+2,"_RA1_",",.01)=DUZ
112 D UPDATE^DIE("","RAFDA","RAIEN","RAMSG")
113 W !!,"Your preference for Long Display of Procedures has been set.",!
114 Q
115CDIS ; set up RACDIS array to store 1st non-duplicate proc+pmod+cptmod
116 N N1,N2,R1,RA71,Y
117 K RACDIS
118 D LDIS
119 S N1=0
120 F S N1=$O(^RADPT(RADFN,"DT",RADTI,"P",N1)) Q:'N1 S R1=$G(^(N1,0)) D:R1]""
121 . S RA71=$P(R1,U,2),RACNI=N1
122 . D MODS^RAUTL2
123 . S RACDIS("B",RA71,Y,Y(1),N1)=""
124 . S N2=$O(RACDIS("B",RA71,Y,Y(1),0))
125 . S RACDIS(N2)=$G(RACDIS(N2))+1 ;increment lowest ien of same proc+pmod+cptmod
126 . S:RACDIS(N2)>1 RACDIS("RAFLDUP")=1 ;>1 same proc+pmod+cptmod
127 . Q
128 Q
129LDIS ; See if user prefers Long Display of Procedures
130 N RA1
131 S RA1=$O(^RA(79,0)) Q:'RA1
132 S:$O(^RA(79,RA1,"LDIS","B",DUZ,0)) RALDIS=1
133 Q
134LIST ;
135 ;;RA("DIV");^DIC(4,;RADI;3
136 ;;RA("LOC");^RA(79.1,;RADI;4
137 ;;RA("WRD");^DIC(42,;Y(0);6
138 ;;RA("SERV");^DIC(49,;Y(0);7
139 ;;RA("CL");^SC(;Y(0);8
140 ;;RA("CONT");^DIC(34,;Y(0);9
141 ;;RA("RES");^VA(200,;Y(0);12
142 ;;RA("DIA");^RA(78.3,;Y(0);13
143 ;;RA("PHY");^VA(200,;Y(0);14
144 ;;RA("STAFF");^VA(200,;Y(0);15
145 ;;RA("CMP");^RA(78.1,;Y(0);16
146 ;;RA("RM");^RA(78.6,;Y(0);18
147 ;;RA("BED");^DIC(42.4,;Y(0);19
Note: See TracBrowser for help on using the repository browser.