-- GLOBAL TEMPORARY TABLES (require pgtt extension) 

CREATE GLOBAL TEMPORARY TABLE  global_temp_alloc4 (
    "AllocatH" numeric(10,0) NOT NULL,
    "PayType" numeric(5,0),
    "TrxType" numeric(5,0),
    "TrxId" numeric(10,0),
    "TrxTreatment" numeric(5,0),
    "Amount" numeric,
    "AllocateLink" numeric(10,0) NOT NULL,
    "TxHistoryId" numeric(10,0) NOT NULL,
    "PmtHistoryId" numeric(10,0) NOT NULL,
    "OrigRecNo" numeric(10,0),
    "History" numeric(10,0),
    "HistoryType" numeric(5,0),
    "Patient" numeric(10,0),
    "TxModifiedDate" timestamp without time zone,
    "Payed" numeric,
    "InsPayed" numeric,
    "PtAdj" numeric,
    "InsAdj" numeric,
    "InsTransfer" numeric,
    "Discipline" character(15),
    "Procedure" character(7),
    "Practice" numeric(5,0),
    "ClaimDoctor" character(10),
    "Location" character(6),
    "EntryUser" numeric(10,0),
    "AppUser" numeric(10,0),
    "Custom1" character(6),
    "Custom2" character(6),
    "Producer" character(10),
    "TypeCode" character(1),
    "PGroup" character(6),
    "Year" numeric(10,0),
    "CustomCode1" character(6),
    "CustomCode2" character(6),
    "CustomCode3" character(6),
    "CustomCode4" character(6),
    "CustomCode5" character(6),
    "CustomCode6" character(6),
    "CustomCode7" character(6),
    "CustomCode8" character(6),
    "CustomCode9" character(6),
    "CustomCode10" character(6),
    "Department" character(6),
    "HistoryTypeDescription" character(30),
    "GroupBy1" numeric,
    "GroupBy2" numeric,
    "PreviousHistory" numeric(10,0),
    "PreviousDiscipline" character(15),
    "PreviousProcedure" character(7),
    "PreviousPractice" numeric(5,0),
    "PreviousClaimDoctor" character(10),
    "PreviousLocation" character(6),
    "PreviousEntryUser" numeric(10,0),
    "PreviousAppUser" numeric(10,0),
    "PreviousCustom1" character(6),
    "PreviousCustom2" character(6),
    "PreviousProducer" character(10),
    "PreviousTypeCode" character(1),
    "PreviousPGroup" character(6),
    "PreviousYear" numeric(10,0),
    "PreviousCustomCode1" character(6),
    "PreviousCustomCode2" character(6),
    "PreviousCustomCode3" character(6),
    "PreviousCustomCode4" character(6),
    "PreviousCustomCode5" character(6),
    "PreviousCustomCode6" character(6),
    "PreviousCustomCode7" character(6),
    "PreviousCustomCode8" character(6),
    "PreviousCustomCode9" character(6),
    "PreviousCustomCode10" character(6),
    "PreviousDepartment" character(6),
    "GroupBy1Value" character(30),
    "GroupBy2Value" character(30),
    "PreviousGroupBy1Value" character(30),
    "PreviousGroupBy2Value" character(30)
);


--
-- Name: history_ar_global_temp3; Type: TABLE; Schema: pgtt_schema; Owner: -
--

CREATE GLOBAL TEMPORARY TABLE  history_ar_global_temp3 (
    "History" numeric(10,0),
    "HistoryType" numeric(5,0),
    "OrigRecNo" numeric(10,0),
    "Type" numeric(5,0),
    "Id" numeric(10,0),
    "Treatment" numeric(5,0),
    "ModifiedDate" timestamp without time zone,
    "TreatmentDate" timestamp without time zone,
    "Producer" character(10),
    "Procedure" character(7),
    "Patient" numeric(10,0),
    "Family" numeric(10,0),
    "Code" character(6),
    "Description" character varying(60),
    "Company1" character(6),
    "ReportDepartment" character(6),
    "ReportDiscipline" character(15),
    "ReportProcedure" character(7),
    "ReportPractice" numeric(5,0),
    "ReportClaimDoctor" character(10),
    "ReportLocation" character(6),
    "ReportEntryUser" numeric(10,0),
    "ReportAppUser" numeric(10,0),
    "ReportCustom1" character(6),
    "ReportCustom2" character(6),
    "ReportProducer" character(10),
    "ReportTypeCode" character(1),
    "ReportPGroup" character(6),
    "ReportYear" numeric(10,0),
    "ReportCustomCode1" character(6),
    "ReportCustomCode2" character(6),
    "ReportCustomCode3" character(6),
    "ReportCustomCode4" character(6),
    "ReportCustomCode5" character(6),
    "ReportCustomCode6" character(6),
    "ReportCustomCode7" character(6),
    "ReportCustomCode8" character(6),
    "ReportCustomCode9" character(6),
    "ReportCustomCode10" character(6),
    "ReportGroupBy1" numeric,
    "ReportGroupBy1Description" character(23),
    "ReportGroupBy2" numeric,
    "ReportGroupBy2Description" character(23),
    "ReportFromDate" timestamp without time zone,
    "ReportToDate" timestamp without time zone,
    "ReportIsDetailed" numeric,
    "ReportIncludeUnallocated" numeric,
    "ReportHistoryTypeDescription" character(30),
    "ReportOldTotal" numeric,
    "ReportTotal" numeric,
    "ReportTotalChange" numeric,
    "ReportOldInsTotal" numeric,
    "ReportInsTotal" numeric,
    "ReportInsTotalChange" numeric,
    "ReportOldPayed" numeric,
    "ReportPayed" numeric,
    "ReportPayedChange" numeric,
    "ReportOldInsPayed" numeric,
    "ReportInsPayed" numeric,
    "ReportInsPayedChange" numeric,
    "ReportOldPtAdj" numeric,
    "ReportPtAdj" numeric,
    "ReportPtAdjChange" numeric,
    "ReportOldInsAdj" numeric,
    "ReportInsAdj" numeric,
    "ReportInsAdjChange" numeric,
    "ReportOldInsTransfer" numeric,
    "ReportInsTransfer" numeric,
    "ReportInsTransferChange" numeric,
    "PreviousHistory" numeric(10,0)
);


--
-- Name: global_temp_alloc1; Type: TABLE; Schema: pgtt_schema; Owner: -
--

CREATE GLOBAL TEMPORARY TABLE  global_temp_alloc1 (
    "AllocatH" numeric(10,0) NOT NULL,
    "PayType" numeric(5,0),
    "TrxType" numeric(5,0),
    "TrxId" numeric(10,0),
    "TrxTreatment" numeric(5,0),
    "Amount" numeric,
    "AllocateLink" numeric(10,0) NOT NULL,
    "TxHistoryId" numeric(10,0) NOT NULL,
    "PmtHistoryId" numeric(10,0) NOT NULL,
    "OrigRecNo" numeric(10,0),
    "History" numeric(10,0),
    "HistoryType" numeric(5,0),
    "Patient" numeric(10,0),
    "TxModifiedDate" timestamp without time zone,
    "Payed" numeric,
    "InsPayed" numeric,
    "PtAdj" numeric,
    "InsAdj" numeric,
    "InsTransfer" numeric,
    "Discipline" character(15),
    "Procedure" character(7),
    "Practice" numeric(5,0),
    "ClaimDoctor" character(10),
    "Location" character(6),
    "EntryUser" numeric(10,0),
    "AppUser" numeric(10,0),
    "Custom1" character(6),
    "Custom2" character(6),
    "Producer" character(10),
    "TypeCode" character(1),
    "PGroup" character(6),
    "Year" numeric(10,0),
    "CustomCode1" character(6),
    "CustomCode2" character(6),
    "CustomCode3" character(6),
    "CustomCode4" character(6),
    "CustomCode5" character(6),
    "CustomCode6" character(6),
    "CustomCode7" character(6),
    "CustomCode8" character(6),
    "CustomCode9" character(6),
    "CustomCode10" character(6),
    "Department" character(6),
    "HistoryTypeDescription" character(30),
    "GroupBy1" numeric,
    "GroupBy2" numeric
);


--
-- Name: global_temp_alloc2; Type: TABLE; Schema: pgtt_schema; Owner: -
--

CREATE GLOBAL TEMPORARY TABLE  global_temp_alloc2 (
    "AllocatH" numeric(10,0) NOT NULL,
    "PayType" numeric(5,0),
    "TrxType" numeric(5,0),
    "TrxId" numeric(10,0),
    "TrxTreatment" numeric(5,0),
    "Amount" numeric,
    "AllocateLink" numeric(10,0) NOT NULL,
    "TxHistoryId" numeric(10,0) NOT NULL,
    "PmtHistoryId" numeric(10,0) NOT NULL,
    "OrigRecNo" numeric(10,0),
    "History" numeric(10,0),
    "HistoryType" numeric(5,0),
    "Patient" numeric(10,0),
    "TxModifiedDate" timestamp without time zone,
    "Payed" numeric,
    "InsPayed" numeric,
    "PtAdj" numeric,
    "InsAdj" numeric,
    "InsTransfer" numeric,
    "Discipline" character(15),
    "Procedure" character(7),
    "Practice" numeric(5,0),
    "ClaimDoctor" character(10),
    "Location" character(6),
    "EntryUser" numeric(10,0),
    "AppUser" numeric(10,0),
    "Custom1" character(6),
    "Custom2" character(6),
    "Producer" character(10),
    "TypeCode" character(1),
    "PGroup" character(6),
    "Year" numeric(10,0),
    "CustomCode1" character(6),
    "CustomCode2" character(6),
    "CustomCode3" character(6),
    "CustomCode4" character(6),
    "CustomCode5" character(6),
    "CustomCode6" character(6),
    "CustomCode7" character(6),
    "CustomCode8" character(6),
    "CustomCode9" character(6),
    "CustomCode10" character(6),
    "Department" character(6),
    "HistoryTypeDescription" character(30),
    "GroupBy1" numeric,
    "GroupBy2" numeric
);


--
-- Name: global_temp_alloc3; Type: TABLE; Schema: pgtt_schema; Owner: -
--

CREATE GLOBAL TEMPORARY TABLE  global_temp_alloc3 (
    "AllocatH" numeric(10,0) NOT NULL,
    "PayType" numeric(5,0),
    "TrxType" numeric(5,0),
    "TrxId" numeric(10,0),
    "TrxTreatment" numeric(5,0),
    "Amount" numeric,
    "AllocateLink" numeric(10,0) NOT NULL,
    "TxHistoryId" numeric(10,0) NOT NULL,
    "PmtHistoryId" numeric(10,0) NOT NULL,
    "OrigRecNo" numeric(10,0),
    "History" numeric(10,0),
    "HistoryType" numeric(5,0),
    "Patient" numeric(10,0),
    "TxModifiedDate" timestamp without time zone,
    "Payed" numeric,
    "InsPayed" numeric,
    "PtAdj" numeric,
    "InsAdj" numeric,
    "InsTransfer" numeric,
    "Discipline" character(15),
    "Procedure" character(7),
    "Practice" numeric(5,0),
    "ClaimDoctor" character(10),
    "Location" character(6),
    "EntryUser" numeric(10,0),
    "AppUser" numeric(10,0),
    "Custom1" character(6),
    "Custom2" character(6),
    "Producer" character(10),
    "TypeCode" character(1),
    "PGroup" character(6),
    "Year" numeric(10,0),
    "CustomCode1" character(6),
    "CustomCode2" character(6),
    "CustomCode3" character(6),
    "CustomCode4" character(6),
    "CustomCode5" character(6),
    "CustomCode6" character(6),
    "CustomCode7" character(6),
    "CustomCode8" character(6),
    "CustomCode9" character(6),
    "CustomCode10" character(6),
    "Department" character(6),
    "HistoryTypeDescription" character(30),
    "GroupBy1" numeric,
    "GroupBy2" numeric,
    "PreviousHistory" numeric(10,0),
    "PreviousDiscipline" character(15),
    "PreviousProcedure" character(7),
    "PreviousPractice" numeric(5,0),
    "PreviousClaimDoctor" character(10),
    "PreviousLocation" character(6),
    "PreviousEntryUser" numeric(10,0),
    "PreviousAppUser" numeric(10,0),
    "PreviousCustom1" character(6),
    "PreviousCustom2" character(6),
    "PreviousProducer" character(10),
    "PreviousTypeCode" character(1),
    "PreviousPGroup" character(6),
    "PreviousYear" numeric(10,0),
    "PreviousCustomCode1" character(6),
    "PreviousCustomCode2" character(6),
    "PreviousCustomCode3" character(6),
    "PreviousCustomCode4" character(6),
    "PreviousCustomCode5" character(6),
    "PreviousCustomCode6" character(6),
    "PreviousCustomCode7" character(6),
    "PreviousCustomCode8" character(6),
    "PreviousCustomCode9" character(6),
    "PreviousCustomCode10" character(6),
    "PreviousDepartment" character(6),
    "GroupBy1Value" character(30),
    "GroupBy2Value" character(30),
    "PreviousGroupBy1Value" character(30),
    "PreviousGroupBy2Value" character(30)
);


--
-- Name: history_ar_global_temp; Type: TABLE; Schema: pgtt_schema; Owner: -
--

CREATE GLOBAL TEMPORARY TABLE  history_ar_global_temp (
    "History" numeric(10,0),
    "HistoryType" numeric(5,0),
    "Type" numeric(5,0),
    "Id" numeric(10,0),
    "Treatment" numeric(5,0),
    "Patient" numeric(10,0),
    "Family" numeric(10,0),
    "Status" character(6),
    edi character(15),
    "EDIStatus" numeric(5,0),
    "Date" timestamp without time zone,
    "SubmitDate" timestamp without time zone,
    "ClaimDoctor" character(10),
    "Submitted" numeric(5,0),
    "TreatmentDate" timestamp without time zone,
    "CreationDate" timestamp without time zone,
    "Procedure" character(7),
    "Code" character(6),
    "Site" character(3),
    "Surface" character(6),
    "Unit" numeric,
    "Producer" character(10),
    "Total" numeric,
    "InsTotal" numeric,
    "Company1" character(6),
    "Policy1" character varying(20),
    "Category1" character(6),
    "Item1" numeric(10,0),
    "Deduct1" numeric,
    "Assign1" numeric(5,0),
    "Eligible1" numeric,
    "Pct1" numeric,
    "Amount1" numeric,
    "InsPayed1" numeric,
    "InsAdj1" numeric,
    "Company2" character(6),
    "Policy2" character varying(20),
    "Category2" character(6),
    "Item2" numeric(10,0),
    "Assign2" numeric(5,0),
    "Deduct2" numeric,
    "Eligible2" numeric,
    "Pct2" numeric,
    "Amount2" numeric,
    "InsPayed2" numeric,
    "InsAdj2" numeric,
    "Company3" character(6),
    "Policy3" character varying(20),
    "Category3" character(6),
    "Item3" numeric(10,0),
    "Assign3" numeric(5,0),
    "Deduct3" numeric,
    "Eligible3" numeric,
    "Pct3" numeric,
    "Amount3" numeric,
    "InsPayed3" numeric,
    "InsAdj3" numeric,
    "Description" character varying(60),
    "Deleted" numeric(5,0),
    "Bank" character(6),
    "Payed" numeric,
    "InsPayed" numeric,
    "PtAdj" numeric,
    "InsAdj" numeric,
    "EstimateF" numeric(10,0),
    "Additional" character(7),
    "TxStatus" character(6),
    "User" numeric(10,0),
    "PtWriteOff" numeric,
    "PolicyId1" numeric(10,0),
    "PolicyId2" numeric(10,0),
    "PolicyId3" numeric(10,0),
    "InsStatus1" numeric(5,0),
    "InsStatus2" numeric(5,0),
    "InsStatus3" numeric(5,0),
    "IsBankDeposit" numeric(5,0),
    "ChartTrx" numeric(10,0),
    "PlanTotal" numeric,
    "Phase" character(2),
    "Seq" numeric(5,0),
    "AppUser" numeric(10,0),
    "AppDate" timestamp without time zone,
    "Grading" numeric(10,0),
    "Site2" character(3),
    "Custom1" character(6),
    "Custom2" character(6),
    "PayPlanId" numeric(10,0),
    "Discipline" character(15),
    "DiscountedPmtId" numeric(10,0),
    "Location" character(6),
    "OrigAssign1" numeric(5,0),
    "OrigAssign2" numeric(5,0),
    "OrigAssign3" numeric(5,0),
    "InDispute" numeric(5,0),
    "DisputeDate" timestamp without time zone,
    "DeletionDate" timestamp without time zone,
    "EDIPat" character(15),
    "EDIPatStatus" numeric(5,0),
    "InsTransfer1" numeric,
    "InsTransfer2" numeric,
    "InsTransfer3" numeric,
    "InsTransfer" numeric,
    "InsPmtId" numeric(10,0),
    "StationId" numeric(10,0),
    "Practice" numeric(5,0),
    "Suspended" numeric(5,0),
    "DelAppUser" numeric(10,0),
    "DelAppDate" timestamp without time zone,
    "OrthoStatus" numeric(5,0),
    "CvgType" numeric(5,0),
    "ModifiedDate" timestamp without time zone,
    "OrigClaimDate" timestamp without time zone,
    "SubmitMode" numeric(5,0),
    "Custom3" character(6),
    "Custom4" character(6),
    "CorrespondCode" character(7),
    "InsCvgType1" numeric(5,0),
    "InsCvgType2" numeric(5,0),
    "InsCvgType3" numeric(5,0),
    "OrigRecNo" numeric(10,0),
    "EntryUser" numeric(10,0),
    "PlanInProcTotal" numeric,
    "TrxDep" numeric(10,0),
    "CustomaryTotal" numeric,
    "TaxRate" numeric,
    "TaxAmount" numeric,
    "ReportPeriod" character(11),
    "Department" character(6),
    "Producer_TypeCode" character(1),
    "Producer_PGroup" character(6),
    "Producer_Year" numeric(10,0),
    "Patient_CustomCode1" character(6),
    "Patient_CustomCode2" character(6),
    "Patient_CustomCode3" character(6),
    "Patient_CustomCode4" character(6),
    "Patient_CustomCode5" character(6),
    "Patient_CustomCode6" character(6),
    "Patient_CustomCode7" character(6),
    "Patient_CustomCode8" character(6),
    "Patient_CustomCode9" character(6),
    "Patient_CustomCode10" character(6),
    "ReportGroupBy1" numeric,
    "ReportGroupBy1Description" character(23),
    "ReportGroupBy2" numeric,
    "ReportGroupBy2Description" character(23),
    "ReportFromDate" timestamp without time zone,
    "ReportToDate" timestamp without time zone,
    "ReportIsDetailed" numeric,
    "ReportIncludeUnallocated" numeric
);


--
-- Name: history_ar_global_temp2; Type: TABLE; Schema: pgtt_schema; Owner: -
--

CREATE GLOBAL TEMPORARY TABLE  history_ar_global_temp2 (
    "History" numeric(10,0),
    "HistoryType" numeric(5,0),
    "Type" numeric(5,0),
    "Id" numeric(10,0),
    "Treatment" numeric(5,0),
    "Patient" numeric(10,0),
    "Family" numeric(10,0),
    "Status" character(6),
    edi character(15),
    "EDIStatus" numeric(5,0),
    "Date" timestamp without time zone,
    "SubmitDate" timestamp without time zone,
    "ClaimDoctor" character(10),
    "Submitted" numeric(5,0),
    "TreatmentDate" timestamp without time zone,
    "CreationDate" timestamp without time zone,
    "Procedure" character(7),
    "Code" character(6),
    "Site" character(3),
    "Surface" character(6),
    "Unit" numeric,
    "Producer" character(10),
    "Total" numeric,
    "InsTotal" numeric,
    "Company1" character(6),
    "Policy1" character varying(20),
    "Category1" character(6),
    "Item1" numeric(10,0),
    "Deduct1" numeric,
    "Assign1" numeric(5,0),
    "Eligible1" numeric,
    "Pct1" numeric,
    "Amount1" numeric,
    "InsPayed1" numeric,
    "InsAdj1" numeric,
    "Company2" character(6),
    "Policy2" character varying(20),
    "Category2" character(6),
    "Item2" numeric(10,0),
    "Assign2" numeric(5,0),
    "Deduct2" numeric,
    "Eligible2" numeric,
    "Pct2" numeric,
    "Amount2" numeric,
    "InsPayed2" numeric,
    "InsAdj2" numeric,
    "Company3" character(6),
    "Policy3" character varying(20),
    "Category3" character(6),
    "Item3" numeric(10,0),
    "Assign3" numeric(5,0),
    "Deduct3" numeric,
    "Eligible3" numeric,
    "Pct3" numeric,
    "Amount3" numeric,
    "InsPayed3" numeric,
    "InsAdj3" numeric,
    "Description" character varying(60),
    "Deleted" numeric(5,0),
    "Bank" character(6),
    "Payed" numeric,
    "InsPayed" numeric,
    "PtAdj" numeric,
    "InsAdj" numeric,
    "EstimateF" numeric(10,0),
    "Additional" character(7),
    "TxStatus" character(6),
    "User" numeric(10,0),
    "PtWriteOff" numeric,
    "PolicyId1" numeric(10,0),
    "PolicyId2" numeric(10,0),
    "PolicyId3" numeric(10,0),
    "InsStatus1" numeric(5,0),
    "InsStatus2" numeric(5,0),
    "InsStatus3" numeric(5,0),
    "IsBankDeposit" numeric(5,0),
    "ChartTrx" numeric(10,0),
    "PlanTotal" numeric,
    "Phase" character(2),
    "Seq" numeric(5,0),
    "AppUser" numeric(10,0),
    "AppDate" timestamp without time zone,
    "Grading" numeric(10,0),
    "Site2" character(3),
    "Custom1" character(6),
    "Custom2" character(6),
    "PayPlanId" numeric(10,0),
    "Discipline" character(15),
    "DiscountedPmtId" numeric(10,0),
    "Location" character(6),
    "OrigAssign1" numeric(5,0),
    "OrigAssign2" numeric(5,0),
    "OrigAssign3" numeric(5,0),
    "InDispute" numeric(5,0),
    "DisputeDate" timestamp without time zone,
    "DeletionDate" timestamp without time zone,
    "EDIPat" character(15),
    "EDIPatStatus" numeric(5,0),
    "InsTransfer1" numeric,
    "InsTransfer2" numeric,
    "InsTransfer3" numeric,
    "InsTransfer" numeric,
    "InsPmtId" numeric(10,0),
    "StationId" numeric(10,0),
    "Practice" numeric(5,0),
    "Suspended" numeric(5,0),
    "DelAppUser" numeric(10,0),
    "DelAppDate" timestamp without time zone,
    "OrthoStatus" numeric(5,0),
    "CvgType" numeric(5,0),
    "ModifiedDate" timestamp without time zone,
    "OrigClaimDate" timestamp without time zone,
    "SubmitMode" numeric(5,0),
    "Custom3" character(6),
    "Custom4" character(6),
    "CorrespondCode" character(7),
    "InsCvgType1" numeric(5,0),
    "InsCvgType2" numeric(5,0),
    "InsCvgType3" numeric(5,0),
    "OrigRecNo" numeric(10,0),
    "EntryUser" numeric(10,0),
    "PlanInProcTotal" numeric,
    "TrxDep" numeric(10,0),
    "CustomaryTotal" numeric,
    "TaxRate" numeric,
    "TaxAmount" numeric,
    "ReportPeriod" character(11),
    "Department" character(6),
    "Producer_TypeCode" character(1),
    "Producer_PGroup" character(6),
    "Producer_Year" numeric(10,0),
    "Patient_CustomCode1" character(6),
    "Patient_CustomCode2" character(6),
    "Patient_CustomCode3" character(6),
    "Patient_CustomCode4" character(6),
    "Patient_CustomCode5" character(6),
    "Patient_CustomCode6" character(6),
    "Patient_CustomCode7" character(6),
    "Patient_CustomCode8" character(6),
    "Patient_CustomCode9" character(6),
    "Patient_CustomCode10" character(6),
    "ReportGroupBy1" numeric,
    "ReportGroupBy1Description" character(23),
    "ReportGroupBy2" numeric,
    "ReportGroupBy2Description" character(23),
    "ReportFromDate" timestamp without time zone,
    "ReportToDate" timestamp without time zone,
    "ReportIsDetailed" numeric,
    "ReportIncludeUnallocated" numeric,
    "ReportHistoryTypeDescription" character(30),
    "ReportTotal" numeric,
    "ReportInsTotal" numeric,
    "ReportPayed" numeric,
    "ReportInsPayed" numeric,
    "ReportPtAdj" numeric,
    "ReportInsAdj" numeric,
    "ReportInsTransfer" numeric,
    "ReportDepartment" character(6),
    "ReportDiscipline" character(15),
    "ReportProcedure" character(7),
    "ReportPractice" numeric(5,0),
    "ReportClaimDoctor" character(10),
    "ReportLocation" character(6),
    "ReportEntryUser" numeric(10,0),
    "ReportAppUser" numeric(10,0),
    "ReportCustom1" character(6),
    "ReportCustom2" character(6),
    "ReportProducer" character(10),
    "ReportTypeCode" character(1),
    "ReportPGroup" character(6),
    "ReportYear" numeric(10,0),
    "ReportCustomCode1" character(6),
    "ReportCustomCode2" character(6),
    "ReportCustomCode3" character(6),
    "ReportCustomCode4" character(6),
    "ReportCustomCode5" character(6),
    "ReportCustomCode6" character(6),
    "ReportCustomCode7" character(6),
    "ReportCustomCode8" character(6),
    "ReportCustomCode9" character(6),
    "ReportCustomCode10" character(6)
);


--
-- Name: history_ar_global_temp4; Type: TABLE; Schema: pgtt_schema; Owner: -
--

CREATE GLOBAL TEMPORARY TABLE  history_ar_global_temp4 (
    "History" numeric(10,0)
);


--
-- Name: global_temp_alloc4_idx1; Type: INDEX; Schema: pgtt_schema; Owner: -
--

CREATE INDEX global_temp_alloc4_idx1 ON global_temp_alloc4 USING btree ("OrigRecNo");


--
-- Name: history_ar_global_temp2_idx1; Type: INDEX; Schema: pgtt_schema; Owner: -
--

CREATE INDEX history_ar_global_temp2_idx1 ON history_ar_global_temp2 USING btree ("History");


--
-- Name: history_ar_global_temp2_idx2; Type: INDEX; Schema: pgtt_schema; Owner: -
--

CREATE INDEX history_ar_global_temp2_idx2 ON history_ar_global_temp2 USING btree ("OrigRecNo", "Family", "History");


--
-- Name: history_ar_global_temp3_idx1; Type: INDEX; Schema: pgtt_schema; Owner: -
--

CREATE INDEX history_ar_global_temp3_idx1 ON history_ar_global_temp3 USING btree ("History");


--
-- Name: history_ar_global_temp3_idx2; Type: INDEX; Schema: pgtt_schema; Owner: -
--

CREATE INDEX history_ar_global_temp3_idx2 ON history_ar_global_temp3 USING btree ("OrigRecNo", "HistoryType", "Type");


--
-- Name: history_ar_global_temp_idx1; Type: INDEX; Schema: pgtt_schema; Owner: -
--

CREATE UNIQUE INDEX history_ar_global_temp_idx1 ON history_ar_global_temp USING btree ("History");


--
-- Name: history_ar_global_temp_idx2; Type: INDEX; Schema: pgtt_schema; Owner: -
--

CREATE UNIQUE INDEX history_ar_global_temp_idx2 ON history_ar_global_temp USING btree ("OrigRecNo", "Family", "History");

