GMTSFH1 ; SLC/JER,MKB - Dietetics Component con't ;1/29/91 11:44
;;2.5;Health Summary;;Dec 16, 1992
SF ; Supplemental feeding
I '$D(^UTILITY($J,"SF")) Q
S CNTR=GMTSNDM
D CKP^GMTSUP Q:$D(GMTSQIT) W !,"SUPPLEMENTAL FEEDINGS:",!
N GMW,GMIDT
S GMIDT=GMTS1 F GMW=0:0 S GMIDT=$O(^UTILITY($J,"SF",GMIDT)) Q:(GMIDT'>0)!(GMIDT>GMTS2) D SFWRT
Q
SFWRT ; Writes Supplemental Feedings
S CNTR=CNTR-1 I CNTR<0 Q
N GMZ S GMZ=^UTILITY($J,"SF",GMIDT,0)
S X=+$P(GMZ,U) D REGDT^GMTSU S STRT=X
I $P(GMZ,U,2)="" S STP="Present"
E S X=+$P(GMZ,U,2) D REGDT^GMTSU S STP=X
D CKP^GMTSUP Q:$D(GMTSQIT) W STRT_" - "_STP,!
D CKP^GMTSUP Q:$D(GMTSQIT) W ?14,"10 Am " S STR=$S($P(GMZ,U,3)'="":$P(GMZ,U,3),1:"No order")
I $L(STR)<55 W STR,!
E S COL=45 D WRAP W !
D CKP^GMTSUP Q:$D(GMTSQIT) W ?14," 2 Pm " S STR=$S($P(GMZ,U,4)'="":$P(GMZ,U,4),1:"No order")
I $L(STR)<55 W STR,!
E S COL=45 D WRAP W !
D CKP^GMTSUP Q:$D(GMTSQIT) W ?14," 8 Pm " S STR=$S($P(GMZ,U,5)'="":$P(GMZ,U,5),1:"No order")
I $L(STR)<55 W STR,!
E S COL=45 D WRAP W !
Q
TF ; Tubefeeding
I '$D(^UTILITY($J,"TF")) Q
S CNTR=GMTSNDM
D CKP^GMTSUP Q:$D(GMTSQIT) W !,"TUBE FEEDINGS:",!
N GMW,GMIDT
S GMIDT=GMTS1 F GMW=0:0 S GMIDT=$O(^UTILITY($J,"TF",GMIDT)) Q:(GMIDT'>0)!(GMIDT>GMTS2) D TFWRT
Q
TFWRT ; Writes tubefeeding
S CNTR=CNTR-1 I CNTR<0 Q
N GMZ S GMZ=^UTILITY($J,"TF",GMIDT,0)
S X=+$P(GMZ,U) D REGDT^GMTSU S STRT=X
I $P(GMZ,U,2)="" S STP="Present"
E S X=+$P(GMZ,U,2) D REGDT^GMTSU S STP=X
D CKP^GMTSUP Q:$D(GMTSQIT) W STRT_" - "_STP,!
D CKP^GMTSUP Q:$D(GMTSQIT) W ?12,"Product: ",$P(GMZ,U,3),!
D CKP^GMTSUP Q:$D(GMTSQIT) W ?11,"Strength: ",$P(GMZ,U,4),?51,"Quantity: ",$P(GMZ,U,5),!
D CKP^GMTSUP Q:$D(GMTSQIT) W ?9,"Daily CC's: ",$P(GMZ,U,6),?47,"Daily KCal's: ",$P(GMZ,U,7),!
I $P(GMZ,U,8)'="" D TFCOM
Q
TFCOM ; Writes comments for TF
D CKP^GMTSUP Q:$D(GMTSQIT) W ?11,"Comments: "
I $L($P(GMZ,U,8))<55 W $P(GMZ,U,8),!
E S STR=$P(GMZ,U,8),COL=45 D WRAP W !
Q
WRAP ; Controls wrap-around feature for comments, etc.
S TX=$F(STR," ",COL) W $E(STR,1,TX-1),!
D CKP^GMTSUP Q:$D(GMTSQIT) W ?21,$E(STR,TX,$L(STR))
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMTSFH1 2167 printed Nov 22, 2024@17:07:40 Page 2
GMTSFH1 ; SLC/JER,MKB - Dietetics Component con't ;1/29/91 11:44
+1 ;;2.5;Health Summary;;Dec 16, 1992
SF ; Supplemental feeding
+1 IF '$DATA(^UTILITY($JOB,"SF"))
QUIT
+2 SET CNTR=GMTSNDM
+3 DO CKP^GMTSUP
if $DATA(GMTSQIT)
QUIT
WRITE !,"SUPPLEMENTAL FEEDINGS:",!
+4 NEW GMW,GMIDT
+5 SET GMIDT=GMTS1
FOR GMW=0:0
SET GMIDT=$ORDER(^UTILITY($JOB,"SF",GMIDT))
if (GMIDT'>0)!(GMIDT>GMTS2)
QUIT
DO SFWRT
+6 QUIT
SFWRT ; Writes Supplemental Feedings
+1 SET CNTR=CNTR-1
IF CNTR<0
QUIT
+2 NEW GMZ
SET GMZ=^UTILITY($JOB,"SF",GMIDT,0)
+3 SET X=+$PIECE(GMZ,U)
DO REGDT^GMTSU
SET STRT=X
+4 IF $PIECE(GMZ,U,2)=""
SET STP="Present"
+5 IF '$TEST
SET X=+$PIECE(GMZ,U,2)
DO REGDT^GMTSU
SET STP=X
+6 DO CKP^GMTSUP
if $DATA(GMTSQIT)
QUIT
WRITE STRT_" - "_STP,!
+7 DO CKP^GMTSUP
if $DATA(GMTSQIT)
QUIT
WRITE ?14,"10 Am "
SET STR=$SELECT($PIECE(GMZ,U,3)'="":$PIECE(GMZ,U,3),1:"No order")
+8 IF $LENGTH(STR)<55
WRITE STR,!
+9 IF '$TEST
SET COL=45
DO WRAP
WRITE !
+10 DO CKP^GMTSUP
if $DATA(GMTSQIT)
QUIT
WRITE ?14," 2 Pm "
SET STR=$SELECT($PIECE(GMZ,U,4)'="":$PIECE(GMZ,U,4),1:"No order")
+11 IF $LENGTH(STR)<55
WRITE STR,!
+12 IF '$TEST
SET COL=45
DO WRAP
WRITE !
+13 DO CKP^GMTSUP
if $DATA(GMTSQIT)
QUIT
WRITE ?14," 8 Pm "
SET STR=$SELECT($PIECE(GMZ,U,5)'="":$PIECE(GMZ,U,5),1:"No order")
+14 IF $LENGTH(STR)<55
WRITE STR,!
+15 IF '$TEST
SET COL=45
DO WRAP
WRITE !
+16 QUIT
TF ; Tubefeeding
+1 IF '$DATA(^UTILITY($JOB,"TF"))
QUIT
+2 SET CNTR=GMTSNDM
+3 DO CKP^GMTSUP
if $DATA(GMTSQIT)
QUIT
WRITE !,"TUBE FEEDINGS:",!
+4 NEW GMW,GMIDT
+5 SET GMIDT=GMTS1
FOR GMW=0:0
SET GMIDT=$ORDER(^UTILITY($JOB,"TF",GMIDT))
if (GMIDT'>0)!(GMIDT>GMTS2)
QUIT
DO TFWRT
+6 QUIT
TFWRT ; Writes tubefeeding
+1 SET CNTR=CNTR-1
IF CNTR<0
QUIT
+2 NEW GMZ
SET GMZ=^UTILITY($JOB,"TF",GMIDT,0)
+3 SET X=+$PIECE(GMZ,U)
DO REGDT^GMTSU
SET STRT=X
+4 IF $PIECE(GMZ,U,2)=""
SET STP="Present"
+5 IF '$TEST
SET X=+$PIECE(GMZ,U,2)
DO REGDT^GMTSU
SET STP=X
+6 DO CKP^GMTSUP
if $DATA(GMTSQIT)
QUIT
WRITE STRT_" - "_STP,!
+7 DO CKP^GMTSUP
if $DATA(GMTSQIT)
QUIT
WRITE ?12,"Product: ",$PIECE(GMZ,U,3),!
+8 DO CKP^GMTSUP
if $DATA(GMTSQIT)
QUIT
WRITE ?11,"Strength: ",$PIECE(GMZ,U,4),?51,"Quantity: ",$PIECE(GMZ,U,5),!
+9 DO CKP^GMTSUP
if $DATA(GMTSQIT)
QUIT
WRITE ?9,"Daily CC's: ",$PIECE(GMZ,U,6),?47,"Daily KCal's: ",$PIECE(GMZ,U,7),!
+10 IF $PIECE(GMZ,U,8)'=""
DO TFCOM
+11 QUIT
TFCOM ; Writes comments for TF
+1 DO CKP^GMTSUP
if $DATA(GMTSQIT)
QUIT
WRITE ?11,"Comments: "
+2 IF $LENGTH($PIECE(GMZ,U,8))<55
WRITE $PIECE(GMZ,U,8),!
+3 IF '$TEST
SET STR=$PIECE(GMZ,U,8)
SET COL=45
DO WRAP
WRITE !
+4 QUIT
WRAP ; Controls wrap-around feature for comments, etc.
+1 SET TX=$FIND(STR," ",COL)
WRITE $EXTRACT(STR,1,TX-1),!
+2 DO CKP^GMTSUP
if $DATA(GMTSQIT)
QUIT
WRITE ?21,$EXTRACT(STR,TX,$LENGTH(STR))
+3 QUIT