[613] | 1 | ORPRS08 ; slc/dcm - Nightly Order Summary Task ;6/10/97 15:45
|
---|
| 2 | ;;3.0;ORDER ENTRY/RESULTS REPORTING;**11,69**;Dec 17, 1997
|
---|
| 3 | MAIN ; Controls branching
|
---|
| 4 | N ORL,ORI,ORPDOS,ORDOS
|
---|
| 5 | D ENVAL^XPAR(.ORDOS,"ORPF DAILY ORDER SUMMARY DEVC")
|
---|
| 6 | D ENVAL^XPAR(.ORPDOS,"ORPF PRINT DAILY ORDER SUMMARY")
|
---|
| 7 | S ORL=""
|
---|
| 8 | F S ORL=$O(ORPDOS(ORL)) Q:ORL="" I $G(ORPDOS(ORL,1)),$G(ORDOS(ORL,1)) D LOC(ORL,ORDOS(ORL,1))
|
---|
| 9 | Q
|
---|
| 10 | LOC(ORL,ORDVC) ; Build patient list and task summary for each Inpatient location
|
---|
| 11 | I $S(+ORL'>0:1,ORDVC'>0:1,1:0) G LOCX
|
---|
| 12 | N %,%H,%I,%T,DFN,ORDT,ORPM,ORSHORT,ORSCPAT,ORSSTOP,ORSSTRT,ORTIT,X,ORSCPAT,ORSWDN
|
---|
| 13 | N ORPRES,ORVP,ORX,IOP,Y,ZTIO,ZTSK,ZTRTN,ZTDESC,ZTDTH,ZTSAVE
|
---|
| 14 | S ORSWDN=$P($G(^SC(+ORL,0)),"^")
|
---|
| 15 | D PATARAY(.ORSCPAT,+ORL)
|
---|
| 16 | I '$D(ORSCPAT) G LOCX
|
---|
| 17 | D NOW^%DTC
|
---|
| 18 | S (ORDT,X1)=$P(%,"."),(ORPM,X2)=$S($E($P(%,".",2),1,2)>12:1,1:-1)
|
---|
| 19 | D C^%DTC
|
---|
| 20 | S ORSSTRT=$S(ORPM>0:ORDT,1:X),ORSSTOP=$S(ORPM>0:X,1:ORDT),ORSHORT=$$SHORT^ORPRS02(),ORTIT="DAILY ORDER SUMMARY",ORPRES="DATE"
|
---|
| 21 | S ZTRTN="EN1^ORPRS10",ZTDTH=$H,ZTDESC="Daily Order Summary for "_ORSWDN,ZTIO="`"_ORDVC,ZTSAVE("O*")=""
|
---|
| 22 | D ^%ZTLOAD
|
---|
| 23 | LOCX Q
|
---|
| 24 | PATARAY(ORSCPAT,LOC) ;Loads patients into ORSCPAT local array
|
---|
| 25 | ;LOC=Location
|
---|
| 26 | ;ORVP=Patient variable pointer
|
---|
| 27 | Q:'$L($G(LOC))
|
---|
| 28 | Q:'$D(^SC(+LOC,42)) Q:'$D(^DIC(42,^(42),0)) S NAME=$P(^(0),"^")
|
---|
| 29 | N X,I
|
---|
| 30 | S I=0
|
---|
| 31 | F S I=$O(^DPT("CN",NAME,I)) Q:'I S X=^DPT(I,0),ORSCPAT($P(X,"^")_" "_I)=I
|
---|
| 32 | Q
|
---|