Function

ShortDateStrToDate

Module

uReports

Last Modified

7/15/2014 3:26:44 PM

Comments

Converts date in format 'mmm dd,yy' or 'mmm dd,yyyy' to standard 'mm/dd/yy'

Scope

Interfaced

Declaration

function ShortDateStrToDate(shortdate: string): string ;

Called-By Hierarchy


                                     ShortDateStrToDate
                                       ListProcedures┘ 
                         TfrmReports.tvReportsClick┘   
                  TfrmFrame.lstCIRNLocationsClick┤     
                            TfrmFrame.SetUpCIRN┘ │     
                       TfrmFrame.SetupPatient┘   │     
                  UpdatePatientInfoForAlert┤     │     
               TfrmFrame.mnuFileNextClick┘ │     │     
             TfrmFrame.mnuFileOpenClick┤   │     │     
                 TfrmFrame.UMInitiate┤ │   │     │     
        TfrmFrame.mnuFileNextClick...┤ │   │     │     
        TfrmFrame.mnuFileRefreshClick┤ │   │     │     
        TfrmOrders.CheckOrderStatus┤ │ │   │     │     
    TfrmOrders.mnuActChgEvntClick┤ │ │ │   │     │     
       TfrmOrders.mnuActHoldClick┤ │ │ │   │     │     
     TfrmOrders.mnuActUnholdClick┤ │ │ │   │     │     
      TfrmOrders.mnuActRenewClick┤ │ │ │   │     │     
     TfrmOrders.mnuActChangeClick┤ │ │ │   │     │     
       TfrmOrders.mnuActCopyClick┘ │ │ │   │     │     
             TfrmMeds.mnuActDCClick┤ │ │   │     │     
            TfrmMeds.CheckMedStatus┘ │ │   │     │     
         TfrmMeds.mnuActHoldClick┤   │ │   │     │     
        TfrmMeds.mnuActRenewClick┤   │ │   │     │     
       TfrmMeds.mnuActUnholdClick┤   │ │   │     │     
       TfrmMeds.mnuActChangeClick┤   │ │   │     │     
         TfrmMeds.mnuActCopyClick┤   │ │   │     │     
       TfrmMeds.mnuActRefillClick┘   │ │   │     │     
                   TfrmFrame.ViewInfo┘ │   │     │     
                TfrmDCSumm.ViewInfo┤   │   │     │     
              TfrmConsults.ViewInfo┤   │   │     │     
      TfrmFrame.pnlRemindersMouseUp┤   │   │     │     
       TfrmFrame.RemindersChanged┘ │   │   │     │     
           TfrmFrame.FormCreate┘   │   │   │     │     
             TfrmFrame.pnlCIRNClick┤   │   │     │     
       TfrmFrame.pnlVistaWebClick┤ │   │   │     │     
            TfrmFrame.FormKeyDown┘ │   │   │     │     
          TfrmFrame.pnlPatientClick┤   │   │     │     
            TfrmFrame.pnlVisitClick┤   │   │     │     
      TfrmFrame.pnlPrimaryCareClick┤   │   │     │     
        TfrmFrame.pnlRemindersClick┤   │   │     │     
         TfrmFrame.pnlPostingsClick┤   │   │     │     
             TfrmFrame.pnlFlagClick┤   │   │     │     
               TfrmFrame.laMHVClick┤   │   │     │     
              TfrmFrame.laVAA2Click┤   │   │     │     
                TfrmOrders.ViewInfo┤   │   │     │     
                  TfrmMeds.ViewInfo┤   │   │     │     
               TfrmSurgery.ViewInfo┤   │   │     │     
                 TfrmNotes.ViewInfo┤   │   │     │     
              TfrmProblems.ViewInfo┘   │   │     │     
      TfrmFrame.mnuFileNotifRemoveClick┤   │     │     
              TfrmFrame.NextButtonClick┘   │     │     
            TfrmFrame.SetUpNextButton┘     │     │     
      TfrmFrame.mnuFileOpenClick...┤       │     │     
               TfrmFrame.FormResize┘       │     │     
             TfrmFrame.ChangeFont┘         │     │     
     TfrmFrame.LoadSizesForUser┤           │     │     
TfrmFrame.LoadUserPreferences┘ │           │     │     
       TfrmFrame.UMInitiate┘   │           │     │     
     TfrmFrame.mnuFontSizeClick┘           │     │     
              TfrmFrame.mnuFileOpenClick...┤     │     
           TfrmFrame.AllowCCOWContextChange┤     │     
            TfrmFrame.mnuFileNextClick...┤ │     │     
            TfrmFrame.mnuFileOpenClick...┤ │     │     
   TfrmFrame.mnuFileResumeContextSetClick┘ │     │     
                TfrmFrame.UpdateCCOWContext┤     │     
            TfrmFrame.mnuFileOpenClick...┤ │     │     
          TfrmFrame.ctxContextorCommitted┤ │     │     
           TfrmFrame.StartCCOWContextor┘ │ │     │     
                 TfrmFrame.FormCreate┘   │ │     │     
   TfrmFrame.mnuFileResumeContextGetClick┘ │     │     
     TfrmFrame.mnuFileResumeContextSetClick┘     │     
                          TfrmReports.DisplayPage┤     
                         TfrmReports.LoadTreeView┤     
                        TfrmReports.DisplayPage┤ │     
           TfrmOptionsReportsDefault.btnOKClick┤ │     
        TfrmOptionsReportsDefault.btnResetClick┤ │     
         TfrmOptionsReportsCustom.btnApplyClick┘ │     
          TfrmOptionsReportsCustom.btnOKClick┘   │     
                 TfrmReports.ProcessNotifications┤     
                        TfrmReports.DisplayPage┘ │     
                     TfrmReports.tvReportsKeyDown┤     
                  TfrmReports.tvProceduresKeyDown┤     
                      TfrmReports.chkMaxFreqClick┤     
             TfrmOptionsReportsDefault.btnOKClick┤     
          TfrmOptionsReportsDefault.btnResetClick┤     
        TfrmOptionsReportsCustom.btnApplyClick...┘     

Called-By

Name Declaration Comments
ListProcedures procedure ListProcedures(Dest: TStrings); -


Source

284   function ShortDateStrToDate(shortdate: string): string ;
285   {Converts date in format 'mmm dd,yy' or 'mmm dd,yyyy' to standard 'mm/dd/yy'}
286   var
287     month,day,year: string ;
288     i: integer ;
289   begin
290     result := 'ERROR' ;
291     if (Pos(' ',shortdate) <> 4) or ((Pos(',',shortdate) <> 7) and (Pos(',',shortdate) <> 6)) then exit ;  {no spaces or comma}
292     for i := 1 to 12 do
293       if Months[i] = UpperCase(Copy(shortdate,1,3)) then month := IntToStr(i);
294     if month = '' then exit ;    {invalid month name}
295     if length(month) = 1 then month := '0' + month;
296     if Pos(',',shortdate) = 7 then
297       begin
298         day  := IntToStr(StrToInt(Copy(shortdate,5,2))) ;
299         year := IntToStr(StrToInt(Copy(shortdate,8,99))) ;
300       end;
301     if Pos(',',shortdate) = 6 then
302       begin
303         day  := '0' + IntToStr(StrToInt(Copy(shortdate,5,1))) ;
304         year := IntToStr(StrToInt(Copy(shortdate,7,99))) ;
305       end;
306     result := month+'/'+day+'/'+year ;
307   end ;