Skip to content

Instantly share code, notes, and snippets.

@ImaginaryDevelopment
Created November 17, 2015 18:31
Show Gist options
  • Save ImaginaryDevelopment/f0b282a0e814a1a9f9ec to your computer and use it in GitHub Desktop.
Save ImaginaryDevelopment/f0b282a0e814a1a9f9ec to your computer and use it in GitHub Desktop.
Generator and generated code from new T4 to F#
namespace Pm.Schema.DataModels.Claims // Generated by item in namespace PracticeManagement.Foundation
open System
open System.ComponentModel
open System.Linq.Expressions
/// 59 properties
type IClaim =
abstract member AccidentDate:DateTime Nullable with get
abstract member AccidentState:string with get
abstract member AccidentType:string with get
abstract member Adjudicated:int Nullable with get
abstract member AmountPaidPrimary:decimal Nullable with get
abstract member AmountPaidSecondary:decimal Nullable with get
abstract member AmountPaidTertiary:decimal Nullable with get
abstract member AmountPaidWorkmansComp:decimal Nullable with get
abstract member AppointmentID:int Nullable with get
abstract member AuthException:int Nullable with get
abstract member AutoPostFail:int Nullable with get
abstract member AvailDocs:string with get
abstract member Balance:decimal Nullable with get
abstract member Claim837Type:string with get
abstract member ClaimAmount:decimal Nullable with get
abstract member ClaimCharges:string with get
abstract member ClaimFilingIndicatorCodeID:int Nullable with get
abstract member ClaimFreq:int Nullable with get
abstract member ClaimID:int with get
abstract member ClaimStatus:int Nullable with get
abstract member ClaimType:string with get
abstract member CobState:int Nullable with get
abstract member CreateDateTime:DateTime Nullable with get
abstract member CurrentIllnessDate:DateTime Nullable with get
abstract member CurrentLevel:string with get
abstract member DisabilityEndDate:DateTime Nullable with get
abstract member DisabilityStartDate:DateTime Nullable with get
abstract member EmergencySvc:int Nullable with get
abstract member ExtID:string with get
abstract member FacilityID:int Nullable with get
abstract member FirstIllnessDate:DateTime Nullable with get
abstract member HospitalizationFromDate:DateTime Nullable with get
abstract member HospitalizationToDate:DateTime Nullable with get
abstract member IsAccident:bool Nullable with get
abstract member IsPregnant:bool Nullable with get
abstract member LastWorked:DateTime Nullable with get
abstract member Lmp:DateTime Nullable with get
abstract member MaxLevel:string with get
abstract member MedicareICN:string with get
abstract member NoteToPayer:string with get
abstract member PatientID:int Nullable with get
abstract member POS:int Nullable with get
abstract member PrimaryGuarantorProfileInfoID:int Nullable with get
abstract member PriorAuth:string with get
abstract member ReceivedDateTime:DateTime Nullable with get
abstract member ReferralNumber:string with get
abstract member RefProviderFirstName:string with get
abstract member RefProviderLastName:string with get
abstract member RefProviderNPI:string with get
abstract member ReturnToWork:DateTime Nullable with get
abstract member SecondaryGuarantorProfileInfoID:int Nullable with get
abstract member ServiceFacilityID:int Nullable with get
abstract member SubmissionDelayReason:int Nullable with get
abstract member SubmitDateTime:DateTime Nullable with get
abstract member Submitted:bool Nullable with get
abstract member TertiaryGuarantorProfileInfoID:int Nullable with get
abstract member ThirdPartyGuarantorProfileInfoID:int Nullable with get
abstract member UserIdCurrentlyEditing:int Nullable with get
abstract member WorkmansCompGuarantorProfileInfoID:int Nullable with get
/// 59 properties
type IClaimRW =
abstract member AccidentDate:DateTime Nullable with get,set
abstract member AccidentState:string with get,set
abstract member AccidentType:string with get,set
abstract member Adjudicated:int Nullable with get,set
abstract member AmountPaidPrimary:decimal Nullable with get,set
abstract member AmountPaidSecondary:decimal Nullable with get,set
abstract member AmountPaidTertiary:decimal Nullable with get,set
abstract member AmountPaidWorkmansComp:decimal Nullable with get,set
abstract member AppointmentID:int Nullable with get,set
abstract member AuthException:int Nullable with get,set
abstract member AutoPostFail:int Nullable with get,set
abstract member AvailDocs:string with get,set
abstract member Balance:decimal Nullable with get,set
abstract member Claim837Type:string with get,set
abstract member ClaimAmount:decimal Nullable with get,set
abstract member ClaimCharges:string with get,set
abstract member ClaimFilingIndicatorCodeID:int Nullable with get,set
abstract member ClaimFreq:int Nullable with get,set
abstract member ClaimID:int with get,set
abstract member ClaimStatus:int Nullable with get,set
abstract member ClaimType:string with get,set
abstract member CobState:int Nullable with get,set
abstract member CreateDateTime:DateTime Nullable with get,set
abstract member CurrentIllnessDate:DateTime Nullable with get,set
abstract member CurrentLevel:string with get,set
abstract member DisabilityEndDate:DateTime Nullable with get,set
abstract member DisabilityStartDate:DateTime Nullable with get,set
abstract member EmergencySvc:int Nullable with get,set
abstract member ExtID:string with get,set
abstract member FacilityID:int Nullable with get,set
abstract member FirstIllnessDate:DateTime Nullable with get,set
abstract member HospitalizationFromDate:DateTime Nullable with get,set
abstract member HospitalizationToDate:DateTime Nullable with get,set
abstract member IsAccident:bool Nullable with get,set
abstract member IsPregnant:bool Nullable with get,set
abstract member LastWorked:DateTime Nullable with get,set
abstract member Lmp:DateTime Nullable with get,set
abstract member MaxLevel:string with get,set
abstract member MedicareICN:string with get,set
abstract member NoteToPayer:string with get,set
abstract member PatientID:int Nullable with get,set
abstract member POS:int Nullable with get,set
abstract member PrimaryGuarantorProfileInfoID:int Nullable with get,set
abstract member PriorAuth:string with get,set
abstract member ReceivedDateTime:DateTime Nullable with get,set
abstract member ReferralNumber:string with get,set
abstract member RefProviderFirstName:string with get,set
abstract member RefProviderLastName:string with get,set
abstract member RefProviderNPI:string with get,set
abstract member ReturnToWork:DateTime Nullable with get,set
abstract member SecondaryGuarantorProfileInfoID:int Nullable with get,set
abstract member ServiceFacilityID:int Nullable with get,set
abstract member SubmissionDelayReason:int Nullable with get,set
abstract member SubmitDateTime:DateTime Nullable with get,set
abstract member Submitted:bool Nullable with get,set
abstract member TertiaryGuarantorProfileInfoID:int Nullable with get,set
abstract member ThirdPartyGuarantorProfileInfoID:int Nullable with get,set
abstract member UserIdCurrentlyEditing:int Nullable with get,set
abstract member WorkmansCompGuarantorProfileInfoID:int Nullable with get,set
/// 59 properties
[<NoComparison>]
type ClaimRecord =
{
/// datetime (8) null
AccidentDate:DateTime Nullable
/// varchar (5) null
AccidentState:string
/// varchar (255) null
AccidentType:string
/// int (4) null
Adjudicated:int Nullable
/// decimal (9) null
AmountPaidPrimary:decimal Nullable
/// decimal (9) null
AmountPaidSecondary:decimal Nullable
/// decimal (9) null
AmountPaidTertiary:decimal Nullable
/// decimal (9) null
AmountPaidWorkmansComp:decimal Nullable
/// int (4) null
AppointmentID:int Nullable
/// int (4) null
AuthException:int Nullable
/// int (4) null
AutoPostFail:int Nullable
/// varchar (-1) null
AvailDocs:string
/// decimal (9) null
Balance:decimal Nullable
/// varchar (2) null
Claim837Type:string
/// decimal (9) null
ClaimAmount:decimal Nullable
/// varchar (255) null
ClaimCharges:string
/// int (4) null
ClaimFilingIndicatorCodeID:int Nullable
/// int (4) null
ClaimFreq:int Nullable
/// int (4) not null
ClaimID:int
/// int (4) null
ClaimStatus:int Nullable
/// varchar (10) null
ClaimType:string
/// int (4) null
CobState:int Nullable
/// datetime (8) null
CreateDateTime:DateTime Nullable
/// datetime (8) null
CurrentIllnessDate:DateTime Nullable
/// varchar (255) null
CurrentLevel:string
/// datetime (8) null
DisabilityEndDate:DateTime Nullable
/// datetime (8) null
DisabilityStartDate:DateTime Nullable
/// int (4) null
EmergencySvc:int Nullable
/// varchar (255) null
ExtID:string
/// int (4) null
FacilityID:int Nullable
/// datetime (8) null
FirstIllnessDate:DateTime Nullable
/// datetime (8) null
HospitalizationFromDate:DateTime Nullable
/// datetime (8) null
HospitalizationToDate:DateTime Nullable
/// bit (1) null
IsAccident:bool Nullable
/// bit (1) null
IsPregnant:bool Nullable
/// datetime (8) null
LastWorked:DateTime Nullable
/// datetime (8) null
Lmp:DateTime Nullable
/// varchar (255) null
MaxLevel:string
/// varchar (50) null
MedicareICN:string
/// varchar (-1) null
NoteToPayer:string
/// int (4) null
PatientID:int Nullable
/// int (4) null
POS:int Nullable
/// int (4) null
PrimaryGuarantorProfileInfoID:int Nullable
/// varchar (255) null
PriorAuth:string
/// datetime (8) null
ReceivedDateTime:DateTime Nullable
/// varchar (255) null
ReferralNumber:string
/// nvarchar (100) null
RefProviderFirstName:string
/// nvarchar (100) null
RefProviderLastName:string
/// nvarchar (40) null
RefProviderNPI:string
/// datetime (8) null
ReturnToWork:DateTime Nullable
/// int (4) null
SecondaryGuarantorProfileInfoID:int Nullable
/// int (4) null
ServiceFacilityID:int Nullable
/// int (4) null
SubmissionDelayReason:int Nullable
/// datetime (8) null
SubmitDateTime:DateTime Nullable
/// bit (1) null
Submitted:bool Nullable
/// int (4) null
TertiaryGuarantorProfileInfoID:int Nullable
/// int (4) null
ThirdPartyGuarantorProfileInfoID:int Nullable
/// int (4) null
UserIdCurrentlyEditing:int Nullable
/// int (4) null
WorkmansCompGuarantorProfileInfoID:int Nullable
}
interface IClaim with
/// datetime (8) null
member x.AccidentDate with get () = x.AccidentDate
/// varchar (5) null
member x.AccidentState with get () = x.AccidentState
/// varchar (255) null
member x.AccidentType with get () = x.AccidentType
/// int (4) null
member x.Adjudicated with get () = x.Adjudicated
/// decimal (9) null
member x.AmountPaidPrimary with get () = x.AmountPaidPrimary
/// decimal (9) null
member x.AmountPaidSecondary with get () = x.AmountPaidSecondary
/// decimal (9) null
member x.AmountPaidTertiary with get () = x.AmountPaidTertiary
/// decimal (9) null
member x.AmountPaidWorkmansComp with get () = x.AmountPaidWorkmansComp
/// int (4) null
member x.AppointmentID with get () = x.AppointmentID
/// int (4) null
member x.AuthException with get () = x.AuthException
/// int (4) null
member x.AutoPostFail with get () = x.AutoPostFail
/// varchar (-1) null
member x.AvailDocs with get () = x.AvailDocs
/// decimal (9) null
member x.Balance with get () = x.Balance
/// varchar (2) null
member x.Claim837Type with get () = x.Claim837Type
/// decimal (9) null
member x.ClaimAmount with get () = x.ClaimAmount
/// varchar (255) null
member x.ClaimCharges with get () = x.ClaimCharges
/// int (4) null
member x.ClaimFilingIndicatorCodeID with get () = x.ClaimFilingIndicatorCodeID
/// int (4) null
member x.ClaimFreq with get () = x.ClaimFreq
/// int (4) not null
member x.ClaimID with get () = x.ClaimID
/// int (4) null
member x.ClaimStatus with get () = x.ClaimStatus
/// varchar (10) null
member x.ClaimType with get () = x.ClaimType
/// int (4) null
member x.CobState with get () = x.CobState
/// datetime (8) null
member x.CreateDateTime with get () = x.CreateDateTime
/// datetime (8) null
member x.CurrentIllnessDate with get () = x.CurrentIllnessDate
/// varchar (255) null
member x.CurrentLevel with get () = x.CurrentLevel
/// datetime (8) null
member x.DisabilityEndDate with get () = x.DisabilityEndDate
/// datetime (8) null
member x.DisabilityStartDate with get () = x.DisabilityStartDate
/// int (4) null
member x.EmergencySvc with get () = x.EmergencySvc
/// varchar (255) null
member x.ExtID with get () = x.ExtID
/// int (4) null
member x.FacilityID with get () = x.FacilityID
/// datetime (8) null
member x.FirstIllnessDate with get () = x.FirstIllnessDate
/// datetime (8) null
member x.HospitalizationFromDate with get () = x.HospitalizationFromDate
/// datetime (8) null
member x.HospitalizationToDate with get () = x.HospitalizationToDate
/// bit (1) null
member x.IsAccident with get () = x.IsAccident
/// bit (1) null
member x.IsPregnant with get () = x.IsPregnant
/// datetime (8) null
member x.LastWorked with get () = x.LastWorked
/// datetime (8) null
member x.Lmp with get () = x.Lmp
/// varchar (255) null
member x.MaxLevel with get () = x.MaxLevel
/// varchar (50) null
member x.MedicareICN with get () = x.MedicareICN
/// varchar (-1) null
member x.NoteToPayer with get () = x.NoteToPayer
/// int (4) null
member x.PatientID with get () = x.PatientID
/// int (4) null
member x.POS with get () = x.POS
/// int (4) null
member x.PrimaryGuarantorProfileInfoID with get () = x.PrimaryGuarantorProfileInfoID
/// varchar (255) null
member x.PriorAuth with get () = x.PriorAuth
/// datetime (8) null
member x.ReceivedDateTime with get () = x.ReceivedDateTime
/// varchar (255) null
member x.ReferralNumber with get () = x.ReferralNumber
/// nvarchar (100) null
member x.RefProviderFirstName with get () = x.RefProviderFirstName
/// nvarchar (100) null
member x.RefProviderLastName with get () = x.RefProviderLastName
/// nvarchar (40) null
member x.RefProviderNPI with get () = x.RefProviderNPI
/// datetime (8) null
member x.ReturnToWork with get () = x.ReturnToWork
/// int (4) null
member x.SecondaryGuarantorProfileInfoID with get () = x.SecondaryGuarantorProfileInfoID
/// int (4) null
member x.ServiceFacilityID with get () = x.ServiceFacilityID
/// int (4) null
member x.SubmissionDelayReason with get () = x.SubmissionDelayReason
/// datetime (8) null
member x.SubmitDateTime with get () = x.SubmitDateTime
/// bit (1) null
member x.Submitted with get () = x.Submitted
/// int (4) null
member x.TertiaryGuarantorProfileInfoID with get () = x.TertiaryGuarantorProfileInfoID
/// int (4) null
member x.ThirdPartyGuarantorProfileInfoID with get () = x.ThirdPartyGuarantorProfileInfoID
/// int (4) null
member x.UserIdCurrentlyEditing with get () = x.UserIdCurrentlyEditing
/// int (4) null
member x.WorkmansCompGuarantorProfileInfoID with get () = x.WorkmansCompGuarantorProfileInfoID
static member Zero () =
{
AccidentDate = Nullable()
AccidentState = null
AccidentType = null
Adjudicated = Nullable()
AmountPaidPrimary = Nullable()
AmountPaidSecondary = Nullable()
AmountPaidTertiary = Nullable()
AmountPaidWorkmansComp = Nullable()
AppointmentID = Nullable()
AuthException = Nullable()
AutoPostFail = Nullable()
AvailDocs = null
Balance = Nullable()
Claim837Type = null
ClaimAmount = Nullable()
ClaimCharges = null
ClaimFilingIndicatorCodeID = Nullable()
ClaimFreq = Nullable()
ClaimID = 0
ClaimStatus = Nullable()
ClaimType = null
CobState = Nullable()
CreateDateTime = Nullable()
CurrentIllnessDate = Nullable()
CurrentLevel = null
DisabilityEndDate = Nullable()
DisabilityStartDate = Nullable()
EmergencySvc = Nullable()
ExtID = null
FacilityID = Nullable()
FirstIllnessDate = Nullable()
HospitalizationFromDate = Nullable()
HospitalizationToDate = Nullable()
IsAccident = Nullable()
IsPregnant = Nullable()
LastWorked = Nullable()
Lmp = Nullable()
MaxLevel = null
MedicareICN = null
NoteToPayer = null
PatientID = Nullable()
POS = Nullable()
PrimaryGuarantorProfileInfoID = Nullable()
PriorAuth = null
ReceivedDateTime = Nullable()
ReferralNumber = null
RefProviderFirstName = null
RefProviderLastName = null
RefProviderNPI = null
ReturnToWork = Nullable()
SecondaryGuarantorProfileInfoID = Nullable()
ServiceFacilityID = Nullable()
SubmissionDelayReason = Nullable()
SubmitDateTime = Nullable()
Submitted = Nullable()
TertiaryGuarantorProfileInfoID = Nullable()
ThirdPartyGuarantorProfileInfoID = Nullable()
UserIdCurrentlyEditing = Nullable()
WorkmansCompGuarantorProfileInfoID = Nullable()
}
module ClaimHelpers =
let ToRecord (iClaim:IClaim) =
{
AccidentDate = iClaim.AccidentDate
AccidentState = iClaim.AccidentState
AccidentType = iClaim.AccidentType
Adjudicated = iClaim.Adjudicated
AmountPaidPrimary = iClaim.AmountPaidPrimary
AmountPaidSecondary = iClaim.AmountPaidSecondary
AmountPaidTertiary = iClaim.AmountPaidTertiary
AmountPaidWorkmansComp = iClaim.AmountPaidWorkmansComp
AppointmentID = iClaim.AppointmentID
AuthException = iClaim.AuthException
AutoPostFail = iClaim.AutoPostFail
AvailDocs = iClaim.AvailDocs
Balance = iClaim.Balance
Claim837Type = iClaim.Claim837Type
ClaimAmount = iClaim.ClaimAmount
ClaimCharges = iClaim.ClaimCharges
ClaimFilingIndicatorCodeID = iClaim.ClaimFilingIndicatorCodeID
ClaimFreq = iClaim.ClaimFreq
ClaimID = iClaim.ClaimID
ClaimStatus = iClaim.ClaimStatus
ClaimType = iClaim.ClaimType
CobState = iClaim.CobState
CreateDateTime = iClaim.CreateDateTime
CurrentIllnessDate = iClaim.CurrentIllnessDate
CurrentLevel = iClaim.CurrentLevel
DisabilityEndDate = iClaim.DisabilityEndDate
DisabilityStartDate = iClaim.DisabilityStartDate
EmergencySvc = iClaim.EmergencySvc
ExtID = iClaim.ExtID
FacilityID = iClaim.FacilityID
FirstIllnessDate = iClaim.FirstIllnessDate
HospitalizationFromDate = iClaim.HospitalizationFromDate
HospitalizationToDate = iClaim.HospitalizationToDate
IsAccident = iClaim.IsAccident
IsPregnant = iClaim.IsPregnant
LastWorked = iClaim.LastWorked
Lmp = iClaim.Lmp
MaxLevel = iClaim.MaxLevel
MedicareICN = iClaim.MedicareICN
NoteToPayer = iClaim.NoteToPayer
PatientID = iClaim.PatientID
POS = iClaim.POS
PrimaryGuarantorProfileInfoID = iClaim.PrimaryGuarantorProfileInfoID
PriorAuth = iClaim.PriorAuth
ReceivedDateTime = iClaim.ReceivedDateTime
ReferralNumber = iClaim.ReferralNumber
RefProviderFirstName = iClaim.RefProviderFirstName
RefProviderLastName = iClaim.RefProviderLastName
RefProviderNPI = iClaim.RefProviderNPI
ReturnToWork = iClaim.ReturnToWork
SecondaryGuarantorProfileInfoID = iClaim.SecondaryGuarantorProfileInfoID
ServiceFacilityID = iClaim.ServiceFacilityID
SubmissionDelayReason = iClaim.SubmissionDelayReason
SubmitDateTime = iClaim.SubmitDateTime
Submitted = iClaim.Submitted
TertiaryGuarantorProfileInfoID = iClaim.TertiaryGuarantorProfileInfoID
ThirdPartyGuarantorProfileInfoID = iClaim.ThirdPartyGuarantorProfileInfoID
UserIdCurrentlyEditing = iClaim.UserIdCurrentlyEditing
WorkmansCompGuarantorProfileInfoID = iClaim.WorkmansCompGuarantorProfileInfoID
}
let toRecord claim =
{
AccidentDate = claim.AccidentDate
AccidentState = claim.AccidentState
AccidentType = claim.AccidentType
Adjudicated = claim.Adjudicated
AmountPaidPrimary = claim.AmountPaidPrimary
AmountPaidSecondary = claim.AmountPaidSecondary
AmountPaidTertiary = claim.AmountPaidTertiary
AmountPaidWorkmansComp = claim.AmountPaidWorkmansComp
AppointmentID = claim.AppointmentID
AuthException = claim.AuthException
AutoPostFail = claim.AutoPostFail
AvailDocs = claim.AvailDocs
Balance = claim.Balance
Claim837Type = claim.Claim837Type
ClaimAmount = claim.ClaimAmount
ClaimCharges = claim.ClaimCharges
ClaimFilingIndicatorCodeID = claim.ClaimFilingIndicatorCodeID
ClaimFreq = claim.ClaimFreq
ClaimID = claim.ClaimID
ClaimStatus = claim.ClaimStatus
ClaimType = claim.ClaimType
CobState = claim.CobState
CreateDateTime = claim.CreateDateTime
CurrentIllnessDate = claim.CurrentIllnessDate
CurrentLevel = claim.CurrentLevel
DisabilityEndDate = claim.DisabilityEndDate
DisabilityStartDate = claim.DisabilityStartDate
EmergencySvc = claim.EmergencySvc
ExtID = claim.ExtID
FacilityID = claim.FacilityID
FirstIllnessDate = claim.FirstIllnessDate
HospitalizationFromDate = claim.HospitalizationFromDate
HospitalizationToDate = claim.HospitalizationToDate
IsAccident = claim.IsAccident
IsPregnant = claim.IsPregnant
LastWorked = claim.LastWorked
Lmp = claim.Lmp
MaxLevel = claim.MaxLevel
MedicareICN = claim.MedicareICN
NoteToPayer = claim.NoteToPayer
PatientID = claim.PatientID
POS = claim.POS
PrimaryGuarantorProfileInfoID = claim.PrimaryGuarantorProfileInfoID
PriorAuth = claim.PriorAuth
ReceivedDateTime = claim.ReceivedDateTime
ReferralNumber = claim.ReferralNumber
RefProviderFirstName = claim.RefProviderFirstName
RefProviderLastName = claim.RefProviderLastName
RefProviderNPI = claim.RefProviderNPI
ReturnToWork = claim.ReturnToWork
SecondaryGuarantorProfileInfoID = claim.SecondaryGuarantorProfileInfoID
ServiceFacilityID = claim.ServiceFacilityID
SubmissionDelayReason = claim.SubmissionDelayReason
SubmitDateTime = claim.SubmitDateTime
Submitted = claim.Submitted
TertiaryGuarantorProfileInfoID = claim.TertiaryGuarantorProfileInfoID
ThirdPartyGuarantorProfileInfoID = claim.ThirdPartyGuarantorProfileInfoID
UserIdCurrentlyEditing = claim.UserIdCurrentlyEditing
WorkmansCompGuarantorProfileInfoID = claim.WorkmansCompGuarantorProfileInfoID
}
let inline toRecordStp (claim: ^a) =
{
AccidentDate = (^a: (member AccidentDate: _) claim)
AccidentState = (^a: (member AccidentState: _) claim)
AccidentType = (^a: (member AccidentType: _) claim)
Adjudicated = (^a: (member Adjudicated: _) claim)
AmountPaidPrimary = (^a: (member AmountPaidPrimary: _) claim)
AmountPaidSecondary = (^a: (member AmountPaidSecondary: _) claim)
AmountPaidTertiary = (^a: (member AmountPaidTertiary: _) claim)
AmountPaidWorkmansComp = (^a: (member AmountPaidWorkmansComp: _) claim)
AppointmentID = (^a: (member AppointmentID: _) claim)
AuthException = (^a: (member AuthException: _) claim)
AutoPostFail = (^a: (member AutoPostFail: _) claim)
AvailDocs = (^a: (member AvailDocs: _) claim)
Balance = (^a: (member Balance: _) claim)
Claim837Type = (^a: (member Claim837Type: _) claim)
ClaimAmount = (^a: (member ClaimAmount: _) claim)
ClaimCharges = (^a: (member ClaimCharges: _) claim)
ClaimFilingIndicatorCodeID = (^a: (member ClaimFilingIndicatorCodeID: _) claim)
ClaimFreq = (^a: (member ClaimFreq: _) claim)
ClaimID = (^a: (member ClaimID: _) claim)
ClaimStatus = (^a: (member ClaimStatus: _) claim)
ClaimType = (^a: (member ClaimType: _) claim)
CobState = (^a: (member CobState: _) claim)
CreateDateTime = (^a: (member CreateDateTime: _) claim)
CurrentIllnessDate = (^a: (member CurrentIllnessDate: _) claim)
CurrentLevel = (^a: (member CurrentLevel: _) claim)
DisabilityEndDate = (^a: (member DisabilityEndDate: _) claim)
DisabilityStartDate = (^a: (member DisabilityStartDate: _) claim)
EmergencySvc = (^a: (member EmergencySvc: _) claim)
ExtID = (^a: (member ExtID: _) claim)
FacilityID = (^a: (member FacilityID: _) claim)
FirstIllnessDate = (^a: (member FirstIllnessDate: _) claim)
HospitalizationFromDate = (^a: (member HospitalizationFromDate: _) claim)
HospitalizationToDate = (^a: (member HospitalizationToDate: _) claim)
IsAccident = (^a: (member IsAccident: _) claim)
IsPregnant = (^a: (member IsPregnant: _) claim)
LastWorked = (^a: (member LastWorked: _) claim)
Lmp = (^a: (member Lmp: _) claim)
MaxLevel = (^a: (member MaxLevel: _) claim)
MedicareICN = (^a: (member MedicareICN: _) claim)
NoteToPayer = (^a: (member NoteToPayer: _) claim)
PatientID = (^a: (member PatientID: _) claim)
POS = (^a: (member POS: _) claim)
PrimaryGuarantorProfileInfoID = (^a: (member PrimaryGuarantorProfileInfoID: _) claim)
PriorAuth = (^a: (member PriorAuth: _) claim)
ReceivedDateTime = (^a: (member ReceivedDateTime: _) claim)
ReferralNumber = (^a: (member ReferralNumber: _) claim)
RefProviderFirstName = (^a: (member RefProviderFirstName: _) claim)
RefProviderLastName = (^a: (member RefProviderLastName: _) claim)
RefProviderNPI = (^a: (member RefProviderNPI: _) claim)
ReturnToWork = (^a: (member ReturnToWork: _) claim)
SecondaryGuarantorProfileInfoID = (^a: (member SecondaryGuarantorProfileInfoID: _) claim)
ServiceFacilityID = (^a: (member ServiceFacilityID: _) claim)
SubmissionDelayReason = (^a: (member SubmissionDelayReason: _) claim)
SubmitDateTime = (^a: (member SubmitDateTime: _) claim)
Submitted = (^a: (member Submitted: _) claim)
TertiaryGuarantorProfileInfoID = (^a: (member TertiaryGuarantorProfileInfoID: _) claim)
ThirdPartyGuarantorProfileInfoID = (^a: (member ThirdPartyGuarantorProfileInfoID: _) claim)
UserIdCurrentlyEditing = (^a: (member UserIdCurrentlyEditing: _) claim)
WorkmansCompGuarantorProfileInfoID = (^a: (member WorkmansCompGuarantorProfileInfoID: _) claim)
}
/// 59 properties
type ClaimN (model:ClaimRecord) =
let propertyChanged = new Event<_, _>()
let mutable accidentDate = model.AccidentDate
let mutable accidentState = model.AccidentState
let mutable accidentType = model.AccidentType
let mutable adjudicated = model.Adjudicated
let mutable amountPaidPrimary = model.AmountPaidPrimary
let mutable amountPaidSecondary = model.AmountPaidSecondary
let mutable amountPaidTertiary = model.AmountPaidTertiary
let mutable amountPaidWorkmansComp = model.AmountPaidWorkmansComp
let mutable appointmentID = model.AppointmentID
let mutable authException = model.AuthException
let mutable autoPostFail = model.AutoPostFail
let mutable availDocs = model.AvailDocs
let mutable balance = model.Balance
let mutable claim837Type = model.Claim837Type
let mutable claimAmount = model.ClaimAmount
let mutable claimCharges = model.ClaimCharges
let mutable claimFilingIndicatorCodeID = model.ClaimFilingIndicatorCodeID
let mutable claimFreq = model.ClaimFreq
let mutable claimID = model.ClaimID
let mutable claimStatus = model.ClaimStatus
let mutable claimType = model.ClaimType
let mutable cobState = model.CobState
let mutable createDateTime = model.CreateDateTime
let mutable currentIllnessDate = model.CurrentIllnessDate
let mutable currentLevel = model.CurrentLevel
let mutable disabilityEndDate = model.DisabilityEndDate
let mutable disabilityStartDate = model.DisabilityStartDate
let mutable emergencySvc = model.EmergencySvc
let mutable extID = model.ExtID
let mutable facilityID = model.FacilityID
let mutable firstIllnessDate = model.FirstIllnessDate
let mutable hospitalizationFromDate = model.HospitalizationFromDate
let mutable hospitalizationToDate = model.HospitalizationToDate
let mutable isAccident = model.IsAccident
let mutable isPregnant = model.IsPregnant
let mutable lastWorked = model.LastWorked
let mutable lmp = model.Lmp
let mutable maxLevel = model.MaxLevel
let mutable medicareICN = model.MedicareICN
let mutable noteToPayer = model.NoteToPayer
let mutable patientID = model.PatientID
let mutable pOS = model.POS
let mutable primaryGuarantorProfileInfoID = model.PrimaryGuarantorProfileInfoID
let mutable priorAuth = model.PriorAuth
let mutable receivedDateTime = model.ReceivedDateTime
let mutable referralNumber = model.ReferralNumber
let mutable refProviderFirstName = model.RefProviderFirstName
let mutable refProviderLastName = model.RefProviderLastName
let mutable refProviderNPI = model.RefProviderNPI
let mutable returnToWork = model.ReturnToWork
let mutable secondaryGuarantorProfileInfoID = model.SecondaryGuarantorProfileInfoID
let mutable serviceFacilityID = model.ServiceFacilityID
let mutable submissionDelayReason = model.SubmissionDelayReason
let mutable submitDateTime = model.SubmitDateTime
let mutable submitted = model.Submitted
let mutable tertiaryGuarantorProfileInfoID = model.TertiaryGuarantorProfileInfoID
let mutable thirdPartyGuarantorProfileInfoID = model.ThirdPartyGuarantorProfileInfoID
let mutable userIdCurrentlyEditing = model.UserIdCurrentlyEditing
let mutable workmansCompGuarantorProfileInfoID = model.WorkmansCompGuarantorProfileInfoID
interface IClaim with
member x.AccidentDate with get () = x.AccidentDate
member x.AccidentState with get () = x.AccidentState
member x.AccidentType with get () = x.AccidentType
member x.Adjudicated with get () = x.Adjudicated
member x.AmountPaidPrimary with get () = x.AmountPaidPrimary
member x.AmountPaidSecondary with get () = x.AmountPaidSecondary
member x.AmountPaidTertiary with get () = x.AmountPaidTertiary
member x.AmountPaidWorkmansComp with get () = x.AmountPaidWorkmansComp
member x.AppointmentID with get () = x.AppointmentID
member x.AuthException with get () = x.AuthException
member x.AutoPostFail with get () = x.AutoPostFail
member x.AvailDocs with get () = x.AvailDocs
member x.Balance with get () = x.Balance
member x.Claim837Type with get () = x.Claim837Type
member x.ClaimAmount with get () = x.ClaimAmount
member x.ClaimCharges with get () = x.ClaimCharges
member x.ClaimFilingIndicatorCodeID with get () = x.ClaimFilingIndicatorCodeID
member x.ClaimFreq with get () = x.ClaimFreq
member x.ClaimID with get () = x.ClaimID
member x.ClaimStatus with get () = x.ClaimStatus
member x.ClaimType with get () = x.ClaimType
member x.CobState with get () = x.CobState
member x.CreateDateTime with get () = x.CreateDateTime
member x.CurrentIllnessDate with get () = x.CurrentIllnessDate
member x.CurrentLevel with get () = x.CurrentLevel
member x.DisabilityEndDate with get () = x.DisabilityEndDate
member x.DisabilityStartDate with get () = x.DisabilityStartDate
member x.EmergencySvc with get () = x.EmergencySvc
member x.ExtID with get () = x.ExtID
member x.FacilityID with get () = x.FacilityID
member x.FirstIllnessDate with get () = x.FirstIllnessDate
member x.HospitalizationFromDate with get () = x.HospitalizationFromDate
member x.HospitalizationToDate with get () = x.HospitalizationToDate
member x.IsAccident with get () = x.IsAccident
member x.IsPregnant with get () = x.IsPregnant
member x.LastWorked with get () = x.LastWorked
member x.Lmp with get () = x.Lmp
member x.MaxLevel with get () = x.MaxLevel
member x.MedicareICN with get () = x.MedicareICN
member x.NoteToPayer with get () = x.NoteToPayer
member x.PatientID with get () = x.PatientID
member x.POS with get () = x.POS
member x.PrimaryGuarantorProfileInfoID with get () = x.PrimaryGuarantorProfileInfoID
member x.PriorAuth with get () = x.PriorAuth
member x.ReceivedDateTime with get () = x.ReceivedDateTime
member x.ReferralNumber with get () = x.ReferralNumber
member x.RefProviderFirstName with get () = x.RefProviderFirstName
member x.RefProviderLastName with get () = x.RefProviderLastName
member x.RefProviderNPI with get () = x.RefProviderNPI
member x.ReturnToWork with get () = x.ReturnToWork
member x.SecondaryGuarantorProfileInfoID with get () = x.SecondaryGuarantorProfileInfoID
member x.ServiceFacilityID with get () = x.ServiceFacilityID
member x.SubmissionDelayReason with get () = x.SubmissionDelayReason
member x.SubmitDateTime with get () = x.SubmitDateTime
member x.Submitted with get () = x.Submitted
member x.TertiaryGuarantorProfileInfoID with get () = x.TertiaryGuarantorProfileInfoID
member x.ThirdPartyGuarantorProfileInfoID with get () = x.ThirdPartyGuarantorProfileInfoID
member x.UserIdCurrentlyEditing with get () = x.UserIdCurrentlyEditing
member x.WorkmansCompGuarantorProfileInfoID with get () = x.WorkmansCompGuarantorProfileInfoID
interface IClaimRW with
member x.AccidentDate with get () = x.AccidentDate and set v = x.AccidentDate <- v
member x.AccidentState with get () = x.AccidentState and set v = x.AccidentState <- v
member x.AccidentType with get () = x.AccidentType and set v = x.AccidentType <- v
member x.Adjudicated with get () = x.Adjudicated and set v = x.Adjudicated <- v
member x.AmountPaidPrimary with get () = x.AmountPaidPrimary and set v = x.AmountPaidPrimary <- v
member x.AmountPaidSecondary with get () = x.AmountPaidSecondary and set v = x.AmountPaidSecondary <- v
member x.AmountPaidTertiary with get () = x.AmountPaidTertiary and set v = x.AmountPaidTertiary <- v
member x.AmountPaidWorkmansComp with get () = x.AmountPaidWorkmansComp and set v = x.AmountPaidWorkmansComp <- v
member x.AppointmentID with get () = x.AppointmentID and set v = x.AppointmentID <- v
member x.AuthException with get () = x.AuthException and set v = x.AuthException <- v
member x.AutoPostFail with get () = x.AutoPostFail and set v = x.AutoPostFail <- v
member x.AvailDocs with get () = x.AvailDocs and set v = x.AvailDocs <- v
member x.Balance with get () = x.Balance and set v = x.Balance <- v
member x.Claim837Type with get () = x.Claim837Type and set v = x.Claim837Type <- v
member x.ClaimAmount with get () = x.ClaimAmount and set v = x.ClaimAmount <- v
member x.ClaimCharges with get () = x.ClaimCharges and set v = x.ClaimCharges <- v
member x.ClaimFilingIndicatorCodeID with get () = x.ClaimFilingIndicatorCodeID and set v = x.ClaimFilingIndicatorCodeID <- v
member x.ClaimFreq with get () = x.ClaimFreq and set v = x.ClaimFreq <- v
member x.ClaimID with get () = x.ClaimID and set v = x.ClaimID <- v
member x.ClaimStatus with get () = x.ClaimStatus and set v = x.ClaimStatus <- v
member x.ClaimType with get () = x.ClaimType and set v = x.ClaimType <- v
member x.CobState with get () = x.CobState and set v = x.CobState <- v
member x.CreateDateTime with get () = x.CreateDateTime and set v = x.CreateDateTime <- v
member x.CurrentIllnessDate with get () = x.CurrentIllnessDate and set v = x.CurrentIllnessDate <- v
member x.CurrentLevel with get () = x.CurrentLevel and set v = x.CurrentLevel <- v
member x.DisabilityEndDate with get () = x.DisabilityEndDate and set v = x.DisabilityEndDate <- v
member x.DisabilityStartDate with get () = x.DisabilityStartDate and set v = x.DisabilityStartDate <- v
member x.EmergencySvc with get () = x.EmergencySvc and set v = x.EmergencySvc <- v
member x.ExtID with get () = x.ExtID and set v = x.ExtID <- v
member x.FacilityID with get () = x.FacilityID and set v = x.FacilityID <- v
member x.FirstIllnessDate with get () = x.FirstIllnessDate and set v = x.FirstIllnessDate <- v
member x.HospitalizationFromDate with get () = x.HospitalizationFromDate and set v = x.HospitalizationFromDate <- v
member x.HospitalizationToDate with get () = x.HospitalizationToDate and set v = x.HospitalizationToDate <- v
member x.IsAccident with get () = x.IsAccident and set v = x.IsAccident <- v
member x.IsPregnant with get () = x.IsPregnant and set v = x.IsPregnant <- v
member x.LastWorked with get () = x.LastWorked and set v = x.LastWorked <- v
member x.Lmp with get () = x.Lmp and set v = x.Lmp <- v
member x.MaxLevel with get () = x.MaxLevel and set v = x.MaxLevel <- v
member x.MedicareICN with get () = x.MedicareICN and set v = x.MedicareICN <- v
member x.NoteToPayer with get () = x.NoteToPayer and set v = x.NoteToPayer <- v
member x.PatientID with get () = x.PatientID and set v = x.PatientID <- v
member x.POS with get () = x.POS and set v = x.POS <- v
member x.PrimaryGuarantorProfileInfoID with get () = x.PrimaryGuarantorProfileInfoID and set v = x.PrimaryGuarantorProfileInfoID <- v
member x.PriorAuth with get () = x.PriorAuth and set v = x.PriorAuth <- v
member x.ReceivedDateTime with get () = x.ReceivedDateTime and set v = x.ReceivedDateTime <- v
member x.ReferralNumber with get () = x.ReferralNumber and set v = x.ReferralNumber <- v
member x.RefProviderFirstName with get () = x.RefProviderFirstName and set v = x.RefProviderFirstName <- v
member x.RefProviderLastName with get () = x.RefProviderLastName and set v = x.RefProviderLastName <- v
member x.RefProviderNPI with get () = x.RefProviderNPI and set v = x.RefProviderNPI <- v
member x.ReturnToWork with get () = x.ReturnToWork and set v = x.ReturnToWork <- v
member x.SecondaryGuarantorProfileInfoID with get () = x.SecondaryGuarantorProfileInfoID and set v = x.SecondaryGuarantorProfileInfoID <- v
member x.ServiceFacilityID with get () = x.ServiceFacilityID and set v = x.ServiceFacilityID <- v
member x.SubmissionDelayReason with get () = x.SubmissionDelayReason and set v = x.SubmissionDelayReason <- v
member x.SubmitDateTime with get () = x.SubmitDateTime and set v = x.SubmitDateTime <- v
member x.Submitted with get () = x.Submitted and set v = x.Submitted <- v
member x.TertiaryGuarantorProfileInfoID with get () = x.TertiaryGuarantorProfileInfoID and set v = x.TertiaryGuarantorProfileInfoID <- v
member x.ThirdPartyGuarantorProfileInfoID with get () = x.ThirdPartyGuarantorProfileInfoID and set v = x.ThirdPartyGuarantorProfileInfoID <- v
member x.UserIdCurrentlyEditing with get () = x.UserIdCurrentlyEditing and set v = x.UserIdCurrentlyEditing <- v
member x.WorkmansCompGuarantorProfileInfoID with get () = x.WorkmansCompGuarantorProfileInfoID and set v = x.WorkmansCompGuarantorProfileInfoID <- v
member x.MakeRecord () =
{
AccidentDate = x.AccidentDate
AccidentState = x.AccidentState
AccidentType = x.AccidentType
Adjudicated = x.Adjudicated
AmountPaidPrimary = x.AmountPaidPrimary
AmountPaidSecondary = x.AmountPaidSecondary
AmountPaidTertiary = x.AmountPaidTertiary
AmountPaidWorkmansComp = x.AmountPaidWorkmansComp
AppointmentID = x.AppointmentID
AuthException = x.AuthException
AutoPostFail = x.AutoPostFail
AvailDocs = x.AvailDocs
Balance = x.Balance
Claim837Type = x.Claim837Type
ClaimAmount = x.ClaimAmount
ClaimCharges = x.ClaimCharges
ClaimFilingIndicatorCodeID = x.ClaimFilingIndicatorCodeID
ClaimFreq = x.ClaimFreq
ClaimID = x.ClaimID
ClaimStatus = x.ClaimStatus
ClaimType = x.ClaimType
CobState = x.CobState
CreateDateTime = x.CreateDateTime
CurrentIllnessDate = x.CurrentIllnessDate
CurrentLevel = x.CurrentLevel
DisabilityEndDate = x.DisabilityEndDate
DisabilityStartDate = x.DisabilityStartDate
EmergencySvc = x.EmergencySvc
ExtID = x.ExtID
FacilityID = x.FacilityID
FirstIllnessDate = x.FirstIllnessDate
HospitalizationFromDate = x.HospitalizationFromDate
HospitalizationToDate = x.HospitalizationToDate
IsAccident = x.IsAccident
IsPregnant = x.IsPregnant
LastWorked = x.LastWorked
Lmp = x.Lmp
MaxLevel = x.MaxLevel
MedicareICN = x.MedicareICN
NoteToPayer = x.NoteToPayer
PatientID = x.PatientID
POS = x.POS
PrimaryGuarantorProfileInfoID = x.PrimaryGuarantorProfileInfoID
PriorAuth = x.PriorAuth
ReceivedDateTime = x.ReceivedDateTime
ReferralNumber = x.ReferralNumber
RefProviderFirstName = x.RefProviderFirstName
RefProviderLastName = x.RefProviderLastName
RefProviderNPI = x.RefProviderNPI
ReturnToWork = x.ReturnToWork
SecondaryGuarantorProfileInfoID = x.SecondaryGuarantorProfileInfoID
ServiceFacilityID = x.ServiceFacilityID
SubmissionDelayReason = x.SubmissionDelayReason
SubmitDateTime = x.SubmitDateTime
Submitted = x.Submitted
TertiaryGuarantorProfileInfoID = x.TertiaryGuarantorProfileInfoID
ThirdPartyGuarantorProfileInfoID = x.ThirdPartyGuarantorProfileInfoID
UserIdCurrentlyEditing = x.UserIdCurrentlyEditing
WorkmansCompGuarantorProfileInfoID = x.WorkmansCompGuarantorProfileInfoID
}
interface INotifyPropertyChanged with
[<CLIEvent>]
member x.PropertyChanged = propertyChanged.Publish
abstract member RaisePropertyChanged : string -> unit
default x.RaisePropertyChanged(propertyName : string) = propertyChanged.Trigger(x, PropertyChangedEventArgs(propertyName))
/// datetime (8) null
member x.AccidentDate
with get() = accidentDate
and set v =
accidentDate <- v
x.RaisePropertyChanged "AccidentDate"
/// varchar (5) null
member x.AccidentState
with get() = accidentState
and set v =
accidentState <- v
x.RaisePropertyChanged "AccidentState"
/// varchar (255) null
member x.AccidentType
with get() = accidentType
and set v =
accidentType <- v
x.RaisePropertyChanged "AccidentType"
/// int (4) null
member x.Adjudicated
with get() = adjudicated
and set v =
adjudicated <- v
x.RaisePropertyChanged "Adjudicated"
/// decimal (9) null
member x.AmountPaidPrimary
with get() = amountPaidPrimary
and set v =
amountPaidPrimary <- v
x.RaisePropertyChanged "AmountPaidPrimary"
/// decimal (9) null
member x.AmountPaidSecondary
with get() = amountPaidSecondary
and set v =
amountPaidSecondary <- v
x.RaisePropertyChanged "AmountPaidSecondary"
/// decimal (9) null
member x.AmountPaidTertiary
with get() = amountPaidTertiary
and set v =
amountPaidTertiary <- v
x.RaisePropertyChanged "AmountPaidTertiary"
/// decimal (9) null
member x.AmountPaidWorkmansComp
with get() = amountPaidWorkmansComp
and set v =
amountPaidWorkmansComp <- v
x.RaisePropertyChanged "AmountPaidWorkmansComp"
/// int (4) null
member x.AppointmentID
with get() = appointmentID
and set v =
appointmentID <- v
x.RaisePropertyChanged "AppointmentID"
/// int (4) null
member x.AuthException
with get() = authException
and set v =
authException <- v
x.RaisePropertyChanged "AuthException"
/// int (4) null
member x.AutoPostFail
with get() = autoPostFail
and set v =
autoPostFail <- v
x.RaisePropertyChanged "AutoPostFail"
/// varchar (-1) null
member x.AvailDocs
with get() = availDocs
and set v =
availDocs <- v
x.RaisePropertyChanged "AvailDocs"
/// decimal (9) null
member x.Balance
with get() = balance
and set v =
balance <- v
x.RaisePropertyChanged "Balance"
/// varchar (2) null
member x.Claim837Type
with get() = claim837Type
and set v =
claim837Type <- v
x.RaisePropertyChanged "Claim837Type"
/// decimal (9) null
member x.ClaimAmount
with get() = claimAmount
and set v =
claimAmount <- v
x.RaisePropertyChanged "ClaimAmount"
/// varchar (255) null
member x.ClaimCharges
with get() = claimCharges
and set v =
claimCharges <- v
x.RaisePropertyChanged "ClaimCharges"
/// int (4) null
member x.ClaimFilingIndicatorCodeID
with get() = claimFilingIndicatorCodeID
and set v =
claimFilingIndicatorCodeID <- v
x.RaisePropertyChanged "ClaimFilingIndicatorCodeID"
/// int (4) null
member x.ClaimFreq
with get() = claimFreq
and set v =
claimFreq <- v
x.RaisePropertyChanged "ClaimFreq"
/// int (4) not null
member x.ClaimID
with get() = claimID
and set v =
claimID <- v
x.RaisePropertyChanged "ClaimID"
/// int (4) null
member x.ClaimStatus
with get() = claimStatus
and set v =
claimStatus <- v
x.RaisePropertyChanged "ClaimStatus"
/// varchar (10) null
member x.ClaimType
with get() = claimType
and set v =
claimType <- v
x.RaisePropertyChanged "ClaimType"
/// int (4) null
member x.CobState
with get() = cobState
and set v =
cobState <- v
x.RaisePropertyChanged "CobState"
/// datetime (8) null
member x.CreateDateTime
with get() = createDateTime
and set v =
createDateTime <- v
x.RaisePropertyChanged "CreateDateTime"
/// datetime (8) null
member x.CurrentIllnessDate
with get() = currentIllnessDate
and set v =
currentIllnessDate <- v
x.RaisePropertyChanged "CurrentIllnessDate"
/// varchar (255) null
member x.CurrentLevel
with get() = currentLevel
and set v =
currentLevel <- v
x.RaisePropertyChanged "CurrentLevel"
/// datetime (8) null
member x.DisabilityEndDate
with get() = disabilityEndDate
and set v =
disabilityEndDate <- v
x.RaisePropertyChanged "DisabilityEndDate"
/// datetime (8) null
member x.DisabilityStartDate
with get() = disabilityStartDate
and set v =
disabilityStartDate <- v
x.RaisePropertyChanged "DisabilityStartDate"
/// int (4) null
member x.EmergencySvc
with get() = emergencySvc
and set v =
emergencySvc <- v
x.RaisePropertyChanged "EmergencySvc"
/// varchar (255) null
member x.ExtID
with get() = extID
and set v =
extID <- v
x.RaisePropertyChanged "ExtID"
/// int (4) null
member x.FacilityID
with get() = facilityID
and set v =
facilityID <- v
x.RaisePropertyChanged "FacilityID"
/// datetime (8) null
member x.FirstIllnessDate
with get() = firstIllnessDate
and set v =
firstIllnessDate <- v
x.RaisePropertyChanged "FirstIllnessDate"
/// datetime (8) null
member x.HospitalizationFromDate
with get() = hospitalizationFromDate
and set v =
hospitalizationFromDate <- v
x.RaisePropertyChanged "HospitalizationFromDate"
/// datetime (8) null
member x.HospitalizationToDate
with get() = hospitalizationToDate
and set v =
hospitalizationToDate <- v
x.RaisePropertyChanged "HospitalizationToDate"
/// bit (1) null
member x.IsAccident
with get() = isAccident
and set v =
isAccident <- v
x.RaisePropertyChanged "IsAccident"
/// bit (1) null
member x.IsPregnant
with get() = isPregnant
and set v =
isPregnant <- v
x.RaisePropertyChanged "IsPregnant"
/// datetime (8) null
member x.LastWorked
with get() = lastWorked
and set v =
lastWorked <- v
x.RaisePropertyChanged "LastWorked"
/// datetime (8) null
member x.Lmp
with get() = lmp
and set v =
lmp <- v
x.RaisePropertyChanged "Lmp"
/// varchar (255) null
member x.MaxLevel
with get() = maxLevel
and set v =
maxLevel <- v
x.RaisePropertyChanged "MaxLevel"
/// varchar (50) null
member x.MedicareICN
with get() = medicareICN
and set v =
medicareICN <- v
x.RaisePropertyChanged "MedicareICN"
/// varchar (-1) null
member x.NoteToPayer
with get() = noteToPayer
and set v =
noteToPayer <- v
x.RaisePropertyChanged "NoteToPayer"
/// int (4) null
member x.PatientID
with get() = patientID
and set v =
patientID <- v
x.RaisePropertyChanged "PatientID"
/// int (4) null
member x.POS
with get() = pOS
and set v =
pOS <- v
x.RaisePropertyChanged "POS"
/// int (4) null
member x.PrimaryGuarantorProfileInfoID
with get() = primaryGuarantorProfileInfoID
and set v =
primaryGuarantorProfileInfoID <- v
x.RaisePropertyChanged "PrimaryGuarantorProfileInfoID"
/// varchar (255) null
member x.PriorAuth
with get() = priorAuth
and set v =
priorAuth <- v
x.RaisePropertyChanged "PriorAuth"
/// datetime (8) null
member x.ReceivedDateTime
with get() = receivedDateTime
and set v =
receivedDateTime <- v
x.RaisePropertyChanged "ReceivedDateTime"
/// varchar (255) null
member x.ReferralNumber
with get() = referralNumber
and set v =
referralNumber <- v
x.RaisePropertyChanged "ReferralNumber"
/// nvarchar (100) null
member x.RefProviderFirstName
with get() = refProviderFirstName
and set v =
refProviderFirstName <- v
x.RaisePropertyChanged "RefProviderFirstName"
/// nvarchar (100) null
member x.RefProviderLastName
with get() = refProviderLastName
and set v =
refProviderLastName <- v
x.RaisePropertyChanged "RefProviderLastName"
/// nvarchar (40) null
member x.RefProviderNPI
with get() = refProviderNPI
and set v =
refProviderNPI <- v
x.RaisePropertyChanged "RefProviderNPI"
/// datetime (8) null
member x.ReturnToWork
with get() = returnToWork
and set v =
returnToWork <- v
x.RaisePropertyChanged "ReturnToWork"
/// int (4) null
member x.SecondaryGuarantorProfileInfoID
with get() = secondaryGuarantorProfileInfoID
and set v =
secondaryGuarantorProfileInfoID <- v
x.RaisePropertyChanged "SecondaryGuarantorProfileInfoID"
/// int (4) null
member x.ServiceFacilityID
with get() = serviceFacilityID
and set v =
serviceFacilityID <- v
x.RaisePropertyChanged "ServiceFacilityID"
/// int (4) null
member x.SubmissionDelayReason
with get() = submissionDelayReason
and set v =
submissionDelayReason <- v
x.RaisePropertyChanged "SubmissionDelayReason"
/// datetime (8) null
member x.SubmitDateTime
with get() = submitDateTime
and set v =
submitDateTime <- v
x.RaisePropertyChanged "SubmitDateTime"
/// bit (1) null
member x.Submitted
with get() = submitted
and set v =
submitted <- v
x.RaisePropertyChanged "Submitted"
/// int (4) null
member x.TertiaryGuarantorProfileInfoID
with get() = tertiaryGuarantorProfileInfoID
and set v =
tertiaryGuarantorProfileInfoID <- v
x.RaisePropertyChanged "TertiaryGuarantorProfileInfoID"
/// int (4) null
member x.ThirdPartyGuarantorProfileInfoID
with get() = thirdPartyGuarantorProfileInfoID
and set v =
thirdPartyGuarantorProfileInfoID <- v
x.RaisePropertyChanged "ThirdPartyGuarantorProfileInfoID"
/// int (4) null
member x.UserIdCurrentlyEditing
with get() = userIdCurrentlyEditing
and set v =
userIdCurrentlyEditing <- v
x.RaisePropertyChanged "UserIdCurrentlyEditing"
/// int (4) null
member x.WorkmansCompGuarantorProfileInfoID
with get() = workmansCompGuarantorProfileInfoID
and set v =
workmansCompGuarantorProfileInfoID <- v
x.RaisePropertyChanged "WorkmansCompGuarantorProfileInfoID"
<#@ template debug="True" language="C#" hostspecific="True" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="System.Data" #>
<#@ assembly name="System.Data.Entity.Design" #>
<#@ import namespace="System.Globalization" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Data.Entity.Design.PluralizationServices" #>
<#@ include file="DataModelToF.ttinclude" #><#
var cString = "Data Source=(local);Initial Catalog=ApplicationDatabase;App=T4TypeGenerator;"; //connection string mostly omitted use your own
var tables = new []{
"Claims",
};
var targetProjectName = "Pm.Schema";
Generate(Host,Dte,GenerationEnvironment, targetProjectName, tables, cString, doMultiFile: true);
#>
<#@ assembly name="System.Core" #>
<#@ assembly name="System.Data" #>
<#@ assembly name="System.Data.Entity.Design" #>
<#@ import namespace="System.Globalization" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Data.Entity.Design.PluralizationServices" #>
<#@ output extension=".txt" #>
<# EnvDTE.DTE Dte;
//this relies on the nuget packages: T4EnvDte and T4MultiFile
#>
<#@ include file="MultipleOutputHelper.ttinclude" #>
<#@ include file="EnvDteHelper.ttinclude" #>
Main File Output
<#+
public static void Generate(ITextTemplatingEngineHost host, EnvDTE.DTE dte, StringBuilder generationEnvironment, string targetProjectName, IEnumerable<string> tables, string cString, bool doMultiFile)
{
generationEnvironment.AppendLine(host.TemplateFile);
Action<int,string> appendLine = (indentLevels, text) => generationEnvironment.AppendLine(String.Join(string.Empty,Enumerable.Repeat(" ",indentLevels)) + text);
var useOptions = false;
var manager = Manager.Create(host, generationEnvironment);
var projects = RecurseSolutionProjects(dte);
var targetProject = projects.First(p => p.Name==targetProjectName);
var targetProjectFolder = Path.GetDirectoryName(targetProject.FullName);
var pluralizer = PluralizationService.CreateService(new CultureInfo("en")); // https://msdn.microsoft.com/en-us/library/system.data.entity.design.pluralizationservices.pluralizationservice(v=vs.110).aspx
generationEnvironment.AppendLine("Main file output");
foreach(var p in projects)
{
generationEnvironment.AppendLine(p.Name + " " + p.FullName);
}
using(var cn = new System.Data.SqlClient.SqlConnection(cString))
{
cn.Open();
foreach(var tableName in tables)
{
manager.StartNewFile(Path.Combine(targetProjectFolder,tableName + ".generated.fs"),targetProject);
var typeName = pluralizer.Singularize(tableName);
var columns = new List<ColumnDescription>();
using(var cmd= new System.Data.SqlClient.SqlCommand("sp_help " + tableName,cn))
using(var r = cmd.ExecuteReader())
{
r.NextResult(); // ignore the first tables
while(r.Read())
{
// columns and info
var columnName = r["Column_name"].ToString();
var type = r["Type"].ToString();
// var computed = r["Computed"];
var length = Convert.ToInt32(r["Length"]);
// var prec = r["Prec"];
columns.Add(new ColumnDescription{ColumnName=columnName, Type=type, Length=length, Nullable = r["Nullable"].ToString() =="yes"});
}
}
columns = new List<ColumnDescription>( columns.OrderBy(c => c.ColumnName));
generationEnvironment.AppendLine ("namespace Pm.Schema.DataModels." + pluralizer.Pluralize(typeName) + " // Generated by item in namespace " + manager.DefaultProjectNamespace );
generationEnvironment.AppendLine(string.Empty);
generationEnvironment.AppendLine("open System");
generationEnvironment.AppendLine("open System.ComponentModel");
generationEnvironment.AppendLine("open System.Linq.Expressions");
generationEnvironment.AppendLine(string.Empty);
GenerateInterface(typeName, columns, appendLine,writeable:false, useOptions:useOptions);
GenerateInterface(typeName, columns, appendLine,writeable:true, useOptions:useOptions);
GenerateRecord(typeName, columns, appendLine, useOptions);
GenerateModule(typeName, columns, appendLine, useOptions);
GenerateClass(typeName, columns, appendLine, useOptions);
manager.EndBlock();
}
}
manager.Process(doMultiFile);
}
public static void GenerateInterface(string typeName, IEnumerable<ColumnDescription> columns, Action<int,string> appendLine, bool writeable, bool useOptions)
{
appendLine(0, TypeComment(columns.Count()));
appendLine(0,"type I" + typeName + (writeable ? "RW" : string.Empty) + " =");
foreach(var cd in columns)
{
appendLine(1, "abstract member " + cd.ColumnName + ":" + MapSqlType(cd.Type, cd.Nullable, useOptions) + " with get" + (writeable ? ",set" : string.Empty));
}
appendLine(0,string.Empty);
}
public static void GenerateRecord(string typeName, IEnumerable<ColumnDescription> columns, Action<int,string> appendLine, bool useOptions)
{
appendLine(0, TypeComment(columns.Count()));
if (!useOptions)
{
appendLine(0,"[<NoComparison>]");
}
appendLine(0, "type " + typeName + "Record =");
appendLine(1, "{");
foreach(var cd in columns)
{
appendLine(1, ColumnComment(cd));
appendLine(1, cd.ColumnName + ":" + MapSqlType(cd.Type,cd.Nullable,useOptions));
}
appendLine(1,"}");
appendLine(1,"interface I" + typeName + " with");
foreach(var cd in columns )
{
appendLine(2, ColumnComment(cd));
appendLine(2, "member x." + cd.ColumnName + " with get () = x." + cd.ColumnName);
}
appendLine(1,"static member Zero () = ");
appendLine(2,"{");
foreach(var cd in columns )
{
var mapped = MapSqlType(cd.Type,cd.Nullable,useOptions);
appendLine(2, cd.ColumnName + " = " + GetDefaultValue(mapped));
}
appendLine(2,"}");
appendLine(0,string.Empty);
}
public static void GenerateModule(string typeName, IEnumerable<ColumnDescription> columns, Action<int,string> appendLine, bool useOptions)
{
var camelType = toCamel(typeName);
appendLine(0, "module " + typeName + "Helpers =");
appendLine(1, "let ToRecord (i" + typeName + ":I" + typeName + ") =");
appendLine(2, "{");
foreach(var cd in columns )
{
var mapped = MapSqlType(cd.Type,cd.Nullable,useOptions);
appendLine(2, cd.ColumnName + " = i" + typeName + "." + cd.ColumnName);
}
appendLine(2, "}");
appendLine(0,string.Empty);
appendLine(1, "let toRecord " + camelType + " =");
appendLine(2, "{");
foreach(var cd in columns )
{
var mapped = MapSqlType(cd.Type,cd.Nullable,useOptions);
appendLine(2, cd.ColumnName + " = " + camelType + "." + cd.ColumnName);
}
appendLine(2, "}");
appendLine(0,string.Empty);
appendLine(1, "let inline toRecordStp (" + camelType + ": ^a) =");
appendLine(2, "{");
foreach(var cd in columns )
{
var mapped = MapSqlType(cd.Type,cd.Nullable,useOptions);
appendLine(2, cd.ColumnName + " = (^a: (member " + cd.ColumnName + ": _) " + camelType + ")");
}
appendLine(2, "}");
appendLine(0,string.Empty);
}
public static void GenerateClass(string typeName, IEnumerable<ColumnDescription> columns, Action<int,string> appendLine, bool useOptions)
{
appendLine(0, TypeComment(columns.Count()));
appendLine(0, "type "+ typeName + "N (model:" + typeName + "Record) = ");
appendLine(0, string.Empty);
appendLine(1, "let propertyChanged = new Event<_, _>()");
appendLine(0, string.Empty);
appendLine(0, string.Empty);
foreach(var cd in columns) // https://fadsworld.wordpress.com/2011/05/18/f-quotations-for-inotifypropertychanged/
{
var camel = toCamel(cd.ColumnName);
appendLine(1, "let mutable "+ camel + " = model." + cd.ColumnName);
}
appendLine(0, string.Empty);
appendLine(1, "interface I" + typeName + " with");
foreach(var cd in columns)
{
appendLine(2, "member x." + cd.ColumnName + " with get () = x." + cd.ColumnName);
}
appendLine(1, "interface I" + typeName + "RW with" );
foreach(var cd in columns)
{
appendLine(2, "member x." + cd.ColumnName + " with get () = x." + cd.ColumnName + " and set v = x." + cd.ColumnName + " <- v");
}
appendLine(0, string.Empty);
appendLine(1, "member x.MakeRecord () =");
appendLine(2, "{");
foreach(var cd in columns)
{
appendLine(2, cd.ColumnName + " = x." + cd.ColumnName);
}
appendLine(2, "}");
appendLine(0, string.Empty);
appendLine(1, "interface INotifyPropertyChanged with");
appendLine(2, "[<CLIEvent>]");
appendLine(2, "member x.PropertyChanged = propertyChanged.Publish");
appendLine(1, "abstract member RaisePropertyChanged : string -> unit");
appendLine(1, "default x.RaisePropertyChanged(propertyName : string) = propertyChanged.Trigger(x, PropertyChangedEventArgs(propertyName))");
appendLine(0, string.Empty);
foreach(var cd in columns)
{
var camel = toCamel(cd.ColumnName);
appendLine(0,string.Empty);
appendLine(1, ColumnComment(cd));
appendLine(1, "member x."+ cd.ColumnName);
appendLine(2, "with get() = " + camel);
appendLine(2, "and set v = ");
appendLine(3, camel +" <- v");
appendLine(3, "x.RaisePropertyChanged \"" + cd.ColumnName +"\"");
}
}
public class ColumnDescription
{
public string ColumnName{get;set;}
public string Type {get;set;}
public int Length {get;set;}
public bool Nullable{get;set;}
}
static string MapSqlType(string type, bool nullable, bool useOptions)
{
switch (type.ToLower()){
case "char":
case "nchar":
case "nvarchar":
case "varchar": return "string";
case "bit": return nullable ? (useOptions ? "bool option" : "bool Nullable") : "bool";
case "date":
case "datetime":
case "smalldatetime": return nullable ? (useOptions ? "DateTime option" : "DateTime Nullable") : "DateTime";
case "int": return nullable ? (useOptions ? "int option" : "int Nullable") : "int";
case "decimal": return nullable ? (useOptions ? "decimal option": "decimal Nullable") : "decimal";
default : return type ?? string.Empty;
}
}
static string GetDefaultValue(string mappedType)
{
if(mappedType.EndsWith("Nullable"))
return "Nullable()";
if(mappedType.EndsWith("option"))
return "None";
switch(mappedType.ToLower()){
case "int": return "0";
case "bool": return "false";
case "decimal": return "0m";
case "datetime": return "System.DateTime.MinValue";
default : return "null";
}
}
static string ColumnComment(ColumnDescription cd)
{
return "/// " + (cd.Type ?? "null") + " (" + cd.Length + ") " + (cd.Nullable? "null" : "not null");
}
static string TypeComment(int columnCount)
{
return "/// " + columnCount + " properties";
}
static string toCamel(string s) // https://github.com/ayoung/Newtonsoft.Json/blob/master/Newtonsoft.Json/Utilities/StringUtils.cs
{
if (string.IsNullOrEmpty(s))
return s;
if (!char.IsUpper(s[0]))
return s;
string camelCase = char.ToLower(s[0], CultureInfo.InvariantCulture).ToString(CultureInfo.InvariantCulture);
if (s.Length > 1)
camelCase += s.Substring(1);
return camelCase;
}
#>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment