Kent Geisler

Forum Replies Created

Viewing 4 replies – 1 through 4 (of 4 total)
  • Author
    Replies
  • in reply to: HL7 Timestamp (ts) to XML Datetime (dtm) #75490
    Kent Geisler
    Participant

      It was the solution I chose

      in reply to: HL7 Timestamp (ts) to XML Datetime (dtm) #75488
      Kent Geisler
      Participant

        Jim,

        We are running 5.7P

        Below the test-schema I am using (also attached) where the type of the datotid-field is “dateTime”.

        It’s right, if I change the type of datotid to: ENGINE=”s.string” it runs without errors.

        <s:schema xmlns:s="http://www.w3.org/2001/XMLSchema”&gt;

         

           

             

               

             

           

         

        If I make a HL7-variant where the type of MSH.7 is changed from TS to ST it also runs without errors.

        in reply to: HL7 Timestamp (ts) to XML Datetime (dtm) #75486
        Kent Geisler
        Participant

          Jim,

          Below my tries and the results:

          First try with no input except the hardcoded datetime

          prologue

             type: xlt

             version: 7.0

          end_prologue

          { { OP COPY }

             { ERR 0 }

             { PRE {

                 set out “2011-09-08T16:47:00”

                 set xlateOutVals $out

             }}

             { IN {} }

             { OUT testDatoTid.datotid.#text }

          }

          Result in TestTool where I can parse the date to the xml-field:

          Command output:

          MESSAGE 1

          testDatoTid.datotid.#text:   >2011-09-08T16:47:00<

          Second try with MSH-7 as input field, but not used:

          prologue

             type: xlt

             version: 7.0

          end_prologue

          { { OP COPY }

             { ERR 0 }

             { PRE {

                 set out “2011-09-08T16:47:00”

                 set xlateOutVals $out

             }}

             { IN {{0(0).MSH(0).#7(0).[0]}} }

             { OUT testDatoTid.datotid.#text }

          }

          Result in TestTool where I get the error:

          MESSAGE 1

          [0:TEST] Warning: The format of source value ‘2011-09-08T16:47:00’ is inconsistent with its type: ‘ts’

          [0:TEST] Message encode warnings: Error generated during parsing. – Element ‘datotid’ got Datatype error, Type:SchemaDateTimeException, Message:buffer not initialized yet!. – Line 1, Col 130

          Output validation errors: Error generated during parsing. – Element ‘datotid’ got Datatype error, Type:SchemaDateTimeException, Message:buffer not initialized yet!. – Line 1, Col 130

          [0:TEST] Error generated during parsing. – Element ‘datotid’ got Datatype error, Type:SchemaDateTimeException, Message:buffer not initialized yet!. – Line 1, Col 172

          in reply to: HL7 Timestamp (ts) to XML Datetime (dtm) #75483
          Kent Geisler
          Participant

            Jim and Levy,

            Below is my tcl and xlate

            I have previously tried to display the datetime returned from the xlate, and it has the right value.

            I have considered making a HL7 variant and change the data type from TS to ST. Maybe it’s the easiest way to solve the problem.

            ######################################################################

            # Name: xlt_convert_tid

            # Purpose: Transform timestamps

            # UPoC type: xltp

            # Args: input_timestamp

            # input_format

            # output_format

            # Return: output_timestamp

            #

            proc xlt_convert_tid {} {

            upvar xlateId xlateId

            xlateInList   xlateInList

            xlateInTypes  xlateInTypes

            xlateInVals   xlateInVals

            xlateOutList  xlateOutList

            xlateOutTypes xlateOutTypes  

            xlateOutVals  xlateOutVals

            set tid  [ lindex $xlateInVals 0 ]

            set in_fmt  [ lindex $xlateInVals 1 ]

            set out_fmt  [ lindex $xlateInVals 2 ]

            set cen “”

            set year “”

            set mon “”

            set day “”

            set hour “00”

            set min “00”

            set sec “00”

            set sec1 “0”

            if { $in_fmt == “YYMMDD” } {

            set year [string range $tid 0 1 ]

            set mon [string range $tid 2 3 ]

            set day [string range $tid 4 5]

            # Fjern foranstillet 0, s

          Viewing 4 replies – 1 through 4 (of 4 total)