source: WorldVistAEHR/trunk/r/SURGERY-SR/SROACC4.m@ 834

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

initial load of WorldVistAEHR

File size: 3.1 KB
Line 
1SROACC4 ;BIR/MAM - CPT ACCURACY ALL CODES AND 1 SPECIALTY ;05/14/99 11:37 AM
2 ;;3.0; Surgery ;**37,50,88,127,142**;24 Jun 93
3 ;
4 ; Reference to ^ECC(723 supported by DBIA #205
5 ;
6 S SRSPEC=SRSS,SRSS=$S(SRFLG=1:$P(^SRO(137.45,SRSS,0),"^"),1:$P(^ECC(723,SRSS,0),"^"))
7 S SRSDT=SDATE1 F S SRSDT=$O(^SRF("AC",SRSDT)) Q:SRSDT>EDATE1!('SRSDT) S SRTN=0 F S SRTN=$O(^SRF("AC",SRSDT,SRTN)) Q:'SRTN I $D(^SRF(SRTN,0)),$P($G(^SRF(SRTN,30)),"^")="",$$DIV^SROUTL0(SRTN) D UTIL
8 S SRHDR=0 D HDR^SROACC0 Q:SRSOUT S SRHDR=1
9 S TYPE=0,X=$$CPT^ICPTCOD(SRCPT,EDATE),CPT1=$P(X,"^",2)_" "_$P(X,"^",3)
10 F S TYPE=$O(^TMP("SR",$J,SRSS,TYPE)) Q:TYPE="" D DESC S SRSDT=0 F S SRSDT=$O(^TMP("SR",$J,SRSS,TYPE,SRSDT)) Q:'SRSDT!(SRSOUT) D SRTN
11 I '$D(^TMP("SR",$J)) D LINE W $$NODATA^SROUTL0()
12 Q
13SRTN S SRTN=0 F S SRTN=$O(^TMP("SR",$J,SRSS,TYPE,SRSDT,SRTN)) Q:'SRTN!(SRSOUT) D PRINT
14 Q
15LOOP ; break procedure greater than 50 characters
16 S SROP(M)="" F LOOP=1:1 S MM=$P(SROPER," "),MMM=$P(SROPER," ",2,200) Q:MMM="" Q:$L(SROP(M))+$L(MM)'<50 S SROP(M)=SROP(M)_MM_" ",SROPER=MMM
17 Q
18DESC ; print description
19 Q:SRSOUT I '$O(^TMP("SR",$J,SRSS,TYPE,0)) Q
20 D LINE W !!,?(132-$L(CPT1)\2),CPT1
21 I TYPE=1 W !,?50,"PRINCIPAL PROCEDURES"
22 I TYPE=2 W !,?54,"OTHER PROCEDURES"
23 K SRDESC S X=$$CPTD^ICPTCOD(SRCPT,"SRDESC",,EDATE) F I=1:1:X S Y=$S(I=1:"DESCRIPTION: "_SRDESC(I),1:SRDESC(I)) W !,?(132-$L(Y)\2),Y
24 W !! F LINE=1:1:132 W "-"
25 Q
26PRINT ; print each case
27 I $Y+5>IOSL D HDR^SROACC0 Q:SRSOUT D DESC
28 S SRNON=0 I $P($G(^SRF(SRTN,"NON")),"^")="Y" S SRNON=1
29 S DFN=$P(^SRF(SRTN,0),"^"),Y=SRSDT D D^DIQ S SRDT=Y
30 S Y=$P(SRDT,"@",2),SRDT=$E(SRSDT,4,5)_"/"_$E(SRSDT,6,7)_"/"_$E(SRSDT,2,3)_" "_Y
31 D DEM^VADPT S SRNAME=VADM(1),SSN=VA("PID"),SR(.1)=$S($D(^SRF(SRTN,.1)):^(.1),1:""),SRSUR=$S(SRNON:$P(^SRF(SRTN,"NON"),"^",6),1:$P(SR(.1),"^",4)),SRATT=$S(SRNON:$P(^SRF(SRTN,"NON"),"^",7),1:$P(SR(.1),"^",13))
32 I SRSUR S SRSUR=$P(^VA(200,SRSUR,0),"^") I $L(SRSUR)>20 S SRSUR=$P(SRSUR,",")_", "_$E($P(SRSUR,",",2))
33 I SRATT S SRATT=$P(^VA(200,SRATT,0),"^") I $L(SRATT)>20 S SRATT=$P(SRATT,",")_", "_$E($P(SRATT,",",2))
34 D OPER^SROACC0
35 K SROP,SROPT,MM,MMM S:$L(SROPER)<51 SROP(1)=SROPER I $L(SROPER)>50 S SROPER=SROPER_" " F M=1:1 D LOOP Q:MMM=""
36 W !,SRDT,?20,SRNAME,?60,SROP(1),?111,SRSUR,!,?3,SRTN,?20,VA("PID") W:$D(SROP(2)) ?60,SROP(2) W ?111,SRATT,! W:SRFLG=3&(SRNON) "NON-O.R." I $D(SROP(3)) W ?60,SROP(3) I $D(SROP(4)) W !,?60,SROP(4) I $D(SROP(5)) W !,?60,SROP(5)
37 I $D(SRCPTT) S:$L(SRCPTT)<51 SROPT(1)=SRCPTT I $L(SRCPTT)>50 S SRCPTT=SRCPTT_" " F M=1:1 D LOOP^SROACC0 Q:MMM=""
38 I $D(SRCPTT) F LOOP=1:1 Q:'$D(SROPT(LOOP)) W !,?60,SROPT(LOOP)
39 W ! Q
40UTIL ; set ^TMP("SR")
41 S SRNON=0 I $P($G(^SRF(SRTN,"NON")),"^")="Y" S SRNON=1
42 I SRFLG=1!(SRFLG=3&('SRNON)) Q:$P($G(^SRF(SRTN,.2)),"^",12)=""
43 I SRFLG=2 Q:'SRNON
44 S CPT=$P($G(^SRO(136,SRTN,0)),"^",2)
45 I 'SRNON S X=$P(^SRF(SRTN,0),"^",4) I X'=SRSPEC Q
46 I SRNON S X=$P(^SRF(SRTN,"NON"),"^",8) I X'=SRSPEC Q
47 I CPT=SRCPT S ^TMP("SR",$J,SRSS,1,SRSDT,SRTN)=""
48 S OP=0 F S OP=$O(^SRO(136,SRTN,3,OP)) Q:'OP S CPT=$P($G(^SRO(136,SRTN,3,OP,0)),"^") I CPT=SRCPT S ^TMP("SR",$J,SRSS,2,SRSDT,SRTN)=""
49 Q
50LINE W ! F LINE=1:1:132 W "="
51 Q
Note: See TracBrowser for help on using the repository browser.