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