FHPRW4 ; HISC/REL - List Supp. Fdg. Sites ;4/25/93 14:23
;;5.5;DIETETICS;;Jan 28, 2005
F K1=0:0 S K1=$O(^FH(119.74,K1)) Q:K1'>0 D Q5
Q
Q5 S X=^FH(119.74,K1,0) D BLD,HDR
W !!,"Short Name:",?25,$P(X,"^",2)
W !,"Separate Labels:",?25,$S($P(X,"^",4)="Y":"YES",1:"NO")
W !,"Items on Ward Lists:",?25,$S($P(X,"^",5)="Y":"YES",1:"NO")
W !,"Production Facility:",?25 S Z=$P(X,"^",3) W:Z $P($G(^FH(119.71,Z,0)),"^",1)
D WRD Q
WRD W !!,"Associated Dietetic Wards:",!
K P S N=0,NM="" F S NM=$O(^TMP($J,NM)) Q:NM="" S N=N+1,P(N)=$P(NM,"~",1)
I N S (Z,K)=N+1\2 F LL=1:1:Z W !?5,P(LL) S K=K+1 I $D(P(K)) W ?45,P(K)
Q
BLD ; Build temp files
K ^TMP($J)
F LL=0:0 S LL=$O(^FH(119.6,LL)) Q:LL<1 S Y=^(LL,0) I $P(Y,"^",9)=K1 D B1
Q
B1 S ^TMP($J,$P(Y,"^",1)_"~"_LL)="" Q
HDR W:'($E(IOST,1,2)'="C-"&'PG) @IOF S PG=PG+1,DTP=NOW D DTP^FH W !,$E(DTP,1,9),?15,"S U P P L E M E N T A L F E E D I N G S I T E",?73,"Page ",PG
S Y=$P(X,"^",1) W !!?(78-$L(Y)\2),Y
W !,"-------------------------------------------------------------------------------",! Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HFHPRW4 1071 printed Dec 13, 2024@01:54:47 Page 2
FHPRW4 ; HISC/REL - List Supp. Fdg. Sites ;4/25/93 14:23
+1 ;;5.5;DIETETICS;;Jan 28, 2005
+2 FOR K1=0:0
SET K1=$ORDER(^FH(119.74,K1))
if K1'>0
QUIT
DO Q5
+3 QUIT
Q5 SET X=^FH(119.74,K1,0)
DO BLD
DO HDR
+1 WRITE !!,"Short Name:",?25,$PIECE(X,"^",2)
+2 WRITE !,"Separate Labels:",?25,$SELECT($PIECE(X,"^",4)="Y":"YES",1:"NO")
+3 WRITE !,"Items on Ward Lists:",?25,$SELECT($PIECE(X,"^",5)="Y":"YES",1:"NO")
+4 WRITE !,"Production Facility:",?25
SET Z=$PIECE(X,"^",3)
if Z
WRITE $PIECE($GET(^FH(119.71,Z,0)),"^",1)
+5 DO WRD
QUIT
WRD WRITE !!,"Associated Dietetic Wards:",!
+1 KILL P
SET N=0
SET NM=""
FOR
SET NM=$ORDER(^TMP($JOB,NM))
if NM=""
QUIT
SET N=N+1
SET P(N)=$PIECE(NM,"~",1)
+2 IF N
SET (Z,K)=N+1\2
FOR LL=1:1:Z
WRITE !?5,P(LL)
SET K=K+1
IF $DATA(P(K))
WRITE ?45,P(K)
+3 QUIT
BLD ; Build temp files
+1 KILL ^TMP($JOB)
+2 FOR LL=0:0
SET LL=$ORDER(^FH(119.6,LL))
if LL<1
QUIT
SET Y=^(LL,0)
IF $PIECE(Y,"^",9)=K1
DO B1
+3 QUIT
B1 SET ^TMP($JOB,$PIECE(Y,"^",1)_"~"_LL)=""
QUIT
HDR if '($EXTRACT(IOST,1,2)'="C-"&'PG)
WRITE @IOF
SET PG=PG+1
SET DTP=NOW
DO DTP^FH
WRITE !,$EXTRACT(DTP,1,9),?15,"S U P P L E M E N T A L F E E D I N G S I T E",?73,"Page ",PG
+1 SET Y=$PIECE(X,"^",1)
WRITE !!?(78-$LENGTH(Y)\2),Y
+2 WRITE !,"-------------------------------------------------------------------------------",!
QUIT