Query check ICD10 trach dxs consistent: Difference between revisions

mNo edit summary
mNo edit summary
Line 6: Line 6:
| DIC_app = CCMDB.mdb
| DIC_app = CCMDB.mdb
| DIC_coding = Query ''check_ICD10_trach_dxs_consistent''
| DIC_coding = Query ''check_ICD10_trach_dxs_consistent''
| DIC_status = implemented  
| DIC_status = implemented
| DIC_implementation_date = 2019-01-22
| DIC_implementation_date = 2019-01-22
}}
}}


* if any of following dxs are present then must have {{ICD10WithCode|Tracheostomy, has one}}:
* if any trach-implying dxs are present then pt must have a code that indicates that they have a trach :
** ICD10
** trach-implying dxs
*** {{ICD10WithCode|Tracheostomy complication, hemorrhage from site}}
*** {{ICD10WithCode|Tracheostomy complication, hemorrhage from site}}
*** {{ICD10WithCode|Tracheostomy complication, malfunction}}
*** {{ICD10WithCode|Tracheostomy complication, malfunction}}
*** {{ICD10WithCode|Tracheostomy complication, NOS}}
*** {{ICD10WithCode|Tracheostomy complication, NOS}}
*** {{ICD10WithCode|Tracheostomy complication, tracheo-esophageal fistula}}
*** {{ICD10WithCode|Tracheostomy complication, tracheo-esophageal fistula}}
** CCI
** code that indicates that they have a trach
*** [[Tracheostomy creation]]  
*** CCI - [[Tracheostomy creation]]  
 
*** ICD10 - {{ICD10WithCode|Tracheostomy, has one}}
== old query SQL ==
{{Collapsable| always = click to expand old query | full =
SELECT l_log.pat_id,
      has_trach_implying_code.pat_id,
      has_hasTrach_code.pat_id,
      *
FROM  ((SELECT l_log.pat_id,
              l_cci_picklist.cci_picklist_code,
              l_icd10.icd10_code
        FROM  (l_log
                INNER JOIN l_cci_picklist
                        ON l_log.pat_id = l_cci_picklist.pat_id)
              INNER JOIN l_icd10
                      ON l_log.pat_id = l_icd10.pat_id
        WHERE  (( ( l_icd10.icd10_code ) = "j95.00"
                  OR ( l_icd10.icd10_code ) = "j95.02"
                  OR ( l_icd10.icd10_code ) = "j95.08"
                  OR ( l_icd10.icd10_code ) = "j95.03" ))
                OR (( ( l_cci_picklist.cci_picklist_code ) = "1.gj.77" ))) AS
      has_trach_implying_code
        RIGHT JOIN l_log
                ON has_trach_implying_code.pat_id = l_log.pat_id)
      LEFT JOIN (SELECT l_icd10.pat_id,
                        l_icd10.icd10_code
                  FROM  l_icd10
                  WHERE  (( ( l_icd10.icd10_code ) = "z93.0" ))) AS
                has_hasTrach_code
              ON l_log.pat_id = has_hasTrach_code.pat_id
WHERE  ( ( ( l_log.pat_id ) = [param] )
        AND ( ( has_trach_implying_code.pat_id ) IS NOT NULL )
        AND ( ( has_hasTrach_code.pat_id ) IS NULL ) );  }}


== Log ==
== Log ==
* 2019-04-08 - removed [[Tracheostomy care]] from this query
* 2019-04-08 - removed [[Tracheostomy care]] from this query; changed how it is structured altogether to test new rule
* 2019-03-20 - previously this also required one of the above if "has one" was present, but that makes no sense, because one could be present without additional care requirements, so have taken that part out. Ttenbergen 12:45, 2019 March 20 (CDT)
* 2019-03-20 - previously this also required one of the above if "has one" was present, but that makes no sense, because one could be present without additional care requirements, so have taken that part out. Ttenbergen 12:45, 2019 March 20 (CDT)