ORPRS05 ; slc/dcm - Order summary headers, footers, inerds ;6/10/97 15:42
;;3.0;ORDER ENTRY/RESULTS REPORTING;**11**;Dec 17, 1997
PTOP(PG,TITLE,SHORT,START,STOP) ;header for printouts
;PG=Page #
;TITLE=Report title
;SHORT=Format type (short or long)
;START=Internal start date^External start date
;STOP=Internal stop date^External Stop date
Q:'$G(PG) Q:'$D(TITLE)
N ORHLINE S $P(ORHLINE,"=",IOM+1)=""
W !?(IOM-$L(ORTIT)\2),ORTIT,?(IOM-($L(PG)+5)),$S('$G(SHORT):"Page "_PG,1:"")
W ! I $L($P(START,"^",2)) D W X
. S X=$P(START,"^",2)_" thru "_$P(STOP,"^",2) I $$FMDIFF^XLFDT(+STOP,+START)<2 S X="For: "_$P($P(STOP,"^",2),"@")
S X=$P($$HTE^XLFDT($H),":",1,2) W ?IOM-($L(X)+8),"Printed "_X
W !,"Ord'd",?9,"ST",?13,"Item Ordered",?54,"Requestor Start Stop",!,ORHLINE
Q
PBOT(PG,BOTTOM,NAME,SSN,DOB,AGE,WEIGHT,LOC,BED,SHORT) ;Footer for printouts
;PG=Page #
;BOTTOM=Page length
;NAME=Patient name
;SSN=SSN, DOB=DOB, AGE=Age, WEIGHT=Weight, LOC=Location, BED=bed
;SHORT=Report format (short or long)
Q:'$G(PG) Q:'$G(BOTTOM) Q:'$D(NAME) Q:'$D(SSN) Q:'$D(DOB) Q:'$D(AGE) Q:'$D(LOC)
N ORHLINE S $P(ORHLINE,"=",IOM+1)=""
I '$G(SHORT) F I=$Y:1:(BOTTOM-6) W !
W !,ORHLINE S X=DOB_" ("_AGE_") "_"Wt (lb): "_$S($D(WEIGHT):WEIGHT,1:" ")
W !,NAME," ",SSN,?IOM-$L(X),X
W !,LOC,$S($L($G(BED)):"/"_BED,1:"") W:'$G(SHORT) ?(IOM-($L(PG)+5)),"Page "_PG,!
Q
CTOP(PG,SEND,EOP,TITLE,SHORT,LOC,BED,WARD,NAME,SSN,DOB,AGE,WEIGHT) ;Display header
;PG=Page #
;SEND=??
;EOP=??
;TITLE=Report title
;SHORT=Report format (short or long)
Q:'$G(PG) Q:'$D(TITLE) Q:'$D(SHORT)
I $G(SEND),$G(EOP) Q
N ORHLINE S $P(ORHLINE,"=",IOM+1)=""
W @IOF
W !?(IOM-$L(TITLE)\2),TITLE I $G(PG) W ?IOM-$L(PG)-5,"Page "_PG
I '$G(SHORT) D HDG
W !,"Ord'd",?9,"St",?13,"Item Ordered",?54,"Requestor Start Stop",!,ORHLINE
Q
HDG ;Print header
Q:'$D(DOB) Q:'$D(AGE) Q:'$D(WEIGHT) Q:'$D(NAME) Q:'$D(SSN)
I '$D(LOC),$G(WARD) S X=+$G(^DIC(42,+WARD,44)) S LOC=$P($G(^SC(X,0)),"^",2)
S X=DOB_" ("_AGE_") "_"Wt (lb): "_$S($D(WEIGHT):WEIGHT,1:" ")
S:'$D(BED) BED=""
S X1=LOC_$S($L(BED):"/"_BED,1:"")
W !,NAME," ",SSN,?39-($L(X1)\2),X1,?(79-$L(X)),X
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORPRS05 2214 printed Nov 22, 2024@17:42:49 Page 2
ORPRS05 ; slc/dcm - Order summary headers, footers, inerds ;6/10/97 15:42
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**11**;Dec 17, 1997
PTOP(PG,TITLE,SHORT,START,STOP) ;header for printouts
+1 ;PG=Page #
+2 ;TITLE=Report title
+3 ;SHORT=Format type (short or long)
+4 ;START=Internal start date^External start date
+5 ;STOP=Internal stop date^External Stop date
+6 if '$GET(PG)
QUIT
if '$DATA(TITLE)
QUIT
+7 NEW ORHLINE
SET $PIECE(ORHLINE,"=",IOM+1)=""
+8 WRITE !?(IOM-$LENGTH(ORTIT)\2),ORTIT,?(IOM-($LENGTH(PG)+5)),$SELECT('$GET(SHORT):"Page "_PG,1:"")
+9 WRITE !
IF $LENGTH($PIECE(START,"^",2))
Begin DoDot:1
+10 SET X=$PIECE(START,"^",2)_" thru "_$PIECE(STOP,"^",2)
IF $$FMDIFF^XLFDT(+STOP,+START)<2
SET X="For: "_$PIECE($PIECE(STOP,"^",2),"@")
End DoDot:1
WRITE X
+11 SET X=$PIECE($$HTE^XLFDT($HOROLOG),":",1,2)
WRITE ?IOM-($LENGTH(X)+8),"Printed "_X
+12 WRITE !,"Ord'd",?9,"ST",?13,"Item Ordered",?54,"Requestor Start Stop",!,ORHLINE
+13 QUIT
PBOT(PG,BOTTOM,NAME,SSN,DOB,AGE,WEIGHT,LOC,BED,SHORT) ;Footer for printouts
+1 ;PG=Page #
+2 ;BOTTOM=Page length
+3 ;NAME=Patient name
+4 ;SSN=SSN, DOB=DOB, AGE=Age, WEIGHT=Weight, LOC=Location, BED=bed
+5 ;SHORT=Report format (short or long)
+6 if '$GET(PG)
QUIT
if '$GET(BOTTOM)
QUIT
if '$DATA(NAME)
QUIT
if '$DATA(SSN)
QUIT
if '$DATA(DOB)
QUIT
if '$DATA(AGE)
QUIT
if '$DATA(LOC)
QUIT
+7 NEW ORHLINE
SET $PIECE(ORHLINE,"=",IOM+1)=""
+8 IF '$GET(SHORT)
FOR I=$Y:1:(BOTTOM-6)
WRITE !
+9 WRITE !,ORHLINE
SET X=DOB_" ("_AGE_") "_"Wt (lb): "_$SELECT($DATA(WEIGHT):WEIGHT,1:" ")
+10 WRITE !,NAME," ",SSN,?IOM-$LENGTH(X),X
+11 WRITE !,LOC,$SELECT($LENGTH($GET(BED)):"/"_BED,1:"")
if '$GET(SHORT)
WRITE ?(IOM-($LENGTH(PG)+5)),"Page "_PG,!
+12 QUIT
CTOP(PG,SEND,EOP,TITLE,SHORT,LOC,BED,WARD,NAME,SSN,DOB,AGE,WEIGHT) ;Display header
+1 ;PG=Page #
+2 ;SEND=??
+3 ;EOP=??
+4 ;TITLE=Report title
+5 ;SHORT=Report format (short or long)
+6 if '$GET(PG)
QUIT
if '$DATA(TITLE)
QUIT
if '$DATA(SHORT)
QUIT
+7 IF $GET(SEND)
IF $GET(EOP)
QUIT
+8 NEW ORHLINE
SET $PIECE(ORHLINE,"=",IOM+1)=""
+9 WRITE @IOF
+10 WRITE !?(IOM-$LENGTH(TITLE)\2),TITLE
IF $GET(PG)
WRITE ?IOM-$LENGTH(PG)-5,"Page "_PG
+11 IF '$GET(SHORT)
DO HDG
+12 WRITE !,"Ord'd",?9,"St",?13,"Item Ordered",?54,"Requestor Start Stop",!,ORHLINE
+13 QUIT
HDG ;Print header
+1 if '$DATA(DOB)
QUIT
if '$DATA(AGE)
QUIT
if '$DATA(WEIGHT)
QUIT
if '$DATA(NAME)
QUIT
if '$DATA(SSN)
QUIT
+2 IF '$DATA(LOC)
IF $GET(WARD)
SET X=+$GET(^DIC(42,+WARD,44))
SET LOC=$PIECE($GET(^SC(X,0)),"^",2)
+3 SET X=DOB_" ("_AGE_") "_"Wt (lb): "_$SELECT($DATA(WEIGHT):WEIGHT,1:" ")
+4 if '$DATA(BED)
SET BED=""
+5 SET X1=LOC_$SELECT($LENGTH(BED):"/"_BED,1:"")
+6 WRITE !,NAME," ",SSN,?39-($LENGTH(X1)\2),X1,?(79-$LENGTH(X)),X
+7 QUIT