How do I get my data back with no duplicates
I need no duplicate EncounterNo even if I do this it still returns dupes. Any Suggestions would be deeply appreciated!
SELECT Distinct
PWLDBA.ENTORDER.ENTORDERNO,
PWLDBA.TESTREQ.ACCESSION,
PWLDBA.ENCOUNTER.ENCOUNTERNO,
PWLDBA.PATIENT.NAMELAST,
PWLDBA.PATIENT.NAMEFIRST,
PWLDBA.PATIENT.NAMEINITIAL,
PWLDBA.PATIENT.NAMESUFFIX,
'F' AS PATIENT_GENDER,
PWLDBA.PATIENT.SSN,
PWLDBA.PATIENT.DOB,
' ' As AGE,
PWLDBA.RC.DESCRIPTION AS ETHNICITY,
'NA' AS PATIENT_OCCUPATION,
PWLDBA.PATIENT.ADDR1,
PWLDBA.PATIENT.ADDR2,
PWLDBA.PATIENT.CITY,
PWLDBA.PATIENT.STATE,
PWLDBA.PATIENT.COUNTRY,
PWLDBA.PATIENT.PHONE,
PWLDBA.SF.SRCFAC,
PWLDBA.SF.SRCFACNAME,
PWLDBA.PATIENT.PID,
PWLDBA.RD.NAMELAST AS ORDERING_PROVLNAME,
PWLDBA.RD.NAMEFIRST AS ORDERING_PROVFNAME,
PWLDBA.RD.NAMEINITIAL AS ORDERING_PROVINITIAL,
PWLDBA.RD.NAMEDEGREE AS TITLE,
PWLDBA.RD.NAMESUFFIX,
PWLDBA.RD.PMRY_SFKEY,
PWLDBA.RD.ADDR1,
PWLDBA.RD.ADDR2,
PWLDBA.RD.CITY,
PWLDBA.RD.STATE,
PWLDBA.RD.ZIP,
PWLDBA.RD.CONTACTPHONE,
PWLDBA.RD.UPIN,
PWLDBA.RD.NPI,
PWLDBA.PATIENT.ITKEY_0,
PWLDBA.PATIENT.GROUP_0,
PWLDBA.TESTREQ.COLLECTED AS PRIMARY_COL_DT,
PWLDBA.TESTREQ.RECEIVED AS PRIMARY_REC_DT,
PWLDBA.PTRESULT.FINALSTAMP AS FINAL_COMP_DT,
'NA' AS CASECURRENTSTEPDESC,
'DIGENE' AS CASE_TYPE,
PWLDBA.TEST.SHORTNAME,
PWLDBA.TEST.TESTCODE,
'NA' AS LOCALSTANDARDCODE,
PWLDBA.PWSP.DESCRIPTION AS PRIMSPECDESC,
PWLDBA.TESTREQ.SOURCE,
'NA' AS SNOMED_CODES,
PWLDBA.TESTREQ.ICD9KEY_0,
PWLDBA.BILLING.DESCRIPTION,
PWLDBA.BILLING_CPT.CPTBILLCODE AS CPTCODE,
'NA' AS LOINCCODES,
'NA' AS UMLCODES,
PWLDBA.TEST.TESTCODE,
PWLDBA.ANALYT.DESCRIPTION AS RESULTNAME,
PWLDBA.PTRESULT.VALUE AS RESULT_VALUE,
PWLDBA.PTRESULT.VALUE AS HPV_DETECTED,
PWLDBA.TESTCOMMENT.D_COMMENT,
PWLDBA.PTRESULT.ABNRANGE,
'NA' AS CLINICALHIST,
'NA' AS SPECIMENSOURCE,
PWLDBA.TEST.NAME,
'DIGENE' AS HPVTEST_MFG,
'NA' AS ADDENDUM,
'SED MEDICAL LAB' AS LABCODE
FROM
PWLDBA.TESTREQ
INNER JOIN PWLDBA.PATIENT
ON PWLDBA.PATIENT.SFKEY=PWLDBA.TESTREQ.SFKEY
INNER JOIN PWLDBA.ENCOUNTER
ON PWLDBA.ENCOUNTER.PATIENTKEY=PWLDBA.TESTREQ.PATIENTKEY
INNER JOIN PWLDBA.SF
ON PWLDBA.SF.SFKEY=PWLDBA.PATIENT.SFKEY
INNER JOIN PWLDBA.TEST
ON PWLDBA.TEST.TESTKEY=PWLDBA.TESTREQ.TESTKEY
INNER JOIN PWLDBA.PWSP
ON PWLDBA.PWSP.PWSPKEY=PWLDBA.TESTREQ.PWSPKEY
INNER JOIN PWLDBA.PTRESULT
ON PWLDBA.PTRESULT.TESTREQKEY=PWLDBA.TESTREQ.TESTREQKEY
INNER JOIN PWLDBA.PT
ON PWLDBA.PT.PTKEY=PWLDBA.ENCOUNTER.PTKEY
INNER JOIN PWLDBA.RD
ON PWLDBA.TESTREQ.RDKEY_0=PWLDBA.RD.RDKEY
INNER JOIN PWLDBA.ANALYT
ON PWLDBA.ANALYT.ANALYTKEY=PWLDBA.PTRESULT.ANALYTKEY
INNER JOIN PWLDBA.TESTCOMMENT
ON PWLDBA.TESTCOMMENT.TESTREQKEY=PWLDBA.TESTREQ.TESTREQKEY
INNER JOIN PWLDBA.BILLING
ON PWLDBA.BILLING.PATIENTKEY=PWLDBA.TESTREQ.PATIENTKEY
INNER JOIN PWLDBA.BILLING_CPT
ON PWLDBA.BILLING_CPT.BILLINGKEY=PWLDBA.BILLING.BILLINGKEY
INNER JOIN PWLDBA.RC
ON PWLDBA.RC.RCKEY=PWLDBA.PATIENT.RCKEY
INNER JOIN PWLDBA.ENTORDER
ON PWLDBA.ENTORDER.ENTORDERKEY=PWLDBA.TESTREQ.ENTORDERKEY
WHERE PWLDBA.TEST.TESTCODE in ('8191','721L') AND PWLDBA.TESTREQ.STATUS ='D'
ORDER BY PWLDBA.ENCOUNTER.ENCOUNTERNO ASC
Hi,
Whenever you have a question, please post a little sample data (CREATE TABLE and INSERT statements) and the results you want from that data. Explain how you get those results from that data.
If you can show your problem using commonly available tables (liek those in the scott schema) then you don't have to post any sample data; just the results and explanation.
Always say which version of Oracle you're using.
I believe your problem is very much like this:
Say you want to display one row for every ditinct job in the scott.emp table.
If you run this query:
SELECT DISTINCT
job, ename, hiredate
FROM scott.emp
ORDER BY job
, ename
;you'll get these results:
JOB ENAME HIREDATE
ANALYST FORD 03-Dec-1981
ANALYST SCOTT 19-Apr-1987
CLERK ADAMS 23-May-1987
CLERK JAMES 03-Dec-1981
CLERK MILLER 23-Jan-1982
CLERK SMITH 17-Dec-1980
MANAGER BLAKE 01-May-1981
MANAGER CLARK 09-Jun-1981
MANAGER JONES 02-Apr-1981
PRESIDENT KING 17-Nov-1981
SALESMAN ALLEN 20-Feb-1981
SALESMAN MARTIN 28-Sep-1981
SALESMAN TURNER 08-Sep-1981
SALESMAN WARD 22-Feb-1981because SELECT DISTINCT means that no row of output will be identical to any other row of output; it says nothing about individual columns. For example, there are two rows in the output above with job='ANALYST'; these rows are distinct, because even though the job column is identical, the ename column is different.
If you want only one row of output per job, like this:
JOB ENAME HIREDATE
ANALYST FORD 03-Dec-1981
CLERK ADAMS 23-May-1987
MANAGER BLAKE 01-May-1981
PRESIDENT KING 17-Nov-1981
SALESMAN ALLEN 20-Feb-1981then you can run a query like this:
WITH got_r_num AS
SELECT job, ename, hiredate
, ROW_NUMBER () OVER ( PARTITION BY job
ORDER BY ename
) AS r_num
FROM scott.emp
SELECT job, ename, hiredate
FROM got_r_num
WHERE r_num = 1
;Notice that, although the table contains two rows where job='ANALYST' this query displays only one of them, the one where ename='FORD'. Why didn't the query display the other row from the table, the one with ename='SCOTT'? Because of the analytic ORDER BY clause in the ROW_NUMBER function. "ROW_NUMBER () OVER (PARTITION BY job ORDER BY ename)" means that the ROWN_NUMBER function will return distinct numbers (1, 2, 3, ...) for each alue of job, with the first row in order by ename getting #1, the 2nd row getting 2, and so on. If there happened to be 2 or more rows with the same job and the same ename, then ROW_NUMBER would still assign distinct numbers to each one, but there's no way to foretell which of the rows would get the lower number.
Similar Messages
-
My wife bought an iPad Air and synced contact from our PC (Outlook), now all our contacts in Outlook have gone and we have to go to iCloud to get them, and even then they are a bit jumbled. How do I get my data back onto my PC?
If you can see the iCloud contacts in Outlook, you can copy them back to your PC by selecting all the contacts (click one, then press Control-A), then drag and drop the selected contacts to Contacts under My Contacts on the left sidebar of Outlook.
If you want to copy your calendar back to Outlook, select your iCloud calendar on the left sidebar of Outlook, switch to the list view (select View from the ribbon, then click Change View>List), select your events (click on a single event, then press Control-A), then control drag and drop them to Calendar under My Calendars on the left sidebar.
Then you can sign out of iCloud on the iCloud control panel and your local copies will still be there. If you want to add your iCloud email account back to iCloud, you can do this with these settings: http://support.apple.com/kb/HT4864. -
How can I get the data back from my game
How can I get the data back from minecraft if I deleted the app and bought with a different Apple ID
No, they are tied to the ID that purchased them, and cannot be transferred to anyone else.
-
If someone has wiped my ipad and changed passwords on icloud how do i get my data back
if someone has wiped my ipad and changed passwords on icloud how do i get my data back? please could someone help me out thanks
How did they wipe it? By using Find My iPad and performing a wipe? If so, that means they have your icloud ID and password, not a good thing.
You could try connecting it to iTunes and performing a restore from iCloud. But if they changed password, then you are out of the loop. How did they get your password in order to change it? -
I backed up my ipod. I then updated it but all of my data is still gone. How do I get my data back??
Were the app in your iTunes library? If not the app data in the backup has no place to go. Redownload the apps in your iTunes libaray
Downloading past purchases from the App Store, iBookstore, and iTunes Store
and then restore from backup.
iOS: How to back up and restore your content
Otherwise, try restoring from backup again.
If still problem that means the backup does not include the data. -
How do i get my data back if i restored my ipod touch
how do i get my data back if i restored my ipod touch
The backup that iTunes makes does not include synced media like apps and music.
Redownload iTunes purchases by:
Downloading past purchases from the App Store, iBookstore, and iTunes Store
and then restore from the same backup again. -
My iphone battery died and on charging the phone it asked me to connect to itunes and restore the phone.
If i restore the phone how can i get my data back and how can i check when i last backed up my phoneIf you have been syncing regularly as the iphone is designed, then you can sync the data back.
Regardless you will have to restore the iphone. -
I lost my iPhone device, how can I get my data back on another one without using an iCloud backup just back up on i Tunes, Please Help.??
You can find the backup files and then copy them to a safe place if you are worrying about this.
iTunes places the backup files in these places:
Mac: ~/Library/Application Support/MobileSync/Backup/
The "~" represents your Home folder. If you don't see Library in your Home folder, hold Option and click the Go menu.
Windows Vista, Windows 7, and Windows 8: \Users\(username)\AppData\Roaming\Apple Computer\MobileSync\Backup\
To quickly access the AppData folder, click Start. In the search bar, type %appdata%, then press Return.
Windows XP: \Documents and Settings\(username)\Application Data\Apple Computer\MobileSync\Backup\
To quickly access the Application Data folder, click Start, then choose Run. In the search bar, type %appdata%, then click OK. -
I added Icloud to join my calendar on my phone to another person. It erased all history date from previous months. how do I get that data back?
i found the answer to the first part: reboot and keep hold of command+r
this gave me a list of options
one of them was to reinstall lion from fresh
i went for this
dont know why... but all forum posts i read said u should delete hard disc? theres an option for this
which is the right option?
any suggesstion where i go to register new mac would be great
thanks -
Hi,
I wanted to unlock my at&t iphone 3gs that i had for 3 years. i was told to back up the data on my phone and then restore it as new. now i don't have any data i had before it was restored. how can i get that data back onto my iphone 3gs? can i put that data on my ipad?Is it an iTunes backup or an iCloud backup? If iTunes, connect the iPhone, right click on the name of the iPhone under the DEVICES section in iTunes. Click on Restore from Backup.
If iCloud, on the iPhone go to Settings > General > Reset > Erase All Content and Settings. When the device powers back on, you will see the original setup screens you saw when your iPhone was fresh out of the box. One of these screen asks you if you want to restore. Choose Restore from iCloud backup. -
Hi, may i know how can i get all data back after update ios 6
Hi,
May i know how can i get all data back after update ios 6 and all my data lost ?You can restore the phone and when prompted to restore choose from icloud account. BUT MAKE SURE there is 1.) an icloud backup for your phone. 2.) you are using the same apple id.
apl -
My iPhone says "o death" where the date should be on the lock screen, why is it doing this and how do I get the date back?
I tried powering off and on and it went away, but I can't tell if it's been broken into since everything works fine (I'm using it now) is there a test to see if it's been broken into?
Thanks for all your replies! -
My computer where Itunes was installed is crashed, how do I get my libary back with my paid apps, the music I do not care I have them on an other hard drive
Open iTunes and then connect you to the iTunes store
and on the right you will see "Purchased"
and it will show you all the app that you have purchase during the years , and on right corner of the page you can choose to download everything again -
How to get old data back with original apple id
HI Guys
Wrongly i configured my iphone with some other apple id n nw all tat other user id data is been reflecting in my iphone, how shlud i gt my old data back with my original apple id. Rather whnevr i m connecting it with itunes tat odr user id is been reflecting........... how to slove dis issue pls guide.Hi Suyash,
Check if this article is helpful in your case:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f421c86c-0801-0010-e88c-a07ccdc69601
/people/dinesh.lalchand/blog/2006/02/07/loopback-process--follow-up
Regards
Dinesh -
ADF and JQuery: How can I get the data back to server listener.
Jdeveloper 11g Version 11.1.1.2.0
I use Jquery to draw the signature. How can I get the svgOutput back to my server listener.???
e.getSource give me the error e.getSource is not function.
Both of function saveSignatureCapture(which calling from ADF button) and $('#save-output').click(function (event) can not send the the data back to my server listener.
Thanks.
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document id="dSignature" title="Signature Capture">
<af:resource type="javascript" source="../resources/lib/jquery/jquery-1.4.2.min.js"/>
<af:resource type="javascript" source="../resources/js/jquery.drawbox.js"/>
<af:resource type="javascript">
var svgOutput = '';
function saveSignatureCapture(e) {
var signatureText = $('#drawbox-data').val();
var source = e.getSource();
var type = 'saveSignatureCapture_ServerListener';
var immediate = true;
var params = {
signatureText : signatureText
AdfCustomEvent.queue(source, type, params, immediate);
function beginSignatureCapture(e) {
$('#drawbox').drawbox( {
caption : 'This is a caption', lineWidth : 3, lineCap : 'round', lineJoin : 'round', colorSelector : true
$('#view-output').click(function () {
svgOutput = window.open('data:image/svg+xml,' + $('#drawbox-data').val());
svgOutput.document.close();
return false;
$('#save-output').click(function (event) {
var signatureText = $('#drawbox-data').val();
var source = $(document);
var type = "saveSignatureCapture_ServerListener";
var immediate = true;
var params = {
signatureText : signatureText
AdfCustomEvent.queue(source, type, params, immediate);
return false;
$(document).ready(beginSignatureCapture);
</af:resource>
<af:panelStretchLayout id="psSignature">
<f:facet name="bottom"/>
<f:facet name="center">
<af:panelGroupLayout id="pgSignature" layout="vertical">
<f:verbatim>
<div id="divSignature">
<canvas id="drawbox" width="600" height="200">
<p>Your browser does not support <canvas></p>
</canvas>
</div>
<br/>
<br/>
<a href="#" id="view-output">View Rendered SVG Output</a>
<br/>
<br/>
<a href="#" id="save-output">Save Signature</a>
</f:verbatim>
<af:spacer width="10" height="10" id="s10"/>
<af:panelGroupLayout id="pghl14" layout="horizontal" halign="center">
<af:commandButton text="Save Signature" id="cbSaveSignatureButtonId" partialSubmit="true">
<af:clientListener method="saveSignatureCapture" type="click"/>
<af:serverListener type="saveSignatureCapture_ServerListener"
method="#{backingBeanScope.mainBackingBean.saveSignatureCapture_ServerListener}"/>
</af:commandButton>
</af:panelGroupLayout>
</af:panelGroupLayout>
</f:facet>
<f:facet name="start"/>
<f:facet name="end"/>
<f:facet name="top"/>
</af:panelStretchLayout>
</af:document>
</f:view>
</jsp:root>Edited by: user553450 on Sep 17, 2010 4:02 PM
Edited by: user553450 on Sep 17, 2010 4:13 PMHi Frank,
Thank you so much for your advice, I got lot of knowledge from your book and articles since I am in transition from forms to JDeveloper.
By surrounding <af:panelStretchLayout id="psSignature"> with <af:form id="f1">
Now the following code is work on Firefox, everything fine, I can get the data back and call my server listener as I expected.
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document id="d1" title="Signature Capture">
<af:resource type="javaScript" source="../resources/js/excanvas.js"/>
<af:resource type="javascript" source="../resources/lib/jquery/jquery-1.4.2.min.js"/>
<af:resource type="javascript" source="../resources/js/jquery.drawbox.js"/>
<af:resource type="javascript">
function saveSignatureCapture(e) {
var signatureText = $('#drawbox-data').val();
alert(signatureText);
var source = e.getSource();
var type = 'saveSignatureCapture_ServerListener';
var immediate = true;
var params = {
signatureText : signatureText
AdfCustomEvent.queue(source, type, params, immediate);
function beginSignatureCapture(e) {
var cmd = "$('#drawbox').drawbox({lineWidth:3,lineCap:'round',lineJoin:'round',colorSelector:true});";
if (navigator.userAgent.indexOf('MSIE') != - 1) {
setTimeout(cmd, 1000);
else {
$('#drawbox').drawbox( {
caption : 'This is a caption', lineWidth : 3, lineCap : 'round', lineJoin : 'round', colorSelector : true
</af:resource>
<af:form id="f1">
<af:panelStretchLayout id="psSignature">
<f:facet name="bottom"/>
<f:facet name="center">
<af:panelGroupLayout id="pgSignature" layout="vertical">
<f:verbatim>
<canvas id="drawbox" width="600" height="200">
<p>Your browser does not support <canvas></p>
</canvas>
</f:verbatim>
<af:spacer width="10" height="10" id="s10"/>
<af:panelGroupLayout id="pghl14" layout="horizontal" halign="center">
<af:commandButton text="Save Signature" id="cbSaveSignatureButtonId" partialSubmit="true">
<af:clientListener method="saveSignatureCapture" type="click"/>
<af:serverListener type="saveSignatureCapture_ServerListener"
method="#{backingBeanScope.mainBackingBean.saveSignatureCapture_ServerListener}"/>
</af:commandButton>
</af:panelGroupLayout>
</af:panelGroupLayout>
</f:facet>
<f:facet name="start"/>
<f:facet name="end"/>
<f:facet name="top"/>
</af:panelStretchLayout>
</af:form>
<af:clientListener method="beginSignatureCapture" type="load"/>
</af:document>
</f:view>
</jsp:root> However, I got the error following error when I run the page from IE8.
Assertion failed: Incorrect use of AdfRichUIPeer.GetDomNodeForCommentComponent.AdfRichCommandButton[oracle.adf.RichCommandButton] id=cbSaveSignatureButtonId StackTrace:function(x217)[AdfRichCommandButton[oracle.adf.RichCommandButtonId]..........
FYI, the following simple testing code has the similar error in IE8 too (not for Firefox).
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document id="d1">
<af:resource type="javaScript" source="../resources/js/excanvas.js"/>
<af:form id="f1">
<f:verbatim>
<canvas id="drawbox" width="600" height="200">
<p>Your browser does not support <canvas></p>
</canvas>
</f:verbatim>
</af:form>
</af:document>
</f:view>
</jsp:root>The error is: Assertion failed: Incorrect use of AdfRichUIPeer.GetDomNodeForCommentComponent.AdfRichDialog[oracle.adf.RichDialog] id:::msgDlg StackTrace function(x217).......
Your advice is very much appreciated.
Maybe you are looking for
-
Apple's Iphone Recyling program
Has anyone here ever tried recycling their iphones to apple? How long does it usually take before you get the gift card from them?
-
Component on page not moving as vertical scroll bar is moved
All - I have a mxml page that is a mx:Application. This page basically consists of a VBox and a number of components included within that VBox. All but 1 of the components within this VBox are built-in flex components. The one component that is no
-
Category ABAP Programming Error Runtime Errors TIME_OUT ABAP Program SAPMSSY1 Application Component BC-MID-RFC Date and Time 03.05.2014 09:04:14 |Short text
-
Why the TwirlFilter (Sample project in CS4) plugin is not selectable?
Hello All, Im using Adobe Illustrator CS4. I want to test the "TwirlFilter" (sample project in cs4 SDK) plugin. Project is compiled and plugin created. I have placed this plugin in under plugins folder of AI. Started AI and this plugin is showing und
-
SIRI won't work without iPhone reset.
I have a 5S(7.1.1). After using SIRI, or any voice-text task, I have to reset the entire phone to get the voice-text function to work again. Suggestions? Thanks in advance.