Next dates

  • CREATE TABLE ADMITS
    (
    ID_NUM INT varchar(15) null
    ,provider_id varchar(15) null
    ,provider_name varchar(36) null
    ,ADMIT_DATE DATE NULL
    ,DISCHARGE_DATE DATE NULL
    ,swpa_description varchar(max) null
    ,date_dispensed DATE NULL
    ,drug_name varchar(max) null
    ,discharge_to_dispensed int
    )

    INSERT INTO ADMITS (ID_NUM,provider_id,provider_name, ADMIT_DATE, DISCHARGE_DATE,swpa_description,date_dispensed,discharge_to_dispensed)
    VALUES
    ('008012773','006467','WHITE DEER RUN LLC', '2024-02-06', '2024-02-11','Residential Detox, Rehab, HWH (non hosp)','2024-02-22','GABAPENTIN, 300 MG ORAL CAPSULE',11)
    ,('008012773','006467','WHITE DEER RUN LLC', '2024-02-06', '2024-02-11','Residential Detox, Rehab, HWH (non hosp)','2024-02-22','GABAPENTIN, 600 MG ORAL TABLET',11)
    ,('008012773','006467','WHITE DEER RUN LLC', '2024-02-06', '2024-02-11','Residential Detox, Rehab, HWH (non hosp)','2024-03-11','GABAPENTIN, 600 MG ORAL TABLET',29)
    ,('008012773','006467','WHITE DEER RUN LLC', '2024-02-11', '2024-03-05','Residential Detox, Rehab, HWH (non hosp)','2024-03-11','GABAPENTIN, 600 MG ORAL TABLET',6);

    Hi, I am trying to show a list of patient that had an admit/discharge but then had a prescription given. In my sample the date dispensed on 3/11/24 is showing on the admit that is before another admit. I'd like to only show the dispensed on the admit  that is after the discharge.

     

    delete sample

  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

  • You need to identify pairs of discharges and rx (claims) for the same patient within your reporting period. Then rank them based on time difference and retain the closest. Where you start depends on what you are measuring. If you want to know how many discharged patients fill a prescription within x days, then start with discharges between date1 and date2 because that's likely to be your denominator. If you want to know how many member rx are related to a previous hospitalisation within x days, then start with the rx in the set timeframe, because that's likely to be the denominator. If you're not measuring anything and just identifying patients and hospitals then it doesn't matter where you start, the principle is the same both ways, although there's usually a timeframe involved so work out if the discharge or the rx need to be in the reporting period and then go from there.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply