public void Test_2() { var model = ParseLogic.Parse(_data[1]); Assert.Multiple(() => { Assert.That(model.MSH.버전정보, Is.EqualTo("0.8.0.0")); Assert.That(model.MSH.병원전산업체코드, Is.EqualTo("001")); Assert.That(model.MSH.제품정보, Is.EqualTo("YSR2000")); Assert.That(model.MSH.생성날짜시간, Is.EqualTo("99991231235999")); Assert.That(model.FAC.처방요양기관정보, Is.EqualTo("ys050203")); Assert.That(model.FAC.의료기관명칭, Is.EqualTo("태건병원")); Assert.That(model.FAC.요양기관주소, Is.EqualTo("")); Assert.That(model.FAC.의료기관전화번호, Is.EqualTo("02-2105-5001")); Assert.That(model.FAC.의료기관팩스번호, Is.EqualTo("")); Assert.That(model.PRD.처방의료인성명, Is.EqualTo("안태건")); Assert.That(model.PRD.면허종별, Is.EqualTo("의사")); Assert.That(model.PRD.면허번호, Is.EqualTo("8988")); Assert.That(model.PID.수진자성명, Is.EqualTo("급여2종")); Assert.That(model.PID.수진자주민등록번호, Is.EqualTo("3333333333337")); Assert.That(model.ORC.교부번호, Is.EqualTo("2017071805006")); Assert.That(model.ORC.재해발생일, Is.EqualTo("")); Assert.That(model.ORC.진료과목, Is.EqualTo("03")); Assert.That(model.ORC.특정기호, Is.EqualTo("")); Assert.That(model.ORC.사용기간, Is.EqualTo("7")); Assert.That(model.ORC.용법, Is.EqualTo("")); Assert.That(model.ORC.조제시참고사항, Is.EqualTo("")); Assert.That(model.DG1.상병분류기호1, Is.EqualTo("")); // 스페이스가 있어도 잘 파씽 되어야 한다. Assert.That(model.DG1.상병분류기호2, Is.EqualTo("")); // 스페이스가 있어도 잘 파씽 되어야 한다. Assert.That(model.IN1.보험구분, Is.EqualTo("2")); Assert.That(model.IN1.공상및보훈구분, Is.EqualTo("")); Assert.That(model.IN1.의료급여종별, Is.EqualTo("2")); Assert.That(model.IN1.증번호, Is.EqualTo("")); Assert.That(model.IN1.조합기호산개기관기호, Is.EqualTo("")); Assert.That(model.IN1.보훈번호, Is.EqualTo("")); Assert.That(model.IN1.미사용1, Is.EqualTo("1")); Assert.That(model.IN1.미사용2, Is.EqualTo("")); Assert.That(model.IN1.미사용3, Is.EqualTo("")); Assert.That(model.RXDs[0].처방구분, Is.EqualTo("1")); Assert.That(model.RXDs[0].여구분, Is.EqualTo("1")); Assert.That(model.RXDs[0].코드구분, Is.EqualTo("1")); Assert.That(model.RXDs[0].청구코드사용자코드, Is.EqualTo("052400010")); Assert.That(model.RXDs[0].약품명, Is.EqualTo("")); Assert.That(model.RXDs[0].일회투약량, Is.EqualTo("0.3333")); Assert.That(model.RXDs[0].일회투여횟수, Is.EqualTo("3")); Assert.That(model.RXDs[0].총투약일수, Is.EqualTo("1")); Assert.That(model.RXDs[0].용법코드, Is.EqualTo("")); Assert.That(model.RXDs[0].용법, Is.EqualTo("")); Assert.That(model.RXDs.Count, Is.EqualTo(1)); }); }
private void SetLabelInfo(BarcodeModel parsedModel) { int startLabelNumber = 40; // 폼에서 라벨을 만들다보니 시작이 40번이 되었다. foreach (var value in ParseLogic.GetAllPropertiesValue(parsedModel)) { var labels = this.Controls.Find("label" + startLabelNumber++, true); if (labels.Count() > 0) { var targetLabel = labels[0] as Label; if (targetLabel != null) { targetLabel.Text = value; } } } }
public bool 검증하기버튼(string path, Base검증하기Logic 검증하기Logic, I보험구분검증 보험구분검증Logic) { // 정합성 테스트 try { if (검증하기Logic == null || 보험구분검증Logic == null) { return(false); } if (!검증하기Logic.IsValid()) { return(false); } } catch (InvalidVersionException ex) { MessageHelper.ShowMessageBox(ex.Message); return(false); } try { // 올바른 바코드 테스트 _barcodeString = GetDecryptedString(검증하기Logic); BasicLayoutTest(_barcodeString); _오류목록 = GetErrorData(_barcodeString); // 실제로 파씽 var parsedModel = ParseLogic.Parse(_barcodeString); DisplayData(parsedModel); if (parsedModel != null) { if (!보험구분검증Logic.Validation(parsedModel)) { _오류목록.AddRange(보험구분검증Logic.GetErrorModel(parsedModel, _오류목록.Count())); } } SetErrorData(_오류목록); if (_오류목록.Count <= 0) { var selectedInsuranceTypeName = GetSelectedInsuranceType(); if (!string.IsNullOrEmpty(selectedInsuranceTypeName)) { _FormLogic.SaveResult(selectedInsuranceTypeName, 검증하기Logic.GetEncrytedString()); } } return(parsedModel == null ? false : true); } catch (MyLogicException ex) { InitUI(); MessageHelper.ShowMessageBox(ex.exceptionMessage); return(false); } }
public void Test_1() { var model = ParseLogic.Parse(_data[0]); Assert.Multiple(() => { Assert.That(model.MSH.버전정보, Is.EqualTo("0.8.0.0")); Assert.That(model.MSH.병원전산업체코드, Is.EqualTo("001")); Assert.That(model.MSH.제품정보, Is.EqualTo("YSR2000")); Assert.That(model.MSH.생성날짜시간, Is.EqualTo("20081117090000")); Assert.That(model.FAC.처방요양기관정보, Is.EqualTo("ys040203")); Assert.That(model.FAC.의료기관명칭, Is.EqualTo("의사랑의원")); Assert.That(model.FAC.요양기관주소, Is.EqualTo("")); Assert.That(model.FAC.의료기관전화번호, Is.EqualTo("041-583-0123")); Assert.That(model.FAC.의료기관팩스번호, Is.EqualTo("02-2105-5091")); Assert.That(model.PRD.처방의료인성명, Is.EqualTo("김의사")); Assert.That(model.PRD.면허종별, Is.EqualTo("의사")); Assert.That(model.PRD.면허번호, Is.EqualTo("42409")); Assert.That(model.PID.수진자성명, Is.EqualTo("의사랑")); Assert.That(model.PID.수진자주민등록번호, Is.EqualTo("7711111111111")); Assert.That(model.ORC.교부번호, Is.EqualTo("2008111711002")); Assert.That(model.ORC.재해발생일, Is.EqualTo("")); Assert.That(model.ORC.진료과목, Is.EqualTo("23")); Assert.That(model.ORC.특정기호, Is.EqualTo("")); Assert.That(model.ORC.사용기간, Is.EqualTo("7")); Assert.That(model.ORC.용법, Is.EqualTo("")); Assert.That(model.ORC.조제시참고사항, Is.EqualTo("저함량 배수처방 사유♬A45900471, 사유코드 : C")); Assert.That(model.DG1.상병분류기호1, Is.EqualTo("")); // 스페이스가 있어도 잘 파씽 되어야 한다. Assert.That(model.DG1.상병분류기호2, Is.EqualTo("")); // 스페이스가 있어도 잘 파씽 되어야 한다. Assert.That(model.IN1.보험구분, Is.EqualTo("1")); Assert.That(model.IN1.공상및보훈구분, Is.EqualTo("")); Assert.That(model.IN1.의료급여종별, Is.EqualTo("")); Assert.That(model.IN1.증번호, Is.EqualTo("12345678")); Assert.That(model.IN1.조합기호산개기관기호, Is.EqualTo("70271724")); Assert.That(model.IN1.보훈번호, Is.EqualTo("")); Assert.That(model.IN1.미사용1, Is.EqualTo("")); Assert.That(model.IN1.미사용2, Is.EqualTo("")); Assert.That(model.IN1.미사용3, Is.EqualTo("")); Assert.That(model.RXDs[0].처방구분, Is.EqualTo("1")); Assert.That(model.RXDs[0].여구분, Is.EqualTo("2")); Assert.That(model.RXDs[0].코드구분, Is.EqualTo("1")); Assert.That(model.RXDs[0].청구코드사용자코드, Is.EqualTo("661900010")); Assert.That(model.RXDs[0].약품명, Is.EqualTo("")); Assert.That(model.RXDs[0].일회투약량, Is.EqualTo("0.330")); Assert.That(model.RXDs[0].일회투여횟수, Is.EqualTo("3")); Assert.That(model.RXDs[0].총투약일수, Is.EqualTo("1")); Assert.That(model.RXDs[0].용법코드, Is.EqualTo("")); Assert.That(model.RXDs[0].용법, Is.EqualTo("")); Assert.That(model.RXDs[1].처방구분, Is.EqualTo("1")); Assert.That(model.RXDs[1].여구분, Is.EqualTo("1")); Assert.That(model.RXDs[1].코드구분, Is.EqualTo("1")); Assert.That(model.RXDs[1].청구코드사용자코드, Is.EqualTo("644900310")); Assert.That(model.RXDs[1].약품명, Is.EqualTo("")); Assert.That(model.RXDs[1].일회투약량, Is.EqualTo("2.500")); Assert.That(model.RXDs[1].일회투여횟수, Is.EqualTo("4")); Assert.That(model.RXDs[1].총투약일수, Is.EqualTo("1")); Assert.That(model.RXDs[1].용법코드, Is.EqualTo("")); Assert.That(model.RXDs[1].용법, Is.EqualTo("")); Assert.That(model.RXDs[5].처방구분, Is.EqualTo("1")); Assert.That(model.RXDs[5].여구분, Is.EqualTo("1")); Assert.That(model.RXDs[5].코드구분, Is.EqualTo("2")); Assert.That(model.RXDs[5].청구코드사용자코드, Is.EqualTo("693200860")); Assert.That(model.RXDs[5].약품명, Is.EqualTo("")); Assert.That(model.RXDs[5].일회투약량, Is.EqualTo("1.000")); Assert.That(model.RXDs[5].일회투여횟수, Is.EqualTo("1")); Assert.That(model.RXDs[5].총투약일수, Is.EqualTo("1")); Assert.That(model.RXDs[5].용법코드, Is.EqualTo("odw")); Assert.That(model.RXDs[5].용법, Is.EqualTo("첫주는하루한두번두째주부터는1주에2번사용")); Assert.That(model.RXDs.Count, Is.EqualTo(7)); }); }