Example #1
0
		///<summary></summary>
		public static long Insert(CanadianNetwork canadianNetwork) {
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				canadianNetwork.CanadianNetworkNum=Meth.GetLong(MethodBase.GetCurrentMethod(),canadianNetwork);
				return canadianNetwork.CanadianNetworkNum;
			}
			return Crud.CanadianNetworkCrud.Insert(canadianNetwork);
		}
Example #2
0
		///<summary></summary>
		public static void Update(CanadianNetwork canadianNetwork){
			if(RemotingClient.RemotingRole==RemotingRole.ClientWeb) {
				Meth.GetVoid(MethodBase.GetCurrentMethod(),canadianNetwork);
				return;
			}
			Crud.CanadianNetworkCrud.Update(canadianNetwork);
		}
        ///<summary></summary>
        public CanadianNetwork Copy()
        {
            CanadianNetwork c = new CanadianNetwork();

            c.CanadianNetworkNum = CanadianNetworkNum;
            c.Abbrev             = Abbrev;
            c.Descript           = Descript;
            return(c);
        }
Example #4
0
 ///<summary></summary>
 public static void Update(CanadianNetwork canadianNetwork)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), canadianNetwork);
         return;
     }
     Crud.CanadianNetworkCrud.Update(canadianNetwork);
 }
Example #5
0
 ///<summary></summary>
 public static long Insert(CanadianNetwork canadianNetwork)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         canadianNetwork.CanadianNetworkNum = Meth.GetLong(MethodBase.GetCurrentMethod(), canadianNetwork);
         return(canadianNetwork.CanadianNetworkNum);
     }
     return(Crud.CanadianNetworkCrud.Insert(canadianNetwork));
 }
		public static string RunTwo() {
			CanadianNetwork network=new CanadianNetwork();
			network.Descript="Network 2";
			network.Abbrev="Network 2";
			network.CanadianNetworkNum=2;
			network.CanadianTransactionPrefix="A";
			Provider prov=Providers.GetProv(PrefC.GetLong(PrefName.PracticeDefaultProv));
			Etrans etransAck;
			return Run(2,null,network,prov,out etransAck,new DateTime(1999,6,1));
		}
Example #7
0
        private static void TrySetCanadianNetworkNum(Carrier jsonCarrier, OpenDentBusiness.Carrier odCarrier, List <CanadianNetwork> listCanadianNetworks)
        {
            if (jsonCarrier.Network == null || jsonCarrier.Network.Count == 0)
            {
                return;                //We need to be careful not to fully trust data coming from other applications.
            }
            //Telus B is now the primary network in Canada, includes almost all carriers.
            Network jsonCarrierNetwork = jsonCarrier.Network.FirstOrDefault(x => x.Network_Folder == "TGB");

            if (jsonCarrierNetwork == null)           //We have a bypass that treats INSTREAM like Telus B.  Try looking for INSTREAM now.
            {
                jsonCarrierNetwork = jsonCarrier.Network.FirstOrDefault(x => x.Network_Folder == "INS");
            }
            if (jsonCarrierNetwork == null)           //Otherswise default to first value in list.
            {
                jsonCarrierNetwork = jsonCarrier.Network[0];
            }
            string odAbbr = "";

            switch (jsonCarrierNetwork.Network_Folder)
            {
            case "ABC":                    //Alberta Blue Cross
                odAbbr = "ABC";
                break;

            case "TGA":                    //Telus Group A, this isn't in our current json file. Best guess.
                odAbbr = "TELUS A";
                break;

            case "TGB":                    //Telus Group B
                odAbbr = "TELUS B";
                break;

            case "INS":                    //instream
                odAbbr = "CSI";            //CSI is the previous name for the network now known as INSTREAM.
                break;

            default:                                    //Unknown network_foler, CanadianNetworkNum will not be set.
                ODException.SwallowAnyException(() => { //Let HQ known if this ever happens so that it doesn't go unnoticed.
                    BugSubmissions.SubmitException(
                        new ApplicationException("Unknown iTrans Network. Name: " + jsonCarrierNetwork.Name + " - Folder: " + jsonCarrierNetwork.Network_Folder)
                        );
                });
                break;
            }
            CanadianNetwork network = listCanadianNetworks.FirstOrDefault(x => x.Abbrev == odAbbr);

            if (network != null)
            {
                odCarrier.CanadianNetworkNum = network.CanadianNetworkNum;
            }
        }
        ///<summary>Uses cache.</summary>
        public static CanadianNetwork GetNetwork(long networkNum, Clearinghouse clearinghouseClin)
        {
            //No need to check RemotingRole; no call to db.
            CanadianNetwork network = GetFirstOrDefault(x => x.CanadianNetworkNum == networkNum);

            //CSI is the previous name for the network now known as INSTREAM.
            //For ClaimStream, we use a "bidirect" such that any communication going to INSTREAM/CSI will be redirected to the TELUS B network instead.
            //This works because INSTREAM was bought out by TELUS and communications to both networks and handled by the same organization now.
            //Sending directly to INSTREAM fails with an error because TELUS expects us to use the "bidirect".
            if (clearinghouseClin.CommBridge == EclaimsCommBridge.Claimstream && network.Abbrev == "CSI")
            {
                network = GetFirstOrDefault(x => x.Abbrev == "TELUS B");
            }
            return(network);
        }
		private static string Run(int scriptNum,Carrier carrier,CanadianNetwork network,Provider prov,out Etrans etrans,DateTime reconciliationDate) {
			string retVal="";
			etrans=CanadianOutput.GetSummaryReconciliation(carrier,network,prov,reconciliationDate);
			retVal+="Summary Reconciliation#"+scriptNum.ToString()+" successful.\r\n";
			return retVal;
		}
Example #10
0
 //THIS TRANSACTION TYPE IS NOT USED BY ANY CANADIAN CARRIERS, AND IS NOT PART OF CERTIFICATION, EVEN THOUGH IT IS IN THE SPECIFICATIONS. WE NEED TO FIX BELOW COMMENTS AND MAKE THIS CODE FUNCTION MORE LIKE THE GetPaymentReconciliations() FUNCTION ABOVE.
 ///<summary>Does not exist in version 02 so only supported for version 04. Returns the request Etrans record. Usually pass in a carrier with network null.  If sending to a network, carrier will be null and we still don't see anywhere in the message format to specify network.  We expect to get clarification on this issue later. Validate provTreat as a CDANet provider before calling this function.</summary>
 public static Etrans GetSummaryReconciliation(Carrier carrier,CanadianNetwork network,Provider provTreat,DateTime reconciliationDate)
 {
     Clearinghouse clearhouse=Canadian.GetClearinghouse();
     if(clearhouse==null) {
         throw new ApplicationException("Canadian clearinghouse not found.");
     }
     string saveFolder=clearhouse.ExportPath;
     if(!Directory.Exists(saveFolder)) {
         throw new ApplicationException(saveFolder+" not found.");
     }
     StringBuilder strb=new StringBuilder();
     Etrans etrans=null;
     if(carrier!=null) {
         if((carrier.CanadianSupportedTypes&CanSupTransTypes.RequestForSummaryReconciliation_05)!=CanSupTransTypes.RequestForSummaryReconciliation_05) {
             throw new ApplicationException("The carrier does not support summary reconciliation transactions.");
         }
         etrans=Etranss.CreateCanadianOutput(0,carrier.CarrierNum,carrier.CanadianNetworkNum,
             clearhouse.ClearinghouseNum,EtransType.RequestSumm_CA,0,0);
     }
     else {//Assume network!=null
         etrans=Etranss.CreateCanadianOutput(0,0,network.CanadianNetworkNum,
             clearhouse.ClearinghouseNum,EtransType.RequestSumm_CA,0,0);
     }
     //A01 transaction prefix 12 AN
     strb.Append(Canadian.TidyAN(network.CanadianTransactionPrefix,12));
     //A02 office sequence number 6 N
     strb.Append(Canadian.TidyN(etrans.OfficeSequenceNumber,6));
     //A03 format version number 2 N
     strb.Append("04");
     //A04 transaction code 2 N
     strb.Append("05");//payment reconciliation request
     //A05 carrier id number 6 N
     if(carrier!=null) {
         strb.Append(carrier.ElectID);//already validated as 6 digit number.
     }
     else { //Assume network!=null
         strb.Append("999999");//Always 999999 when sending to a network.
     }
     //A06 software system id 3 AN
     strb.Append(Canadian.SoftwareSystemId());
     //A10 encryption method 1 N
     if(carrier!=null) {
         strb.Append(carrier.CanadianEncryptionMethod);//validated in UI
     }
     else { //Assume network!=null
         strb.Append("1");//No encryption when sending to a network.
     }
     //A07 message length N4
     strb.Append(Canadian.TidyN("63",5));
     //A09 carrier transaction counter 5 N
     strb.Append(Canadian.TidyN(etrans.CarrierTransCounter,5));
     //B01 CDA provider number 9 AN
     strb.Append(Canadian.TidyAN(provTreat.NationalProvID,9));//already validated
     //B02 (treating) provider office number 4 AN
     strb.Append(Canadian.TidyAN(provTreat.CanadianOfficeNum,4));//already validated
     //F33 Reconciliation Date 8 N
     strb.Append(reconciliationDate.ToString("yyyyMMdd"));
     //End of message construction.
     string result="";
     bool resultIsError=false;
     try {
         if(carrier!=null) {
             result=Canadian.PassToIca(strb.ToString(),clearhouse);
         }
         else { //Assume network!=null
             result=Canadian.PassToIca(strb.ToString(),clearhouse);
         }
     }
     catch(ApplicationException ex) {
         result=ex.Message;
         resultIsError=true;
         //Etranss.Delete(etrans.EtransNum);//we don't want to do this, because we want the incremented etrans.OfficeSequenceNumber to be saved
         //Attach an ack indicating failure.
     }
     //Attach an ack to the etrans
     Etrans etransAck=new Etrans();
     etransAck.PatNum=etrans.PatNum;
     etransAck.PlanNum=etrans.PlanNum;
     etransAck.InsSubNum=etrans.InsSubNum;
     etransAck.CarrierNum=etrans.CarrierNum;
     etransAck.DateTimeTrans=DateTime.Now;
     CCDFieldInputter fieldInputter=null;
     if(resultIsError) {
         etransAck.Etype=EtransType.AckError;
         etrans.Note="failed";
     }
     else {
         fieldInputter=new CCDFieldInputter(result);
         CCDField fieldG05=fieldInputter.GetFieldById("G05");
         if(fieldG05!=null) {
             etransAck.AckCode=fieldG05.valuestr;
         }
         etransAck.Etype=fieldInputter.GetEtransType();
     }
     Etranss.Insert(etransAck);
     Etranss.SetMessage(etransAck.EtransNum,result);
     etrans.AckEtransNum=etransAck.EtransNum;
     Etranss.Update(etrans);
     Etranss.SetMessage(etrans.EtransNum,strb.ToString());
     if(resultIsError) {
         throw new ApplicationException(result);
     }
     new FormCCDPrint(etrans,result,true);
     return etrans;
 }
Example #11
0
		public static string SetInitialCarriers() {
			//We are starting with zero carriers
			CanadianNetwork network=new CanadianNetwork();
			network.Abbrev="CDANET14";
			network.Descript="CDANET14";
			network.CanadianTransactionPrefix="CDANET14";
			CanadianNetworks.Insert(network);
			Carrier carrier=new Carrier();
			carrier.IsCDA=true;
			carrier.CarrierName="Carrier 1";
			carrier.CanadianNetworkNum=network.CanadianNetworkNum;
			carrier.CDAnetVersion="04";
			carrier.ElectID="666666";
			carrier.CanadianEncryptionMethod=2;
			carrier.CanadianSupportedTypes
				//claim_01 is implied
				= CanSupTransTypes.CobClaimTransaction_07
				//claimAck_11 is implied
				//claimEob_21 is implied
				| CanSupTransTypes.ClaimReversal_02
				| CanSupTransTypes.ClaimReversalResponse_12
				| CanSupTransTypes.PredeterminationSinglePage_03
				| CanSupTransTypes.PredeterminationMultiPage_03
				| CanSupTransTypes.RequestForOutstandingTrans_04
				| CanSupTransTypes.EmailTransaction_24
				| CanSupTransTypes.RequestForSummaryReconciliation_05
				| CanSupTransTypes.RequestForPaymentReconciliation_06;
			Carriers.Insert(carrier);
			//Carrier2---------------------------------------------------
			network=new CanadianNetwork();
			network.Abbrev="A";
			network.Descript="A";
			network.CanadianTransactionPrefix="A";
			CanadianNetworks.Insert(network);
			carrier=new Carrier();
			carrier.IsCDA=true;
			carrier.CarrierName="Carrier 2";
			carrier.CanadianNetworkNum=network.CanadianNetworkNum;
			carrier.CDAnetVersion="04";
			carrier.ElectID="777777";
			carrier.CanadianEncryptionMethod=1;
			carrier.CanadianSupportedTypes
				= CanSupTransTypes.EligibilityTransaction_08
				//claim_01 is implied
				//claimAck_11 is implied
				//claimEob_21 is implied
				| CanSupTransTypes.ClaimReversal_02
				| CanSupTransTypes.PredeterminationSinglePage_03
				| CanSupTransTypes.RequestForOutstandingTrans_04
				| CanSupTransTypes.EmailTransaction_24
				| CanSupTransTypes.RequestForPaymentReconciliation_06;
			Carriers.Insert(carrier);
			//Carrier3---------------------------------------------------
			network=new CanadianNetwork();
			network.Abbrev="AB";
			network.Descript="AB";
			network.CanadianTransactionPrefix="AB";
			CanadianNetworks.Insert(network);
			carrier=new Carrier();
			carrier.IsCDA=true;
			carrier.CarrierName="Carrier 3";
			carrier.CanadianNetworkNum=network.CanadianNetworkNum;
			carrier.CDAnetVersion="04";
			carrier.ElectID="888888";
			carrier.CanadianEncryptionMethod=2;
			carrier.CanadianSupportedTypes
				= CanSupTransTypes.EligibilityTransaction_08
				//claim_01 is implied
				| CanSupTransTypes.CobClaimTransaction_07
				//claimAck_11 is implied
				//claimEob_21 is implied
				| CanSupTransTypes.ClaimReversal_02
				| CanSupTransTypes.PredeterminationSinglePage_03
				| CanSupTransTypes.RequestForOutstandingTrans_04
				| CanSupTransTypes.EmailTransaction_24
				| CanSupTransTypes.RequestForPaymentReconciliation_06;
			Carriers.Insert(carrier);
			//Carrier4---------------------------------------------------
			network=new CanadianNetwork();
			network.Abbrev="ABC";
			network.Descript="ABC";
			network.CanadianTransactionPrefix="ABC";
			CanadianNetworks.Insert(network);
			carrier=new Carrier();
			carrier.IsCDA=true;
			carrier.CarrierName="Carrier 4";
			carrier.CanadianNetworkNum=network.CanadianNetworkNum;
			carrier.CDAnetVersion="04";
			carrier.ElectID="999111";
			carrier.CanadianEncryptionMethod=2;
			carrier.CanadianSupportedTypes
				= CanSupTransTypes.EligibilityTransaction_08
				//claim_01 is implied
				| CanSupTransTypes.CobClaimTransaction_07
				//claimAck_11 is implied
				//claimEob_21 is implied
				| CanSupTransTypes.ClaimReversal_02
				| CanSupTransTypes.PredeterminationSinglePage_03
				| CanSupTransTypes.RequestForOutstandingTrans_04
				| CanSupTransTypes.EmailTransaction_24
				| CanSupTransTypes.RequestForPaymentReconciliation_06;
			Carriers.Insert(carrier);
			//Carrier5---------------------------------------------------
			network=new CanadianNetwork();
			network.Abbrev="V2CAR";
			network.Descript="V2CAR";
			network.CanadianTransactionPrefix="V2CAR";
			CanadianNetworks.Insert(network);
			carrier=new Carrier();
			carrier.IsCDA=true;
			carrier.CarrierName="Carrier 5";
			carrier.CanadianNetworkNum=network.CanadianNetworkNum;
			carrier.CDAnetVersion="02";
			carrier.ElectID="555555";
			carrier.CanadianEncryptionMethod=0;//not applicable
			carrier.CanadianSupportedTypes
				= CanSupTransTypes.EligibilityTransaction_08
				| CanSupTransTypes.EligibilityResponse_18
				//claim_01 is implied
				//claimAck_11 is implied
				//claimEob_21 is implied
				| CanSupTransTypes.ClaimReversal_02
				| CanSupTransTypes.PredeterminationSinglePage_03
				| CanSupTransTypes.PredeterminationMultiPage_03;
			Carriers.Insert(carrier);
			//---------------------------------------------------------
			//Used for Payment Reconciliation test #3 and Summary Reconciliation test #3
			network=new CanadianNetwork();
			network.Abbrev="ABC";
			network.Descript="ABC";
			network.CanadianTransactionPrefix="ABC";
			CanadianNetworks.Insert(network);
			carrier=new Carrier();
			carrier.IsCDA=true;
			carrier.CarrierName="111555";
			carrier.CanadianNetworkNum=network.CanadianNetworkNum;
			carrier.CDAnetVersion="04";
			carrier.ElectID="111555";
			carrier.CanadianEncryptionMethod=0;//not applicable
			carrier.CanadianSupportedTypes
				= CanSupTransTypes.PaymentReconciliation_16;
			Carriers.Insert(carrier);
			return "Carrier objects set.\r\n";
		}