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

SROATT2.m

Go to the documentation of this file.
SROATT2 ;B'HAM ISC/MAM - ATTENDING SURGEON REPORT (ALL SPECIALTIES) ; [ 05/11/04  2:33 PM ]
 ;;3.0; Surgery ;**50,129**;24 Jun 93
 K ^TMP("SR",$J)
 S SRSS=0 F  S SRSS=$O(^SRO(137.45,SRSS)) Q:'SRSS  S SRSSN=$P(^SRO(137.45,SRSS,0),"^") D UT
 S (^TMP("SRTOT",$J,"ZZ SPECIALTY NOT ENTERED"),^TMP("SRTOT",$J,"ZZ SPECIALTY NOT ENTERED","ZZ"))=0
 S (SRFLG,SRSOUT)=0,SRSDATE=SRSD-.0001,SREDT=SRED+.9999
 F  S SRSDATE=$O(^SRF("AC",SRSDATE)) Q:'SRSDATE!(SRSDATE>SREDT)!(SRSOUT)  S SRTN=0 F  S SRTN=$O(^SRF("AC",SRSDATE,SRTN)) Q:'SRTN!(SRSOUT)  I $D(^SRF(SRTN,0)),$$DIV^SROUTL0(SRTN) D UTIL
 I SRBOTH'=2 D ^SROAT2P
 Q:SRSOUT  I SRBOTH'=1 D RET Q:SRSOUT  D ^SROAT2T S SRSOUT=1
 Q
UTIL ; set ^TMP
 I '$D(^SRF(SRTN,.2)) Q
 I '$P(^SRF(SRTN,.2),"^",12) Q
 S SRSS=$P(^SRF(SRTN,0),"^",4) S SRSS=$S(SRSS:$P(^SRO(137.45,SRSS,0),"^"),1:"ZZ SPECIALTY NOT ENTERED")
 S SR(.1)=$S($D(^SRF(SRTN,.1)):^(.1),1:""),SRATT=$P(SR(.1),"^",13),SRATT=$S(SRATT:$P(^VA(200,SRATT,0),"^"),1:"ZZ ATTENDING NOT ENTERED")
 S SRCODE=$P(SR(.1),"^",10) S:SRCODE="" SRCODE="ZZ"
 S ^TMP("SR",$J,SRSS,SRATT,SRCODE,SRSDATE,SRTN)=""
 I '$D(^TMP("SRTOT",$J,SRSS,SRCODE)) S ^TMP("SRTOT",$J,SRSS,SRCODE)=0
 I '$D(^TMP("SRTC",$J,SRCODE)) S ^TMP("SRTC",$J,SRCODE)=0
 I '$D(^TMP("SRTOT",$J,"ZZ SPECIALTY NOT ENTERED",SRCODE)) S ^TMP("SRTOT",$J,"ZZ SPECIALTY NOT ENTERED",SRCODE)=0
 S ^TMP("SRTOT",$J)=^TMP("SRTOT",$J)+1
 S ^TMP("SRTOT",$J,SRSS)=^TMP("SRTOT",$J,SRSS)+1
 S ^TMP("SRTOT",$J,SRSS,SRCODE)=^TMP("SRTOT",$J,SRSS,SRCODE)+1
 S ^TMP("SRTC",$J,SRCODE)=^TMP("SRTC",$J,SRCODE)+1
 Q
UT ; initialize ^TMP
 S ^TMP("SRTOT",$J,SRSSN,"ZZ")=0,^TMP("SRTC",$J,"ZZ")=0
 S (^TMP("SRTOT",$J),^TMP("SRTOT",$J,SRSSN),SRCODE)=0
 ;F SRCD=0:1:3 S (^TMP("SRTOT",$J,SRSSN,SRCD),^TMP("SRTC",$J,SRCD),^TMP("SRTOT",$J,"ZZ SPECIALTY NOT ENTERED",SRCD))=0
 Q
RET I $E(IOST)="P"!('SRFLG) S SRFLG=1 Q
 W !!,"Press RETURN to continue, or '^' to quit: " R X:DTIME I '$T!(X["^") S SRSOUT=1 Q
 Q