Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: FHOMRO3

FHOMRO3.m

Go to the documentation of this file.
  1. FHOMRO3 ;Hines OIFO/RTK OUTPATIENT ORDER MULTIPLE DIETS ;9/28/04 10:05
  1. ;;5.5;DIETETICS;;Jan 28, 2005
  1. ;
  1. ;Code reused from FHORD1
  1. K FHDI,PREC S N1=0
  1. F1 ;
  1. W ! K DIC S DIC="^FH(111,",DIC(0)="AEQMZ"
  1. S DIC("S")="I '$D(^(""I""))&(Y>0)" D ^DIC
  1. K DIC G AB:X[U!$D(DTOUT),F5:X="",F1:Y<1
  1. S PREC=$P(Y(0),U,4) I PREC,$D(FHDI(PREC)) W *7,!!,"This conflicts with ",$P(FHDI(PREC),"^",2),! G F1
  1. S N1=N1+1,FHDI(PREC)=+Y_"^"_Y(0) G F5:+Y=1,F1:N1<5 W *7,!!,"You have now selected the maximum of 5 Diet Modifications!"
  1. F5 ;
  1. G:'N1 AB W !!,"You have selected the following Diet:",!
  1. S (FHD3,FHD4)=0 F FHD0=0:0 S FHD0=$O(FHDI(FHD0)) Q:FHD0="" W !?5,$P(FHDI(FHD0),U,2) S:$P(FHDI(FHD0),U,4)="Y" FHD3=1 S:$P(FHDI(FHD0),U,7)="Y" FHD4=1
  1. F9 ;
  1. R !!,"Is this Correct? Y// ",Y:DTIME G:'$T!(Y="^") AB S:Y="" Y="Y" S X=Y D TR^FH S Y=X
  1. I $P("YES",Y,1)'="",$P("NO",Y,1)'="" W *7,!," Answer YES to accept diet list; NO to select diets again" G F9
  1. I Y'?1"Y".E K FHDI S N1=0 W !!,"Select new diets ..." G F1
  1. Q
  1. AB K FHDI S N1=0 Q