Changeset 460 for cprs/branches/foia-cprs/CPRS-Chart/Orders/fODDietLT.pas
- Timestamp:
- Jul 6, 2008, 8:20:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/branches/foia-cprs/CPRS-Chart/Orders/fODDietLT.pas
r459 r460 75 75 begin 76 76 TimePart := Frac(x); 77 if TimePart > 0.1 2then77 if TimePart > 0.1159 then 78 78 begin 79 x := x - 0.12;79 if TimePart > 0.1259 then x := x - 0.12; 80 80 Suffix := 'P' 81 81 end … … 127 127 (TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 6), 0) / 10000)) then Meal := 'E'; 128 128 if Meal = #0 then Exit; 129 // get the available late times for this meal130 case Meal of131 'B': AvailTimes := Pieces(DietParams.BTimes, U, 4, 6);132 'E': AvailTimes := Pieces(DietParams.ETimes, U, 4, 6);133 'N': AvailTimes := Pieces(DietParams.NTimes, U, 4, 6);134 end;135 SetAvailTimes(TimePart, TimeCount, AvailTimes);136 if TimeCount = 0 then Exit;137 129 end 138 130 else // for outpatients 139 131 begin 132 (* From Rich Knoepfle, NFS developer 133 If they order a breakfast and it is after the LATE BREAKFAST ALARM END, I don't allow them to do it. (For special meals I don't allow them to order something for the following day). 134 If it's before the LATE BREAKFAST ALARM BEGIN than I accept the order. 135 If it's between the LATE BREAKFAST ALARM BEGIN and ALARM END then I ask if they want to order a Late breakfast tray. 136 *) 140 137 Meal := AMeal; 141 138 case AMeal of 142 'B': if TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 1), 0) / 10000) then Meal := #0; 143 'N': if TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 3), 0) / 10000) then Meal := #0; 144 'E': if TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 5), 0) / 10000) then Meal := #0; 139 'B': if (TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 1), 0) / 10000)) or 140 (TimePart > (StrToIntDef(Piece(DietParams.Alarms, U, 2), 0) / 10000)) then Meal := #0; 141 'N': if (TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 3), 0) / 10000)) or 142 (TimePart > (StrToIntDef(Piece(DietParams.Alarms, U, 4), 0) / 10000)) then Meal := #0; 143 'E': if (TimePart < (StrToIntDef(Piece(DietParams.Alarms, U, 5), 0) / 10000)) or 144 (TimePart > (StrToIntDef(Piece(DietParams.Alarms, U, 6), 0) / 10000)) then Meal := #0; 145 145 end; 146 146 if Meal = #0 then exit; 147 147 end; 148 149 // get the available late times for this meal 150 case Meal of 151 'B': AvailTimes := Pieces(DietParams.BTimes, U, 4, 6); 152 'E': AvailTimes := Pieces(DietParams.ETimes, U, 4, 6); 153 'N': AvailTimes := Pieces(DietParams.NTimes, U, 4, 6); 154 end; 155 SetAvailTimes(TimePart, TimeCount, AvailTimes); 156 if TimeCount = 0 then Exit; 157 148 158 // setup form to get the selected late tray 149 159 frmODDietLT := TfrmODDietLT.Create(Application); … … 153 163 begin 154 164 FOutpatient := IsOutpatient; 155 if not IsOutpatient then 156 begin 157 if Length(Piece(AvailTimes, U, 1)) > 0 then radLT1.Caption := Piece(AvailTimes, U, 1); 158 if Length(Piece(AvailTimes, U, 2)) > 0 then radLT2.Caption := Piece(AvailTimes, U, 2); 159 if Length(Piece(AvailTimes, U, 3)) > 0 then radLT3.Caption := Piece(AvailTimes, U, 3); 160 radLT1.Visible := Length(radLT1.Caption) > 0; 161 radLT2.Visible := Length(radLT2.Caption) > 0; 162 radLT3.Visible := Length(radLT3.Caption) > 0; 163 radLT1.Checked := TimeCount = 1; 164 end 165 else GroupBox1.Visible := False; 165 if Length(Piece(AvailTimes, U, 1)) > 0 then radLT1.Caption := Piece(AvailTimes, U, 1); 166 if Length(Piece(AvailTimes, U, 2)) > 0 then radLT2.Caption := Piece(AvailTimes, U, 2); 167 if Length(Piece(AvailTimes, U, 3)) > 0 then radLT3.Caption := Piece(AvailTimes, U, 3); 168 radLT1.Visible := Length(radLT1.Caption) > 0; 169 radLT2.Visible := Length(radLT2.Caption) > 0; 170 radLT3.Visible := Length(radLT3.Caption) > 0; 171 radLT1.Checked := TimeCount = 1; 166 172 chkBagged.Visible := DietParams.Bagged; 167 173 with lblMealCutOff do case Meal of … … 174 180 if YesPressed then 175 181 begin 176 if not IsOutpatient then 177 begin 178 with radLT1 do if Checked then LateTrayFields.LateTime := Caption; 179 with radLT2 do if Checked then LateTrayFields.LateTime := Caption; 180 with radLT3 do if Checked then LateTrayFields.LateTime := Caption; 181 end 182 else 183 LateTrayFields.LateTime := FMTimeToAMPM(FMToday + TimePart); 182 with radLT1 do if Checked then LateTrayFields.LateTime := Caption; 183 with radLT2 do if Checked then LateTrayFields.LateTime := Caption; 184 with radLT3 do if Checked then LateTrayFields.LateTime := Caption; 184 185 LateTrayFields.LateMeal := Meal; 185 186 LateTrayFields.IsBagged := chkBagged.Checked; 186 end; {if YesPressed}187 end; 187 188 end; {with frmODDietLT} 188 189 finally
Note:
See TracChangeset
for help on using the changeset viewer.