Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In snowflake s web interface, Create a worksheet that selects data from the medical labs table DXRX _ DATA _ PROD.MEDICAL _ LABS.PATIENT _ PROCEDURES.
In snowflakes web interface, Create a worksheet that selects data from the medical labs table
DXRXDATAPROD.MEDICALLABS.PATIENTPROCEDURES. From this data table we would like to select columns:
DVPATIENTID
TESTORDERID
ACCESSIONNUMBER
REFERRINGPROVIDERNPINUMBER
ORDERINGPROVIDERNPINUMBER
TESTORDEREDDATE
TESTREPORTEDDATE
PERFORMINGORGANIZATIONNAME
PANELNAME
TESTNAME
TESTCODE
RESULTNAME
RESULTCODE
RESULTVALUE
RESULTCOMMENTS.
We want to filter for rows that contain HERor HERin the results fields for tests reported
in This filter infers that the patients have been tested for the biomarker HERIn cases
where there is no test report date, please make use of the ordered date. This filter should be
used in the further activities. Create a new column that selects testorderid as default, if
missing then uses the accession number and name the column as TESTID
The solution for this question is :
WITH herpatients AS
SELECT
DVPATIENTIDTESTORDERIDACCESSIONNUMBER,REFERRINGPROVIDERNPINUMBER,
ORDERINGPROVIDERNPINUMBER,TESTORDEREDDATE,TESTREPORTDATE,
PERFORMINGORGANIZATIONNAME,PANELNAME,TESTNAME,TESTCODE,
RESULTNAME,RESULTCODE,RESULTVALUE,RESULTCOMMENTS,
COALESCE TESTORDERIDACCESSIONNUMBERAS TESTID
COALESCE TESTORDEREDDATE,TESTREPORTDATEAS TESTDATE
FROM DXRXDATAPROD.MEDICALLABS.PATIENTPROCEDURES
WHERE
REGEXPLIKERESULTNAME, HERERBBiOR
REGEXPLIKERESULTVALUE, HERERBBiOR
REGEXPLIKERESULTCOMMENTS, HERERBBi
AND
TESTDATE LIKE
SELECT
FROM herpatients;
From the data retrieved in exercise you will have the same test results reported over
multiple dates and sometimes performing organisation names. This duplication happens in a
system were the same result maybe captured multiple times and seems to cluster within
~days periods. How would we collapse this data to show record where the results are
the same? Please explain the approach in bullet points and show in SQLPlease show
examples of before and after your deduplication process for individual patients results.
aThe question is done on Snowflake SQL Worksheet. So the SQL query should be compatible to it
bPlease explain how the question works and also the logic behind the question?
cPlease give me a solution and the explanation for this question as well.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started