28 lines
1.7 KiB
Mathematica
28 lines
1.7 KiB
Mathematica
GMRYRP1 ;HIRMFO/YH-TMP FOR PATIENT INTAKE/OUTPUT REPORTS-1 ;2/28/91
|
|
;;4.0;Intake/Output;;Apr 25, 1997
|
|
STARTD ;CALCULATE START DATE AND END DATE FOR REPORTS
|
|
I +$P(GMRSTRT,".",2)>0 G FINDT
|
|
I GMRNIT>2000 S X1=+$E(GMRSTRT,1,7),X2=-1 D C^%DTC K %DTC S GMRSTRT=X
|
|
S GMRSTRT=GMRSTRT_"."_GMRNIT
|
|
FINDT ;
|
|
I +$P(GMRFIN,".",2)>0 G NEXT
|
|
S GHR=$E(GMRNIT,1,2),GMIN=$E(GMRNIT,3,4)
|
|
I +GMIN=0 S GHR=GHR-1,GHR=$S(GHR<10:"0"_GHR,1:GHR),GMRFIN=GMRFIN_"."_GHR_"59" G NEXT
|
|
I +GMIN=1 S GMRFIN=GMRFIN_"."_"2400" G NEXT
|
|
S GMIN=GMIN-1,GMIN=$S(GMIN<10:"0"_GMIN,1:GMIN),GMRFIN=GMRFIN_"."_GHR_GMIN
|
|
NEXT ;
|
|
S GDTFIN=+$E(GMRFIN,1,7),GDTSTRT=GDTFIN
|
|
I GMRNIT>2000 S X1=GDTFIN,X2=-1 D C^%DTC K %DT S GDTSTRT=X
|
|
S X1=GDTFIN,X2=-1 D C^%DTC K %DT S GLASTDT=X S X1=GDTSTRT,X2=1 D C^%DTC K %DT S GNXTDT=X
|
|
Q
|
|
DATE ;ENTER START DATE AND END DATE FOR PATIENT INTAKE/OUTPUT REPORT
|
|
S %DT("A")="Enter start DATE for this report: ",%DT("B")="T-3",%DT="AETX" D ^%DT K %DT S:+Y'>0 GMROUT=1 Q:GMROUT S GMRSTRT=+Y
|
|
S %DT("A")="Go to DATE: ",%DT="AETXS",%DT("B")="NOW" D ^%DT K %DT S:+Y'>0 GMROUT=1 Q:GMROUT S (X1,GMRFIN)=+Y Q:GMRFIN=GMRSTRT S X2=GMRSTRT D ^%DTC
|
|
I X<0!(X=0&(((+("."_$P(GMRFIN,".",2))*10000)-((+("."_$P(GMRSTRT,".",2))*10000)))'>0)) W !,?5,"ENDING DATE needs to be greater than STARTING DATE",!,?5,$C(7),"Please reenter!!!" G DATE
|
|
Q
|
|
ITEM ;CONCATENATE INTAKE ITEM AND VOLUME AS TEXT FOR PRINT
|
|
Q:'$D(^GMR(126,DA(1),II,DA,1,0))
|
|
F GI=0:0 S GI=$O(^GMR(126,DA(1),II,DA,1,GI)) Q:GI'>0 I $D(^GMRD(126.8,+$P(^GMR(126,DA(1),II,DA,1,GI,0),"^"),0)) D
|
|
.S GITEM=GITEM_$P(^GMRD(126.8,+$P(^GMR(126,DA(1),II,DA,1,GI,0),"^"),0),"^")_" "_$P(^GMR(126,DA(1),II,DA,1,GI,0),"^",2)_" mls "_$S($P(^(0),"^",3)'="":" * "_$P(^(0),"^",3)_" ",1:"")
|
|
K GI Q
|