Procedure

TfrmODMeds.SetSchedule

Module

fODMeds

Last Modified

7/15/2014 3:26:42 PM

Visibility

Private

Owner

TfrmODMeds

Declaration

procedure SetSchedule(const x: string);

Called-By Hierarchy


           TfrmODMeds.SetSchedule
         TfrmODMeds.SetupDialog┤ 
      TfrmODMeds.SetOnMedSelect┤ 
       TfrmODMeds.SetupDialog┤ │ 
    TfrmODMeds.btnSelectClick┤ │ 
    TfrmODMeds.UMDelayClick┘ │ │ 
  TfrmODMeds.CheckFormAltDose┘ │ 
  TfrmODMeds.cboDosageClick┘   │ 
TfrmODMeds.cboDosageKeyUp┘     │ 
     TfrmODMeds.SetOnQuickOrder┘ 
       TfrmODMeds.SetupDialog┤   
 TfrmODMeds.btnSelectClick...┘   

Called-By

Name Declaration Comments
TfrmODMeds.SetOnMedSelect procedure SetOnMedSelect; -
TfrmODMeds.SetOnQuickOrder procedure SetOnQuickOrder; -
TfrmODMeds.SetupDialog procedure SetupDialog(OrderAction: Integer; const ID: string); override; -


Source

2208  procedure TfrmODMeds.SetSchedule(const x: string);
2209  var
2210  NonPRNPart,tempSch, tempText: string;
2211  begin
2212      //AGP Change 27.72 if schedule matches why goes through and reprocess the same info?
2213      if cboSchedule.ItemIndex > -1 then
2214        begin
2215          tempText := Piece(cboSchedule.Items.Strings[cboSchedule.itemindex], U, 1);
2216          if tempText = x then exit;
2217          if (Pos('PRN',x)>0) and (chkPRN.Checked = true) then
2218            begin
2219               NonPRNPart := Trim(Copy(x, 1, Pos('PRN', x) - 1));
2220               if nonPRNPart = tempText then exit;
2221            end;
2222        end;
2223      cboSchedule.ItemIndex := -1;
2224      cboSchedule.Text := '';
2225      if chkPRN.Checked = True then chkPRN.Checked := False;
2226      cboSchedule.SelectByID(x);
2227      if cboSchedule.ItemIndex > -1 then exit;
2228      if (X = ' PRN') or (X = 'PRN') then
2229        begin
2230          chkPRN.Checked := True;
2231          Exit;
2232        end;
2233     // if cboSchedule.ItemIndex < 0 then
2234      //begin
2235        //if NSSchedule then
2236        //begin
2237        //  cboSchedule.Text := '';
2238        //end
2239        if FInptDlg then
2240          begin
2241            if (Pos('@', x) > 0) then
2242              begin
2243              tempSch := Piece(x, '@', 2);
2244              cboSchedule.SelectByID(tempSch);
2245              if cboSchedule.ItemIndex > -1 then
2246                begin
2247                  tempSch := Piece(x, '@', 1) + '@' + cboSchedule.Items.Strings[cboSchedule.itemindex];
2248                  cboSchedule.Items.Add(tempSch);
2249                  cboSchedule.Text := (Piece(tempSch,U,1));
2250                  cboSchedule.SelectByID(Piece(tempSch,u,1));
2251                  EXIT;
2252                end;
2253              if Pos('PRN', tempSch) > 0 then
2254                begin
2255                  NonPRNPart := Trim(Copy(tempSch, 1, Pos('PRN', tempSch) - 1));
2256                  cboSchedule.SelectByID(NonPRNPart);
2257                  if cboSchedule.ItemIndex > -1 then
2258                    begin
2259                      tempSch := Piece(x, '@', 1) + '@' + cboSchedule.Items.Strings[cboSchedule.itemindex];
2260                      cboSchedule.Items.Add(tempSch);
2261                      cboSchedule.Text := (Piece(tempSch,U,1));
2262                      cboSchedule.SelectByID(Piece(tempSch,u,1));
2263                      chkPRN.Checked := True;
2264                      EXIT;
2265                    end
2266                  else
2267                    begin
2268                      NonPRNPart := Trim(Copy(x, 1, Pos('PRN', x) - 1));
2269                      chkPRN.Checked := true;
2270                      tempSch := NonPRNPart + U + U + U + Piece(NonPRNPart, '@', 2);
2271                      cboSchedule.Items.Add(tempSch);
2272                      cboSchedule.SelectByID(Piece(tempSch, U, 1));
2273                      EXIT;
2274                    end;
2275                end;
2276                cboSchedule.Items.Add(X + U + U + U + Piece(x, '@', 2));
2277                cboSchedule.Text := x;
2278                cboSchedule.SelectByID(x);
2279                EXIT;
2280              end
2281          else if Pos('PRN', x) > 0 then
2282            begin
2283              NonPRNPart := Trim(Copy(x, 1, Pos('PRN', x) - 1));
2284              chkPRN.Checked := True;
2285              cboSchedule.SelectByID(NonPRNPart);
2286              if cboSchedule.ItemIndex > -1 then  EXIT;
2287            end;
2288        end
2289        else if Pos('PRN', x) > 0 then
2290          begin
2291           NonPRNPart := Trim(Copy(x, 1, Pos('PRN', x) - 1));
2292           chkPRN.Checked := True;
2293           cboSchedule.SelectByID(NonPRNPart);
2294           if cboSchedule.ItemIndex > -1 then  EXIT;
2295           cboSchedule.Items.Add(NonPRNPart);
2296           cboSchedule.Text := NonPRNPart;
2297           cboSchedule.SelectByID(NonPRNPart);
2298           EXIT;
2299          end;
2300        cboSchedule.Items.Add(x);
2301        cboSchedule.Text := x;
2302        cboSchedule.SelectByID(x);
2303  end;