Question

  • Creator
    Topic
  • #2170945

    how to write the full statement?

    Locked

    by art222 ·

    Find the patient identification number and the rounded average of RBC, WBC, PLT (by 1 decimal) which have been entered in the first half of 2005 and with WBC greater than 9. Show only the Patient’s identification number, RBC, WBC, PLT and the Date of the laboratory result.

All Answers

  • Author
    Replies
    • #2431743

      Clarifications

      by art222 ·

      In reply to how to write the full statement?

      Clarifications

    • #2431738

      Homework? Nt

      by purpleskys ·

      In reply to how to write the full statement?

      ~

      • #2431701

        Reponse To Answer

        by art222 ·

        In reply to Homework? Nt

        NT

      • #2431682

        Reponse To Answer

        by purpleskys ·

        In reply to Homework? Nt

        more detail…software you’re using…OS…what you’re trying to do? because to me the whole question sounds like it’s taken directly out of a textbook.

      • #2431677

        Reponse To Answer

        by dcolbertmatrixmso ·

        In reply to Homework? Nt

        That looks like exactly what the question-asker has done here.

        Looks like they’re looking for a select statement that will return a bunch of ePHI from a database containing medical records, and they only want integer and date-format responses. I bet it is a pretty easy query to write, if you know SQL and make some assumptions about the fields based on the names supplied in the example.

    • #2431674

      Here is one possible way…

      by dcolbertmatrixmso ·

      In reply to how to write the full statement?

      This seems like it would do the trick:

      select patient_identification_number
      , CONVERT(decimal(18,1), SUM(RBC) / COUNT(RBC)) as AVG_RBC
      , CONVERT(decimal(18,1), SUM(WBC) / COUNT(WBC)) as AVG_WBC
      , CONVERT(decimal(18,1), SUM(PLT) / COUNT(PLT)) as AVG_PLT
      , Lab_Result_Date
      from patient_info_table
      where Lab_Result_Date >= ’01/01/2005′ and Lab_Result_Date < '07/01/2005' and WBC > 9
      group by patient_identification_number

      But if you don’t understand why – you probably shouldn’t submit it as your answer – because there are already enough people like that in the industry as it is, anyhow.

      Props to an app/SQL developer I know for throwing this together for me.

      And really – here is my point… I’m not even *remotely* a coder or developer. If the logic required to make this statement in SQL, Java, C++, Visual Basic or any other development or scripting language escapes you – you might be barking up the wrong tree in your career development. Don’t chase after coding because you think it’ll be good money if you don’t have the mindset for it. But if you can read the code above and the light goes on for you and you can at least understand in an abstract sense what is going on there… then by all means keep on.

Viewing 2 reply threads