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

ORPRS08.m

Go to the documentation of this file.
ORPRS08 ; slc/dcm - Nightly Order Summary Task ;6/10/97  15:45
 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**11,69**;Dec 17, 1997
MAIN ; Controls branching
 N ORL,ORI,ORPDOS,ORDOS
 D ENVAL^XPAR(.ORDOS,"ORPF DAILY ORDER SUMMARY DEVC")
 D ENVAL^XPAR(.ORPDOS,"ORPF PRINT DAILY ORDER SUMMARY")
 S ORL=""
 F  S ORL=$O(ORPDOS(ORL)) Q:ORL=""  I $G(ORPDOS(ORL,1)),$G(ORDOS(ORL,1)) D LOC(ORL,ORDOS(ORL,1))
 Q
LOC(ORL,ORDVC) ; Build patient list and task summary for each Inpatient location
 I $S(+ORL'>0:1,ORDVC'>0:1,1:0) G LOCX
 N %,%H,%I,%T,DFN,ORDT,ORPM,ORSHORT,ORSCPAT,ORSSTOP,ORSSTRT,ORTIT,X,ORSCPAT,ORSWDN
 N ORPRES,ORVP,ORX,IOP,Y,ZTIO,ZTSK,ZTRTN,ZTDESC,ZTDTH,ZTSAVE
 S ORSWDN=$P($G(^SC(+ORL,0)),"^")
 D PATARAY(.ORSCPAT,+ORL)
 I '$D(ORSCPAT) G LOCX
 D NOW^%DTC
 S (ORDT,X1)=$P(%,"."),(ORPM,X2)=$S($E($P(%,".",2),1,2)>12:1,1:-1)
 D C^%DTC
 S ORSSTRT=$S(ORPM>0:ORDT,1:X),ORSSTOP=$S(ORPM>0:X,1:ORDT),ORSHORT=$$SHORT^ORPRS02(),ORTIT="DAILY ORDER SUMMARY",ORPRES="DATE"
 S ZTRTN="EN1^ORPRS10",ZTDTH=$H,ZTDESC="Daily Order Summary for "_ORSWDN,ZTIO="`"_ORDVC,ZTSAVE("O*")=""
 D ^%ZTLOAD
LOCX Q
PATARAY(ORSCPAT,LOC) ;Loads patients into ORSCPAT local array
 ;LOC=Location
 ;ORVP=Patient variable pointer
 Q:'$L($G(LOC))
 Q:'$D(^SC(+LOC,42))  Q:'$D(^DIC(42,^(42),0))  S NAME=$P(^(0),"^")
 N X,I
 S I=0
 F  S I=$O(^DPT("CN",NAME,I)) Q:'I  S X=^DPT(I,0),ORSCPAT($P(X,"^")_" "_I)=I
 Q