Microsoft SQL Server Script to Create Tables

Header

CREATE TABLE [dbo].[EDI_Claims](

[ID] [bigint] IDENTITY(1,1) NOT NULL,

/*File Level Data*/

[Filename] [varchar](100) NULL,

[Version] [varchar](12) NULL,

[ImageFilePath] [varchar](300) NULL,

[ImageFilename] [varchar](100) NULL,

[TradingPartnerIDType] [char](2) NULL,

[TradingPartnerID] [varchar](15) NOT NULL,

[TransactionDate] [date] NULL,

[ReceiveDate] [date] NULL,

[SubmitterName] [varchar](60) NULL,

[SubmitterID] [varchar](30) NULL,

[SubmitterContact] [varchar](60) NULL,

[SubmitterTel] [varchar](20) NULL,

[SubmitterTelExt] [varchar](10) NULL,

[SubmitterFax] [varchar](20) NULL,

[SubmitterEmail] [varchar](80) NULL,

[ReceiverName] [varchar](60) NULL,

[ReceiverID] [varchar](30) NULL,

[TransactionType] [char](2) NULL,

/*Billing Provider*/

[FedTaxID] [varchar](15) NULL,

[BillProvIDType] [char](2) NULL,

[BillProvID] [varchar](80) NULL,

[BillProvNPI] [varchar](12) NULL,

[BillProvLast] [varchar](60) NULL,

[BillProvFirst] [varchar](35) NULL,

[BillProvMiddle] [varchar](25) NULL,

[BillProvSuffix] [varchar](10) NULL,

[BillProvSpecialty] [varchar](10) NULL,

[BillProvAddress] [varchar](55) NULL,

[BillProvAddress2] [varchar](55) NULL,

[BillProvCity] [varchar](30) NULL,

[BillProvState] [char](2) NULL,

[BillProvZip] [varchar](15) NULL,

[BillProvCountry] [varchar](3) NULL,

[BillProvSubdivision] [varchar](3) NULL,

[BillProvContact] [varchar](60) NULL,

[BillProvTel] [varchar](80) NULL,

[BillProvTelExt] [varchar](80) NULL,

[BillProvFax] [varchar](80) NULL,

[BillProvEmail] [varchar](80) NULL,

[BillProvOtherIDQual1] [char](2) NULL,

[BillProvOtherID1] [varchar](30) NULL,

[BillProvOtherIDQual2] [char](2) NULL,

[BillProvOtherID2] [varchar](30) NULL,

[BillProvOtherIDQual3] [char](2) NULL,

[BillProvOtherID3] [varchar](30) NULL,

[BillProvOtherIDQual4] [char](2) NULL,

[BillProvOtherID4] [varchar](30) NULL,

[BillProvOtherIDQual5] [char](2) NULL,

[BillProvOtherID5] [varchar](30) NULL,

/*Pay-to Provider*/

[PayToProvIDType] [char](2) NULL,

[PayToProvID] [varchar](30) NULL,

[PayToProvTaxID] [varchar](12) NULL,

[PayToProvNPI] [varchar](12) NULL,

[PayToProvLast] [varchar](60) NULL,

[PayToProvFirst] [varchar](35) NULL,

[PayToProvMiddle] [varchar](25) NULL,

[PayToProvSuffix] [varchar](10) NULL,

[PayToProvSpecialty] [varchar](10) NULL,

[PayToProvAddress] [varchar](55) NULL,

[PayToProvAddress2] [varchar](55) NULL,

[PayToProvCity] [varchar](30) NULL,

[PayToProvState] [char](2) NULL,

[PayToProvZip] [varchar](15) NULL,

/*Pay-to Payer*/

[PayToPayerIDType] [char](2) NULL,

[PayToPayerID] [varchar](80) NULL,

[PayToPayerTaxID] [varchar](12) NULL,

[PayToPayerLast] [varchar](60) NULL,

[PayToPayerFirst] [varchar](35) NULL,

[PayToPayerMiddle] [varchar](25) NULL,

[PayToPayerSuffix] [varchar](10) NULL,

[PayToPayerAddress] [varchar](55) NULL,

[PayToPayerAddress2] [varchar](55) NULL,

[PayToPayerCity] [varchar](30) NULL,

[PayToPayerState] [char](2) NULL,

[PayToPayerZip] [varchar](15) NULL,

[PayToPayerOtherIDQual] [char](2) NULL,

[PayToPayerOtherID] [varchar](30) NULL,

/*Subscriber*/

[SubscriberLast] [varchar](60) NULL,

[SubscriberFirst] [varchar](35) NULL,

[SubscriberMiddle] [varchar](25) NULL,

[SubscriberSuffix] [varchar](10) NULL,

[SubscriberIDType] [char](2) NULL,

[SubscriberID] [varchar](30) NULL,

[SubscriberAddress] [varchar](55) NULL,

[SubscriberAddress2] [varchar](55) NULL,

[SubscriberCity] [varchar](30) NULL,

[SubscriberState] [char](2) NULL,

[SubscriberZip] [varchar](15) NULL,

[SubscriberCountry] [varchar](3) NULL,

[SubscriberLocation] [varchar](30) NULL,

[SubscriberSubdivision] [varchar](3) NULL,

[SubscriberDOB] [varchar](10) NULL,

[SubscriberSex] [char](1) NULL,

[SubscriberEthnicity] [varchar](75) NULL,

[SubscriberMaritalStatus] [char](1) NULL,

[SubscriberCollectionMethod] [varchar](30) NULL,

[SubscriberSSN] [varchar](12) NULL,

[SubscriberAgencyClaimNo] [varchar](50) NULL,

[SubscriberMemberID] [varchar](50) NULL,

[SubscriberPersonalID] [varchar](50) NULL,

[SubscriberContact] [varchar](60) NULL,

[SubscriberTel] [varchar](15) NULL,

[SubscriberTelExt] [varchar](10) NULL,

/*Destination Payer*/

[PayerName] [varchar](60) NULL,

[PayerIDType] [char](2) NULL,

[PayerID] [varchar](30) NULL,

[PayerAddress] [varchar](55) NULL,

[PayerAddress2] [varchar](55) NULL,

[PayerCity] [varchar](30) NULL,

[PayerState] [char](2) NULL,

[PayerZip] [varchar](15) NULL,

[PayerResponsibility] [char](1) NULL,

[PayerOtherIDQual1] [char](2) NULL,

[PayerOtherID1] [varchar](30) NULL,

[PayerOtherIDQual2] [char](2) NULL,

[PayerOtherID2] [varchar](30) NULL,

[PayerOtherIDQual3] [char](2) NULL,

[PayerOtherID3] [varchar](30) NULL,

[GroupNo] [varchar](50) NULL,

[GroupName] [varchar](60) NULL,

[InsuranceType] [char](2) NULL,

[FilingIndicator] [char](2) NULL,

[COBIndicator] [char](1) NULL,

/*Responsible*/

[ResponsibleLast] [varchar](60) NULL,

[ResponsibleFirst] [varchar](35) NULL,

[ResponsibleMiddle] [varchar](25) NULL,

[ResponsibleSuffix] [varchar](10) NULL,

[ResponsibleAddress] [varchar](55) NULL,

[ResponsibleAddress2] [varchar](55) NULL,

[ResponsibleCity] [varchar](30) NULL,

[ResponsibleState] [char](2) NULL,

[ResponsibleZip] [varchar](15) NULL,

[ResponsibleIDType] [char](2) NULL,

[ResponsibleID] [varchar](80) NULL,

/*Patient*/

[PatientLast] [varchar](60) NULL,

[PatientFirst] [varchar](35) NULL,

[PatientMiddle] [varchar](25) NULL,

[PatientSuffix] [varchar](10) NULL,

[PatientAddress] [varchar](55) NULL,

[PatientAddress2] [varchar](55) NULL,

[PatientCity] [varchar](30) NULL,

[PatientState] [char](2) NULL,

[PatientZip] [varchar](15) NULL,

[PatientCountry] [varchar](3) NULL,

[PatientLocation] [varchar](30) NULL,

[PatientSubdivision] [varchar](3) NULL,

[PatientIDType] [char](2) NULL,

[PatientID] [varchar](30) NULL,

[PatientSSN] [varchar](12) NULL,

[PatientMemberID] [varchar](50) NULL,

[PatientPersonalID] [varchar](50) NULL,

[PatientInsurancePolicy] [varchar](50) NULL,

[PatientDOB] [varchar](50) NULL,

[PatientSex] [char](1) NULL,

[PatientEthnicity] [varchar](75) NULL,

[PatientMaritalStatus] [char](1) NULL,

[PatientCollectionMethod] [varchar](30) NULL,

[PatientRelationship] [char](2) NULL,

[PatientPaid] [varchar](10) NULL,

[PregnancyIndicator] [char](1) NULL,

/*Rendering Provider*/

[RendProvIDType] [char](2) NULL,

[RendProvID] [varchar](30) NULL,

[RendProvNPI] [varchar](12) NULL,

[RendProvTaxID] [varchar](12) NULL,

[RendProvLast] [varchar](60) NULL,

[RendProvFirst] [varchar](35) NULL,

[RendProvMiddle] [varchar](25) NULL,

[RendProvSuffix] [varchar](10) NULL,

[RendProvSpecialty] [varchar](10) NULL,

[RendProvOtherIDQual1] [char](2) NULL,

[RendProvOtherID1] [varchar](30) NULL,

[RendProvOtherIDQual2] [char](2) NULL,

[RendProvOtherID2] [varchar](30) NULL,

[RendProvOtherIDQual3] [char](2) NULL,

[RendProvOtherID3] [varchar](30) NULL,

/*Attending Provider*/

[AttendProvLast] [varchar](60) NULL,

[AttendProvFirst] [varchar](35) NULL,

[AttendProvMiddle] [varchar](25) NULL,

[AttendProvSuffix] [varchar](10) NULL,

[AttendProvIDType] [char](2) NULL,

[AttendProvID] [varchar](30) NULL,

[AttendProvTaxID] [varchar](12) NULL,

[AttendProvNPI] [varchar](12) NULL,

[AttendProvOtherIDQual1] [char](2) NULL,

[AttendProvOtherID1] [varchar](30) NULL,

[AttendProvSpecialty] [varchar](10) NULL,

/*Operating Provider*/

[OperatingProvLast] [varchar](60) NULL,

[OperatingProvFirst] [varchar](35) NULL,

[OperatingProvMiddle] [varchar](25) NULL,

[OperatingProvSuffix] [varchar](10) NULL,

[OperatingProvIDType] [char](2) NULL,

[OperatingProvID] [varchar](30) NULL,

[OperatingProvNPI] [varchar](12) NULL,

[OperatingProvTaxID] [varchar](12) NULL,

[OperatingProvOtherIDQual1] [char](2) NULL,

[OperatingProvOtherID1] [varchar](30) NULL,

[OperatingProvSpecialty] [varchar](10) NULL,

/*Other Provider*/

[OtherProvLast] [varchar](60) NULL,

[OtherProvFirst] [varchar](35) NULL,

[OtherProvMiddle] [varchar](25) NULL,

[OtherProvSuffix] [varchar](10) NULL,

[OtherProvIDType] [char](2) NULL,

[OtherProvID] [varchar](30) NULL,

[OtherProvTaxID] [varchar](12) NULL,

[OtherProvNPI] [varchar](12) NULL,

[OtherProvOtherIDQual1] [char](2) NULL,

[OtherProvOtherID1] [varchar](30) NULL,

[OtherProvSpecialty] [varchar](50) NULL,

/*Facility*/

[FacilityType] [char](2) NULL,

[FacilityIDType] [char](2) NULL,

[FacilityID] [varchar](80) NULL,

[FacilityNPI] [varchar](12) NULL,

[FacilityTaxID] [varchar](12) NULL,

[FacilityOtherIDQual1] [char](2) NULL,

[FacilityOtherID1] [varchar](30) NULL,

[FacilityName] [varchar](80) NULL,

[FacilityAddress] [varchar](55) NULL,

[FacilityAddress2] [varchar](55) NULL,

[FacilityCity] [varchar](30) NULL,

[FacilitySpecialty] [varchar](50) NULL,

[FacilityState] [char](2) NULL,

[FacilityZip] [varchar](15) NULL,

/*Referring Provider*/

[RefProvLast] [varchar](60) NULL,

[RefProvFirst] [varchar](35) NULL,

[RefProvMiddle] [varchar](25) NULL,

[RefProvSuffix] [varchar](10) NULL,

[RefProvIDType] [char](2) NULL,

[RefProvID] [varchar](80) NULL,

[RefProvTaxID] [varchar](12) NULL,

[RefProvNPI] [varchar](12) NULL,

[RefProvOtherIDQual1] [char](2) NULL,

[RefProvOtherID1] [varchar](300) NULL,

[RefProvSpecialty] [varchar](20) NULL,

/*Supervising Provider*/

[SupervProvLast] [varchar](60) NULL,

[SupervProvFirst] [varchar](35) NULL,

[SupervProvMiddle] [varchar](25) NULL,

[SupervProvSuffix] [varchar](10) NULL,

[SupervProvIDType] [char](2) NULL,

[SupervProvID] [varchar](30) NULL,

[SupervProvTaxID] [varchar](12) NULL,

[SupervProvNPI] [varchar](12) NULL,

[SupervProvOtherIDQual1] [char](2) NULL,

[SupervProvOtherID1] [varchar](50) NULL,

[SupervProvSpecialty] [varchar](20) NULL,

/*Assistant Surgeon*/

[AssistSurgLast] [varchar](60) NULL,

[AssistSurgFirst] [varchar](35) NULL,

[AssistSurgMiddle] [varchar](25) NULL,

[AssistSurgSuffix] [varchar](10) NULL,

[AssistSurgIDType] [char](2) NULL,

[AssistSurgID] [varchar](30) NULL,

[AssistSurgTaxID] [varchar](12) NULL,

[AssistSurgNPI] [varchar](12) NULL,

[AssistSurgOtherIDQual1] [varchar](3) NULL,

[AssistSurgOtherID1] [varchar](50) NULL,

[AssistSurgSpecialty] [varchar](10) NULL,

/*Ambulance Pick-up Location*/

[PickUpAddress] [varchar](55) NULL,

[PickUpAddress2] [varchar](55) NULL,

[PickUpCity] [varchar](30) NULL,

[PickUpState] [char](2) NULL,

[PickUpZip] [varchar](15) NULL,

/*Ambulance Drop-off Location*/

[DropOffName] [varchar](80) NULL,

[DropOffAddress] [varchar](55) NULL,

[DropOffAddress2] [varchar](55) NULL,

[DropOffCity] [varchar](30) NULL,

[DropOffState] [char](2) NULL,

[DropOffZip] [varchar](15) NULL,

/*COB Payer 1*/

[OtherInsuredLast] [varchar](60) NULL,

[OtherInsuredFirst] [varchar](35) NULL,

[OtherInsuredMiddle] [varchar](25) NULL,

[OtherInsuredSuffix] [varchar](10) NULL,

[OtherInsuredIDQual] [char](2) NULL,

[OtherInsuredID] [varchar](30) NULL,

[OtherInsuredAddress] [varchar](55) NULL,

[OtherInsuredAddress2] [varchar](55) NULL,

[OtherInsuredCity] [varchar](30) NULL,

[OtherInsuredState] [char](2) NULL,

[OtherInsuredZip] [varchar](15) NULL,

[OtherInsuredCountry] [varchar](3) NULL,

[OtherInsuredSubdivision] [varchar](3) NULL,

[OtherInsuredPolicy] [varchar](50) NULL,

[OtherInsuredDOB] [varchar](10) NULL,

[OtherInsuredSex] [char](1) NULL,

[OtherInsuredRelationship] [char](2) NULL,

[OtherInsuredOtherIDQual1] [char](3) NULL,

[OtherInsuredOtherID1] [varchar](50) NULL,

[OtherInsuredOtherIDQual2] [char](3) NULL,

[OtherInsuredOtherID2] [varchar](50) NULL,

[OtherInsuredOtherIDQual3] [char](3) NULL,

[OtherInsuredOtherID3] [varchar](50) NULL,

[OtherPayerResponsibility] [char](1) NULL,

[OtherPayerName] [varchar](35) NULL,

[OtherPayerIDQual] [char](2) NULL,

[OtherPayerID] [varchar](30) NULL,

[OtherPayerAddress1] [varchar](55) NULL,

[OtherPayerAddress2] [varchar](55) NULL,

[OtherPayerCity] [varchar](30) NULL,

[OtherPayerState] [char](2) NULL,

[OtherPayerZip] [varchar](15) NULL,

[OtherPayerPaid] [varchar](10) NULL,

[OtherPayerGroupName] [varchar](60) NULL,

[OtherPayerGroupNo] [varchar](50) NULL,

[OtherPayerInsuranceType] [char](2) NULL,

[OtherPayerFilingIndicator] [char](2) NULL,

[OtherPayerAdjustmentReasonGroup] [varchar](20) NULL,

[OtherPayerAdjustmentReason] [varchar](50) NULL,

[OtherPayerAdjustmentAmount] [varchar](120) NULL,

[OtherPayerPaidDate] [date] NULL,

[OtherPayerInfoRelease] [char](1) NULL,

[OtherPayerBenefitAssign] [char](1) NULL,

[OtherPayerDocControlNo] [varchar](50) NULL,

[OtherPayerPriorAuth] [varchar](50) NULL,

[OtherPayerOtherIDQual1] [char](3) NULL,

[OtherPayerOtherID1] [varchar](50) NULL,

[OtherPayerOtherIDQual2] [char](3) NULL,

[OtherPayerOtherID2] [varchar](50) NULL,

/*COB Payer 2*/

[OtherInsured2Last] [varchar](60) NULL,

[OtherInsured2First] [varchar](35) NULL,

[OtherInsured2Middle] [varchar](25) NULL,

[OtherInsured2Suffix] [varchar](10) NULL,

[OtherInsured2IDQual] [char](2) NULL,

[OtherInsured2ID] [varchar](30) NULL,

[OtherInsured2Address] [varchar](55) NULL,

[OtherInsured2Address2] [varchar](55) NULL,

[OtherInsured2City] [varchar](30) NULL,

[OtherInsured2State] [char](2) NULL,

[OtherInsured2Zip] [varchar](15) NULL,

[OtherInsured2Country] [varchar](3) NULL,

[OtherInsured2Subdivision] [varchar](3) NULL,

[OtherInsured2Policy] [varchar](50) NULL,

[OtherInsured2DOB] [varchar](10) NULL,

[OtherInsured2Sex] [char](1) NULL,

[OtherInsured2Relationship] [char](2) NULL,

[OtherInsured2OtherIDQual1] [char](3) NULL,

[OtherInsured2OtherID1] [varchar](50) NULL,

[OtherInsured2OtherIDQual2] [char](3) NULL,

[OtherInsured2OtherID2] [varchar](50) NULL,

[OtherInsured2OtherIDQual3] [char](3) NULL,

[OtherInsured2OtherID3] [varchar](50) NULL,

[OtherPayer2Responsibility] [char](1) NULL,

[OtherPayer2Name] [varchar](35) NULL,

[OtherPayer2IDQual] [char](2) NULL,

[OtherPayer2ID] [varchar](80) NULL,

[OtherPayer2Address1] [varchar](55) NULL,

[OtherPayer2Address2] [varchar](55) NULL,

[OtherPayer2City] [varchar](30) NULL,

[OtherPayer2State] [char](2) NULL,

[OtherPayer2Zip] [varchar](15) NULL,

[OtherPayer2Paid] [varchar](10) NULL,

[OtherPayer2GroupName] [varchar](60) NULL,

[OtherPayer2GroupNo] [varchar](50) NULL,

[OtherPayer2InsuranceType] [char](2) NULL,

[OtherPayer2FilingIndicator] [char](2) NULL,

[OtherPayer2AdjustmentReasonGroup] [char](20) NULL,

[OtherPayer2AdjustmentReason] [varchar](50) NULL,

[OtherPayer2AdjustmentAmount] [varchar](120) NULL,

[OtherPayer2PaidDate] [date] NULL,

[OtherPayer2InfoRelease] [char](1) NULL,

[OtherPayer2BenefitAssign] [char](1) NULL,

[OtherPayer2DocControlNo] [varchar](50) NULL,

[OtherPayer2PriorAuth] [varchar](50) NULL,

[OtherPayer2OtherIDQual1] [char](3) NULL,

[OtherPayer2OtherID1] [varchar](50) NULL,

[OtherPayer2OtherIDQual2] [char](3) NULL,

[OtherPayer2OtherID2] [varchar](50) NULL,

/*Claim Data*/

[ClaimNo] [varchar](50) NOT NULL,

[Amount] [money] NULL,

[EstimatedAmountDue] [money] NULL,

[PatientEstimatedAmountDue] [money] NULL,

[PlaceOfService] [char](2) NULL,

[ClaimFrequency] [char](1) NULL,

[SubmitReason] [char](1) NULL,

[ProviderSignature] [char](1) NULL,

[ProviderAcceptsAssignment] [char](1) NULL,

[BenefitAssignment] [char](1) NULL,

[InfoReleaseCode] [char](1) NULL,

[PatientSignatureCode] [char](1) NULL,

[RelatedCauses] [char](2) NULL,

[RelatedCauses2] [char](2) NULL,

[RelatedCausesState] [char](2) NULL,

[SpecialProgramCode] [char](3) NULL,

[ProviderParticipation] [char](1) NULL,

[EOBIndicator] [char](1) NULL,

[DelayReasonCode] [char](2) NULL,

[ServiceDateFrom] [date] NULL,

[ServiceDateTo] [date] NULL,

[OnsetDate] [date] NULL,

[SimilarSymptomsDate] [date] NULL,

[DisabilityBegin] [date] NULL,

[DisabilityEnd] [date] NULL,

[HospitalizationBegin] [date] NULL,

[HospitalizationEnd] [date] NULL,

[AccidentDate] [date] NULL,

[LastMenstrualPeriod] [date] NULL,

[RepricerReceivedDate] [date] NULL,

[AdmissionDate] [date] NULL,

[AdmissionHour] [time](7) NULL,

[AdmissionType] [char](1) NULL,

[AdmissionSource] [char](1) NULL,

[DischargeHour] [time](7) NULL,

[PatientStatus] [char](2) NULL,

[CoveredDays] [varchar](4) NULL,

[NonCoveredDays] [varchar](4) NULL,

[COBDays] [varchar](4) NULL,

[LifeTimeReserveDays] [varchar](4) NULL,

[PriorAuthorization] [varchar](50) NULL,

[ClearingHouseID] [varchar](50) NULL,

[MedicalRecordNumber] [varchar](50) NULL,

[MothersMedicalRecordNumber] [varchar](50) NULL,

[ServiceAuthorizationException] [varchar](50) NULL,

[ReferralNumber] [varchar](50) NULL,

[PayerClaimControlNumber] [varchar](50) NULL,

[AdjustedRepricedClaimNumber] [varchar](50) NULL,

[AutoAccidentState] [varchar](50) NULL,

[OrigRefNo] [varchar](50) NULL,

[ClaimType] [char](1) NULL,

[TypeOfBill] [varchar](20) NULL,

[Remark1] [varchar](90) NULL,

[Remark2] [varchar](90) NULL,

[Remark3] [varchar](90) NULL,

[Remark4] [varchar](90) NULL,

[K3_1] [varchar](80) NULL,

[K3_2] [varchar](80) NULL,

[K3_3] [varchar](80) NULL,

[K3_4] [varchar](80) NULL,

[K3_5] [varchar](80) NULL,

[K3_6] [varchar](80) NULL,

[K3_7] [varchar](80) NULL,

[K3_8] [varchar](80) NULL,

[K3_9] [varchar](80) NULL,

[K3_10] [varchar](80) NULL,

[OutsideLab] [char](1) NULL,

[LabCharge] [varchar](10) NULL,

[Test_Prod] [char](1) NULL,

[ReportTypeCode1] [char](2) NULL,

[ReportTransmissionCode1] [varchar](2) NULL,

[AttachmentControlNumber1] [varchar](80) NULL,

/*Dental Claims*/

[Predetermination] [char](2) NULL,

[OrthodonticTotal] [varchar](5) NULL,

[OrthodonticRemaining] [varchar](5) NULL,

[OrthodonticYesNo] [char](1) NULL,

[ToothStatus] [varchar](100) NULL,

[AppliancePlacementDate] [date] NULL,

/*Diagnosis Information*/

[AdmitDiagnosis] [varchar](10) NULL,

[ECode] [varchar](30) NULL,

[ECode2] [varchar](30) NULL,

[ECode3] [varchar](30) NULL,

[ECode4] [varchar](30) NULL,

[ECode5] [varchar](30) NULL,

[ECode6] [varchar](30) NULL,

[ECode7] [varchar](30) NULL,

[ECode8] [varchar](30) NULL,

--[ECode9] [varchar](30) NULL,

--[ECode10] [varchar](30) NULL,

--[ECode11] [varchar](30) NULL,

--[ECode12] [varchar](30) NULL,

[ReasonForVisit] [varchar](30) NULL,

[ReasonForVisit2] [varchar](30) NULL,

[ReasonForVisit3] [varchar](30) NULL,

[PrincipalDiagnosis] [varchar](10) NULL,

[Diag2] [varchar](10) NULL,

[Diag3] [varchar](10) NULL,

[Diag4] [varchar](10) NULL,

[Diag5] [varchar](10) NULL,

[Diag6] [varchar](10) NULL,

[Diag7] [varchar](10) NULL,

[Diag8] [varchar](10) NULL,

[Diag9] [varchar](10) NULL,

[Diag10] [varchar](10) NULL,

[Diag11] [varchar](10) NULL,

[Diag12] [varchar](10) NULL,

[Diag13] [varchar](10) NULL,

[Diag14] [varchar](10) NULL,

[Diag15] [varchar](10) NULL,

[Diag16] [varchar](10) NULL,

[Diag17] [varchar](10) NULL,

[Diag18] [varchar](10) NULL,

[Diag19] [varchar](10) NULL,

[Diag20] [varchar](10) NULL,

[Diag21] [varchar](10) NULL,

[Diag22] [varchar](10) NULL,

[Diag23] [varchar](10) NULL,

[Diag24] [varchar](10) NULL,

[Diag25] [varchar](10) NULL,

[DRG] [varchar](15) NULL,

/*Procedure Information*/

[PrincipalProcedure] [varchar](10) NULL,

[PrincipalProcedureDate] [datetime2](0) NULL,

[Proc2] [varchar](50) NULL,

[Proc2Date] [datetime2](0) NULL,

[Proc3] [varchar](10) NULL,

[Proc3Date] [datetime2](0) NULL,

[Proc4] [varchar](10) NULL,

[Proc4Date] [datetime2](0) NULL,

[Proc5] [varchar](10) NULL,

[Proc5Date] [datetime2](0) NULL,

[Proc6] [varchar](10) NULL,

[Proc6Date] [datetime2](0) NULL,

[Proc7] [varchar](10) NULL,

[Proc7Date] [datetime2](0) NULL,

[Proc8] [varchar](10) NULL,

[Proc8Date] [datetime2](0) NULL,

[Proc9] [varchar](10) NULL,

[Proc9Date] [datetime2](0) NULL,

[Proc10] [varchar](10) NULL,

[Proc10Date] [datetime2](0) NULL,

[Proc11] [varchar](10) NULL,

[Proc11Date] [datetime2](0) NULL,

[Proc12] [varchar](10) NULL,

[Proc12Date] [datetime2](0) NULL,

[Proc13] [varchar](10) NULL,

[Proc13Date] [datetime2](0) NULL,

[Proc14] [varchar](10) NULL,

[Proc14Date] [datetime2](0) NULL,

[Proc15] [varchar](10) NULL,

[Proc15Date] [datetime2](0) NULL,

[Proc16] [varchar](10) NULL,

[Proc16Date] [datetime2](0) NULL,

[Proc17] [varchar](10) NULL,

[Proc17Date] [datetime2](0) NULL,

[Proc18] [varchar](10) NULL,

[Proc18Date] [datetime2](0) NULL,

[Proc19] [varchar](10) NULL,

[Proc19Date] [datetime2](0) NULL,

[Proc20] [varchar](10) NULL,

[Proc20Date] [datetime2](0) NULL,

[Proc21] [varchar](10) NULL,

[Proc21Date] [datetime2](0) NULL,

[Proc22] [varchar](10) NULL,

[Proc22Date] [datetime2](0) NULL,

[Proc23] [varchar](10) NULL,

[Proc23Date] [datetime2](0) NULL,

[Proc24] [varchar](10) NULL,

[Proc24Date] [datetime2](0) NULL,

[Proc25] [varchar](10) NULL,

[Proc25Date] [datetime2](0) NULL,

/*Value Codes*/

[ValueCode1] [char](3) NULL,

[ValueAmount1] [varchar](10) NULL,

[ValueCode2] [char](3) NULL,

[ValueAmount2] [varchar](10) NULL,

[ValueCode3] [char](3) NULL,

[ValueAmount3] [varchar](10) NULL,

[ValueCode4] [char](3) NULL,

[ValueAmount4] [varchar](10) NULL,

[ValueCode5] [char](3) NULL,

[ValueAmount5] [varchar](10) NULL,

[ValueCode6] [char](3) NULL,

[ValueAmount6] [varchar](10) NULL,

[ValueCode7] [varchar](10) NULL,

[ValueAmount7] [varchar](10) NULL,

[ValueCode8] [char](3) NULL,

[ValueAmount8] [varchar](10) NULL,

[ValueCode9] [char](3) NULL,

[ValueAmount9] [varchar](10) NULL,

[ValueCode10] [char](3) NULL,

[ValueAmount10] [varchar](10) NULL,

[ValueCode11] [char](3) NULL,

[ValueAmount11] [varchar](10) NULL,

[ValueCode12] [char](3) NULL,

[ValueAmount12] [varchar](10) NULL,

--[ValueCode13] [char](3) NULL,

--[ValueAmount13] [varchar](10) NULL,

--[ValueCode14] [char](3) NULL,

--[ValueAmount14] [varchar](10) NULL,

--[ValueCode15] [char](3) NULL,

--[ValueAmount15] [varchar](10) NULL,

--[ValueCode16] [char](3) NULL,

--[ValueAmount16] [varchar](10) NULL,

--[ValueCode17] [char](3) NULL,

--[ValueAmount17] [varchar](10) NULL,

--[ValueCode18] [char](3) NULL,

--[ValueAmount18] [varchar](10) NULL,

--[ValueCode19] [char](3) NULL,

--[ValueAmount19] [varchar](10) NULL,

--[ValueCode20] [char](3) NULL,

--[ValueAmount20] [varchar](10) NULL,

--[ValueCode21] [char](3) NULL,

--[ValueAmount21] [varchar](10) NULL,

--[ValueCode22] [char](3) NULL,

--[ValueAmount22] [varchar](10) NULL,

--[ValueCode23] [char](3) NULL,

--[ValueAmount23] [varchar](10) NULL,

--[ValueCode24] [char](3) NULL,

--[ValueAmount24] [varchar](10) NULL,

/*Condition Codes*/

[ConditionCode1] [varchar](30) NULL,

[ConditionCode2] [varchar](30) NULL,

[ConditionCode3] [varchar](30) NULL,

[ConditionCode4] [varchar](30) NULL,

[ConditionCode5] [varchar](30) NULL,

[ConditionCode6] [varchar](30) NULL,

[ConditionCode7] [varchar](30) NULL,

[ConditionCode8] [varchar](30) NULL,

[ConditionCode9] [varchar](30) NULL,

[ConditionCode10] [varchar](30) NULL,

--[ConditionCode11] [varchar](30) NULL,

--[ConditionCode12] [varchar](30) NULL,

--[ConditionCode13] [varchar](30) NULL,

--[ConditionCode14] [varchar](30) NULL,

--[ConditionCode15] [varchar](30) NULL,

--[ConditionCode16] [varchar](30) NULL,

--[ConditionCode17] [varchar](30) NULL,

--[ConditionCode18] [varchar](30) NULL,

--[ConditionCode19] [varchar](30) NULL,

--[ConditionCode20] [varchar](30) NULL,

--[ConditionCode21] [varchar](30) NULL,

--[ConditionCode22] [varchar](30) NULL,

--[ConditionCode23] [varchar](30) NULL,

--[ConditionCode24] [varchar](30) NULL,

/*Occurrence Codes*/

[OccurranceCode1] [char](3) NULL,

[OccurranceDate1] [date] NULL,

[OccurranceCode2] [char](3) NULL,

[OccurranceDate2] [date] NULL,

[OccurranceCode3] [char](3) NULL,

[OccurranceDate3] [date] NULL,

[OccurranceCode4] [char](3) NULL,

[OccurranceDate4] [date] NULL,

[OccurranceCode5] [char](3) NULL,

[OccurranceDate5] [date] NULL,

[OccurranceCode6] [char](3) NULL,

[OccurranceDate6] [date] NULL,

[OccurranceCode7] [char](3) NULL,

[OccurranceDate7] [date] NULL,

[OccurranceCode8] [char](3) NULL,

[OccurranceDate8] [date] NULL,

--[OccurranceCode9] [char](3) NULL,

--[OccurranceDate9] [date] NULL,

--[OccurranceCode10] [char](3) NULL,

--[OccurranceDate10] [date] NULL,

--[OccurranceCode11] [char](3) NULL,

--[OccurranceDate11] [date] NULL,

--[OccurranceCode12] [char](3) NULL,

--[OccurranceDate12] [date] NULL,

--[OccurranceCode13] [char](3) NULL,

--[OccurranceDate13] [date] NULL,

--[OccurranceCode14] [char](3) NULL,

--[OccurranceDate14] [date] NULL,

--[OccurranceCode15] [char](3) NULL,

--[OccurranceDate15] [date] NULL,

--[OccurranceCode16] [char](3) NULL,

--[OccurranceDate16] [date] NULL,

--[OccurranceCode17] [char](3) NULL,

--[OccurranceDate17] [date] NULL,

--[OccurranceCode18] [char](3) NULL,

--[OccurranceDate18] [date] NULL,

--[OccurranceCode19] [char](3) NULL,

--[OccurranceDate19] [date] NULL,

--[OccurranceCode20] [char](3) NULL,

--[OccurranceDate20] [date] NULL,

--[OccurranceCode21] [char](3) NULL,

--[OccurranceDate21] [date] NULL,

--[OccurranceCode22] [char](3) NULL,

--[OccurranceDate22] [date] NULL,

--[OccurranceCode23] [char](3) NULL,

--[OccurranceDate23] [date] NULL,

--[OccurranceCode24] [char](3) NULL,

--[OccurranceDate24] [date] NULL,

[OccurranceSpanCode1] [char](3) NULL,

[OccurranceSpanFrom1] [date] NULL,

[OccurranceSpanTo1] [date] NULL,

[OccurranceSpanCode2] [char](3) NULL,

[OccurranceSpanFrom2] [date] NULL,

[OccurranceSpanTo2] [date] NULL,

[OccurranceSpanCode3] [char](3) NULL,

[OccurranceSpanFrom3] [date] NULL,

[OccurranceSpanTo3] [date] NULL,

[OccurranceSpanCode4] [char](3) NULL,

[OccurranceSpanFrom4] [date] NULL,

[OccurranceSpanTo4] [date] NULL,

/*CR1*/

[PatientWeight] [varchar](10) NULL,

[AmbulanceTransportCode] [char](1) NULL,

[AmbulanceTransportReasonCode] [char](1) NULL,

[TransportDistance] [varchar](15) NULL,

[RoundTripPurposeDescription] [varchar](80) NULL,

[StretcherPurposeDescription] [varchar](80) NULL,

/* CRC — Ambulance Certification */

[AmbulanceConditionIndicator] [char](1) NULL,

[AmbulanceConditionCode1] [char](3) NULL,

[AmbulanceConditionCode2] [char](3) NULL,

[AmbulanceConditionCode3] [char](3) NULL,

[AmbulanceConditionCode4] [char](3) NULL,

[AmbulanceConditionCode5] [char](3) NULL,

/*Repricing*/

[RepricedClaimNumber] [varchar](50) NULL,

[RepricingMethodology] [varchar](3) NULL,

[RepricedAmount] [money] NULL,

[SavingsAmount] [money] NULL,

[RepricerID] [varchar](30) NULL,

[RepricingRate] [varchar](9) NULL,

[APG_Code] [varchar](30) NULL,

[APG_Amount] [money] NULL,

[ApprovedRevenueCode] [varchar] (48) NULL,

[ApprovedProcedureCode] [varchar] (48) NULL,

[ApprovedUnitCode] [char](2) NULL,

[ApprovedUnits] [bigint] NULL,

[RejectReason] [varchar](3) NULL,

[ComplianceCode] [varchar](2) NULL,

[ExceptionCode] [varchar](2) NULL

/*SQL To EDI*/

--,[ClaimAction] [char](1) NULL,

--[ErrorMessage] [varchar](1000) NULL

) ON [PRIMARY]

Detail
CREATE TABLE [dbo].[edi_ClaimDetail](

[ID] [bigint] IDENTITY(1,1) NOT NULL,

[ClaimID] [bigint] NOT NULL,

[LineNumber] [decimal](18, 0) NULL,

[LineID] [varchar](50) NULL,

[ServiceDateFrom] [datetime2](0) NULL,

[ServiceDateTo] [date] NULL,

[AssessmentDate] [date] NULL,

[FacilityCode] [char](2) NULL,

[RevenueCode] [varchar](48) NULL,

[ProcedureCode] [varchar](48) NULL,

[Amount] [money] NULL,

[Unit] [char](2) NULL,

[Quantity] [float] NULL,

[UnitRate] [money] NULL,

[NonCovered] [money] NULL,

[Paid] [money] NULL,

[PlaceOfService] [char](3) NULL,

[Modifier1] [char](3) NULL,

[Modifier2] [char](3) NULL,

[Modifier3] [char](3) NULL,

[Modifier4] [char](3) NULL,

[ProcedureDescription] [varchar](80) NULL,

[OralCavityDesignation1] [char](3) NULL,

[OralCavityDesignation2] [char](3) NULL,

[OralCavityDesignation3] [char](3) NULL,

[OralCavityDesignation4] [char](3) NULL,

[OralCavityDesignation5] [char](3) NULL,

[DiagPointer1] [char](1) NULL,

[DiagPointer2] [char](1) NULL,

[DiagPointer3] [char](1) NULL,

[DiagPointer4] [char](1) NULL,

[ToothNumber] [char](2) NULL,

[Surface] [varchar](10) NULL,

[EmergencyIndicator] [char](1) NULL,

[ServiceTax] [money] NULL,

[FacilityTax] [money] NULL,

[SalesTax] [money] NULL,

[ApprovedAmount] [money] NULL,

[LineK3_01] [varchar](80) NULL,

[LineK3_02] [varchar](80) NULL,

[LineK3_03] [varchar](80) NULL,

[LineK3_04] [varchar](80) NULL,

[LineK3_05] [varchar](80) NULL,

[LineK3_06] [varchar](80) NULL,

[LineK3_07] [varchar](80) NULL,

[LineK3_08] [varchar](80) NULL,

[LineK3_09] [varchar](80) NULL,

[LineK3_10] [varchar](80) NULL,

[Remark] [varchar](100) NULL,

[AmbulancePatientCount] [bigint] NULL,

/****PWK****/

[ReportType] [char](2) NULL,

[ReportTransmission] [char](2) NULL,

[AttachmentControlNumber] [varchar](80) NULL,

/*HCP*/

[RepricingMethodology] [varchar](3) NULL,

[RepricedAmount] [money] NULL,

[SavingsAmount] [money] NULL,

[RepricerID] [varchar](30) NULL,

[RepricingRate] [varchar](9) NULL,

[APG_Code] [varchar](30) NULL,

[APG_Amount] [money] NULL,

[ApprovedRevenueCode] [varchar] (48) NULL,

[ApprovedProcedureCode] [varchar] (48) NULL,

[ApprovedUnitCode] [char](2) NULL,

[ApprovedUnits] [bigint] NULL,

[RejectReason] [varchar](3) NULL,

[ComplianceCode] [varchar](2) NULL,

[ExceptionCode] [varchar](2) NULL,

/* Drugs */

[DrugCode] [varchar](48) NULL,

[DrugUnitPrice] [money] NULL,

[DrugUnitCode] [char](2) NULL,

[DrugUnits] [float] NULL,

[PrescriptionNumber] [varchar](30) NULL,

/* CR1 */

[PatientWeight] [varchar](10) NULL,

[AmbulanceTransportCode] [char](1) NULL,

[AmbulanceTransportReasonCode] [char](1) NULL,

[TransportDistance] [varchar](15) NULL,

[RoundTripPurposeDescription] [varchar](80) NULL,

[StretcherPurposeDescription] [varchar](80) NULL,

/* CRC — Ambulance Certification */

[AmbulanceConditionIndicator] [char](1) NULL,

[AmbulanceConditionCode1] [char](3) NULL,

[AmbulanceConditionCode2] [char](3) NULL,

[AmbulanceConditionCode3] [char](3) NULL,

[AmbulanceConditionCode4] [char](3) NULL,

[AmbulanceConditionCode5] [char](3) NULL,

/* Attending Provider */

[AttendingProviderLast] [varchar](35) NULL,

[AttendingProviderFirst] [varchar](25) NULL,

[AttendingProviderMiddle] [varchar](25) NULL,

[AttendingProviderSuffix] [varchar](10) NULL,

[AttendingProviderIDQual] [char](2) NULL,

[AttendingProviderID] [varchar](35) NULL,

[AttendingProviderOtherIDQual] [char](2) NULL,

[AttendingProviderOtherID] [varchar](30) NULL,

/* Operating Provider */

[OperatingProviderLast] [varchar](35) NULL,

[OperatingProviderFirst] [varchar](25) NULL,

[OperatingProviderMiddle] [varchar](25) NULL,

[OperatingProviderSuffix] [varchar](10) NULL,

[OperatingProviderIDQual] [char](2) NULL,

[OperatingProviderID] [varchar](35) NULL,

[OperatingProviderOtherIDQual] [char](2) NULL,

[OperatingProviderOtherID] [varchar](30) NULL,

/* Other Provider */

[OtherProviderLast] [varchar](35) NULL,

[OtherProviderFirst] [varchar](25) NULL,

[OtherProviderMiddle] [varchar](25) NULL,

[OtherProviderSuffix] [varchar](10) NULL,

[OtherProviderIDQual] [char](2) NULL,

[OtherProviderID] [varchar](35) NULL,

[OtherProviderOtherIDQual] [char](2) NULL,

[OtherProviderOtherID] [varchar](30) NULL,

/* Rendering Provider */

[RenderingProviderLast] [varchar](35) NULL,

[RenderingProviderFirst] [varchar](25) NULL,

[RenderingProviderMiddle] [varchar](25) NULL,

[RenderingProviderSuffix] [varchar](10) NULL,

[RenderingProviderIDQual] [char](2) NULL,

[RenderingProviderID] [varchar](35) NULL,

[RenderingProviderOtherIDQual] [char](2) NULL,

[RenderingProviderOtherID] [varchar](30) NULL,

/* PurchasedService Provider */

[PurchasedServiceProviderLast] [varchar](35) NULL,

[PurchasedServiceProviderFirst] [varchar](25) NULL,

[PurchasedServiceProviderMiddle] [varchar](25) NULL,

[PurchasedServiceProviderSuffix] [varchar](10) NULL,

[PurchasedServiceProviderIDQual] [char](2) NULL,

[PurchasedServiceProviderID] [varchar](35) NULL,

[PurchasedServiceProviderOtherIDQual] [char](2) NULL,

[PurchasedServiceProviderOtherID] [varchar](30) NULL,

/* Facility Provider */

[FacilityName] [varchar](35) NULL,

[FacilityIDQual] [char](2) NULL,

[FacilityID] [varchar](35) NULL,

[FacilityAddress1] [varchar](25) NULL,

[FacilityAddress2] [varchar](25) NULL,

[FacilityCity] [varchar](30) NULL,

[FacilityState] [char](2) NULL,

[FacilityZip] [varchar](15) NULL,

[FacilityOtherIDQual] [char](2) NULL,

[FacilityOtherID] [varchar](30) NULL,

/* Supervising Provider */

[SupervisingProviderLast] [varchar](35) NULL,

[SupervisingProviderFirst] [varchar](25) NULL,

[SupervisingProviderMiddle] [varchar](25) NULL,

[SupervisingProviderSuffix] [varchar](10) NULL,

[SupervisingProviderIDQual] [char](2) NULL,

[SupervisingProviderID] [varchar](35) NULL,

[SupervisingProviderOtherIDQual] [char](2) NULL,

[SupervisingProviderOtherID] [varchar](30) NULL,

/* Ordering Provider */

[OrderingProviderLast] [varchar](35) NULL,

[OrderingProviderFirst] [varchar](25) NULL,

[OrderingProviderMiddle] [varchar](25) NULL,

[OrderingProviderSuffix] [varchar](10) NULL,

[OrderingProviderIDQual] [char](2) NULL,

[OrderingProviderID] [varchar](35) NULL,

[OrderingProviderOtherIDQual] [char](2) NULL,

[OrderingProviderOtherID] [varchar](30) NULL,

/* Referring Provider */

[ReferringProviderLast] [varchar](35) NULL,

[ReferringProviderFirst] [varchar](25) NULL,

[ReferringProviderMiddle] [varchar](25) NULL,

[ReferringProviderSuffix] [varchar](10) NULL,

[ReferringProviderIDQual] [char](2) NULL,

[ReferringProviderID] [varchar](35) NULL,

[ReferringProviderOtherIDQual] [char](2) NULL,

[ReferringProviderOtherID] [varchar](30) NULL,

/*COB 1 */

[OtherPayer1ID] [varchar](30) NULL,

[OtherPayer1Paid] [money] NULL,

[OtherPayer1PaidProcedure] [varchar](30) NULL,

[OtherPayer1PaidRevenueCode] [varchar](30) NULL,

[OtherPayer1PaidQuantity] [bigint] NULL,

[OtherPayer1BundledLine] [int] NULL,

[OtherPayer1AdjustmentReasonGroup1] [char](2) NULL,

[OtherPayer1AdjustmentReason1] [varchar](5) NULL,

[OtherPayer1AdjustmentAmount1] [money] NULL,

[OtherPayer1AdjustmentQuantity1] [bigint] NULL,

[OtherPayer1AdjustmentReasonGroup2] [char](2) NULL,

[OtherPayer1AdjustmentReason2] [varchar](5) NULL,

[OtherPayer1AdjustmentAmount2] [money] NULL,

[OtherPayer1AdjustmentQuantity2] [bigint] NULL,

[OtherPayer1AdjustmentReasonGroup3] [char](2) NULL,

[OtherPayer1AdjustmentReason3] [varchar](5) NULL,

[OtherPayer1AdjustmentAmount3] [money] NULL,

[OtherPayer1AdjustmentQuantity3] [bigint] NULL,

[OtherPayer1AdjustmentReasonGroup4] [char](2) NULL,

[OtherPayer1AdjustmentReason4] [varchar](5) NULL,

[OtherPayer1AdjustmentAmount4] [money] NULL,

[OtherPayer1AdjustmentQuantity4] [bigint] NULL,

--[OtherPayer1AdjustmentReasonGroup5Plus] [varchar](77) NULL,

--[OtherPayer1AdjustmentReason5Plus] [varchar](155) NULL,

--[OtherPayer1AdjustmentAmount5Plus] [varchar](493) NULL,

--[OtherPayer1AdjustmentQuantity5Plus] [varchar](415) NULL,

[OtherPayer1PaidDate] [date] NULL,

/*COB 2 */

[OtherPayer2ID] [varchar](30) NULL,

[OtherPayer2Paid] [money] NULL,

[OtherPayer2PaidProcedure] [varchar](30) NULL,

[OtherPayer2PaidRevenueCode] [varchar](30) NULL,

[OtherPayer2PaidQuantity] [bigint] NULL,

[OtherPayer2BundledLine] [int] NULL,

[OtherPayer2AdjustmentReasonGroup1] [char](2) NULL,

[OtherPayer2AdjustmentReason1] [varchar](5) NULL,

[OtherPayer2AdjustmentAmount1] [money] NULL,

[OtherPayer2AdjustmentQuantity1] [bigint] NULL,

[OtherPayer2AdjustmentReasonGroup2] [char](2) NULL,

[OtherPayer2AdjustmentReason2] [varchar](5) NULL,

[OtherPayer2AdjustmentAmount2] [money] NULL,

[OtherPayer2AdjustmentQuantity2] [bigint] NULL,

[OtherPayer2AdjustmentReasonGroup3] [char](2) NULL,

[OtherPayer2AdjustmentReason3] [varchar](5) NULL,

[OtherPayer2AdjustmentAmount3] [money] NULL,

[OtherPayer2AdjustmentQuantity3] [bigint] NULL,

[OtherPayer2AdjustmentReasonGroup4] [char](2) NULL,

[OtherPayer2AdjustmentReason4] [varchar](5) NULL,

[OtherPayer2AdjustmentAmount4] [money] NULL,

[OtherPayer2AdjustmentQuantity4] [bigint] NULL,

--[OtherPayer2AdjustmentReasonGroup5Plus] [varchar](77) NULL,

--[OtherPayer2AdjustmentReason5Plus] [varchar](155) NULL,

--[OtherPayer2AdjustmentAmount5Plus] [varchar](493) NULL,

--[OtherPayer2AdjustmentQuantity5Plus] [varchar](415) NULL,

[OtherPayer2PaidDate] [date] NULL

) ON [PRIMARY]

No questions yet.

Publish modules to the "offcanvs" position.