FHXDB1 ; HISC/REL/NCA - Verify data base pointers (cont.) ;12/13/91 14:00
;;5.5;DIETETICS;;Jan 28, 2005
W !!,"Verifying file 119.71 - Production Facility"
W !!,"Verifying file 119.72 - Service Point"
F K=0:0 S K=$O(^FH(119.7,K)) Q:K<1 D D0
W !!,"Verifying file 119.73 - Communication Office"
W !!,"Verifying file 119.74 - Supplemental Feeding Site"
F K=0:0 S K=$O(^FH(119.74,K)) Q:K<1 D SF
W !!,"Verifying file 119.9 - Site Paramaters"
W !!,"Verifying file 113 - Ingredients"
F K=0:0 S K=$O(^FHING(K)) Q:K<1 D I0
W !!,"Verifying file 114 - Recipes"
F K=0:0 S K=$O(^FH(114,K)) Q:K<1 D R1
W !!,"Verifying file 116 - Menu Cycle"
F K=0:0 S K=$O(^FH(116,K)) Q:K<1 D C0
W !!,"Verifying file 116.1 - Meals"
F K=0:0 S K=$O(^FH(116.1,K)) Q:K<1 D R2
W !!,"Verifying file 116.3 - Holiday Meals"
F K=0:0 S K=$O(^FH(116.3,K)) Q:K<1 D C1
G ^FHXDB2
I0 S X=^FHING(K,0),N=$P(X,"^",4) I N,'$D(^FH(113.2,N,0))#2 W !?5,"Vendor ",N," missing from Ingredient ",K," - ",$P(X,"^",1)
S N=$P(X,"^",12) I N,'$D(^FH(113.1,N,0))#2 W !?5,"Storage Location ",N," missing from Ingredient ",K," - ",$P(X,"^",1)
;S N=$P(X,"^",21) I N,'$D(^FH(112,N,0))#2 W !?5,"Default Nutrient ",N," missing from Ingredient ",K," - ",$P(X,"^",1)
Q
C0 F L=0:0 S L=$O(^FH(116,K,"DA",L)) Q:L<1 S X=^(L,0) F M=2:1:4 S N=$P(X,"^",M) I N,'$D(^FH(116.1,N,0))#2 W !?5,"Meal ",N," missing in Cycle ",K," Day ",L," - ",$P(^FH(116,K,0),"^",1)
Q
C1 S X=^FH(116.3,K,0) F L=2:1:4 S N=$P(X,"^",L) I N,'$D(^FH(116.1,N,0))#2 W !?5,"Meal ",N," missing in Holiday Meals ",$E(K,4,5),"/",$E(K,6,7),"/",$E(K,2,3)," - ",$P(^FH(116.3,K,0),"^",5)
Q
D0 F L=0:0 S L=$O(^FH(119.72,K,"A",L)) Q:L<1 S N=+^(L,0) I '$D(^FH(116.2,N,0))#2 W !?5,"Prod. Diet ",N," missing from Service Point ",K," - ",$P(^FH(119.72,K,0),"^",1)
F L=0:0 S L=$O(^FH(119.72,K,"B",L)) Q:L<1 S N=+^(L,0) I '$D(^FH(116.2,N,0))#2 W !?5,"Prod. Diet ",N," missing from Service Point ",K," - ",$P(^FH(119.72,K,0),"^",1)
S X=$G(^FH(119.72,K,0))
S N=$P(X,"^",3) I N,'$D(^FH(119.71,N,0))#2 W !?5,"Production Facility ",N," missing from Service Point ",K," - ",$P(^FH(119.72,K,0),"^",1)
Q
SF S N=$P(^FH(119.74,K,0),"^",3) I N,'$D(^FH(119.71,N,0))#2 W !?5,"Production Facility ",N," missing from Supplemental Fdg. Site ",K," - ",$P(^FH(119.74,K,0),"^",1)
Q
R1 F L=0:0 S L=$O(^FH(114,K,"I",L)) Q:L<1 S N=+^(L,0) I '$D(^FHING(N,0))#2 W !?5,"Ingredient ",N," missing in Recipe ",K," - ",$P(^FH(114,K,0),"^",1)
F L=0:0 S L=$O(^FH(114,K,"R",L)) Q:L<1 S N=+^(L,0) I '$D(^FH(114,N,0))#2 W !?5,"Embedded recipe ",N," missing in Recipe ",K," - ",$P(^FH(114,K,0),"^",1)
S X=^FH(114,K,0)
F L=0:0 S L=$O(^FH(114,K,"E",L)) Q:L<1 S N=+^(L,0) I '$D(^FH(114.4,N,0))#2 W !?5,"Equipment ",N," missing in Recipe ",K," - ",$P(X,"^",1)
S N=$P(X,"^",6) I N,'$D(^FH(114.3,N,0))#2 W !?5,"Serving Utensil ",N," missing in Recipe ",K," - ",$P(X,"^",1)
S N=$P(X,"^",7) I N,'$D(^FH(114.1,N,0))#2 W !?5,"Recipe Category ",N," missing in Recipe ",K," - ",$P(X,"^",1)
S N=$P(X,"^",12) I N,'$D(^FH(114.2,N,0))#2 W !?5,"Preparation Area ",N," missing in Recipe ",K," - ",$P(X,"^",1)
Q
R2 F L=0:0 S L=$O(^FH(116.1,K,"RE",L)) Q:L<1 S N=+^(L,0) D:$D(^FH(116.1,K,"RE",L,"D")) R3 I '$D(^FH(114,N,0))#2 W !?5,"Recipe ",N," missing in Meal ",K," - ",$P(^FH(116.1,K,0),"^",1)
Q
R3 F X9=0:0 S X9=$O(^FH(116.1,K,"RE",L,"D",X9)) Q:X9<1 I '$D(^FH(119.72,X9)) W !?5,"Service Point ",X9," missing in Meal ",$P(^FH(116.1,K,0),"^",1),", Recipe ",$S($D(^FH(114,N,0)):$P(^(0),"^",1),1:N)
Q:'$D(^FH(116.1,K,"RE",L,"R"))
F CAT=0:0 S CAT=$O(^FH(116.1,K,"RE",L,"R",CAT)) Q:CAT<1 S MCA=+^(CAT,0) I '$D(^FH(114.1,MCA,0)) W !?5,"Recipe Category ",CAT," missing in Meal ",$P(^FH(116.1,K,0),"^",1),", Recipe ",$S($D(^FH(114,N,0)):$P(^(0),"^",1),1:N)
Q
FHXDB1 ; HISC/REL/NCA - Verify data base pointers (cont.) ;12/13/91 14:00
+1 ;;5.5;DIETETICS;;Jan 28, 2005
+2 WRITE !!,"Verifying file 119.71 - Production Facility"
+3 WRITE !!,"Verifying file 119.72 - Service Point"
+4 FOR K=0:0
SET K=$ORDER(^FH(119.7,K))
IF K<1
QUIT
DO D0
+5 WRITE !!,"Verifying file 119.73 - Communication Office"
+6 WRITE !!,"Verifying file 119.74 - Supplemental Feeding Site"
+7 FOR K=0:0
SET K=$ORDER(^FH(119.74,K))
IF K<1
QUIT
DO SF
+8 WRITE !!,"Verifying file 119.9 - Site Paramaters"
+9 WRITE !!,"Verifying file 113 - Ingredients"
+10 FOR K=0:0
SET K=$ORDER(^FHING(K))
IF K<1
QUIT
DO I0
+11 WRITE !!,"Verifying file 114 - Recipes"
+12 FOR K=0:0
SET K=$ORDER(^FH(114,K))
IF K<1
QUIT
DO R1
+13 WRITE !!,"Verifying file 116 - Menu Cycle"
+14 FOR K=0:0
SET K=$ORDER(^FH(116,K))
IF K<1
QUIT
DO C0
+15 WRITE !!,"Verifying file 116.1 - Meals"
+16 FOR K=0:0
SET K=$ORDER(^FH(116.1,K))
IF K<1
QUIT
DO R2
+17 WRITE !!,"Verifying file 116.3 - Holiday Meals"
+18 FOR K=0:0
SET K=$ORDER(^FH(116.3,K))
IF K<1
QUIT
DO C1
+19 GOTO ^FHXDB2
I0 SET X=^FHING(K,0)
SET N=$PIECE(X,"^",4)
IF N
IF '$DATA(^FH(113.2,N,0))#2
WRITE !?5,"Vendor ",N," missing from Ingredient ",K," - ",$PIECE(X,"^",1)
+1 SET N=$PIECE(X,"^",12)
IF N
IF '$DATA(^FH(113.1,N,0))#2
WRITE !?5,"Storage Location ",N," missing from Ingredient ",K," - ",$PIECE(X,"^",1)
+2 ;S N=$P(X,"^",21) I N,'$D(^FH(112,N,0))#2 W !?5,"Default Nutrient ",N," missing from Ingredient ",K," - ",$P(X,"^",1)
+3 QUIT
C0 FOR L=0:0
SET L=$ORDER(^FH(116,K,"DA",L))
IF L<1
QUIT
SET X=^(L,0)
FOR M=2:1:4
SET N=$PIECE(X,"^",M)
IF N
IF '$DATA(^FH(116.1,N,0))#2
WRITE !?5,"Meal ",N," missing in Cycle ",K," Day ",L," - ",$PIECE(^FH(116,K,0),"^",1)
+1 QUIT
C1 SET X=^FH(116.3,K,0)
FOR L=2:1:4
SET N=$PIECE(X,"^",L)
IF N
IF '$DATA(^FH(116.1,N,0))#2
WRITE !?5,"Meal ",N," missing in Holiday Meals ",$EXTRACT(K,4,5),"/",$EXTRACT(K,6,7),"/",$EXTRACT(K,2,3)," - ",$PIECE(^FH(116.3,K,0),"^",5)
+1 QUIT
D0 FOR L=0:0
SET L=$ORDER(^FH(119.72,K,"A",L))
IF L<1
QUIT
SET N=+^(L,0)
IF '$DATA(^FH(116.2,N,0))#2
WRITE !?5,"Prod. Diet ",N," missing from Service Point ",K," - ",$PIECE(^FH(119.72,K,0),"^",1)
+1 FOR L=0:0
SET L=$ORDER(^FH(119.72,K,"B",L))
IF L<1
QUIT
SET N=+^(L,0)
IF '$DATA(^FH(116.2,N,0))#2
WRITE !?5,"Prod. Diet ",N," missing from Service Point ",K," - ",$PIECE(^FH(119.72,K,0),"^",1)
+2 SET X=$GET(^FH(119.72,K,0))
+3 SET N=$PIECE(X,"^",3)
IF N
IF '$DATA(^FH(119.71,N,0))#2
WRITE !?5,"Production Facility ",N," missing from Service Point ",K," - ",$PIECE(^FH(119.72,K,0),"^",1)
+4 QUIT
SF SET N=$PIECE(^FH(119.74,K,0),"^",3)
IF N
IF '$DATA(^FH(119.71,N,0))#2
WRITE !?5,"Production Facility ",N," missing from Supplemental Fdg. Site ",K," - ",$PIECE(^FH(119.74,K,0),"^",1)
+1 QUIT
R1 FOR L=0:0
SET L=$ORDER(^FH(114,K,"I",L))
IF L<1
QUIT
SET N=+^(L,0)
IF '$DATA(^FHING(N,0))#2
WRITE !?5,"Ingredient ",N," missing in Recipe ",K," - ",$PIECE(^FH(114,K,0),"^",1)
+1 FOR L=0:0
SET L=$ORDER(^FH(114,K,"R",L))
IF L<1
QUIT
SET N=+^(L,0)
IF '$DATA(^FH(114,N,0))#2
WRITE !?5,"Embedded recipe ",N," missing in Recipe ",K," - ",$PIECE(^FH(114,K,0),"^",1)
+2 SET X=^FH(114,K,0)
+3 FOR L=0:0
SET L=$ORDER(^FH(114,K,"E",L))
IF L<1
QUIT
SET N=+^(L,0)
IF '$DATA(^FH(114.4,N,0))#2
WRITE !?5,"Equipment ",N," missing in Recipe ",K," - ",$PIECE(X,"^",1)
+4 SET N=$PIECE(X,"^",6)
IF N
IF '$DATA(^FH(114.3,N,0))#2
WRITE !?5,"Serving Utensil ",N," missing in Recipe ",K," - ",$PIECE(X,"^",1)
+5 SET N=$PIECE(X,"^",7)
IF N
IF '$DATA(^FH(114.1,N,0))#2
WRITE !?5,"Recipe Category ",N," missing in Recipe ",K," - ",$PIECE(X,"^",1)
+6 SET N=$PIECE(X,"^",12)
IF N
IF '$DATA(^FH(114.2,N,0))#2
WRITE !?5,"Preparation Area ",N," missing in Recipe ",K," - ",$PIECE(X,"^",1)
+7 QUIT
R2 FOR L=0:0
SET L=$ORDER(^FH(116.1,K,"RE",L))
IF L<1
QUIT
SET N=+^(L,0)
IF $DATA(^FH(116.1,K,"RE",L,"D"))
DO R3
IF '$DATA(^FH(114,N,0))#2
WRITE !?5,"Recipe ",N," missing in Meal ",K," - ",$PIECE(^FH(116.1,K,0),"^",1)
+1 QUIT
R3 FOR X9=0:0
SET X9=$ORDER(^FH(116.1,K,"RE",L,"D",X9))
IF X9<1
QUIT
IF '$DATA(^FH(119.72,X9))
WRITE !?5,"Service Point ",X9," missing in Meal ",$PIECE(^FH(116.1,K,0),"^",1),", Recipe ",$SELECT($DATA(^FH(114,N,0)):$PIECE(^(0),"^",1),1:N)
+1 IF '$DATA(^FH(116.1,K,"RE",L,"R"))
QUIT
+2 FOR CAT=0:0
SET CAT=$ORDER(^FH(116.1,K,"RE",L,"R",CAT))
IF CAT<1
QUIT
SET MCA=+^(CAT,0)
IF '$DATA(^FH(114.1,MCA,0))
WRITE !?5,"Recipe Category ",CAT," missing in Meal ",$PIECE(^FH(116.1,K,0),"^",1),", Recipe ",$SELECT($DATA(^FH(114,N,0)):$PIECE(^(0),"^",1),1:N)
+3 QUIT