When Abstractions Break
5 weeks ago
:set magic?
returns:magic
namespace 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 +
doesgv
public 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));