Forum Replies Created

Viewing 15 posts - 76 through 90 (of 197 total)

  • RE: cross-referencing values

    Final working code, thanks, Seth.

    DELETE FROM ptSchedule

    INSERT INTO ptSchedule

    ([MRN]

    , [ApptTypeID]

    , [ResourceId]

    , [StartDtTm]

    , [EndDtTm]

    , [Description]

    , [Notes]

    ...

  • RE: cross-referencing values

    Take a look at my code to do the insert, that should show you what I'm trying to do.

  • RE: cross-referencing values

    Garadin (10/17/2008)


    Thanks for the creation scripts. Is there any reason you can't simply do this?

    I don't see what that does for me.

  • RE: cross-referencing values

    Creation and dummy data scripts avail here:

    cross_reference_problem.sql

  • RE: cross-referencing values

    While that helps me some, I can't make it work in this:

    DELETE FROM ptSchedule

    WITH MyAppointments (ResourceName)

    AS (SELECT REPLACE(REPLACE(REPLACE(Resource, '-SOUTH', ''), '-NORTH', ''), 'CHRISTOPHER J ', '')

    ...

  • RE: Help needed with a CASE

    will post the exec plans and index data tomorrow morn.

  • RE: Help needed with a CASE

    MrBaseball34 (10/15/2008)


    I guess I can but getting past the speed issue seems to be the biggest problem.

    Here is all data for the MRN 5079

    TestData.zip

  • RE: Help needed with a CASE

    I guess I can but getting past the speed issue seems to be the biggest problem.

  • RE: Help needed with a CASE

    smunson (10/15/2008)


    Ok, how about the following:

    CREATE PROCEDURE dbo.PTENCOUNTER_STUFF (

    @MRN varchar(5), -- '5079'

    @DIC_Status varchar(10),

    @ApptTypeID smallint

    )

    AS

    BEGIN

    SET NOCOUNT ON

    ;WITH DICTATION AS (

    SELECT MRN, Status, DOS

    FROM ptDictation

    WHERE MRN = @MRN AND

    Status = @DIC_Status

    ),

    SCHEDULE AS...

  • RE: Help needed with a CASE

    jcrawf02 (10/15/2008)


    Can you de-identify the data to meet HIPAA reqs? John/Jane Doe and scramble the id numbers or something?

    I will try but there are 340,000 ptEncounter records, 610,000 ptDictation records...

  • RE: Help needed with a CASE

    Matt Miller (10/15/2008)


    MrB -

    Did you ever get a chance to try my version? Assuming you get the right results - it should be a little faster than your...

  • RE: Help needed with a CASE

    Gary...

    This one returned 1481416 records in 23 secs...

    HOWEVER, there are only 340501 records in the ptEncounter table.

    Gary Johnson (10/10/2008)


    SELECT e.MRN,

    CASE

    ...

  • RE: Help needed with a CASE

    Yes, just as Gary showed but it didn't help.

  • RE: Help needed with a CASE

    rbarryyoung (10/14/2008)


    Have you in-lined the functions yet?

    HUH?

  • RE: Help needed with a CASE

    Essentially, I will be providing indicators in the UI based on the values returned in the

    DictationState column returned from the stored procedure based on this criteria:

    •Green – An entry in...

Viewing 15 posts - 76 through 90 (of 197 total)