Announcement

Collapse
No announcement yet.

All the brains, can you help?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • All the brains, can you help?

    This is the message.


    MSH|^~&|LAB|RJF|||200808221722||ORU^R01||P|2.2
    PID|1||0999999||TEST^BABYBOY^A|||||||||||||4000779 6150
    PV1|||NICU^NICU25
    OBR||00014^001|F74925|CHM0090584^BASIC METAB. PANEL|||200808221607|||||||||022111^xyz^^LUIS C.||||F74925||||C||CHM0090584^CHM0090584|^^^^^S
    OBX|1|NM|NA^SODIUM||140|MEQ/L|137-145||||Z
    OBX|1|TX|NA^SODIUM||HEMOLYZED SPECIMEN||||||Z
    OBX|2|NM|POT^POTASSIUM||7.4|MEQ/L|3.7-5.9|H|||Z
    OBX|2|TX|POT^POTASSIUM||READ BACK OF CRITICAL VALUE(S) CONFIRMED BY LAB||||||Z
    OBX|2|TX|POT^POTASSIUM||ROBERTA 5:19||||||Z
    OBX|3|NM|CL^CHLORIDE||105|MEQ/L|98-107||||Z
    OBX|3|TX|CL^CHLORIDE||HEMOLYZED SPECIMEN||||||Z
    OBX|4|NM|CO2^CO2||25|MEQ/L|22-30||||Z
    OBX|4|TX|CO2^CO2||HEMOLYZED SPECIMEN||||||Z
    OBX|5|NM|GLF^GLUCOSE FASTING||125|MG/DL|70-105|H|||Z
    OBX|5|TX|GLF^GLUCOSE FASTING||HEMOLYZED SPECIMEN||||||Z
    OBX|6|NM|BUN^BUN||2|MG/DL|5-16|L|||Z
    OBX|6|TX|BUN^BUN||HEMOLYZED SPECIMEN||||||Z
    OBX|7|NM|CRET^CREATININE||0.7|MG/DL|0.8-1.5|L|||Z
    OBX|7|TX|CRET^CREATININE||HEMOLYZED SPECIMEN||||||Z
    OBX|8|NM|CA^CALCIUM||8.2|MG/DL|7.8-10.6||||Z
    OBX|8|TX|CA^CALCIUM||HEMOLYZED SPECIMEN||||||Z


    This is the table on MSSQL server

    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[sma](
    [labID] [int] IDENTITY(1,1) NOT NULL,
    [MR] [int] NOT NULL,
    [orderDate] [datetime] NOT NULL,
    [Na] [int] NULL,
    [K] [float] NULL,
    [Cl] [int] NULL,
    [CO2] [int] NULL,
    [Glu] [int] NULL,
    [ca] [float] NULL,
    [BUN] [int] NULL,
    [Cr] [float] NULL,
    [TG] [int] NULL,
    [Mg] [float] NULL,
    [PO4] [float] NULL,
    CONSTRAINT [PK_sma] PRIMARY KEY CLUSTERED
    (
    [labID] ASC
    )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
    ) ON [PRIMARY]

    GO




    Now my goal is to insert the SMA7 values into the table in MSSQL server and I am trying to figure out how?

    I am attaching the channel, there are several problems,

    I thought of in this way..............

    first, it should create new row in the table with the timestamp and MR#

    Then, it should determine which values should be inserted at what place and it should update that raw.



    Or there might be another way of doing it. If you could help I will be greatful..

    I am attaching the channel also.



    Filter is set to filter--- ORU R01 BASIC METAB. PANEL

    Post edited by: doc4child, at: 09/19/2008 20:47

  • #2
    Re:All the brains, can you help?



    Post edited by: doc4child, at: 09/19/2008 20:52

    Comment


    • #3
      Re:All the brains, can you help?

      this is channel llp2db_bmp-afbb28a9f55230862910de8619a0e4aa.xml (24824 bytes)

      Comment


      • #4
        Re:All the brains, can you help?

        I would probably build up the insert statement then do the insert at once instead of inserting then updating. Also, you could filter the OBX to only pull the values from the numeric values (I'm assuming thats what you want). Also, use a switch statement for checking the tests as it'll be a little more efficient than all the if statements. Hope this helps!

        Comment

        Working...
        X