intakedesk / PowerBI-General

Placeholder for issues migrated from Jira
1 stars 0 forks source link

HK: FIX Rosen Hernia Details - Hernia Type chart numbers don't add up #612

Open jesusitd opened 3 years ago

jesusitd commented 3 years ago
---------

HERNIA TYPES

qualifying implant year
    hernia type X
and quealifying revision hernia types
    hernia type X again!!!!!!
jesusitd commented 3 years ago

Previous SQL:

SELECT
    cases.id AS `Case ID`
    , id_intake_hernia_mesh.hernia_mesh_original_implant_hernia_type AS `Hernia Types`
FROM
    cases
INNER JOIN id_intake_hernia_mesh ON
    cases.id = id_intake_hernia_mesh.case_id
    AND id_intake_hernia_mesh.deleted = 0
    AND id_intake_hernia_mesh.hernia_mesh_original_implant_hernia_type IS NOT NULL
WHERE
    cases.deleted = 0;

Proposed SQL: (this field is more complete that the previous one)

SELECT
    cases.id AS `Case ID`
    , id_intake_hernia_mesh.hernia_mesh_implant_facility_hernia_type AS `Hernia Types`
FROM
    cases
INNER JOIN id_intake_hernia_mesh ON
    cases.id = id_intake_hernia_mesh.case_id
    AND id_intake_hernia_mesh.deleted = 0
    AND id_intake_hernia_mesh.hernia_mesh_implant_facility_hernia_type IS NOT NULL
WHERE
    cases.deleted = 0;

However, this is still not considering the Multiple Hernia Types over the facilities and if this specific hernia type had a revision! (2nd stage maybe?)

jesusitd commented 3 years ago

DONE Rosen DONE Rosen Paralegal

jesusitd commented 3 years ago

Monitoring, close by 9/15/2020.