コード例 #1
0
 public EncounterImport Clone()
 {
     EncounterImport result = new EncounterImport();
     result.EncounterImportID = this.EncounterImportID;
     result.FileID = this.FileID;
     result.RowNumber = this.RowNumber;
     result.PatientNumber = this.PatientNumber;
     result.EncounterNumber = this.EncounterNumber;
     result.Facility = this.Facility;
     result.ErrorCodeID = this.ErrorCodeID;
     result.RawLine = this.RawLine;
     return result;
 }
コード例 #2
0
        public void Execute(ref EncounterImport import)
        {
            Parameters.AddWithValue("@FileID", import.FileID);
            Parameters.AddWithValue("@RowNumber", import.RowNumber);
            Parameters.AddWithValue("@PatientNumber", import.PatientNumber);
            Parameters.AddWithValue("@EncounterNumber", import.EncounterNumber);
            Parameters.AddWithValue("@Facility", import.Facility);
            Parameters.AddWithValue("@RawLine", import.RawLine);

            DataTable t = ExecuteReader();
            if (t.Rows.Count > 0)
            {
                import.EncounterImportID = t.Rows[0].Field<int>("EncounterImportID"); 
            }

        }
コード例 #3
0
 public void EncounterImportSave(ref EncounterImport import)
 {
     spEncounterImportAdd proc = new spEncounterImportAdd(this.ConnectionString);
     proc.Execute(ref import);
 }
コード例 #4
0
        public void SaveToStaging(Job job, int lineNumber, string rawLine, IClientDataProvider DataProvider)
        {
            // parse the appropriate objects out and save to the database
            EncounterImport import = new EncounterImport()
            {
                FileID = job.FileID,
                EncounterNumber = this.EncounterNumber,
                PatientNumber = this.PatientNumber,
                Facility = this.Facility,
                RawLine = rawLine,
                RowNumber = lineNumber
            };
            DataProvider.EncounterImportSave(ref import);
            this.EncounterImportID = import.EncounterImportID;

            try
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    StagingAddress address = GetAddressValues(job);
                    address.EncounterImportID = this.EncounterImportID;
                    DataProvider.StagingAddressSave(ref address);

                    StagingEncounterFile encounter = GetEncounterValues(job);
                    encounter.EncounterImportID = this.EncounterImportID;
                    DataProvider.StagingEncounterFileSave(ref encounter);

                    StagingPerson person = GetPersonValues(job);
                    person.EncounterImportID = this.EncounterImportID;
                    DataProvider.StagingPersonSave(ref person);

                    //throw new Exception("Test transaction handling");
                    StagingPatient patient = GetPatientValues(job);
                    patient.EncounterImportID = this.EncounterImportID;
                    DataProvider.StagingPatientSave(ref patient);

                    StagingEncounterPayment payment = GetPaymentValues(job);
                    payment.EncounterImportID = this.EncounterImportID;
                    DataProvider.StagingEncounterPaymentSave(ref payment);

                    scope.Complete();
                }
            }
            catch (TransactionAbortedException ex)
            {
                log.Error(ex);
            }
            catch (Exception ex)
            {
                log.Error(ex);
            }
        }