source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RAPROD.m@ 619

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

initial load of WorldVistAEHR

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