Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SROPOST2

SROPOST2.m

Go to the documentation of this file.
  1. SROPOST2 ;B'HAM ISC/MAM - POST INIT TO CONVERT OPERATION TIMES ; 18 JAN 1990 3:40 PM
  1. ;;3.0; Surgery ;**12**;24 Jun 93
  1. I 'SRVER Q
  1. B W !!,"Re-indexing 'B' cross references in site configureable files...."
  1. 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
  1. K SRFILE
  1. I $O(^SRO(131.25,0)) Q
  1. 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"
  1. W !,"file will be converted and stored in the Operation Times file.",!!
  1. AGAIN K ^TMP("SR",$J) S X1=DT,X2=-12 D C^%DTC S SRSTOP=X
  1. 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
  1. S SERVICE=0 F S SERVICE=$O(^TMP("SR",$J,SERVICE)) Q:'SERVICE D STUFF
  1. K CPT,I,MIN,SERVICE,SRSDATE,SRSTOP,SRTN,X,X1,^TMP("SR",$J)
  1. Q
  1. UTIL ; find completed cases
  1. I '$D(^SRF(SRTN,.2)) Q
  1. I $P(^SRF(SRTN,0),"^",4)="" Q
  1. S X=$P(^SRF(SRTN,.2),"^",2),X1=$P(^SRF(SRTN,.2),"^",3) Q:X="" I X1="" Q
  1. S CPT=$P(^SRF(SRTN,"OP"),"^",2) I CPT="" Q
  1. MIN 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
  1. S SERVICE=$P(^SRF(SRTN,0),"^",4) I '$D(^TMP("SR",$J,SERVICE,CPT)) S ^TMP("SR",$J,SERVICE,CPT)=MIN_"^"_1 Q
  1. S $P(^TMP("SR",$J,SERVICE,CPT),"^",2)=$P(^TMP("SR",$J,SERVICE,CPT),"^",2)+1
  1. S $P(^TMP("SR",$J,SERVICE,CPT),"^")=$P(^TMP("SR",$J,SERVICE,CPT),"^")+MIN
  1. Q
  1. STUFF ; stuff entries in file 131.25
  1. 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
  1. S ^SRO(131.25,SERVICE,1,0)="^131.251PA^0^0"
  1. S CPT=0 F I=0:0 S CPT=$O(^TMP("SR",$J,SERVICE,CPT)) Q:'CPT D CPT
  1. Q
  1. CPT ; stuff CPT info
  1. S ^SRO(131.25,SERVICE,1,CPT,0)=CPT_"^"_^TMP("SR",$J,SERVICE,CPT)
  1. S $P(^SRO(131.25,SERVICE,1,0),"^",3)=CPT,$P(^(0),"^",4)=$P(^(0),"^",4)+1
  1. Q
  1. NEW ; create entry in Surgery Site Parameters file
  1. 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
  1. Q
  1. TIMES ; convert operation times - SR*3*12
  1. D WAIT^DICD K ^SRO(131.25) S ^SRO(131.25,0)="OPERATION TIMES^131.25P^^"
  1. D AGAIN W !!,"Finished"
  1. Q