Skip to content

Instantly share code, notes, and snippets.

@ImaginaryDevelopment
Created February 1, 2017 15:28
Show Gist options
  • Select an option

  • Save ImaginaryDevelopment/d3cefc2281e5b66edc12db793c3317bd to your computer and use it in GitHub Desktop.

Select an option

Save ImaginaryDevelopment/d3cefc2281e5b66edc12db793c3317bd to your computer and use it in GitHub Desktop.
CodeGenResult
namespace Pm.Schema.DataModels.Appointments // Generated by generateMultiple.linq
open System
open System.ComponentModel
open Pm.Schema
open Pm.Schema.BReusable
// typeName:Appointment writeable:false useOptions:false
/// 29 properties
type IAppointment =
/// int (4) null
abstract member AdmitFacilityID:int<AdmitFacilityId> Nullable with get
/// varchar (50) null
abstract member AdmitStatus:string with get
/// datetime (8) null
abstract member AppointmentAccidentDate:DateTime Nullable with get
/// int (4) null
abstract member AppointmentAccidentID:int Nullable with get
/// bit (1) null
abstract member AppointmentAccidentRelated:bool Nullable with get
/// varchar (2) null
abstract member AppointmentAccidentState:string with get
/// int (4) null
abstract member AppointmentBillingStage:int Nullable with get
/// bit (1) not null
abstract member AppointmentCheckInFlag:bool with get
/// smalldatetime (4) null
abstract member AppointmentCheckInTime:DateTime Nullable with get
/// smalldatetime (4) null
abstract member AppointmentCheckOutTime:DateTime Nullable with get
/// smalldatetime (4) not null
abstract member AppointmentEndTime:DateTime with get
/// int (4) not null
abstract member AppointmentFacilityID:int<FacilityId> with get
/// int (4) null
abstract member AppointmentForeignEHRID:int Nullable with get
/// int (4) not null identity primaryKey
abstract member AppointmentID:int<AppointmentId> with get
/// varchar (5) null
abstract member AppointmentLOS:string with get
/// int (4) not null
abstract member AppointmentPatientID:int<PatientId> with get
/// int (4) not null
abstract member AppointmentPatientInfoID:int<PatientInfoId> with get
/// varchar (50) null
abstract member AppointmentPrimaryGuarantorType:string with get
/// int (4) null
abstract member AppointmentProviderScheduledID:int Nullable with get
/// smalldatetime (4) not null
abstract member AppointmentStartTime:DateTime with get
/// varchar (50) not null
abstract member AppointmentStatus:string with get
/// int (4) not null
abstract member AppointmentTypeID:int with get
/// bit (1) null
abstract member IsChecked:bool Nullable with get
/// varchar (4000) null
abstract member NotesToBiller:string with get
/// varchar (120) null
abstract member PresentingCondition:string with get
/// varchar (100) null
abstract member PropertyCasualtyClaimNumber:string with get
/// int (4) null
abstract member ReferralPcp:int Nullable with get
/// varchar (50) null
abstract member ReferralSource:string with get
/// varchar (50) null
abstract member ReferralSourceSub:string with get
// typeName:Appointment writeable:true useOptions:false
/// 29 properties
type IAppointmentRW =
inherit IAppointment
/// int (4) null
abstract member AdmitFacilityID:int<AdmitFacilityId> Nullable with get,set
/// varchar (50) null
abstract member AdmitStatus:string with get,set
/// datetime (8) null
abstract member AppointmentAccidentDate:DateTime Nullable with get,set
/// int (4) null
abstract member AppointmentAccidentID:int Nullable with get,set
/// bit (1) null
abstract member AppointmentAccidentRelated:bool Nullable with get,set
/// varchar (2) null
abstract member AppointmentAccidentState:string with get,set
/// int (4) null
abstract member AppointmentBillingStage:int Nullable with get,set
/// bit (1) not null
abstract member AppointmentCheckInFlag:bool with get,set
/// smalldatetime (4) null
abstract member AppointmentCheckInTime:DateTime Nullable with get,set
/// smalldatetime (4) null
abstract member AppointmentCheckOutTime:DateTime Nullable with get,set
/// smalldatetime (4) not null
abstract member AppointmentEndTime:DateTime with get,set
/// int (4) not null
abstract member AppointmentFacilityID:int<FacilityId> with get,set
/// int (4) null
abstract member AppointmentForeignEHRID:int Nullable with get,set
/// int (4) not null identity primaryKey
abstract member AppointmentID:int<AppointmentId> with get,set
/// varchar (5) null
abstract member AppointmentLOS:string with get,set
/// int (4) not null
abstract member AppointmentPatientID:int<PatientId> with get,set
/// int (4) not null
abstract member AppointmentPatientInfoID:int<PatientInfoId> with get,set
/// varchar (50) null
abstract member AppointmentPrimaryGuarantorType:string with get,set
/// int (4) null
abstract member AppointmentProviderScheduledID:int Nullable with get,set
/// smalldatetime (4) not null
abstract member AppointmentStartTime:DateTime with get,set
/// varchar (50) not null
abstract member AppointmentStatus:string with get,set
/// int (4) not null
abstract member AppointmentTypeID:int with get,set
/// bit (1) null
abstract member IsChecked:bool Nullable with get,set
/// varchar (4000) null
abstract member NotesToBiller:string with get,set
/// varchar (120) null
abstract member PresentingCondition:string with get,set
/// varchar (100) null
abstract member PropertyCasualtyClaimNumber:string with get,set
/// int (4) null
abstract member ReferralPcp:int Nullable with get,set
/// varchar (50) null
abstract member ReferralSource:string with get,set
/// varchar (50) null
abstract member ReferralSourceSub:string with get,set
/// 29 properties
[<NoComparison>]
type AppointmentRecord =
{
/// int (4) null
AdmitFacilityID:int<AdmitFacilityId> Nullable
/// varchar (50) null
AdmitStatus:string
/// datetime (8) null
AppointmentAccidentDate:DateTime Nullable
/// int (4) null
AppointmentAccidentID:int Nullable
/// bit (1) null
AppointmentAccidentRelated:bool Nullable
/// varchar (2) null
AppointmentAccidentState:string
/// int (4) null
AppointmentBillingStage:int Nullable
/// bit (1) not null
AppointmentCheckInFlag:bool
/// smalldatetime (4) null
AppointmentCheckInTime:DateTime Nullable
/// smalldatetime (4) null
AppointmentCheckOutTime:DateTime Nullable
/// smalldatetime (4) not null
AppointmentEndTime:DateTime
/// int (4) not null
AppointmentFacilityID:int<FacilityId>
/// int (4) null
AppointmentForeignEHRID:int Nullable
/// int (4) not null identity primaryKey
AppointmentID:int<AppointmentId>
/// varchar (5) null
AppointmentLOS:string
/// int (4) not null
AppointmentPatientID:int<PatientId>
/// int (4) not null
AppointmentPatientInfoID:int<PatientInfoId>
/// varchar (50) null
AppointmentPrimaryGuarantorType:string
/// int (4) null
AppointmentProviderScheduledID:int Nullable
/// smalldatetime (4) not null
AppointmentStartTime:DateTime
/// varchar (50) not null
AppointmentStatus:string
/// int (4) not null
AppointmentTypeID:int
/// bit (1) null
IsChecked:bool Nullable
/// varchar (4000) null
NotesToBiller:string
/// varchar (120) null
PresentingCondition:string
/// varchar (100) null
PropertyCasualtyClaimNumber:string
/// int (4) null
ReferralPcp:int Nullable
/// varchar (50) null
ReferralSource:string
/// varchar (50) null
ReferralSourceSub:string
}
interface IAppointment with
member x.AdmitFacilityID with get () = x.AdmitFacilityID
member x.AdmitStatus with get () = x.AdmitStatus
member x.AppointmentAccidentDate with get () = x.AppointmentAccidentDate
member x.AppointmentAccidentID with get () = x.AppointmentAccidentID
member x.AppointmentAccidentRelated with get () = x.AppointmentAccidentRelated
member x.AppointmentAccidentState with get () = x.AppointmentAccidentState
member x.AppointmentBillingStage with get () = x.AppointmentBillingStage
member x.AppointmentCheckInFlag with get () = x.AppointmentCheckInFlag
member x.AppointmentCheckInTime with get () = x.AppointmentCheckInTime
member x.AppointmentCheckOutTime with get () = x.AppointmentCheckOutTime
member x.AppointmentEndTime with get () = x.AppointmentEndTime
member x.AppointmentFacilityID with get () = x.AppointmentFacilityID
member x.AppointmentForeignEHRID with get () = x.AppointmentForeignEHRID
member x.AppointmentID with get () = x.AppointmentID
member x.AppointmentLOS with get () = x.AppointmentLOS
member x.AppointmentPatientID with get () = x.AppointmentPatientID
member x.AppointmentPatientInfoID with get () = x.AppointmentPatientInfoID
member x.AppointmentPrimaryGuarantorType with get () = x.AppointmentPrimaryGuarantorType
member x.AppointmentProviderScheduledID with get () = x.AppointmentProviderScheduledID
member x.AppointmentStartTime with get () = x.AppointmentStartTime
member x.AppointmentStatus with get () = x.AppointmentStatus
member x.AppointmentTypeID with get () = x.AppointmentTypeID
member x.IsChecked with get () = x.IsChecked
member x.NotesToBiller with get () = x.NotesToBiller
member x.PresentingCondition with get () = x.PresentingCondition
member x.PropertyCasualtyClaimNumber with get () = x.PropertyCasualtyClaimNumber
member x.ReferralPcp with get () = x.ReferralPcp
member x.ReferralSource with get () = x.ReferralSource
member x.ReferralSourceSub with get () = x.ReferralSourceSub
static member Zero () =
{
AdmitFacilityID = Nullable()
AdmitStatus = null
AppointmentAccidentDate = Nullable()
AppointmentAccidentID = Nullable()
AppointmentAccidentRelated = Nullable()
AppointmentAccidentState = null
AppointmentBillingStage = Nullable()
AppointmentCheckInFlag = false
AppointmentCheckInTime = Nullable()
AppointmentCheckOutTime = Nullable()
AppointmentEndTime = System.DateTime.MinValue
AppointmentFacilityID = 0<FacilityId>
AppointmentForeignEHRID = Nullable()
AppointmentID = 0<AppointmentId>
AppointmentLOS = null
AppointmentPatientID = 0<PatientId>
AppointmentPatientInfoID = 0<PatientInfoId>
AppointmentPrimaryGuarantorType = null
AppointmentProviderScheduledID = Nullable()
AppointmentStartTime = System.DateTime.MinValue
AppointmentStatus = null
AppointmentTypeID = 0
IsChecked = Nullable()
NotesToBiller = null
PresentingCondition = null
PropertyCasualtyClaimNumber = null
ReferralPcp = Nullable()
ReferralSource = null
ReferralSourceSub = null
}
module AppointmentHelpers =
module Meta =
let schemaName = "dbo"
let tableName = "Appointments"
/// int (4) null
let AdmitFacilityID = "AdmitFacilityID"
/// varchar (50) null
let AdmitStatus = "AdmitStatus"
/// datetime (8) null
let AppointmentAccidentDate = "AppointmentAccidentDate"
/// int (4) null
let AppointmentAccidentID = "AppointmentAccidentID"
/// bit (1) null
let AppointmentAccidentRelated = "AppointmentAccidentRelated"
/// varchar (2) null
let AppointmentAccidentState = "AppointmentAccidentState"
/// int (4) null
let AppointmentBillingStage = "AppointmentBillingStage"
/// bit (1) not null
let AppointmentCheckInFlag = "AppointmentCheckInFlag"
/// smalldatetime (4) null
let AppointmentCheckInTime = "AppointmentCheckInTime"
/// smalldatetime (4) null
let AppointmentCheckOutTime = "AppointmentCheckOutTime"
/// smalldatetime (4) not null
let AppointmentEndTime = "AppointmentEndTime"
/// int (4) not null
let AppointmentFacilityID = "AppointmentFacilityID"
/// int (4) null
let AppointmentForeignEHRID = "AppointmentForeignEHRID"
/// int (4) not null identity primaryKey
let AppointmentID = "AppointmentID"
/// varchar (5) null
let AppointmentLOS = "AppointmentLOS"
/// int (4) not null
let AppointmentPatientID = "AppointmentPatientID"
/// int (4) not null
let AppointmentPatientInfoID = "AppointmentPatientInfoID"
/// varchar (50) null
let AppointmentPrimaryGuarantorType = "AppointmentPrimaryGuarantorType"
/// int (4) null
let AppointmentProviderScheduledID = "AppointmentProviderScheduledID"
/// smalldatetime (4) not null
let AppointmentStartTime = "AppointmentStartTime"
/// varchar (50) not null
let AppointmentStatus = "AppointmentStatus"
/// int (4) not null
let AppointmentTypeID = "AppointmentTypeID"
/// bit (1) null
let IsChecked = "IsChecked"
/// varchar (4000) null
let NotesToBiller = "NotesToBiller"
/// varchar (120) null
let PresentingCondition = "PresentingCondition"
/// varchar (100) null
let PropertyCasualtyClaimNumber = "PropertyCasualtyClaimNumber"
/// int (4) null
let ReferralPcp = "ReferralPcp"
/// varchar (50) null
let ReferralSource = "ReferralSource"
/// varchar (50) null
let ReferralSourceSub = "ReferralSourceSub"
let inline toRecord (appointment:IAppointment) =
{
AdmitFacilityID = appointment.AdmitFacilityID
AdmitStatus = appointment.AdmitStatus
AppointmentAccidentDate = appointment.AppointmentAccidentDate
AppointmentAccidentID = appointment.AppointmentAccidentID
AppointmentAccidentRelated = appointment.AppointmentAccidentRelated
AppointmentAccidentState = appointment.AppointmentAccidentState
AppointmentBillingStage = appointment.AppointmentBillingStage
AppointmentCheckInFlag = appointment.AppointmentCheckInFlag
AppointmentCheckInTime = appointment.AppointmentCheckInTime
AppointmentCheckOutTime = appointment.AppointmentCheckOutTime
AppointmentEndTime = appointment.AppointmentEndTime
AppointmentFacilityID = appointment.AppointmentFacilityID
AppointmentForeignEHRID = appointment.AppointmentForeignEHRID
AppointmentID = appointment.AppointmentID
AppointmentLOS = appointment.AppointmentLOS
AppointmentPatientID = appointment.AppointmentPatientID
AppointmentPatientInfoID = appointment.AppointmentPatientInfoID
AppointmentPrimaryGuarantorType = appointment.AppointmentPrimaryGuarantorType
AppointmentProviderScheduledID = appointment.AppointmentProviderScheduledID
AppointmentStartTime = appointment.AppointmentStartTime
AppointmentStatus = appointment.AppointmentStatus
AppointmentTypeID = appointment.AppointmentTypeID
IsChecked = appointment.IsChecked
NotesToBiller = appointment.NotesToBiller
PresentingCondition = appointment.PresentingCondition
PropertyCasualtyClaimNumber = appointment.PropertyCasualtyClaimNumber
ReferralPcp = appointment.ReferralPcp
ReferralSource = appointment.ReferralSource
ReferralSourceSub = appointment.ReferralSourceSub
}
let fromf (f:string -> obj option) =
{
AdmitFacilityID =
match f "AdmitFacilityID" with // int<AdmitFacilityId> Nullable
|Some x -> x |> Convert.ToInt32 |> (*) 1<AdmitFacilityId> |> Nullable
|None -> Nullable()
AdmitStatus =
match f "AdmitStatus" with // string
|Some x -> x |> Convert.ToString
|None -> null
AppointmentAccidentDate =
match f "AppointmentAccidentDate" with // DateTime Nullable
|Some x -> x |> Convert.ToDateTime |> Nullable
|None -> Nullable()
AppointmentAccidentID =
match f "AppointmentAccidentID" with // int Nullable
|Some x -> x |> Convert.ToInt32 |> Nullable
|None -> Nullable()
AppointmentAccidentRelated =
match f "AppointmentAccidentRelated" with // bool Nullable
|Some x -> x |> Convert.ToBoolean |> Nullable
|None -> Nullable()
AppointmentAccidentState =
match f "AppointmentAccidentState" with // string
|Some x -> x |> Convert.ToString
|None -> null
AppointmentBillingStage =
match f "AppointmentBillingStage" with // int Nullable
|Some x -> x |> Convert.ToInt32 |> Nullable
|None -> Nullable()
AppointmentCheckInFlag =
match f "AppointmentCheckInFlag" with // bool
|Some x -> x |> Convert.ToBoolean
|None -> false
AppointmentCheckInTime =
match f "AppointmentCheckInTime" with // DateTime Nullable
|Some x -> x |> Convert.ToDateTime |> Nullable
|None -> Nullable()
AppointmentCheckOutTime =
match f "AppointmentCheckOutTime" with // DateTime Nullable
|Some x -> x |> Convert.ToDateTime |> Nullable
|None -> Nullable()
AppointmentEndTime =
match f "AppointmentEndTime" with // DateTime
|Some x -> x |> Convert.ToDateTime
|None -> System.DateTime.MinValue
AppointmentFacilityID =
match f "AppointmentFacilityID" with // int<FacilityId>
|Some x -> x |> Convert.ToInt32 |> (*) 1<FacilityId>
|None -> 0<FacilityId>
AppointmentForeignEHRID =
match f "AppointmentForeignEHRID" with // int Nullable
|Some x -> x |> Convert.ToInt32 |> Nullable
|None -> Nullable()
AppointmentID =
match f "AppointmentID" with // int<AppointmentId>
|Some x -> x |> Convert.ToInt32 |> (*) 1<AppointmentId>
|None -> 0<AppointmentId>
AppointmentLOS =
match f "AppointmentLOS" with // string
|Some x -> x |> Convert.ToString
|None -> null
AppointmentPatientID =
match f "AppointmentPatientID" with // int<PatientId>
|Some x -> x |> Convert.ToInt32 |> (*) 1<PatientId>
|None -> 0<PatientId>
AppointmentPatientInfoID =
match f "AppointmentPatientInfoID" with // int<PatientInfoId>
|Some x -> x |> Convert.ToInt32 |> (*) 1<PatientInfoId>
|None -> 0<PatientInfoId>
AppointmentPrimaryGuarantorType =
match f "AppointmentPrimaryGuarantorType" with // string
|Some x -> x |> Convert.ToString
|None -> null
AppointmentProviderScheduledID =
match f "AppointmentProviderScheduledID" with // int Nullable
|Some x -> x |> Convert.ToInt32 |> Nullable
|None -> Nullable()
AppointmentStartTime =
match f "AppointmentStartTime" with // DateTime
|Some x -> x |> Convert.ToDateTime
|None -> System.DateTime.MinValue
AppointmentStatus =
match f "AppointmentStatus" with // string
|Some x -> x |> Convert.ToString
|None -> null
AppointmentTypeID =
match f "AppointmentTypeID" with // int
|Some x -> x |> Convert.ToInt32
|None -> 0
IsChecked =
match f "IsChecked" with // bool Nullable
|Some x -> x |> Convert.ToBoolean |> Nullable
|None -> Nullable()
NotesToBiller =
match f "NotesToBiller" with // string
|Some x -> x |> Convert.ToString
|None -> null
PresentingCondition =
match f "PresentingCondition" with // string
|Some x -> x |> Convert.ToString
|None -> null
PropertyCasualtyClaimNumber =
match f "PropertyCasualtyClaimNumber" with // string
|Some x -> x |> Convert.ToString
|None -> null
ReferralPcp =
match f "ReferralPcp" with // int Nullable
|Some x -> x |> Convert.ToInt32 |> Nullable
|None -> Nullable()
ReferralSource =
match f "ReferralSource" with // string
|Some x -> x |> Convert.ToString
|None -> null
ReferralSourceSub =
match f "ReferralSourceSub" with // string
|Some x -> x |> Convert.ToString
|None -> null
}
let FromF (camelTypeF:Func<string,obj option>) = fromf (Func<_>.invoke1 camelTypeF)
let inline toRecordStp (appointment: ^a) =
{
AdmitFacilityID = (^a: (member AdmitFacilityID: _) appointment)|> Nullable.map((*) 1<AdmitFacilityId>)
AdmitStatus = (^a: (member AdmitStatus: _) appointment)
AppointmentAccidentDate = (^a: (member AppointmentAccidentDate: _) appointment)
AppointmentAccidentID = (^a: (member AppointmentAccidentID: _) appointment)
AppointmentAccidentRelated = (^a: (member AppointmentAccidentRelated: _) appointment)
AppointmentAccidentState = (^a: (member AppointmentAccidentState: _) appointment)
AppointmentBillingStage = (^a: (member AppointmentBillingStage: _) appointment)
AppointmentCheckInFlag = (^a: (member AppointmentCheckInFlag: _) appointment)
AppointmentCheckInTime = (^a: (member AppointmentCheckInTime: _) appointment)
AppointmentCheckOutTime = (^a: (member AppointmentCheckOutTime: _) appointment)
AppointmentEndTime = (^a: (member AppointmentEndTime: _) appointment)
AppointmentFacilityID = (^a: (member AppointmentFacilityID: _) appointment) * 1<FacilityId>
AppointmentForeignEHRID = (^a: (member AppointmentForeignEHRID: _) appointment)
AppointmentID = (^a: (member AppointmentID: _) appointment) * 1<AppointmentId>
AppointmentLOS = (^a: (member AppointmentLOS: _) appointment)
AppointmentPatientID = (^a: (member AppointmentPatientID: _) appointment) * 1<PatientId>
AppointmentPatientInfoID = (^a: (member AppointmentPatientInfoID: _) appointment) * 1<PatientInfoId>
AppointmentPrimaryGuarantorType = (^a: (member AppointmentPrimaryGuarantorType: _) appointment)
AppointmentProviderScheduledID = (^a: (member AppointmentProviderScheduledID: _) appointment)
AppointmentStartTime = (^a: (member AppointmentStartTime: _) appointment)
AppointmentStatus = (^a: (member AppointmentStatus: _) appointment)
AppointmentTypeID = (^a: (member AppointmentTypeID: _) appointment)
IsChecked = (^a: (member IsChecked: _) appointment)
NotesToBiller = (^a: (member NotesToBiller: _) appointment)
PresentingCondition = (^a: (member PresentingCondition: _) appointment)
PropertyCasualtyClaimNumber = (^a: (member PropertyCasualtyClaimNumber: _) appointment)
ReferralPcp = (^a: (member ReferralPcp: _) appointment)
ReferralSource = (^a: (member ReferralSource: _) appointment)
ReferralSourceSub = (^a: (member ReferralSourceSub: _) appointment)
}
//insert into dbo.Appointments(AdmitFacilityID,AdmitStatus,AppointmentAccidentDate,AppointmentAccidentID,AppointmentAccidentRelated,AppointmentAccidentState,AppointmentBillingStage,AppointmentCheckInFlag,AppointmentCheckInTime,AppointmentCheckOutTime,AppointmentEndTime,AppointmentFacilityID,AppointmentForeignEHRID,AppointmentID,AppointmentLOS,AppointmentPatientID,AppointmentPatientInfoID,AppointmentPrimaryGuarantorType,AppointmentProviderScheduledID,AppointmentStartTime,AppointmentStatus,AppointmentTypeID,IsChecked,NotesToBiller,PresentingCondition,PropertyCasualtyClaimNumber,ReferralPcp,ReferralSource,ReferralSourceSub) values (Nullable(),null,Nullable(),Nullable(),Nullable(),null,Nullable(),false,Nullable(),Nullable(),System.DateTime.MinValue,null,Nullable(),null,null,null,null,null,Nullable(),System.DateTime.MinValue,null,0,Nullable(),null,null,null,Nullable(),null,null)
let createInsert blacklist (r:IAppointment) =
let quoted (s:string) = "'" + s.Replace("'","''") + "'" // varchar
[
"AdmitFacilityID", if isNull (box r.AdmitFacilityID) then "null" else r.AdmitFacilityID |> string
"AdmitStatus", if String.IsNullOrEmpty r.AdmitStatus then "null" else quoted r.AdmitStatus
"AppointmentAccidentDate", if isNull (box r.AppointmentAccidentDate) then "null" else r.AppointmentAccidentDate |> string |> quoted
"AppointmentAccidentID", if isNull (box r.AppointmentAccidentID) then "null" else r.AppointmentAccidentID |> string
"AppointmentAccidentRelated", if isNull (box r.AppointmentAccidentRelated) then "null" else r.AppointmentAccidentRelated |> string |> quoted
"AppointmentAccidentState", if String.IsNullOrEmpty r.AppointmentAccidentState then "null" else quoted r.AppointmentAccidentState
"AppointmentBillingStage", if isNull (box r.AppointmentBillingStage) then "null" else r.AppointmentBillingStage |> string
"AppointmentCheckInFlag", r.AppointmentCheckInFlag |> string |> quoted
"AppointmentCheckInTime", if isNull (box r.AppointmentCheckInTime) then "null" else r.AppointmentCheckInTime |> string |> quoted
"AppointmentCheckOutTime", if isNull (box r.AppointmentCheckOutTime) then "null" else r.AppointmentCheckOutTime |> string |> quoted
"AppointmentEndTime", r.AppointmentEndTime |> string |> quoted
"AppointmentFacilityID", r.AppointmentFacilityID |> string
"AppointmentForeignEHRID", if isNull (box r.AppointmentForeignEHRID) then "null" else r.AppointmentForeignEHRID |> string
"AppointmentLOS", if String.IsNullOrEmpty r.AppointmentLOS then "null" else quoted r.AppointmentLOS
"AppointmentPatientID", r.AppointmentPatientID |> string
"AppointmentPatientInfoID", r.AppointmentPatientInfoID |> string
"AppointmentPrimaryGuarantorType", if String.IsNullOrEmpty r.AppointmentPrimaryGuarantorType then "null" else quoted r.AppointmentPrimaryGuarantorType
"AppointmentProviderScheduledID", if isNull (box r.AppointmentProviderScheduledID) then "null" else r.AppointmentProviderScheduledID |> string
"AppointmentStartTime", r.AppointmentStartTime |> string |> quoted
"AppointmentStatus", if String.IsNullOrEmpty r.AppointmentStatus then "null" else quoted r.AppointmentStatus
"AppointmentTypeID", r.AppointmentTypeID |> string
"IsChecked", if isNull (box r.IsChecked) then "null" else r.IsChecked |> string |> quoted
"NotesToBiller", if String.IsNullOrEmpty r.NotesToBiller then "null" else quoted r.NotesToBiller
"PresentingCondition", if String.IsNullOrEmpty r.PresentingCondition then "null" else quoted r.PresentingCondition
"PropertyCasualtyClaimNumber", if String.IsNullOrEmpty r.PropertyCasualtyClaimNumber then "null" else quoted r.PropertyCasualtyClaimNumber
"ReferralPcp", if isNull (box r.ReferralPcp) then "null" else r.ReferralPcp |> string
"ReferralSource", if String.IsNullOrEmpty r.ReferralSource then "null" else quoted r.ReferralSource
"ReferralSourceSub", if String.IsNullOrEmpty r.ReferralSourceSub then "null" else quoted r.ReferralSourceSub
]
|> Seq.filter (fun kvp -> blacklist |> Seq.contains (fst kvp) |> not)
|> fun pairs -> sprintf "insert into dbo.Appointments(%s) values (%s)" (String.Join(",", pairs |> Seq.map fst )) (String.Join(",", pairs |> Seq.map snd))
|> sprintf "%s;select SCOPE_IDENTITY()"
/// 29 properties
type AppointmentN (model:AppointmentRecord) =
let propertyChanged = new Event<_, _>()
let mutable admitFacilityID = model.AdmitFacilityID
let mutable admitStatus = model.AdmitStatus
let mutable appointmentAccidentDate = model.AppointmentAccidentDate
let mutable appointmentAccidentID = model.AppointmentAccidentID
let mutable appointmentAccidentRelated = model.AppointmentAccidentRelated
let mutable appointmentAccidentState = model.AppointmentAccidentState
let mutable appointmentBillingStage = model.AppointmentBillingStage
let mutable appointmentCheckInFlag = model.AppointmentCheckInFlag
let mutable appointmentCheckInTime = model.AppointmentCheckInTime
let mutable appointmentCheckOutTime = model.AppointmentCheckOutTime
let mutable appointmentEndTime = model.AppointmentEndTime
let mutable appointmentFacilityID = model.AppointmentFacilityID
let mutable appointmentForeignEHRID = model.AppointmentForeignEHRID
let mutable appointmentID = model.AppointmentID
let mutable appointmentLOS = model.AppointmentLOS
let mutable appointmentPatientID = model.AppointmentPatientID
let mutable appointmentPatientInfoID = model.AppointmentPatientInfoID
let mutable appointmentPrimaryGuarantorType = model.AppointmentPrimaryGuarantorType
let mutable appointmentProviderScheduledID = model.AppointmentProviderScheduledID
let mutable appointmentStartTime = model.AppointmentStartTime
let mutable appointmentStatus = model.AppointmentStatus
let mutable appointmentTypeID = model.AppointmentTypeID
let mutable isChecked = model.IsChecked
let mutable notesToBiller = model.NotesToBiller
let mutable presentingCondition = model.PresentingCondition
let mutable propertyCasualtyClaimNumber = model.PropertyCasualtyClaimNumber
let mutable referralPcp = model.ReferralPcp
let mutable referralSource = model.ReferralSource
let mutable referralSourceSub = model.ReferralSourceSub
interface IAppointment with
/// int (4) null
member x.AdmitFacilityID with get () = x.AdmitFacilityID
/// varchar (50) null
member x.AdmitStatus with get () = x.AdmitStatus
/// datetime (8) null
member x.AppointmentAccidentDate with get () = x.AppointmentAccidentDate
/// int (4) null
member x.AppointmentAccidentID with get () = x.AppointmentAccidentID
/// bit (1) null
member x.AppointmentAccidentRelated with get () = x.AppointmentAccidentRelated
/// varchar (2) null
member x.AppointmentAccidentState with get () = x.AppointmentAccidentState
/// int (4) null
member x.AppointmentBillingStage with get () = x.AppointmentBillingStage
/// bit (1) not null
member x.AppointmentCheckInFlag with get () = x.AppointmentCheckInFlag
/// smalldatetime (4) null
member x.AppointmentCheckInTime with get () = x.AppointmentCheckInTime
/// smalldatetime (4) null
member x.AppointmentCheckOutTime with get () = x.AppointmentCheckOutTime
/// smalldatetime (4) not null
member x.AppointmentEndTime with get () = x.AppointmentEndTime
/// int (4) not null
member x.AppointmentFacilityID with get () = x.AppointmentFacilityID
/// int (4) null
member x.AppointmentForeignEHRID with get () = x.AppointmentForeignEHRID
/// int (4) not null identity primaryKey
member x.AppointmentID with get () = x.AppointmentID
/// varchar (5) null
member x.AppointmentLOS with get () = x.AppointmentLOS
/// int (4) not null
member x.AppointmentPatientID with get () = x.AppointmentPatientID
/// int (4) not null
member x.AppointmentPatientInfoID with get () = x.AppointmentPatientInfoID
/// varchar (50) null
member x.AppointmentPrimaryGuarantorType with get () = x.AppointmentPrimaryGuarantorType
/// int (4) null
member x.AppointmentProviderScheduledID with get () = x.AppointmentProviderScheduledID
/// smalldatetime (4) not null
member x.AppointmentStartTime with get () = x.AppointmentStartTime
/// varchar (50) not null
member x.AppointmentStatus with get () = x.AppointmentStatus
/// int (4) not null
member x.AppointmentTypeID with get () = x.AppointmentTypeID
/// bit (1) null
member x.IsChecked with get () = x.IsChecked
/// varchar (4000) null
member x.NotesToBiller with get () = x.NotesToBiller
/// varchar (120) null
member x.PresentingCondition with get () = x.PresentingCondition
/// varchar (100) null
member x.PropertyCasualtyClaimNumber with get () = x.PropertyCasualtyClaimNumber
/// int (4) null
member x.ReferralPcp with get () = x.ReferralPcp
/// varchar (50) null
member x.ReferralSource with get () = x.ReferralSource
/// varchar (50) null
member x.ReferralSourceSub with get () = x.ReferralSourceSub
interface IAppointmentRW with
/// int (4) null
member x.AdmitFacilityID with get () = x.AdmitFacilityID and set v = x.AdmitFacilityID <- v
/// varchar (50) null
member x.AdmitStatus with get () = x.AdmitStatus and set v = x.AdmitStatus <- v
/// datetime (8) null
member x.AppointmentAccidentDate with get () = x.AppointmentAccidentDate and set v = x.AppointmentAccidentDate <- v
/// int (4) null
member x.AppointmentAccidentID with get () = x.AppointmentAccidentID and set v = x.AppointmentAccidentID <- v
/// bit (1) null
member x.AppointmentAccidentRelated with get () = x.AppointmentAccidentRelated and set v = x.AppointmentAccidentRelated <- v
/// varchar (2) null
member x.AppointmentAccidentState with get () = x.AppointmentAccidentState and set v = x.AppointmentAccidentState <- v
/// int (4) null
member x.AppointmentBillingStage with get () = x.AppointmentBillingStage and set v = x.AppointmentBillingStage <- v
/// bit (1) not null
member x.AppointmentCheckInFlag with get () = x.AppointmentCheckInFlag and set v = x.AppointmentCheckInFlag <- v
/// smalldatetime (4) null
member x.AppointmentCheckInTime with get () = x.AppointmentCheckInTime and set v = x.AppointmentCheckInTime <- v
/// smalldatetime (4) null
member x.AppointmentCheckOutTime with get () = x.AppointmentCheckOutTime and set v = x.AppointmentCheckOutTime <- v
/// smalldatetime (4) not null
member x.AppointmentEndTime with get () = x.AppointmentEndTime and set v = x.AppointmentEndTime <- v
/// int (4) not null
member x.AppointmentFacilityID with get () = x.AppointmentFacilityID and set v = x.AppointmentFacilityID <- v
/// int (4) null
member x.AppointmentForeignEHRID with get () = x.AppointmentForeignEHRID and set v = x.AppointmentForeignEHRID <- v
/// int (4) not null identity primaryKey
member x.AppointmentID with get () = x.AppointmentID and set v = x.AppointmentID <- v
/// varchar (5) null
member x.AppointmentLOS with get () = x.AppointmentLOS and set v = x.AppointmentLOS <- v
/// int (4) not null
member x.AppointmentPatientID with get () = x.AppointmentPatientID and set v = x.AppointmentPatientID <- v
/// int (4) not null
member x.AppointmentPatientInfoID with get () = x.AppointmentPatientInfoID and set v = x.AppointmentPatientInfoID <- v
/// varchar (50) null
member x.AppointmentPrimaryGuarantorType with get () = x.AppointmentPrimaryGuarantorType and set v = x.AppointmentPrimaryGuarantorType <- v
/// int (4) null
member x.AppointmentProviderScheduledID with get () = x.AppointmentProviderScheduledID and set v = x.AppointmentProviderScheduledID <- v
/// smalldatetime (4) not null
member x.AppointmentStartTime with get () = x.AppointmentStartTime and set v = x.AppointmentStartTime <- v
/// varchar (50) not null
member x.AppointmentStatus with get () = x.AppointmentStatus and set v = x.AppointmentStatus <- v
/// int (4) not null
member x.AppointmentTypeID with get () = x.AppointmentTypeID and set v = x.AppointmentTypeID <- v
/// bit (1) null
member x.IsChecked with get () = x.IsChecked and set v = x.IsChecked <- v
/// varchar (4000) null
member x.NotesToBiller with get () = x.NotesToBiller and set v = x.NotesToBiller <- v
/// varchar (120) null
member x.PresentingCondition with get () = x.PresentingCondition and set v = x.PresentingCondition <- v
/// varchar (100) null
member x.PropertyCasualtyClaimNumber with get () = x.PropertyCasualtyClaimNumber and set v = x.PropertyCasualtyClaimNumber <- v
/// int (4) null
member x.ReferralPcp with get () = x.ReferralPcp and set v = x.ReferralPcp <- v
/// varchar (50) null
member x.ReferralSource with get () = x.ReferralSource and set v = x.ReferralSource <- v
/// varchar (50) null
member x.ReferralSourceSub with get () = x.ReferralSourceSub and set v = x.ReferralSourceSub <- v
member x.MakeRecord () = x :> IAppointment |> AppointmentHelpers.toRecord
interface INotifyPropertyChanged with
[<CLIEvent>]
member __.PropertyChanged = propertyChanged.Publish
abstract member RaisePropertyChanged : string -> unit
default x.RaisePropertyChanged(propertyName : string) = propertyChanged.Trigger(x, PropertyChangedEventArgs(propertyName))
abstract member SetAndNotify<'t,'b> : string * 'b * 't Action * 't -> bool
default x.SetAndNotify<'t,'b> (propertyName, baseValue:'b, baseSetter: 't Action, value:'t) =
if obj.ReferenceEquals(box baseValue,box value) then false
else
baseSetter.Invoke value
x.RaisePropertyChanged(propertyName)
true
/// int (4) null
member x.AdmitFacilityID
with get() = admitFacilityID
and set v =
admitFacilityID <- v
x.RaisePropertyChanged "AdmitFacilityID"
/// varchar (50) null
member x.AdmitStatus
with get() = admitStatus
and set v =
admitStatus <- v
x.RaisePropertyChanged "AdmitStatus"
/// datetime (8) null
member x.AppointmentAccidentDate
with get() = appointmentAccidentDate
and set v =
appointmentAccidentDate <- v
x.RaisePropertyChanged "AppointmentAccidentDate"
/// int (4) null
member x.AppointmentAccidentID
with get() = appointmentAccidentID
and set v =
appointmentAccidentID <- v
x.RaisePropertyChanged "AppointmentAccidentID"
/// bit (1) null
member x.AppointmentAccidentRelated
with get() = appointmentAccidentRelated
and set v =
appointmentAccidentRelated <- v
x.RaisePropertyChanged "AppointmentAccidentRelated"
/// varchar (2) null
member x.AppointmentAccidentState
with get() = appointmentAccidentState
and set v =
appointmentAccidentState <- v
x.RaisePropertyChanged "AppointmentAccidentState"
/// int (4) null
member x.AppointmentBillingStage
with get() = appointmentBillingStage
and set v =
appointmentBillingStage <- v
x.RaisePropertyChanged "AppointmentBillingStage"
/// bit (1) not null
member x.AppointmentCheckInFlag
with get() = appointmentCheckInFlag
and set v =
appointmentCheckInFlag <- v
x.RaisePropertyChanged "AppointmentCheckInFlag"
/// smalldatetime (4) null
member x.AppointmentCheckInTime
with get() = appointmentCheckInTime
and set v =
appointmentCheckInTime <- v
x.RaisePropertyChanged "AppointmentCheckInTime"
/// smalldatetime (4) null
member x.AppointmentCheckOutTime
with get() = appointmentCheckOutTime
and set v =
appointmentCheckOutTime <- v
x.RaisePropertyChanged "AppointmentCheckOutTime"
/// smalldatetime (4) not null
member x.AppointmentEndTime
with get() = appointmentEndTime
and set v =
appointmentEndTime <- v
x.RaisePropertyChanged "AppointmentEndTime"
/// int (4) not null
member x.AppointmentFacilityID
with get() = appointmentFacilityID
and set v =
appointmentFacilityID <- v
x.RaisePropertyChanged "AppointmentFacilityID"
/// int (4) null
member x.AppointmentForeignEHRID
with get() = appointmentForeignEHRID
and set v =
appointmentForeignEHRID <- v
x.RaisePropertyChanged "AppointmentForeignEHRID"
/// int (4) not null identity primaryKey
member x.AppointmentID
with get() = appointmentID
and set v =
appointmentID <- v
x.RaisePropertyChanged "AppointmentID"
/// varchar (5) null
member x.AppointmentLOS
with get() = appointmentLOS
and set v =
appointmentLOS <- v
x.RaisePropertyChanged "AppointmentLOS"
/// int (4) not null
member x.AppointmentPatientID
with get() = appointmentPatientID
and set v =
appointmentPatientID <- v
x.RaisePropertyChanged "AppointmentPatientID"
/// int (4) not null
member x.AppointmentPatientInfoID
with get() = appointmentPatientInfoID
and set v =
appointmentPatientInfoID <- v
x.RaisePropertyChanged "AppointmentPatientInfoID"
/// varchar (50) null
member x.AppointmentPrimaryGuarantorType
with get() = appointmentPrimaryGuarantorType
and set v =
appointmentPrimaryGuarantorType <- v
x.RaisePropertyChanged "AppointmentPrimaryGuarantorType"
/// int (4) null
member x.AppointmentProviderScheduledID
with get() = appointmentProviderScheduledID
and set v =
appointmentProviderScheduledID <- v
x.RaisePropertyChanged "AppointmentProviderScheduledID"
/// smalldatetime (4) not null
member x.AppointmentStartTime
with get() = appointmentStartTime
and set v =
appointmentStartTime <- v
x.RaisePropertyChanged "AppointmentStartTime"
/// varchar (50) not null
member x.AppointmentStatus
with get() = appointmentStatus
and set v =
appointmentStatus <- v
x.RaisePropertyChanged "AppointmentStatus"
/// int (4) not null
member x.AppointmentTypeID
with get() = appointmentTypeID
and set v =
appointmentTypeID <- v
x.RaisePropertyChanged "AppointmentTypeID"
/// bit (1) null
member x.IsChecked
with get() = isChecked
and set v =
isChecked <- v
x.RaisePropertyChanged "IsChecked"
/// varchar (4000) null
member x.NotesToBiller
with get() = notesToBiller
and set v =
notesToBiller <- v
x.RaisePropertyChanged "NotesToBiller"
/// varchar (120) null
member x.PresentingCondition
with get() = presentingCondition
and set v =
presentingCondition <- v
x.RaisePropertyChanged "PresentingCondition"
/// varchar (100) null
member x.PropertyCasualtyClaimNumber
with get() = propertyCasualtyClaimNumber
and set v =
propertyCasualtyClaimNumber <- v
x.RaisePropertyChanged "PropertyCasualtyClaimNumber"
/// int (4) null
member x.ReferralPcp
with get() = referralPcp
and set v =
referralPcp <- v
x.RaisePropertyChanged "ReferralPcp"
/// varchar (50) null
member x.ReferralSource
with get() = referralSource
and set v =
referralSource <- v
x.RaisePropertyChanged "ReferralSource"
/// varchar (50) null
member x.ReferralSourceSub
with get() = referralSourceSub
and set v =
referralSourceSub <- v
x.RaisePropertyChanged "ReferralSourceSub"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment