My IPeople

Community discussion for IPeople products and services
Welcome to My IPeople Sign in | Help
in
Home Blogs Forums

Meditech Time

Last post 03-03-2008, 5:16 PM by Henri. 3 replies.
Sort Posts: Previous Next
  •  08-14-2006, 4:47 PM 182

    Meditech Time

    Internal Meditech Time is set up in two formats.

                    1) 4 digit clinical  (EX: 9072)

                    2) 9 digit format   (EX:902345678)

    Each represents a counter from March 1st 1980.  The 4 digit is the number of days since March 1st 1980 and the 9 digit is the number of seconds since March first 1980.  

    It is important to note that the clinical 4 digit date can not be used as a time field.  It is simply the number of days since March 1st 1980 and there is no way to convert this data into a time field.  

    Both the 4 digit date and the 9 digit time can be converted into standard formats using any of the Z programs that are provided by Meditech. 

    Sample Clinical date programs:

          Z.date.clin.npr

          Z.date.out

     Sample Time programs:

         Z.time.out

         Z..stime.out

    There are a number of programs that can convert the data into whatever output might be desired.

     

     Two less common programs are the $DATE and $TIME programs.

         $DATE(A) A = 4 date or 9 digit time will produce the format of YY/MM/DD    (EX: 03/11/26)

         $DATE1(A) A = 4 date or 9 digit time will produce the format of Month DD, YYYY (EX: Nov 26, 2003)

         $TIME(A) A = 9 digit time (Date can not be used) will produce (EX:12:06:54)

    Filed under:
  •  03-03-2008, 2:22 PM 601 in reply to 182

    Re: Meditech Time

    We are calculating turn-around-times for our ED and I have come across one of the 9-digit time formats.  Has anyone converted this time using SQL Server into a usable date time in IPeople Direct?

  •  03-03-2008, 5:14 PM 602 in reply to 601

    Re: Meditech Time

    Here is a SQL function I have used to convert a 9 digit MEDITECH stamp to a PC Date/Time. 

    CREATE FUNCTION fn_DateFromMedSeconds
       (@strMeditechSeconds As varchar(50), @blnTime As bit = 0 )
    RETURNS varchar(255)
    AS
    /*
        'Purpose:
        '       Convert Meditech Date from Seconds to a standard date
        '           assuming seconds since 3/1/1980
        'Input:
        '       strMeditechSeconds  - a string in the format of sssssssss
        '       blnTime          - a boolean value
        '                           default=False
        'Output:
        '       a string in one of two formats
        '           if blnTime=True then mm/dd/yyyy hh:nn:ss
        '           if blnTime=False then mm/dd/yyyy
        'History:
        '       02/25/2005  Created: Brett Blue
    */   
    BEGIN
      Declare @out varchar(255)

     SET @out = DATEADD(second, @strMeditechSeconds, '3/1/1980')
     If (@blnTime = 1)
      SET @out = convert(varchar(20), 100, @out)
     Else
      SET @out = convert(varchar(20), 101, @out)


       RETURN (@out)
    END

  •  03-03-2008, 5:16 PM 603 in reply to 602

    RE: Meditech Time

    We also have a post on it in the MyIPeople forums:

     

    http://myipeople.com/forums/thread/162.aspx

     

    Henri

     

    From: meditech@myipeople.com [mailto:meditech@myipeople.com] On Behalf Of Brett
    Sent: Monday, March 03, 2008 5:15 PM
    To: Henri Du Plessis
    Subject: Re: [MEDITECH Report Writer] Meditech Time

     

    Here is a SQL function I have used to convert a 9 digit MEDITECH stamp to a PC Date/Time. 

    CREATE FUNCTION fn_DateFromMedSeconds
       (@strMeditechSeconds As varchar(50), @blnTime As bit = 0 )
    RETURNS varchar(255)
    AS
    /*
        'Purpose:
        '       Convert Meditech Date from Seconds to a standard date
        '           assuming seconds since 3/1/1980
        'Input:
        '       strMeditechSeconds  - a string in the format of sssssssss
        '       blnTime          - a boolean value
        '                           default=False
        'Output:
        '       a string in one of two formats
        '           if blnTime=True then mm/dd/yyyy hh:nn:ss
        '           if blnTime=False then mm/dd/yyyy
        'History:
        '       02/25/2005  Created: Brett Blue
    */   
    BEGIN
      Declare @out varchar(255)

     SET @out = DATEADD(second, @strMeditechSeconds, '3/1/1980')
     If (@blnTime = 1)
      SET @out = convert(varchar(20), 100, @out)
     Else
      SET @out = convert(varchar(20), 101, @out)


       RETURN (@out)
    END




    Click reply to respond directly to the list. Unsubscribe at http://myipeople.com/forums/ForumSubscriptions.aspx

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems