[613] | 1 | RADLY1 ;HISC/GJC-Rad Daily Log Report ;5/7/97 13:50
|
---|
| 2 | ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
|
---|
| 3 | PRINT ; Output subroutine part one
|
---|
| 4 | S RA1=""
|
---|
| 5 | P1 S RA1=$O(^TMP($J,"RADLY",RA1)) Q:RA1']"" S RA2=""
|
---|
| 6 | S RADIV=$P($G(^DIC(4,RA1,0)),"^") D CKCHANGE Q:RAXIT
|
---|
| 7 | P2 S RA2=$O(^TMP($J,"RADLY",RA1,RA2)) I RA2']"" D DIVCHK Q:RAXIT G P1
|
---|
| 8 | S RAITYPE=RA2,RA3="" D CKCHANGE Q:RAXIT
|
---|
| 9 | P3 S RA3=$O(^TMP($J,"RADLY",RA1,RA2,RA3)) I RA3']"" D IMGCHK Q:RAXIT G P2
|
---|
| 10 | S RAILOC=RA3,RA4="" D CKCHANGE Q:RAXIT
|
---|
| 11 | P4 S RA4=$O(^TMP($J,"RADLY",RA1,RA2,RA3,RA4)) I RA4']"" D LOCCHK Q:RAXIT G P3
|
---|
| 12 | S RA5=""
|
---|
| 13 | P5 S RA5=$O(^TMP($J,"RADLY",RA1,RA2,RA3,RA4,RA5)) G:RA5']"" P4 S RA6=""
|
---|
| 14 | P6 S RA6=$O(^TMP($J,"RADLY",RA1,RA2,RA3,RA4,RA5,RA6)) G:RA6']"" P5 S RA0=$G(^(RA6))
|
---|
| 15 | D:RA0]"" PRT1 Q:RAXIT
|
---|
| 16 | G P6
|
---|
| 17 | HD ; Header
|
---|
| 18 | W:RAPG!($E(IOST,1,2)="C-") @IOF
|
---|
| 19 | S RAPG=RAPG+1 W !?(IOM-$L(RAHEAD)\2-5),RAHEAD,?RATAB(9),"Page: ",RAPG
|
---|
| 20 | ; raflg gets set after all records are printed,=1 if more than 1 div.
|
---|
| 21 | W:'$D(RAFLG) !,"Division : ",$S(RADIV]"":RADIV,1:"Unknown")
|
---|
| 22 | W:$D(RAFLG) !,"Division : "
|
---|
| 23 | W ?RATAB(9),"Date: ",RATDY
|
---|
| 24 | N RA12
|
---|
| 25 | S RA12=$S(RAILOC]"":RAILOC,1:"Unknown")
|
---|
| 26 | S:IOM<132 RA12=$E(RA12,1,30)
|
---|
| 27 | W:'$D(RAFLG) !,"Imaging Location : ",RA12," ("
|
---|
| 28 | W:$D(RAFLG) !,"Imaging Location :"
|
---|
| 29 | S RA12=$S(RAITYPE]"":RAITYPE,1:"Unknown")
|
---|
| 30 | S:IOM<132 RA12=$E(RA12,1,30)
|
---|
| 31 | W:'$D(RAFLG) RA12,")"
|
---|
| 32 | I IOM=132 D ; If 132 column
|
---|
| 33 | . W !,"Name",?RATAB(2),"Pt ID",?RATAB(3),"Time",?RATAB(4),"Ward/Clinic"
|
---|
| 34 | . W ?RATAB(5),"Procedure",?RATAB(6),"Exam Status",?RATAB(7),"Case#"
|
---|
| 35 | . W ?RATAB(8),"Reported",!,RALN
|
---|
| 36 | . Q
|
---|
| 37 | E D ; default to 80 column format
|
---|
| 38 | . W !,"Name",?RATAB(3),"Pt ID",?RATAB(5),"Ward/Clinic"
|
---|
| 39 | . W ?RATAB(7),"Procedure",!,?RATAB(2),"Exam Status",?RATAB(4),"Case #"
|
---|
| 40 | . W ?RATAB(6),"Time",?RATAB(8),"Reported",!,RALN
|
---|
| 41 | . Q
|
---|
| 42 | I $D(ZTQUEUED) D STOPCHK^RAUTL9 S:$G(ZTSTOP)=1 RAXIT=1
|
---|
| 43 | Q
|
---|
| 44 | PRT1 ; Output subroutine two
|
---|
| 45 | F I=1:1:7 D
|
---|
| 46 | . S @$P("RACN^RAPRC^RAST^RATME^RAWHE^RARPT^RASSN","^",I)=$P(RA0,"^",I)
|
---|
| 47 | . Q
|
---|
| 48 | I $Y>(IOSL-4) D Q:RAXIT
|
---|
| 49 | . S:$E(IOST,1,2)="C-" RAXIT=$$EOS^RAUTL5() D:'RAXIT HD
|
---|
| 50 | . Q
|
---|
| 51 | I IOM=132 D ; default to 132 column format
|
---|
| 52 | . W !,RA4,?RATAB(2),RASSN,?RATAB(3),RATME,?RATAB(4),RAWHE
|
---|
| 53 | . W ?RATAB(5),RAPRC,?RATAB(6),RAST,?RATAB(7),RACN,?RATAB(8),RARPT
|
---|
| 54 | . Q
|
---|
| 55 | E D ; If 80 column
|
---|
| 56 | . W !,RA4,?RATAB(3),RASSN,?RATAB(5),RAWHE,?RATAB(7),RAPRC
|
---|
| 57 | . W !?RATAB(2),RAST,?RATAB(4),RACN,?RATAB(6),RATME,?RATAB(8),RARPT
|
---|
| 58 | . Q
|
---|
| 59 | Q
|
---|
| 60 | KILL ; Kill variables
|
---|
| 61 | K %,%I,%X,%Y,DIC,I,RA0,RA1,RA2,RA3,RA4,RA5,RA6,RA7,RA8,RA9,RA10,RA11
|
---|
| 62 | K RACN,RACNI,RADFN,RADIV,RADIVNM,RADIVTY,RADTE,RADTI,RAEX,RAFLG,RAHEAD
|
---|
| 63 | K RAIMGTY,RAITYPE,RALDTI,RALDTX,RALN,RAMES,RANME,RAPG,RAPOP,RAPRC,RAPT
|
---|
| 64 | K RAQUIT,RARE,RARPT,RASSN,RAST,RATAB,RATDY,RATME,RAWHE,RAXIT,X,Y,ZTDESC
|
---|
| 65 | K RAILOC,RADIV0,RAITYPE0,RAILOC0
|
---|
| 66 | K ZTRTN,ZTSAVE K:$D(RAPSTX) RACCESS,RAPSTX,POP,DUOUT
|
---|
| 67 | K ^TMP($J,"RA D-TYPE"),^TMP($J,"RA I-TYPE"),^TMP($J,"RADLY")
|
---|
| 68 | K ^TMP($J,"RA LOC-TYPE"),^TMP($J,"DIV-ITYP-ILOC")
|
---|
| 69 | Q
|
---|
| 70 | DIVCHK ; Output statistics within division.
|
---|
| 71 | N RA7 I $Y>(IOSL-4) S RAXIT=$$EOS^RAUTL5() D:'RAXIT HD Q:RAXIT
|
---|
| 72 | W !?RATAB(2),"Division Total '"_RADIV_"': ",+$G(^TMP($J,"RADLY",RA1))
|
---|
| 73 | Q
|
---|
| 74 | IMGCHK ; Check for EOS on I-Type
|
---|
| 75 | N RA10 I $Y>(IOSL-4) S RAXIT=$$EOS^RAUTL5() D:'RAXIT HD Q:RAXIT
|
---|
| 76 | W !?RATAB(2),"Imaging Type Total '"_RAITYPE_"': ",+$G(^TMP($J,"RADLY",RA1,RAITYPE))
|
---|
| 77 | Q
|
---|
| 78 | LOCCHK ; Check for EOS on Loc-Type
|
---|
| 79 | N RA9 I $Y>(IOSL-4) S RAXIT=$$EOS^RAUTL5() D:'RAXIT HD Q:RAXIT
|
---|
| 80 | W !?RATAB(2),"Imaging Location Total '"_RAILOC_"': ",+$G(^TMP($J,"RADLY",RA1,RAITYPE,RAILOC))
|
---|
| 81 | Q
|
---|
| 82 | CKCHANGE ; Check for change in div/img-type/img-loc, for header
|
---|
| 83 | N A,RAPRTHD
|
---|
| 84 | S RAPRTHD=0 ;whether to print page header or not, 1=yes
|
---|
| 85 | S A=$P($G(^DIC(4,+RA1,0)),"^")
|
---|
| 86 | I $G(RA2)]"",$G(RA3)]"" S:A'=RADIV0 RAPRTHD=1
|
---|
| 87 | I $G(RA2)]"",$G(RA3)]"",RADIV0=A S:RA2'=RAITYPE0 RAPRTHD=1
|
---|
| 88 | I $G(RA3)]"",RAITYPE0=RA2 S:RA3'=RAILOC0 RAPRTHD=1
|
---|
| 89 | S RADIV0=A S:$G(RA2)]"" RAITYPE0=RA2 S:$G(RA3)]"" RAILOC0=RA3
|
---|
| 90 | Q:'RAPRTHD&($Y<(IOSL-5))
|
---|
| 91 | S:$E(IOST,1,2)="C-" RAXIT=$$EOS^RAUTL5()
|
---|
| 92 | D:'RAXIT HD
|
---|
| 93 | Q
|
---|
| 94 | SORT ; Gather/sort data
|
---|
| 95 | S RARE(0)=$G(^RADPT(RADFN,"DT",RADTI,0))
|
---|
| 96 | S RADIV=+$P(RARE(0),"^",3),RADIV("I")=+$P($G(^RA(79,RADIV,0)),"^")
|
---|
| 97 | S RADIV=$P($G(^DIC(4,RADIV("I"),0)),"^")
|
---|
| 98 | I RADIV']""!('$D(^TMP($J,"RA D-TYPE",RADIV))) Q ; no div
|
---|
| 99 | S RADIV=RADIV("I") K RADIV("I")
|
---|
| 100 | S RAITYPE=+$P(RARE(0),"^",2) Q:RAITYPE'>0
|
---|
| 101 | S RAITYPE=$P($G(^RA(79.2,RAITYPE,0)),"^")
|
---|
| 102 | Q:'$D(^TMP($J,"RA I-TYPE",RAITYPE)) ; no img type
|
---|
| 103 | S RAILOC=+$P(RARE(0),"^",4) Q:RAILOC'>0
|
---|
| 104 | S RAILOC=$P($G(^RA(79.1,RAILOC,0)),"^"),RAILOC=$P($G(^SC(+RAILOC,0)),"^")
|
---|
| 105 | Q:'$D(^TMP($J,"RA LOC-TYPE",RAILOC)) ;no img loc
|
---|
| 106 | S (RANME,RASSN)="Unknown",RAPT(0)=$G(^DPT(RADFN,0))
|
---|
| 107 | S RANME=$S($P(RAPT(0),"^")]"":$P(RAPT(0),"^"),1:RANME)
|
---|
| 108 | S RASSN=$$SSN^RAUTL,RANME=$E(RANME,1,23)
|
---|
| 109 | F RACNI=0:0 S RACNI=$O(^RADPT(RADFN,"DT",RADTI,"P",RACNI)) Q:'RACNI D Q:RAXIT
|
---|
| 110 | . D:$D(^RADPT(RADFN,"DT",RADTI,"P",RACNI,0)) SET^RADLY
|
---|
| 111 | . Q
|
---|
| 112 | Q
|
---|
| 113 | ZEROUT ; zero out the ^tmp($j,"RADLY"
|
---|
| 114 | ; loop throu raccess(duz,"DIV,ITYP-ILOC",divname,imgtypename,imglocname)
|
---|
| 115 | ; THIS SECTION REPLACES THE ORIGINAL CALL TO ZEROUT^RADLQ3("RADLY")
|
---|
| 116 | ; so to ensure that locations not assigned to the user will be
|
---|
| 117 | ; zeroed out, if those locations share the same imaging types that
|
---|
| 118 | ; his assigned locations have
|
---|
| 119 | N X,Y,Z,X1
|
---|
| 120 | S X=""
|
---|
| 121 | ZER1 S X=$O(RACCESS(DUZ,"DIV-ITYP-ILOC",X)) Q:X="" ;eg. "cgo (ws)"
|
---|
| 122 | S Y="",X1=$O(^DIC(4,"B",X,0)) ; eg. 639
|
---|
| 123 | ZER2 S Y=$O(RACCESS(DUZ,"DIV-ITYP-ILOC",X,Y)) G:Y="" ZER1 S Z="" ;eg. "gen rad"
|
---|
| 124 | ZER3 S Z=$O(RACCESS(DUZ,"DIV-ITYP-ILOC",X,Y,Z)) G:Z="" ZER2 ;eg. "x-ray"
|
---|
| 125 | S ^TMP($J,"RADLY",X1,Y,Z)=0
|
---|
| 126 | G ZER3
|
---|