• thomashohner (12/5/2013)


    I have to create a report that tells us if a Patient has had a Behavioral Health visit and a Medical Visit on the same day. We need to figure this one out in a emergency as the New Medicaid expansion is telling us we need to bill these visits on a single form if they occur on a single day. We are trying to figure out how many of our clients see a Medical and Behavioral Health provider on the same day. This seems like it would be very easy but i'm stumped right now.

    My fields are

    Date of Service (Date)

    Encounter type (Varchar)

    Unique PatientID (Integer)

    Unique EncounterID (Integer)

    I'm trying to get results that look like this:

    Date of Service:PatientID:EncounterIDEncountertype:

    08/01/13 10 45 BH

    08/01/13 10 46 Medical

    08/02/13 12 49 BH

    08/02/13 12 50 Medical

    08/02/13 14 54 BH

    08/02/13 14 55 Medical

    Try using Order By.

    Select Date of Service, PatientID, EncounterID, Encountertype

    from YourTable

    Order By Date of Service, PatientID, Encountertype