[SIZE=1]let
TFR = Table.TransformColumnTypes(Table.FromRecords({[DateTime = DateTime.FixedLocalNow(),Type = "Error",Kind = "Source data is not available"]}),{{"DateTime", type datetime}}),
Source = Csv.Document(File.Contents("O:\Dashboards\Disability Mgmnt\Data\DM_raw.txt"),[Delimiter="|", Columns=29, Encoding=65001, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = try Table.TransformColumnTypes(#"Promoted Headers",{{"MCA", type text}, {"MCA_MISS", type text}, {"PROV_NAME", type text}, {"PROV_MISS", type text}, {"MRN", type number}, {"PATIENT", type text}, {"FIRSTVIS", type date}, {"LASTVIS", type date}, {"LASTVIS_TYPE", type text}, {"APPT_STAT", type text}, {"NEXT_APPT", type datetime}, {"ACCT_ID", type number}, {"DOI", type date}, {"EMPLOYER", type text}, {"PAYOR", type text}, {"MOD_", Int64.Type}, {"OFF_", Int64.Type}, {"SURGERYDT", type datetime}, {"SURGERYPROC", type text}, {"CLOSEDREASON", type text}, {"ARX_MMI", type date}, {"FACE_PS", type date}, {"DX_ARX", type text}, {"ICD10", type text}, {"CASE_REVIEW_DATE", type date}, {"CASE_FOLLOWUP_DATE", type date}, {"CLOSED_DATE", type date}, {"FUT_MED", type text}, {"LAST_OPN_DT", type datetime}}) otherwise TFR
in
#"Changed Type"[/SIZE]