source: WorldVistAEHR/trunk/r/SURGERY-SR/SROPOST2.m@ 1259

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

initial load of WorldVistAEHR

File size: 2.4 KB
Line 
1SROPOST2 ;B'HAM ISC/MAM - POST INIT TO CONVERT OPERATION TIMES ; 18 JAN 1990 3:40 PM
2 ;;3.0; Surgery ;**12**;24 Jun 93
3 I 'SRVER Q
4B W !!,"Re-indexing 'B' cross references in site configureable files...."
5 F SRFILE=131.01,131.9,132,132.05,132.4,133.4,133.6,133.7,135,135.1,135.2,135.3,135.4,138 K ^SRO(SRFILE,"B"),DIK S DIK="^SRO("_SRFILE_",",DIK(1)=".01^B" D ENALL^DIK K DIK
6 K SRFILE
7 I $O(^SRO(131.25,0)) Q
8 W !!,"Version 3.0 of the Surgery software will estimate the average length",!,"of time for a procedure (using CPT code) based on Surgical Specialty ",!,"instead of the individual surgeon. The data in the Surgeon's Operation Times"
9 W !,"file will be converted and stored in the Operation Times file.",!!
10AGAIN K ^TMP("SR",$J) S X1=DT,X2=-12 D C^%DTC S SRSTOP=X
11 S SRTN=0 F S SRTN=$O(^SRF(SRTN)) Q:'SRTN I $D(^SRF(SRTN,0)) S SRSDATE=$E($P($G(^SRF(SRTN,0)),"^",9),1,7) I SRSDATE,SRSDATE<SRSTOP D UTIL
12 S SERVICE=0 F S SERVICE=$O(^TMP("SR",$J,SERVICE)) Q:'SERVICE D STUFF
13 K CPT,I,MIN,SERVICE,SRSDATE,SRSTOP,SRTN,X,X1,^TMP("SR",$J)
14 Q
15UTIL ; find completed cases
16 I '$D(^SRF(SRTN,.2)) Q
17 I $P(^SRF(SRTN,0),"^",4)="" Q
18 S X=$P(^SRF(SRTN,.2),"^",2),X1=$P(^SRF(SRTN,.2),"^",3) Q:X="" I X1="" Q
19 S CPT=$P(^SRF(SRTN,"OP"),"^",2) I CPT="" Q
20MIN S Y=$E(X1_"000",9,10)-$E(X_"000",9,10)*60+$E(X1_"00000",11,12)-$E(X_"00000",11,12),X2=X,X=$P(X,".",1)'=$P(X1,".",1) D ^%DTC:X S MIN=X*1440+Y
21 S SERVICE=$P(^SRF(SRTN,0),"^",4) I '$D(^TMP("SR",$J,SERVICE,CPT)) S ^TMP("SR",$J,SERVICE,CPT)=MIN_"^"_1 Q
22 S $P(^TMP("SR",$J,SERVICE,CPT),"^",2)=$P(^TMP("SR",$J,SERVICE,CPT),"^",2)+1
23 S $P(^TMP("SR",$J,SERVICE,CPT),"^")=$P(^TMP("SR",$J,SERVICE,CPT),"^")+MIN
24 Q
25STUFF ; stuff entries in file 131.25
26 I '$D(^SRO(131.25,SERVICE,0)) K DD,DO S DIC="^SRO(131.25,",DIC(0)="L",DLAYGO=131.25,(X,DINUM)=SERVICE D FILE^DICN K DIC,DLAYGO,DINUM
27 S ^SRO(131.25,SERVICE,1,0)="^131.251PA^0^0"
28 S CPT=0 F I=0:0 S CPT=$O(^TMP("SR",$J,SERVICE,CPT)) Q:'CPT D CPT
29 Q
30CPT ; stuff CPT info
31 S ^SRO(131.25,SERVICE,1,CPT,0)=CPT_"^"_^TMP("SR",$J,SERVICE,CPT)
32 S $P(^SRO(131.25,SERVICE,1,0),"^",3)=CPT,$P(^(0),"^",4)=$P(^(0),"^",4)+1
33 Q
34NEW ; create entry in Surgery Site Parameters file
35 K DIC,DD,DO,DA,DINUM S DIC="^SRO(133,",DIC(0)="L",DLAYGO=133,X=SRINST D FILE^DICN K DIC,DD,DO,DA,DLAYGO
36 Q
37TIMES ; convert operation times - SR*3*12
38 D WAIT^DICD K ^SRO(131.25) S ^SRO(131.25,0)="OPERATION TIMES^131.25P^^"
39 D AGAIN W !!,"Finished"
40 Q
Note: See TracBrowser for help on using the repository browser.