The book is done!
1 week ago
:set magic? returns:magicnamespace PracticeManagement.Foundation.DataModels
{
public class BillingStageDataAccess
{
public static IEnumerable<BillingStageDataModel> LoadRejectedGrid(string payerId, Connector cn)
{
return Pm.Dal.BillingStages.loadRejectedGrid(payerId, SessionVariables.Instance.CurrentFacility.FacilityID, cn)
.Select(r => new BillingStageDataModel(r));
}
public static IEnumerable<BillingStageDataModel> LoadPendingGrid(string payerId, Connector cn)
{
return Pm.Dal.BillingStages.loadPendingGrid(payerId, SessionVariables.Instance.CurrentFacility.FacilityID, cn)
.Select(r=> new BillingStageDataModel(r));
}
public static IEnumerable<BillingStageDataModel> LoadReviewGrid(string payerId, Connector cn)
{
return Pm.Dal.BillingStages.loadReviewGrid(payerId, SessionVariables.Instance.CurrentFacility.FacilityID, cn)
.Select(r => new BillingStageDataModel(r));
}
public static IEnumerable<BillingStageDataModel> LoadPatientBilling(bool? includeThirdParty, Connector cn)
{
return Pm.Dal.BillingStages.loadPatientBilling(SessionVariables.Instance.CurrentFacility.FacilityID, includeThirdParty, cn).Select(bsm => new BillingStageDataModel(new Pm.Schema.BillingStageRecord(bsm.Age.ToString(), 0m, 0m, bsm.DOS ?? DateTime.Now, null, 0, bsm.FirstStatement ?? DateTime.Now, bsm.NofStatements ?? 0, bsm.PatientName, bsm.ThirdPartyPayerId ?? 0, null, null, bsm.Appointmentid ?? 0, null, null)) { PrimaryGuarantorType= bsm.AppointmentPrimaryGuarantorType });
}
public static IEnumerable<BillingStageDataModel> LoadCompleted(Connector cn)
{
return Pm.Dal.BillingStages.loadCompleted(SessionVariables.Instance.CurrentFacility.FacilityID, cn).Select(bsm => new BillingStageDataModel(new Pm.Schema.BillingStageRecord(null,bsm.ClaimAmount ?? 0, 0, bsm.DOS ?? DateTime.Now, bsm.Claimdate ?? DateTime.Now, bsm.Daysfilled ?? 0, null, 0,bsm.PatientName, 0, bsm.Claimstatus, null, bsm.Appointmentid ?? 0,null,null)));
}
public static IEnumerable<BillingStageDataModel> LoadPrepGrid(int facilityId, Connector cn)
{
return Pm.Dal.BillingStages.loadPrepClaimGrid(facilityId, cn).Select(r => new BillingStageDataModel(r));
}
}
}
dd to delete the namespace and class linesmodule name =:'<,'>s:^\s*[{}]\s*$:* doesn't need an escape but in other places + doesgvpublic static T with
:'<,'>s:public static [\w<>]\+:let+ needed to be escaped!gv<< followed by . as needed
gv:'<,'>s/return /gv= on the end of the let lines with :'<,'>s:let .*:\0 =gv:'<,'>s:let \(\u\w\+\):let \l\1 or closer to regular regex :'<,'>s:let \([A-Z]\w\+\):let \l\1( and ) for capturing groups+ (:'<,'>s:let \(\u\w+\):let \l\1 did not work)
.*gv:'<,'>s/\(let \w\+\)(\?\(\w\+\)\(?\)\? \(\w\+\)[,)]/\1(\3\4:\2)/ ? (Nullable to the front for replacement with the word `Nullable` in F#)
module BillingStages =
let loadRejectedGrid(payerId:string) Connector cn) =
Pm.Dal.BillingStages.loadRejectedGrid(payerId, SessionVariables.Instance.CurrentFacility.FacilityID, cn)
.Select(r => new BillingStageDataModel(r));
let loadPendingGrid(payerId:string) Connector cn) =
Pm.Dal.BillingStages.loadPendingGrid(payerId, SessionVariables.Instance.CurrentFacility.FacilityID, cn)
.Select(r=> new BillingStageDataModel(r));
let loadReviewGrid(payerId:string) Connector cn) =
Pm.Dal.BillingStages.loadReviewGrid(payerId, SessionVariables.Instance.CurrentFacility.FacilityID, cn)
.Select(r => new BillingStageDataModel(r));
let loadPatientBilling(?includeThirdParty:bool) Connector cn) =
Pm.Dal.BillingStages.loadPatientBilling(SessionVariables.Instance.CurrentFacility.FacilityID, includeThirdParty, cn).Select(bsm => new BillingStageDataModel(new Pm.Schema.BillingStageRecord(bsm.Age.ToString(), 0m, 0m, bsm.DOS ?? DateTime.Now, null, 0, bsm.FirstStatement ?? DateTime.Now, bsm.NofStatements ?? 0, bsm.PatientName, bsm.ThirdPartyPayerId ?? 0, null, null, bsm.Appointmentid ?? 0, null, null)) { PrimaryGuarantorType= bsm.AppointmentPrimaryGuarantorType });
let loadCompleted(cn:Connector) =
Pm.Dal.BillingStages.loadCompleted(SessionVariables.Instance.CurrentFacility.FacilityID, cn).Select(bsm => new BillingStageDataModel(new Pm.Schema.BillingStageRecord(null,bsm.ClaimAmount ?? 0, 0, bsm.DOS ?? DateTime.Now, bsm.Claimdate ?? DateTime.Now, bsm.Daysfilled ?? 0, null, 0,bsm.PatientName, 0, bsm.Claimstatus, null, bsm.Appointmentid ?? 0,null,null)));
let loadPrepGrid(facilityId:int) Connector cn) =
Pm.Dal.BillingStages.loadPrepClaimGrid(facilityId, cn).Select(r => new BillingStageDataModel(r));
INotifyPropertyChanged for WPF consumptionINotifyPropertyChanged desires magic strings (exception in the lovely new C# 6 nameof operator) so automation makes sure the strings are correct as of the last time T4 was run- Generator and generated code from new T4 to F#
Things I want to add:
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Performance Tools\vsinstr.exe" -coverage "%1" "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Performance Tools\VSPerfCmd.exe" /start:coverage /output:run.coverage start "%1" /wait "%1" "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Performance Tools\VSPerfCmd.exe" /shutdown notepad "run.coverage" echo "%1" echo "%2" pauseCreate an External Tool Entry in your Visual Studio Tools Menu.
$(TargetName)$(TargetExt) $(BinDir)
$(BinDir)
replace the command with wherever your new shiny batch file lives.
Then in trigger that External Tool on the Tools Menu.
It will launch your app, and you can then click around or do whatever is needed to activate parts of your application, and the results will be saved into the same directory as your executable file as run.coverage. Open this file in your already open Visual Studio instance, or drag and drop the file from explorer into VS.
There you have your App's coverage metrics for that run.