source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACMP2.m@ 949

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

initial load of WorldVistAEHR

File size: 3.8 KB
Line 
1RACMP2 ;HISC/GJC-Complication Report (Part 3 of 3) ;7/17/96 14:06
2 ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
3HEADER ; Header
4 W:RAPG!($E(IOST,1,2)="C-") @IOF S RAPG=RAPG+1
5 W !?10,RAHDR(1)
6 S:'($D(RADIV("X"))#2) RADIV("X")=$S($G(^DIC(4,RADIV,0))]"":$P(^(0),"^"),1:"")
7 W:'$D(RAFLG) !?4,"Division: ",$S(RADIV("X")]"":RADIV("X"),1:"Unknown")
8 W:$D(RAFLG) !?4,"Division: "
9 W ?RATAB(6),"Page: ",RAPG
10 W:'$D(RAFLG) !,"Imaging Type: ",$S(RAITYPE]"":RAITYPE,1:"Unknown")
11 W:$D(RAFLG) !,"Imaging Type: "
12 W ?RATAB(6),"Date: ",RATDY
13 W !?6,RAHDR(2),!,RALN
14 I IOM=132 D ; If 132 column
15 . W !,"Name",?RATAB(2),"Pt ID",?RATAB(3),"Date/Time"
16 . W ?RATAB(4),"Procedure/Complication",?RATAB(5),"Personnel"
17 . W !,RALN
18 . Q
19 E D ; default to 80 column format
20 . W !,"Name/Pt-Id",?RATAB(3),"Date/Time"
21 . W ?RATAB(4),"Procedure/Complication"
22 . W !?RATAB(1),"Personnel",!,RALN
23 . Q
24 I $D(ZTQUEUED) D STOPCHK^RAUTL9 S:$G(ZTSTOP)=1 RAXIT=1
25 Q
26SORT ; Obtain data
27 I $D(ZTQUEUED) D STOPCHK^RAUTL9 S:$G(ZTSTOP)=1 RAXIT=1 Q:RAXIT
28 Q:'$D(^RADPT(RADFN,"DT",RADTI,0)) ; Registered Exam data missing
29 S RARE(0)=$G(^RADPT(RADFN,"DT",RADTI,0)),RADIV("I")=+$P(RARE(0),"^",3)
30 S RADIV("X")=$S($G(^DIC(4,RADIV("I"),0))]"":$P(^(0),"^"),1:"Unknown")
31 I RADIV("X")']""!('$D(^TMP($J,"RA D-TYPE",RADIV("X")))) Q
32 S RADIV=RADIV("I"),RAITYPE=+$P(RARE(0),"^",2) Q:RAITYPE'>0 ;ft 9/19/94
33 S RAITYPE=$P($G(^RA(79.2,RAITYPE,0)),"^")
34 I RAITYPE']""!('$D(^TMP($J,"RA I-TYPE",RAITYPE))) Q
35 S RAITYPE=$S(RAITYPE]"":RAITYPE,1:"Unknown")
36 S RANME=$G(^DPT(RADFN,0)),RANME=$S(RANME]"":$P(RANME,"^"),1:"Unknown")
37 S RANME=$E(RANME,1,23),RASSN=$$SSN^RAUTL,RACNI=0
38 F S RACNI=$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI)) Q:'RACNI D
39 . S RAEX(0)=$G(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0)) Q:RAEX(0)']""
40 . I $P(RAEX(0),"^",3)>0 D
41 .. ; Tab Examination data (total & site specific)
42 .. S ^TMP($J,"RAEXAM")=+$G(^TMP($J,"RAEXAM"))+1
43 .. S ^TMP($J,"RAEXAM",RADIV)=+$G(^TMP($J,"RAEXAM",RADIV))+1
44 .. S ^TMP($J,"RAEXAM",RADIV,RAITYPE)=+$G(^TMP($J,"RAEXAM",RADIV,RAITYPE))+1
45 .. I $P(RAEX(0),"^",10)]"",("Yy"[$P(RAEX(0),"^",10)) D
46 .. S ^TMP($J,"RACNTU")=+$G(^TMP($J,"RACNTU"))+1
47 .. S ^TMP($J,"RACNTU",RADIV)=+$G(^TMP($J,"RACNTU",RADIV))+1
48 .. S ^TMP($J,"RACNTU",RADIV,RAITYPE)=+$G(^TMP($J,"RACNTU",RADIV,RAITYPE))+1
49 .. Q
50 . I $D(^RA(78.1,+$P(RAEX(0),"^",16),0)),(RACMP'=+$P(RAEX(0),"^",16)) D
51 .. S RACOMP=$G(^RA(78.1,+$P(RAEX(0),"^",16),0))
52 .. ; Tab Complication data (total & site specific)
53 .. S ^TMP($J,"RACOMP")=+$G(^TMP($J,"RACOMP"))+1
54 .. S ^TMP($J,"RACOMP",RADIV)=+$G(^TMP($J,"RACOMP",RADIV))+1
55 .. S ^TMP($J,"RACOMP",RADIV,RAITYPE)=+$G(^TMP($J,"RACOMP",RADIV,RAITYPE))+1
56 .. I $P(RACOMP,"^",2)]"",("Yy"[$P(RACOMP,"^",2)) D
57 ... S ^TMP($J,"RACMRE")=+$G(^TMP($J,"RACMRE"))+1
58 ... S ^TMP($J,"RACMRE",RADIV)=+$G(^TMP($J,"RACMRE",RADIV))+1
59 ... S ^TMP($J,"RACMRE",RADIV,RAITYPE)=+$G(^TMP($J,"RACMRE",RADIV,RAITYPE))+1
60 ... Q
61 .. D SET^RACMP
62 .. Q
63 . Q
64 Q
65SYNOP ; Final synopsis of data presented to the user.
66 N A,B S A=""
67 F S A=$O(^TMP($J,"RACMP",A)) Q:A']"" D Q:RAXIT
68 . I $Y>(IOSL-4) S RAXIT=$$EOS^RAUTL5() D:'RAXIT HEADER^RACMP2 Q:RAXIT
69 . W !!?10,"Division: ",$P($G(^DIC(4,A,0)),U),!?3,"Imaging Type(s): " S B=""
70 . F S B=$O(^TMP($J,"RACMP",A,B)) Q:B']"" D Q:RAXIT
71 .. I $Y>(IOSL-4) S RAXIT=$$EOS^RAUTL5() D:'RAXIT HEADER^RACMP2 Q:RAXIT
72 .. W:$X>(IOM-25) !?($X+$L("Imaging Type(s): ")+3) W B,?($X+3)
73 .. Q
74 . Q
75 Q:RAXIT
76 I $Y>(IOSL-4) S RAXIT=$$EOS^RAUTL5() D:'RAXIT HEADER^RACMP2 Q:RAXIT
77 W !!!?5,"Totals for all Divisions:"
78 W !!,"Complications: ",+$G(^TMP($J,"RACOMP"))
79 W " Exams: ",+$G(^TMP($J,"RAEXAM"))," % Complications: "
80 I +$G(^TMP($J,"RAEXAM"))=0 W "0"
81 E W $J((+$G(^TMP($J,"RACOMP"))/+$G(^TMP($J,"RAEXAM")))*100,6,2)
82 W !,"Contrast Media Comp.: ",+$G(^TMP($J,"RACMRE"))
83 W " C.M. Exams: ",+$G(^TMP($J,"RACOMP"))
84 W " % C.M. Comp.: "
85 I +$G(^TMP($J,"RACOMP"))=0 W "0"
86 E W $J((+$G(^TMP($J,"RACMRE"))/+$G(^TMP($J,"RACOMP")))*100,6,2)
87 Q
Note: See TracBrowser for help on using the repository browser.