Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have written the following script. Everything works fine up until the Store...IN statement. The table "EH" according to QV does not exist. Can someone please look at the last portion and let me know why the Buffer Load and Store do not work?
Thanks
Glen
ODBC CONNECT TO MeditechDREH;
VisitsEH:
LOAD
AdmitDateTime,
DischargeDateTime as Disch_Date,
interval(num(DischargeDateTime)-num(AdmitDateTime)) as LOS,
FacilityName,
FacilityName & PrimaryInsuranceID as FAC_INS,
InpatientOrOutpatient,
PatientID ,
PrimaryInsuranceID as InsuranceID,
Month(DischargeDateTime) as Month,
Year(DischargeDateTime) as Year,
applymap('Maptype',FacilityName) as TYPE,
applymap('Mapfacility',FacilityName) as F_NAME,
applymap('Mapregion',FacilityName) as REGION,
applymap('Insurance',PrimaryInsuranceID) as INS_NAME,
VisitID as MT_VISIT;
SQL SELECT *
FROM LiveEH.dbo.BarVisits
Where InpatientOrOutpatient='I';
//***************************Patient Financial Info*******************
Fin_Data:
Load
AdjustmentTotal,
Balance as BAL,
BarStatus,
ChargeTotal as CHARGES,
ReceiptTotal as RECEIPTS,
RefundTotal as REFUNDS,
VisitID as MT_VISIT;
Sql select *
FROM LiveEH.dbo.BarVisitFinancialData
WHERE (Balance=0 and BarStatus='FB'and ChargeTotal<>0) or (BarStatus='BD' and ChargeTotal<>0);
Left Join (VisitsEH)
Load *
Resident Fin_Data;
Drop Table Fin_Data;
EH:
Buffer Load
AdmitDateTime,
Disch_Date,
LOS,
FacilityName,
FAC_INS,
InpatientOrOutpatient,
PatientID ,
InsuranceID,
Month,
Year,
TYPE,
F_NAME,
REGION,
INS_NAME,
MT_VISIT,
AdjustmentTotal,
BAL,
BarStatus,
CHARGES,
RECEIPTS,
REFUNDS
Resident VisitsEH;
STORE EH into C:\Documents and Settings\gxpowers\MyDocuments/EH.qvd;
Drop Table VisitsEH;
Since your VisitEH and EH tables have same fields, and their names, it will not create nother table. Why do you need to create EH table additionally? You can always store Visit EH into EH.qvd. Otherwise, if you must create a new table (EH) just add a dummy field, say '1' as dummy, and then store into qvd. Make sure to drop EH afterwards, otherwise you will have synthetic keys between these two tables.
Hope this helps.
PS: Are you in GA, as you name has "GA"? 🙂
another way is to put the keyword:
NOCONCATENATE
before the EH table
that tells QV not to concatenate the two tables, then you will be able to store the EH table and drop the VisitsEH table
Mansyno