source: WorldVistAEHR/trunk/r/GEN_MED_REC_IO-GMRY/GMRYRP1.m@ 1801

Last change on this file since 1801 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 1.7 KB
Line 
1GMRYRP1 ;HIRMFO/YH-TMP FOR PATIENT INTAKE/OUTPUT REPORTS-1 ;2/28/91
2 ;;4.0;Intake/Output;;Apr 25, 1997
3STARTD ;CALCULATE START DATE AND END DATE FOR REPORTS
4 I +$P(GMRSTRT,".",2)>0 G FINDT
5 I GMRNIT>2000 S X1=+$E(GMRSTRT,1,7),X2=-1 D C^%DTC K %DTC S GMRSTRT=X
6 S GMRSTRT=GMRSTRT_"."_GMRNIT
7FINDT ;
8 I +$P(GMRFIN,".",2)>0 G NEXT
9 S GHR=$E(GMRNIT,1,2),GMIN=$E(GMRNIT,3,4)
10 I +GMIN=0 S GHR=GHR-1,GHR=$S(GHR<10:"0"_GHR,1:GHR),GMRFIN=GMRFIN_"."_GHR_"59" G NEXT
11 I +GMIN=1 S GMRFIN=GMRFIN_"."_"2400" G NEXT
12 S GMIN=GMIN-1,GMIN=$S(GMIN<10:"0"_GMIN,1:GMIN),GMRFIN=GMRFIN_"."_GHR_GMIN
13NEXT ;
14 S GDTFIN=+$E(GMRFIN,1,7),GDTSTRT=GDTFIN
15 I GMRNIT>2000 S X1=GDTFIN,X2=-1 D C^%DTC K %DT S GDTSTRT=X
16 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
17 Q
18DATE ;ENTER START DATE AND END DATE FOR PATIENT INTAKE/OUTPUT REPORT
19 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
20 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
21 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
22 Q
23ITEM ;CONCATENATE INTAKE ITEM AND VOLUME AS TEXT FOR PRINT
24 Q:'$D(^GMR(126,DA(1),II,DA,1,0))
25 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
26 .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:"")
27 K GI Q
Note: See TracBrowser for help on using the repository browser.