public void RunGrouperAndCheckOutputTest() { // Note: I put all of the asserts in one test due to the high cost of actually running the grouper. inputRecord.PatientName = "PatientNamePatientNamePatientNa"; inputRecord.MedicalRecordNumber = "MedicalRecord"; inputRecord.AccountNumber = "AccountNumberAcco"; inputRecord.AdmitDate = new DateTime(2010, 1, 2); inputRecord.DischargeDate = new DateTime(2010, 1, 3); inputRecord.DischargeStatus = 20; inputRecord.PrimaryPayer = 1; inputRecord.LOS = 987; inputRecord.BirthDate = new DateTime(1971, 1, 4); inputRecord.Age = 41; inputRecord.Sex = 1; inputRecord.AdmitDiagnosis = "34400"; inputRecord.PrimaryDiagnosis = "486"; inputRecord.SetSecondaryDiagnoses(1, "7802"); inputRecord.SetSecondaryDiagnoses(2, "34691"); inputRecord.SetSecondaryDiagnoses(3, "45341"); inputRecord.SetSecondaryDiagnoses(4, "27651"); inputRecord.SetSecondaryDiagnoses(5, "V4582"); inputRecord.SetSecondaryDiagnoses(6, "78651"); inputRecord.SetSecondaryDiagnoses(7, "1890"); inputRecord.SetSecondaryDiagnoses(8, "5601"); inputRecord.SetSecondaryDiagnoses(9, "5589"); inputRecord.PrincipalProcedure = "8622"; inputRecord.SetSecondaryProcedures(1, "8628"); inputRecord.SetSecondaryProcedures(2, "9904"); inputRecord.SetProcedureDate(1, new DateTime(2010, 1, 5)); inputRecord.SetProcedureDate(2, new DateTime(2010, 1, 6)); inputRecord.SetProcedureDate(3, new DateTime(2010, 1, 7)); inputRecord.ApplyHACLogic = "X"; inputRecord.OptionalInformation = "OptionalInformationOptionalInformationOptionalInformationOptionalInforma"; grouper.AddRecordToBeGrouped(inputRecord); grouper.RunGrouper(); grouper.GetGroupedRecord(outputRecord); // Make sure input parameters match after going through the grouper. Assert.AreEqual(inputRecord.PatientName, outputRecord.PatientName); Assert.AreEqual(inputRecord.MedicalRecordNumber, outputRecord.MedicalRecordNumber); Assert.AreEqual(inputRecord.AccountNumber, outputRecord.AccountNumber); Assert.AreEqual(inputRecord.AdmitDate, outputRecord.AdmitDate); Assert.AreEqual(inputRecord.DischargeDate, outputRecord.DischargeDate); Assert.AreEqual(inputRecord.DischargeStatus, outputRecord.DischargeStatus); Assert.AreEqual(inputRecord.PrimaryPayer, outputRecord.PrimaryPayer); Assert.AreEqual(inputRecord.LOS, outputRecord.LOS); Assert.AreEqual(inputRecord.BirthDate, outputRecord.BirthDate); Assert.AreEqual(inputRecord.Age, outputRecord.Age); Assert.AreEqual(inputRecord.Sex, outputRecord.Sex); Assert.AreEqual(inputRecord.AdmitDiagnosis, outputRecord.AdmitDiagnosis); Assert.AreEqual(inputRecord.PrimaryDiagnosis, outputRecord.PrimaryDiagnosis); Assert.AreEqual(inputRecord.GetSecondaryDiagnoses(1), outputRecord.GetSecondaryDiagnoses(1)); Assert.AreEqual(inputRecord.GetSecondaryDiagnoses(2), outputRecord.GetSecondaryDiagnoses(2)); Assert.AreEqual(inputRecord.GetSecondaryDiagnoses(3), outputRecord.GetSecondaryDiagnoses(3)); Assert.AreEqual(inputRecord.GetSecondaryDiagnoses(4), outputRecord.GetSecondaryDiagnoses(4)); Assert.AreEqual(inputRecord.GetSecondaryDiagnoses(5), outputRecord.GetSecondaryDiagnoses(5)); Assert.AreEqual(inputRecord.GetSecondaryDiagnoses(6), outputRecord.GetSecondaryDiagnoses(6)); Assert.AreEqual(inputRecord.GetSecondaryDiagnoses(7), outputRecord.GetSecondaryDiagnoses(7)); Assert.AreEqual(inputRecord.GetSecondaryDiagnoses(8), outputRecord.GetSecondaryDiagnoses(8)); Assert.AreEqual(inputRecord.GetSecondaryDiagnoses(9), outputRecord.GetSecondaryDiagnoses(9)); Assert.AreEqual(inputRecord.PrincipalProcedure, outputRecord.PrincipalProcedure); Assert.AreEqual(inputRecord.GetSecondaryProcedures(1), outputRecord.GetSecondaryProcedures(1)); Assert.AreEqual(inputRecord.GetSecondaryProcedures(2), outputRecord.GetSecondaryProcedures(2)); Assert.AreEqual(inputRecord.GetProcedureDate(1), outputRecord.GetProcedureDate(1)); Assert.AreEqual(inputRecord.GetProcedureDate(2), outputRecord.GetProcedureDate(2)); Assert.AreEqual(inputRecord.GetProcedureDate(3), outputRecord.GetProcedureDate(3)); Assert.AreEqual(inputRecord.ApplyHACLogic, outputRecord.ApplyHACLogic); Assert.AreEqual(inputRecord.OptionalInformation, outputRecord.OptionalInformation); // Check output parameters. Assert.AreEqual(270, outputRecord.MsgMceVersionUsed); Assert.AreEqual(167, outputRecord.InitialDRG); Assert.AreEqual(2, outputRecord.InitialMedicalSurgicalIndicator); Assert.AreEqual(4, outputRecord.FinalMDC); Assert.AreEqual(167, outputRecord.FinalDRG); Assert.AreEqual(2, outputRecord.FinalMedicalSurgicalIndicator); Assert.AreEqual(0, outputRecord.DRGReturnCode); Assert.AreEqual(0, outputRecord.MsgMceEditReturnCode); Assert.AreEqual(10, outputRecord.DiagnosticCodeCount); Assert.AreEqual(3, outputRecord.ProcedureCodeCount); Assert.AreEqual(12, outputRecord.PrincipalDiagnosisEditReturnFlag1); Assert.AreEqual(0, outputRecord.PrincipalDiagnosisEditReturnFlag2); Assert.AreEqual(0, outputRecord.PrincipalDiagnosisEditReturnFlag3); Assert.AreEqual(0, outputRecord.PrincipalDiagnosisEditReturnFlag4); Assert.AreEqual(0, outputRecord.PrincipalDiagnosisHACAssigned); Assert.AreEqual(0, outputRecord.PrincipalDiagnosisHAC); for (int i = 1; i <= 2; i++) { Assert.AreEqual(0, outputRecord.GetSecondaryDiagnosesReturnFlag1(i)); Assert.AreEqual(0, outputRecord.GetSecondaryDiagnosesReturnFlag2(i)); Assert.AreEqual(0, outputRecord.GetSecondaryDiagnosesReturnFlag3(i)); Assert.AreEqual(0, outputRecord.GetSecondaryDiagnosesReturnFlag4(i)); } Assert.AreEqual(11, outputRecord.GetSecondaryDiagnosesReturnFlag1(3)); Assert.AreEqual(12, outputRecord.GetSecondaryDiagnosesReturnFlag2(3)); Assert.AreEqual(0, outputRecord.GetSecondaryDiagnosesReturnFlag3(3)); Assert.AreEqual(0, outputRecord.GetSecondaryDiagnosesReturnFlag4(3)); for (int i = 5; i <= 6; i++) { Assert.AreEqual(0, outputRecord.GetSecondaryDiagnosesReturnFlag1(i)); Assert.AreEqual(0, outputRecord.GetSecondaryDiagnosesReturnFlag2(i)); Assert.AreEqual(0, outputRecord.GetSecondaryDiagnosesReturnFlag3(i)); Assert.AreEqual(0, outputRecord.GetSecondaryDiagnosesReturnFlag4(i)); } for (int i = 7; i <= 8; i++) { Assert.AreEqual(11, outputRecord.GetSecondaryDiagnosesReturnFlag1(i)); Assert.AreEqual(0, outputRecord.GetSecondaryDiagnosesReturnFlag2(i)); Assert.AreEqual(0, outputRecord.GetSecondaryDiagnosesReturnFlag3(i)); Assert.AreEqual(0, outputRecord.GetSecondaryDiagnosesReturnFlag4(i)); } for (int i = 9; i <= 24; i++) { Assert.AreEqual(0, outputRecord.GetSecondaryDiagnosesReturnFlag1(i)); Assert.AreEqual(0, outputRecord.GetSecondaryDiagnosesReturnFlag2(i)); Assert.AreEqual(0, outputRecord.GetSecondaryDiagnosesReturnFlag3(i)); Assert.AreEqual(0, outputRecord.GetSecondaryDiagnosesReturnFlag4(i)); } for (int i = 1; i <= 9; i++) { Assert.AreEqual(0, outputRecord.GetSecondaryDiagnosesHACAssigned(i)); } for (int i = 10; i <= 24; i++) { Assert.AreEqual(null, outputRecord.GetSecondaryDiagnosesHACAssigned(i)); } for (int i = 1; i <= 9; i++) { Assert.AreEqual(0, outputRecord.GetSecondaryDiagnosesHAC(i)); } for (int i = 10; i <= 24; i++) { Assert.AreEqual(null, outputRecord.GetSecondaryDiagnosesHAC(i)); } Assert.AreEqual(12, outputRecord.GetProcedureReturnFlag1(1)); Assert.AreEqual(20, outputRecord.GetProcedureReturnFlag2(1)); Assert.AreEqual(0, outputRecord.GetProcedureReturnFlag3(1)); Assert.AreEqual(0, outputRecord.GetProcedureReturnFlag4(1)); for (int i = 2; i <= 25; i++) { Assert.AreEqual(0, outputRecord.GetProcedureReturnFlag1(i)); Assert.AreEqual(0, outputRecord.GetProcedureReturnFlag2(i)); Assert.AreEqual(0, outputRecord.GetProcedureReturnFlag3(i)); Assert.AreEqual(0, outputRecord.GetProcedureReturnFlag4(i)); } for (int i = 1; i <= 3; i++) { Assert.AreEqual(0, outputRecord.GetProcedureHACAssigned(i)); } for (int i = 4; i <= 25; i++) { Assert.AreEqual(null, outputRecord.GetProcedureHACAssigned(i)); } Assert.AreEqual(1662, outputRecord.Initial4DigitDRG); Assert.AreEqual(1662, outputRecord.Final4DigitDRG); Assert.AreEqual(2, outputRecord.FinalDrgCcMccUsage); Assert.AreEqual(2, outputRecord.InitialDrgCcMccUsage); Assert.AreEqual(0, outputRecord.NumberOfUniqueHACMet); Assert.AreEqual(0, outputRecord.HACStatus); Assert.AreEqual((float)2.0068, outputRecord.CostWeight); }
public void InputRecordToStringTest() { StringBuilder sbExpected = new StringBuilder(); sbExpected.Append("PatientNamePatientNamePatientNa"); inputRecord.PatientName = "PatientNamePatientNamePatientNa"; sbExpected.Append("MedicalRecord"); inputRecord.MedicalRecordNumber = "MedicalRecord"; sbExpected.Append("AccountNumberAcco"); inputRecord.AccountNumber = "AccountNumberAcco"; sbExpected.Append("01/02/2010"); inputRecord.AdmitDate = new DateTime(2010, 1, 2); sbExpected.Append("01/03/2010"); inputRecord.DischargeDate = new DateTime(2010, 1, 3); sbExpected.Append("20"); inputRecord.DischargeStatus = 20; sbExpected.Append("01"); inputRecord.PrimaryPayer = 1; sbExpected.Append("987"); inputRecord.LOS = 987; sbExpected.Append("01/04/1971"); inputRecord.BirthDate = new DateTime(1971, 1, 4); sbExpected.Append("041"); inputRecord.Age = 41; sbExpected.Append("1"); inputRecord.Sex = 1; sbExpected.Append("34400 "); inputRecord.AdmitDiagnosis = "34400"; sbExpected.Append("486 "); inputRecord.PrimaryDiagnosis = "486"; sbExpected.Append("7802 "); inputRecord.SetSecondaryDiagnoses(1, "7802"); sbExpected.Append("34691 "); inputRecord.SetSecondaryDiagnoses(2, "34691"); sbExpected.Append("45341 "); inputRecord.SetSecondaryDiagnoses(3, "45341"); sbExpected.Append("27651 "); inputRecord.SetSecondaryDiagnoses(4, "27651"); sbExpected.Append("V4582 "); inputRecord.SetSecondaryDiagnoses(5, "V4582"); sbExpected.Append("78651 "); inputRecord.SetSecondaryDiagnoses(6, "78651"); sbExpected.Append("1890 "); inputRecord.SetSecondaryDiagnoses(7, "1890"); sbExpected.Append("5601 "); inputRecord.SetSecondaryDiagnoses(8, "5601"); sbExpected.Append("5589 "); inputRecord.SetSecondaryDiagnoses(9, "5589"); sbExpected.Append(" "); //10 sbExpected.Append(" "); //11 sbExpected.Append(" "); //12 sbExpected.Append(" "); //13 sbExpected.Append(" "); //14 sbExpected.Append(" "); //15 sbExpected.Append(" "); //16 sbExpected.Append(" "); //17 sbExpected.Append(" "); //18 sbExpected.Append(" "); //19 sbExpected.Append(" "); //20 sbExpected.Append(" "); //21 sbExpected.Append(" "); //22 sbExpected.Append(" "); //23 sbExpected.Append(" "); //24 sbExpected.Append("8622 "); inputRecord.PrincipalProcedure = "8622"; sbExpected.Append("8628 "); inputRecord.SetSecondaryProcedures(1, "8628"); sbExpected.Append("9904 "); inputRecord.SetSecondaryProcedures(2, "9904"); sbExpected.Append(" "); //3 sbExpected.Append(" "); //4 sbExpected.Append(" "); //5 sbExpected.Append(" "); //6 sbExpected.Append(" "); //7 sbExpected.Append(" "); //8 sbExpected.Append(" "); //9 sbExpected.Append(" "); //10 sbExpected.Append(" "); //11 sbExpected.Append(" "); //12 sbExpected.Append(" "); //13 sbExpected.Append(" "); //14 sbExpected.Append(" "); //15 sbExpected.Append(" "); //16 sbExpected.Append(" "); //17 sbExpected.Append(" "); //18 sbExpected.Append(" "); //19 sbExpected.Append(" "); //20 sbExpected.Append(" "); //21 sbExpected.Append(" "); //22 sbExpected.Append(" "); //23 sbExpected.Append(" "); //24 sbExpected.Append("01/05/2010"); inputRecord.SetProcedureDate(1, new DateTime(2010, 1, 5)); sbExpected.Append("01/06/2010"); inputRecord.SetProcedureDate(2, new DateTime(2010, 1, 6)); sbExpected.Append("01/07/2010"); inputRecord.SetProcedureDate(3, new DateTime(2010, 1, 7)); sbExpected.Append(" "); //4 sbExpected.Append(" "); //5 sbExpected.Append(" "); //6 sbExpected.Append(" "); //7 sbExpected.Append(" "); //8 sbExpected.Append(" "); //9 sbExpected.Append(" "); //10 sbExpected.Append(" "); //11 sbExpected.Append(" "); //12 sbExpected.Append(" "); //13 sbExpected.Append(" "); //14 sbExpected.Append(" "); //15 sbExpected.Append(" "); //16 sbExpected.Append(" "); //17 sbExpected.Append(" "); //18 sbExpected.Append(" "); //19 sbExpected.Append(" "); //20 sbExpected.Append(" "); //21 sbExpected.Append(" "); //22 sbExpected.Append(" "); //23 sbExpected.Append(" "); //24 sbExpected.Append(" "); //25 sbExpected.Append("X"); inputRecord.ApplyHACLogic = "X"; sbExpected.Append("OptionalInformationOptionalInformationOptionalInformationOptionalInforma"); inputRecord.OptionalInformation = "OptionalInformationOptionalInformationOptionalInformationOptionalInforma"; string expected = string.Format("{0,-832}", sbExpected.ToString()); string actual = inputRecord.ToString(); //actual = inputRecord.GetString(); Debug.WriteLine(expected); Debug.WriteLine(actual); Assert.AreEqual(expected, actual, "Actual does not match expected results."); }