Closed callahantiff closed 4 years ago
@mgkahn - I'm not entirely sure I understand what's need to utilize SQLRender
after reading the documentation.
I see how the library can be used to create generalizable SQL templates, but I'm not sure how this is applied to our query, which does not need to be templated since we are using OMOP. It could also be that the functions that we need are not available in their list of translatable functions (here).
I'm hoping we can talk about this during our meeting tomorrow.
SQL Render: At the very least, you will have parameters for the local names of the database and the database schema that will varying by site. Also, I suspect "UNION DISTINCT" is GBQ specific syntax that the SQL Render syntax will expand to the correct syntax. The rest of the syntax looks pretty vanilla to me.
Also. To minimize resources/file size -- You may want to remove fields in your final SQL that you can recreate when you get the site file back. So only concept_id. You don't need source_code, label, domain as you can get them back with just the concept_id.
SQL Render: At the very least, you will have parameters for the local names of the database and the database schema that will varying by site. Also, I suspect "UNION DISTINCT" is GBQ specific syntax that the SQL Render syntax will expand to the correct syntax. The rest of the syntax looks pretty vanilla to me.
Good call. I didn't think about different DB names. I will work on this script.
Also. To minimize resources/file size -- You may want to remove fields in your final SQL that you can recreate when you get the site file back. So only concept_id. You don't need source_code, label, domain as you can get them back with just the concept_id.
Great suggestion!
OK, the updated SQL is shown above. OK with this? I added an additional column to return the version
I had intended to ask this question before: Do you want to know if folks are putting non-standard codes into their concept_ids? I know this isn't OHDSI "kosher" but do you want to know if this is happening "in the real world"? If so, you would remove all of the standard_concept = 'S' clauses. Else if you only wanted to focus on the standard concepts, leave it in. My recommendation is to take standard_concept = 'S' out. You can alway impose that restriction on the set of concept_ids you get back on your side. And, it would give you insights into if people are "cheating" in actual practice.
I had intended to ask this question before: Do you want to know if folks are putting non-standard codes into their concept_ids? I know this isn't OHDSI "kosher" but do you want to know if this is happening "in the real world"? If so, you would remove all of the standard_concept = 'S' clauses. Else if you only wanted to focus on the standard concepts, leave it in. My recommendation is to take standard_concept = 'S' out. You can alway impose that restriction on the set of concept_ids you get back on your side. And, it would give you insights into if people are "cheating" in actual practice.
OK, I agree with removing the c1.standard_concept = "S"
logic. I think getting a wider set and having the option to restrict it after the fact, like you mention, is a great idea. I will update all of the queries to match. The updated script for this issue is shown above. Any other changes you'd would like made or should I contact Andrew?
Good morning! @mgkahn - just circling back. Are you OK with this? Can I close this issue and reach out to our first contact to begin the coverage studies?
Yes. Remember to send out the SQLRender version, not the one here with the CU-AMC specific project information.
Absolutely. Closing this now. Thank you!
PURPOSE: This query is designed to query an OMOP instance and return the 6 columns listed below. This query makes the assumption that the other shops would be willing to return some results to us, rather than calculating coverage statistics locally (that version will be coming next).
CONCEPT_ID
- OMOPconcept_id
from thecondition_occurrence
,drug_exposure
, andmeasurement
tablesCONCEPT_VOCAB_VERSION
- The OMOP vocabulary version usedVISIT_COUNT
- The count of uniquevisit_occurrence_id
byconcept_id
PATIENT_COUNT
- The count of uniqueperson_id
byconcept_id
QUERY TYPE:
OMOP Coverage V1
RUNTIME:19.4
secondsRESULTS:
39,910
rows (i.e. unique CONCEPT_IDs)TASK: @mgkahn - What do you think about this?
QUERY FILES:
OMOPCoverage_V1.sql
SQLRender Query Templates:
OMOPCoverage_V1_Template.txt