예제 #1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the payFileImportData EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTopayFileImportData(payFileImportData payFileImportData)
 {
     base.AddObject("payFileImportData", payFileImportData);
 }
예제 #2
0
        protected int SavePatientRecord(PatientData patData)
        {
            bool isNewMember = false;

            payFileImportData fid = new payFileImportData();

            //get patient record by hmoId
            chsi.dat.payNewPatients pat = (from patients in db.payNewPatients
                                           join payerIds in db.payPatientPayers on patients.payNewPatientId equals payerIds.payNewPatientId
                                           where payerIds.HMOId == patData.HmoId
                                           select patients).FirstOrDefault();

            int patId = 0;

            if (pat == null)
            {
                _newMemberCount += 1;
                isNewMember = true;
                //if patient is not in the database, insert patient into database
                patId = chsi.dom.pay.NewPatients.AddToNewPatients(patData);
            }
            else
            {
                if (pat.Active == false)
                    _newMemberCount += 1;

                //only update address, phone, and provider from file if not in nextgen
                if (pat.Address == null)
                {
                    pat.Address = Upper(patData.Address);
                    pat.City = Upper(patData.City);
                    pat.State = Upper(patData.State);
                    pat.Zip = patData.Zip;
                }

                if (pat.Phone == null)
                    pat.Phone = patData.Phone;

                if (pat.NG_provider_id == null)
                {
                    if (patData.NGProviderId != null)
                        pat.NG_provider_id = patData.NGProviderId;
                }

                pat.EnrollmentDate = patData.EffectiveDate;
                pat.TermDate = patData.TermDate;
                pat.payPayerId = (int)_payer;

                if ((int)patData.BusinessLine != 0)
                    pat.payBusinessLineId = (int)patData.BusinessLine;

                pat.Active = true;

                db.SaveChanges();
                patId = pat.payNewPatientId;
            }

            _activeMemberCount += 1;

            UpdateFileImportData(patId, fileImport.payFileImport, isNewMember, false, patData.NGProviderId);

            return patId;
        }
예제 #3
0
 /// <summary>
 /// Create a new payFileImportData object.
 /// </summary>
 /// <param name="payFileImportDataId">Initial value of the payFileImportDataId property.</param>
 /// <param name="payFileImport">Initial value of the payFileImport property.</param>
 /// <param name="payNewPatientId">Initial value of the payNewPatientId property.</param>
 /// <param name="isAdded">Initial value of the isAdded property.</param>
 /// <param name="isDeleted">Initial value of the isDeleted property.</param>
 /// <param name="hasVisit">Initial value of the hasVisit property.</param>
 public static payFileImportData CreatepayFileImportData(global::System.Int32 payFileImportDataId, global::System.Int32 payFileImport, global::System.Int32 payNewPatientId, global::System.Boolean isAdded, global::System.Boolean isDeleted, global::System.Boolean hasVisit)
 {
     payFileImportData payFileImportData = new payFileImportData();
     payFileImportData.payFileImportDataId = payFileImportDataId;
     payFileImportData.payFileImport = payFileImport;
     payFileImportData.payNewPatientId = payNewPatientId;
     payFileImportData.isAdded = isAdded;
     payFileImportData.isDeleted = isDeleted;
     payFileImportData.hasVisit = hasVisit;
     return payFileImportData;
 }