source: WorldVistAEHR/trunk/r/SURGERY-SR/SROALNC.m@ 700

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

initial load of WorldVistAEHR

File size: 3.8 KB
Line 
1SROALNC ;BIR/ADM - LIST OF CASES WITHOUT CPT CODE ;11/13/07
2 ;;3.0; Surgery ;**166**;24 Jun 93;Build 7
3 S (GRAND,SRNEW,SRSOUT,TOT)=0,(SRHDR,SRPAGE)=1,SRTITLE="CASES WITHOUT CPT CODES" K ^TMP("SRA",$J)
4 I SRFLG,SRASP S SRSPEC=$P(^SRO(137.45,SRASP,0),"^")
5 F S SRSD=$O(^SRF("AC",SRSD)) Q:'SRSD!(SRSD>SRED)!SRSOUT S SRTN=0 F S SRTN=$O(^SRF("AC",SRSD,SRTN)) Q:'SRTN!SRSOUT I $D(^SRF(SRTN,0)),$$MANDIV^SROUTL0(SRINSTP,SRTN) D UTL
6 I SRSP S SRSS="" F S SRSS=$O(^TMP("SRA",$J,SRSS)) Q:SRSS="" D SRSD Q:SRSOUT D:TOT TOT
7 I 'SRSP S SRNEW=1,(SRSD,TOT)=0 F S SRSD=$O(^TMP("SRA",$J,SRSD)) Q:'SRSD!SRSOUT S SRTN=0 F S SRTN=$O(^TMP("SRA",$J,SRSD,SRTN)) Q:'SRTN S SRA=^(SRTN) D CASE Q:SRSOUT
8 Q:SRSOUT I SRSP,'SRFLG,GRAND D GRAND
9 I SRFLG,'GRAND S SRSS=SRSPEC D HDR,GRAND
10 I SRSP,'SRFLG,'GRAND S SRSS="" D HDR,GRAND
11 I 'SRSP,'GRAND S SRSS="" D HDR,GRAND
12 I 'SRSP,GRAND S SRSS="" D GRAND
13 Q
14UTL ; set up TMP global
15 I '$P($G(^SRF(SRTN,.2)),"^",3)&'$P($G(^SRF(SRTN,.2)),"^",12) Q
16 I $P($G(^SRF(SRTN,30)),"^") Q
17 I SRFLG,$P(^SRF(SRTN,0),"^",4)'=SRASP Q
18 I $P($G(^SRO(136,SRTN,0)),"^",2)'="" Q
19 S SRA=$G(^SRF(SRTN,"RA"))
20 I SRSP S SRSS=$P(^SRF(SRTN,0),"^",4),SRSS=$S(SRSS:$P(^SRO(137.45,SRSS,0),"^"),1:"SPECIALTY NOT ENTERED"),^TMP("SRA",$J,SRSS,SRSD,SRTN)=SRA Q
21 S ^TMP("SRA",$J,SRSD,SRTN)=SRA
22 Q
23SRSD S SRNEW=1,(SRSD,TOT)=0 F S SRSD=$O(^TMP("SRA",$J,SRSS,SRSD)) Q:'SRSD!SRSOUT S SRTN=0 F S SRTN=$O(^TMP("SRA",$J,SRSS,SRSD,SRTN)) Q:'SRTN S SRA=^(SRTN) D CASE Q:SRSOUT
24 Q
25CASE N SRA2 S SRA2=$P(SRA,"^",2) D
26 .I SRA2="" S SRATYPE="NOT LOGGED" Q
27 .I SRA2="N" D Q
28 .. I $P(SRA,"^",6)="N" S SRATYPE="EXCLUDED" Q
29 .. S SRATYPE="NON-CARDIAC"
30 .I SRA2="C" S SRATYPE="CARDIAC"
31 S TOT=TOT+1,GRAND=GRAND+1 D PRINT
32 Q
33PRINT ; print case info
34 N SRDA,SRPROCS,SRSP1,SRY S SRPROCS=""
35 I $Y+7>IOSL!SRNEW D PAGE I SRSOUT Q
36 S SRA(0)=^SRF(SRTN,0),DFN=$P(SRA(0),"^") N I D DEM^VADPT S SRANM=VADM(1),SRASSN=VA("PID") K VADM
37 I $L(SRANM)>19 S SRANM=$P(SRANM,",")_","_$E($P(SRANM,",",2))_"."
38 S SRSP1="",X=$P(SRA(0),"^",4) S:X SRSP1=$P(^SRO(137.45,X,0),"^")
39 S SROPER=$P(^SRF(SRTN,"OP"),"^") I $O(^SRF(SRTN,13,0)) S SROTHER=0 F I=0:0 S SROTHER=$O(^SRF(SRTN,13,SROTHER)) Q:'SROTHER D OTHER
40 K SROPS,MM,MMM S:$L(SROPER)<63 SROPS(1)=SROPER I $L(SROPER)>62 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
41 S X=$P(SRA,"^"),SRSTATUS=$S(X="T":"TRANSMITTED",X="C":"COMPLETE",X="I":"INCOMPLETE",1:"NO ASSESSMENT"),Y=SRSD D D^DIQ S SRDT=$P(Y,"@")
42 I $Y+6>IOSL D PAGE I SRSOUT Q
43 W !,SRTN,?18,SRANM_" "_VA("PID"),?53,SRATYPE,?67,SRSTATUS,!,SRDT,?18,SROPS(1),! D
44 .I 'SRSP W $E(SRSP1,1,17) F I=2:1 W:$D(SROPS(I)) ?18,SROPS(I),! I '$D(SROPS(I)) W ! Q
45 .I SRSP F I=2:1 Q:'$D(SROPS(I)) W ?18,SROPS(I),!
46 I 'SRSOUT F LINE=1:1:80 W "-"
47 Q
48OTHER ; other operations
49 S SRLONG=1 I $L(SROPER)+$L($P(^SRF(SRTN,13,SROTHER,0),"^"))>125 S SRLONG=0,SROTHER=999,SROPERS=" ..."
50 I SRLONG S SROPERS=$P(^SRF(SRTN,13,SROTHER,0),"^")
51 S SROPER=SROPER_$S(SROPERS'=" ...":", "_SROPERS,1:SROPERS)
52 Q
53LOOP ; break procedures
54 S SROPS(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROPS(M))+$L(MM)'<63 S SROPS(M)=SROPS(M)_MM_" ",SROPER=MMM
55 Q
56PAGE I $E(IOST)="P"!SRHDR G HDR
57 W !!,"Press <RET> to continue, or '^' to quit " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
58 I X["?" W !!,"If you want to continue the listing, press the 'Enter' key.",!,"Type '^' to return to the menu." G PAGE
59HDR ; print heading
60 W @IOF,!,?(80-$L(SRTITLE)\2),SRTITLE,?70,$J("PAGE "_SRPAGE,9) W:$E(IOST)="P" !,?(80-$L(SRINST)\2),SRINST W !,?(80-$L(SRFRTO)\2),SRFRTO
61 W:$E(IOST)="P" !,?(80-$L(SRPRINT)\2),SRPRINT
62 I SRSP,SRSS'="" W !,">>> "_SRSS
63 W !!,"CASE #",?18,"PATIENT",?53,"TYPE",?67,"STATUS",!,"OP DATE",?18,"OPERATION(S)",! W:'SRSP "SURG SPECIALTY",! F LINE=1:1:80 W "="
64 S SRHDR=0,SRNEW=0,SRPAGE=SRPAGE+1
65 Q
66TOT W !!,"TOTAL FOR "_SRSS_": ",TOT
67 Q
68GRAND I 'SRSP W !!,"TOTAL: ",GRAND Q
69 I SRSP,'SRFLG W !!,"TOTAL FOR ALL SPECIALTIES: ",GRAND Q
70 I SRSP,SRFLG S SRSS=SRSPEC D TOT
71 Q
Note: See TracBrowser for help on using the repository browser.