コード例 #1
0
        public Dictionary <int, int> checkItemInStock(string itemId, long clinicRecId)
        {
            Dictionary <int, int> ret = new Dictionary <int, int>();

            //HMCommonClient client = new HMCommonClient();

            //CallContext callContext = new CallContext { Company = AppSettings.GetByKey("axCompany") };
            //client.ClientCredentials.Windows.ClientCredential = new NetworkCredential { Domain = AppSettings.GetByKey("axDomain"), UserName = AppSettings.GetByKey("axUserName"), Password = AppSettings.GetByKey("axPassword") };

            //Dictionary<int, int> ret = client.checkItemInStock(callContext, itemId, clinicRecId);

            //client.Close();

            //return ret;



            try
            {
                var endpointAddress = SoapHelper.GetEndPointAddress();
                var binding         = SoapHelper.GetBinding();

                var client  = new HMCommonClient(binding, endpointAddress);
                var channel = client.InnerChannel;
                using (OperationContextScope operationContextScope = new OperationContextScope(channel))
                {
                    SoapHelper.channelHelper();

                    checkItemInStockResponse obj = ((HMCommon)channel).checkItemInStock(new checkItemInStock()
                    {
                        _clinicRecId = clinicRecId, _itemId = itemId
                    });

                    if (obj.result.Length > 0)
                    {
                        string[] splitString = obj.result[0].Split(',');
                        int      i           = 0;
                        foreach (string s in splitString)
                        {
                            int j = 0;
                            if (int.TryParse(s, out j))
                            {
                                ret.Add(i, j);
                                i++;
                            }
                        }
                    }
                    else
                    {
                        throw new ValidationException(CommonRepository.getErrorMessage(obj.Infolog));
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(ret);
        }
コード例 #2
0
        public long createCaseTrans(string itemId, HMServiceStatus serviceStatus, string caseId, long appointmentRecId, decimal quantity, string orderId, string unit = "", HMUrgency urgency = HMUrgency.None, string notesToPharmacy = "", string patientInstructionsEng = "", string patientInstructionsArabic = "", long specialityRecId = 0, long treatmentLocationRecId = 0)
        {
            long caseTransRecId = 0;

            //HMCaseServiceClient client = null;

            //try
            //{
            //    client = new HMCaseServiceClient();

            //    CallContext callContext = new CallContext { Company = AppSettings.GetByKey("axCompany") };
            //    client.ClientCredentials.Windows.ClientCredential = new NetworkCredential { Domain = AppSettings.GetByKey("axDomain"), UserName = AppSettings.GetByKey("axUserName"), Password = AppSettings.GetByKey("axPassword") };

            //    caseTransRecId = client.createCaseTrans(callContext, itemId, serviceStatus, new Guid(caseId), appointmentRecId, quantity, new Guid(orderId), unit, urgency, notesToPharmacy, patientInstructionsEng, patientInstructionsArabic, specialityRecId, prnIndication, treatmentLocationRecId);
            //}
            //catch (System.ServiceModel.FaultException<AifFault> aiffaultException)
            //{
            //    throw ValidationException.create(aiffaultException.Message, aiffaultException.HelpLink, aiffaultException.Source);
            //}
            //catch (Exception ex)
            //{
            //    throw ex;
            //}
            //finally
            //{
            //    client.Close();
            //}
            //return caseTransRecId;

            try
            {
                var endpointAddress = SoapHelper.GetEndPointAddress();
                var binding         = SoapHelper.GetBinding();

                var client  = new HMCaseServiceClient(binding, endpointAddress);
                var channel = client.InnerChannel;
                using (OperationContextScope operationContextScope = new OperationContextScope(channel))
                {
                    SoapHelper.channelHelper();
                    createCaseTransResponse obj = ((HMCaseService)channel).createCaseTrans(new createCaseTrans()
                    {
                        _itemid = itemId, _serviceStatus = serviceStatus, _caseGuid = new Guid(caseId), _apptRecId = appointmentRecId, _quantity = quantity, _orderId = string.IsNullOrEmpty(orderId) ? Guid.Empty : new Guid(orderId), _unit = unit, _urgency = urgency, notesToPharmacy = notesToPharmacy, patientInstructionsEng = patientInstructionsEng, patientInstructionsArabic = patientInstructionsArabic, _specialityRecId = specialityRecId, _treatmentLocation = treatmentLocationRecId
                    });
                    if (obj.result > 0)
                    {
                        caseTransRecId = obj.result;
                    }
                    else
                    {
                        throw new ValidationException(CommonRepository.getErrorMessage(obj.Infolog));
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(caseTransRecId);
        }
コード例 #3
0
        public bool updateVisitReason(Guid caseId, long appointmentRecId, string visitReason)
        {
            //HMPatientVisitServiceClient client = null;
            bool ret = false;

            try
            {
                var endpointAddress = SoapHelper.GetEndPointAddress();
                var binding         = SoapHelper.GetBinding();

                var client  = new HMPatientServiceClient(binding, endpointAddress);
                var channel = client.InnerChannel;
                using (OperationContextScope operationContextScope = new OperationContextScope(channel))
                {
                    SoapHelper.channelHelper();
                    updateVisitReasonResponse response = ((HMPatientVisitService)channel).updateVisitReason(new updateVisitReason()
                    {
                        _apptRecId = appointmentRecId, _caseGuid = caseId, _visitReason = visitReason
                    });
                    if (response.result)
                    {
                        ret = response.result;
                    }
                    else
                    {
                        new ValidationException(CommonRepository.getErrorMessage(response.Infolog));
                    }
                    //var result = ((HMPatientService)channel).getPatientBasicDetails(new getPatientBasicDetails() { _patientRecId = "0" }).result;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            //try
            //{
            //    client = new HMPatientVisitServiceClient();

            //    CallContext callContext = new CallContext { Company = AppSettings.GetByKey("axCompany") };
            //    client.ClientCredentials.Windows.ClientCredential = new NetworkCredential { Domain = AppSettings.GetByKey("axDomain"), UserName = AppSettings.GetByKey("axUserName"), Password = AppSettings.GetByKey("axPassword") };

            //    ret = client.updateVisitReason(callContext, caseId, appointmentRecId, visitReason);
            //}
            //catch (System.ServiceModel.FaultException<AifFault> aiffaultException)
            //{
            //    throw ValidationException.create(aiffaultException.Message, aiffaultException.HelpLink, aiffaultException.Source);
            //}
            //catch (Exception ex)
            //{
            //    throw ex;
            //}
            //finally
            //{
            //    client.Close();
            //}

            return(ret);
        }
コード例 #4
0
        public HMCaseTransContract getCaseTransDetails(long caseTransRecId)
        {
            HMCaseTransContract contract = new HMCaseTransContract();

            //HMCaseServiceClient client = new HMCaseServiceClient();

            //CallContext callContext = new CallContext { Company = AppSettings.GetByKey("axCompany") };
            //client.ClientCredentials.Windows.ClientCredential = new NetworkCredential { Domain = AppSettings.GetByKey("axDomain"), UserName = AppSettings.GetByKey("axUserName"), Password = AppSettings.GetByKey("axPassword") };

            //HMCaseTransContract contract = client.getCaseTransDetails(callContext, caseTransRecId);
            //client.Close();

            //return contract;

            try
            {
                var endpointAddress = SoapHelper.GetEndPointAddress();
                var binding         = SoapHelper.GetBinding();

                var client  = new HMCaseServiceClient(binding, endpointAddress);
                var channel = client.InnerChannel;

                using (OperationContextScope operationContextScope = new OperationContextScope(channel))
                {
                    SoapHelper.channelHelper();

                    getCaseTransDetailsResponse obj = ((HMCaseService)channel).getCaseTransDetails(new getCaseTransDetails()
                    {
                        _recId = caseTransRecId
                    });

                    if (obj.result != null)
                    {
                        contract = obj.result;
                    }
                    else
                    {
                        throw new ValidationException(CommonRepository.getErrorMessage(obj.Infolog));
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(contract);
        }
コード例 #5
0
        public string getDocumentsBase64(long docuRefRecId)
        {
            string file = string.Empty;

            //HMCommonClient client = new HMCommonClient();

            //CallContext callContext = new CallContext { Company = AppSettings.GetByKey("axCompany") };
            //client.ClientCredentials.Windows.ClientCredential = new NetworkCredential { Domain = AppSettings.GetByKey("axDomain"), UserName = AppSettings.GetByKey("axUserName"), Password = AppSettings.GetByKey("axPassword") };

            //string file = client.getDocumentsBase64(callContext, docuRefRecId);

            //client.Close();

            //return file;

            try
            {
                var endpointAddress = SoapHelper.GetEndPointAddress();
                var binding         = SoapHelper.GetBinding();

                var client  = new HMCommonClient(binding, endpointAddress);
                var channel = client.InnerChannel;
                using (OperationContextScope operationContextScope = new OperationContextScope(channel))
                {
                    SoapHelper.channelHelper();

                    getDocumentsBase64Response obj = ((HMCommon)channel).getDocumentsBase64(new getDocumentsBase64()
                    {
                        docuRefRecId = docuRefRecId
                    });

                    if (!string.IsNullOrEmpty(obj.result))
                    {
                        file = obj.result;
                    }
                    else
                    {
                        throw new ValidationException(CommonRepository.getErrorMessage(obj.Infolog));
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(file);
        }
コード例 #6
0
        public bool IsAppointmentProgressive(long appointmentRefRecId)
        {
            //HMAppointmentSchedulingServiceClient client = new HMAppointmentSchedulingServiceClient();

            //CallContext callContext = new CallContext { Company = AppSettings.GetByKey("axCompany") };
            //client.ClientCredentials.Windows.ClientCredential = new NetworkCredential { Domain = AppSettings.GetByKey("axDomain"), UserName = AppSettings.GetByKey("axUserName"), Password = AppSettings.GetByKey("axPassword") };

            //bool contract = client.isAppointmentProgressive(callContext, appointmentRefRecId);
            //client.Close();

            //return contract;

            bool ret = false;

            try
            {
                var endpointAddress = SoapHelper.GetEndPointAddress();
                var binding         = SoapHelper.GetBinding();

                var client  = new HMAppointmentSchedulingServiceClient(binding, endpointAddress);
                var channel = client.InnerChannel;

                using (OperationContextScope operationContextScope = new OperationContextScope(channel))
                {
                    SoapHelper.channelHelper();

                    isAppointmentProgressiveResponse obj = ((HMAppointmentSchedulingService)channel).isAppointmentProgressive(new isAppointmentProgressive()
                    {
                        _appointmentRecId = appointmentRefRecId
                    });

                    if (obj.result)
                    {
                        ret = obj.result;
                    }
                    else
                    {
                        throw new ValidationException(CommonRepository.getErrorMessage(obj.Infolog));
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(ret);
        }
コード例 #7
0
        public HMPatientInfoContract GetPatientBasicDetails(string patientRecId)
        {
            HMPatientInfoContract contract = new HMPatientInfoContract();

            //HMPatientServiceClient client = new HMPatientServiceClient();

            //CallContext callContext = new CallContext { Company = AppSettings.GetByKey("axCompany") };
            //client.ClientCredentials.Windows.ClientCredential = new NetworkCredential { Domain = AppSettings.GetByKey("axDomain"), UserName = AppSettings.GetByKey("axUserName"), Password = AppSettings.GetByKey("axPassword") };

            //HMPatientInfoContract contract = new HMPatientInfoContract();

            //client.getPatientBasicDetails(callContext, patientRecId, contract);
            //client.Close();

            //return contract;

            try
            {
                var endpointAddress = SoapHelper.GetEndPointAddress();
                var binding         = SoapHelper.GetBinding();

                var client  = new HMPatientServiceClient(binding, endpointAddress);
                var channel = client.InnerChannel;
                using (OperationContextScope operationContextScope = new OperationContextScope(channel))
                {
                    SoapHelper.channelHelper();
                    getPatientBasicDetailsResponse response = ((HMPatientService)channel).getPatientBasicDetails(new getPatientBasicDetails()
                    {
                        _patientRecId = patientRecId
                    });
                    if (response.result != null)
                    {
                        contract = response.result;
                    }
                    else
                    {
                        new ValidationException(CommonRepository.getErrorMessage(response.Infolog));
                    }
                    //var result = ((HMPatientService)channel).getPatientBasicDetails(new getPatientBasicDetails() { _patientRecId = "0" }).result;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(contract);
        }
コード例 #8
0
        public HMClinicDataContract[] getAllClinicsList(HMFileLocationType locationType)
        {
            HMClinicDataContract[] contract = null;

            //HMResourceServiceClient client = new HMResourceServiceClient();

            //CallContext callContext = new CallContext { Company = AppSettings.GetByKey("axCompany") };
            //client.ClientCredentials.Windows.ClientCredential = new NetworkCredential { Domain = AppSettings.GetByKey("axDomain"), UserName = AppSettings.GetByKey("axUserName"), Password = AppSettings.GetByKey("axPassword") };

            //contract = client.getClinicsList(callContext, locationType);
            //client.Close();

            try
            {
                var endpointAddress = SoapHelper.GetEndPointAddress();
                var binding         = SoapHelper.GetBinding();

                var client  = new HMPatientServiceClient(binding, endpointAddress);
                var channel = client.InnerChannel;
                using (OperationContextScope operationContextScope = new OperationContextScope(channel))
                {
                    SoapHelper.channelHelper();
                    getClinicsListResponse response = ((HMResourceService)channel).getClinicsList(new getClinicsList()
                    {
                        _locationType = locationType
                    });
                    if (response.result.Length > 0)
                    {
                        contract = response.result;
                    }
                    else
                    {
                        new ValidationException(CommonRepository.getErrorMessage(response.Infolog));
                    }
                    //var result = ((HMPatientService)channel).getPatientBasicDetails(new getPatientBasicDetails() { _patientRecId = "0" }).result;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(contract);
        }
コード例 #9
0
        public long createCaseInsurance(long caseRecId, long patientInsuranceRecId)
        {
            long caseInsuranceRecId = 0;

            try
            {
                var endpointAddress = SoapHelper.GetEndPointAddress();
                var binding         = SoapHelper.GetBinding();

                var client  = new HMCaseServiceClient(binding, endpointAddress);
                var channel = client.InnerChannel;

                using (OperationContextScope operationContextScope = new OperationContextScope(channel))
                {
                    SoapHelper.channelHelper();

                    createCaseInsuranceResponse obj = ((HMCaseService)channel).createCaseInsurance(new createCaseInsurance()
                    {
                        _caseRecId = caseRecId, _patientInsurance = patientInsuranceRecId
                    });

                    if (obj.result > 0)
                    {
                        caseInsuranceRecId = obj.result;
                    }
                    else
                    {
                        throw new ValidationException(CommonRepository.getErrorMessage(obj.Infolog));
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(caseInsuranceRecId);
        }
コード例 #10
0
        public HMDropDownContract[] getDropDownList(string type)
        {
            HMDropDownContract[] contract = null;

            //HMDropDownServiceClient client = new HMDropDownServiceClient();

            //CallContext callContext = new CallContext { Company = AppSettings.GetByKey("axCompany") };
            //client.ClientCredentials.Windows.ClientCredential = new NetworkCredential { Domain = AppSettings.GetByKey("axDomain"), UserName = AppSettings.GetByKey("axUserName"), Password = AppSettings.GetByKey("axPassword") };


            //switch (type)
            //{
            //    case "DocumentType":
            //        contract = client.getDocumentTypes(callContext);
            //        break;
            //    case "Gender":
            //        contract = client.getGender(callContext);
            //        break;
            //    case "NationalIdType":
            //        contract = client.getNationalIdType(callContext);
            //        break;
            //    case "SearchPatientFilter":
            //        contract = client.getSearchPatientFilter(callContext);
            //        break;
            //    case "ActivityStatus":
            //        contract = client.getActivityStatus(callContext, HMActivityStatus.None);
            //        break;
            //}

            //client.Close();

            //return contract;

            try
            {
                var endpointAddress = SoapHelper.GetEndPointAddress();
                var binding         = SoapHelper.GetBinding();

                var client  = new HMDropDownServiceClient(binding, endpointAddress);
                var channel = client.InnerChannel;

                using (OperationContextScope operationContextScope = new OperationContextScope(channel))
                {
                    SoapHelper.channelHelper();

                    switch (type)
                    {
                    case "DocumentType":
                        getDocumentTypesResponse objDoc = ((HMDropDownService)channel).getDocumentTypes(new getDocumentTypes()
                        {
                        });

                        if (objDoc.result != null)
                        {
                            contract = objDoc.result;
                        }
                        else
                        {
                            new ValidationException(CommonRepository.getErrorMessage(objDoc.Infolog));
                        }

                        break;

                    case "Gender":
                        getGenderResponse objGender = ((HMDropDownService)channel).getGender(new getGender()
                        {
                        });

                        if (objGender.result != null)
                        {
                            contract = objGender.result;
                        }
                        else
                        {
                            new ValidationException(CommonRepository.getErrorMessage(objGender.Infolog));
                        }

                        break;

                    case "NationalIdType":
                        getNationalIdTypeResponse objNationalIdType = ((HMDropDownService)channel).getNationalIdType(new getNationalIdType()
                        {
                        });

                        if (objNationalIdType.result != null)
                        {
                            contract = objNationalIdType.result;
                        }
                        else
                        {
                            new ValidationException(CommonRepository.getErrorMessage(objNationalIdType.Infolog));
                        }

                        break;

                    case "SearchPatientFilter":
                        getSearchPatientFilterResponse objPatientFilter = ((HMDropDownService)channel).getSearchPatientFilter(new getSearchPatientFilter()
                        {
                        });

                        if (objPatientFilter.result != null)
                        {
                            contract = objPatientFilter.result;
                        }
                        else
                        {
                            new ValidationException(CommonRepository.getErrorMessage(objPatientFilter.Infolog));
                        }

                        break;

                    case "ActivityStatus":
                        getActivityStatusResponse objActivityStatus = ((HMDropDownService)channel).getActivityStatus(new getActivityStatus()
                        {
                        });

                        if (objActivityStatus.result != null)
                        {
                            contract = objActivityStatus.result;
                        }
                        else
                        {
                            new ValidationException(CommonRepository.getErrorMessage(objActivityStatus.Infolog));
                        }

                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(contract);
        }
コード例 #11
0
        public long createCase(long patientId, long clinicId, HMCaseType caseType, string caseId, string caseNumber)
        {
            long caseRecId = 0;

            //HMCaseServiceClient client = null;

            //try
            //{
            //    client = new HMCaseServiceClient();

            //    CallContext callContext = new CallContext { Company = AppSettings.GetByKey("axCompany") };
            //    client.ClientCredentials.Windows.ClientCredential = new NetworkCredential { Domain = AppSettings.GetByKey("axDomain"), UserName = AppSettings.GetByKey("axUserName"), Password = AppSettings.GetByKey("axPassword") };

            //    caseRecId = client.createCase(callContext, patientId, clinicId, caseType);
            //}
            //catch (System.ServiceModel.FaultException<AifFault> aiffaultException)
            //{
            //    throw ValidationException.create(aiffaultException.Message, aiffaultException.HelpLink, aiffaultException.Source);
            //}
            //catch (Exception ex)
            //{
            //    throw ex;
            //}
            //finally
            //{
            //    client.Close();
            //}

            //return caseRecId;

            try
            {
                var endpointAddress = SoapHelper.GetEndPointAddress();
                var binding         = SoapHelper.GetBinding();

                var client  = new HMCaseServiceClient(binding, endpointAddress);
                var channel = client.InnerChannel;
                using (OperationContextScope operationContextScope = new OperationContextScope(channel))
                {
                    // Helper.Files.SaveToCSV(string.Format("{0}, {1}, {2},{3},{4}", patientId, clinicId, caseType, caseId, caseNumber), "rttrt", DateTime.Now, DateTime.Now);
                    SoapHelper.channelHelper();
                    createCaseResponse obj = ((HMCaseService)channel).createCase(new createCase()
                    {
                        _patientRecId = patientId, _organizationalUnitRecId = clinicId, _caseType = caseType, _crmRefRecId = new Guid(caseId), _caseNo = caseNumber
                    });
                    if (obj.result > 0)
                    {
                        // Helper.Files.SaveToCSV(obj.result.ToString(), "rttrt", DateTime.Now, DateTime.Now);
                        caseRecId = obj.result;
                    }
                    else
                    {
                        throw new ValidationException(CommonRepository.getErrorMessage(obj.Infolog));
                    }
                }
            }
            catch (Exception ex)
            {
                // Helper.Files.SaveToCSV(ex.Message, "rttrt", DateTime.Now, DateTime.Now);
                throw ex;
            }
            return(caseRecId);
        }
コード例 #12
0
        public bool updateCaseStatus(string caseId, HMCaseStatus caseStatus)
        {
            bool ret = false;

            //HMCaseServiceClient client = null;

            //try
            //{
            //    client = new HMCaseServiceClient();

            //    CallContext callContext = new CallContext { Company = AppSettings.GetByKey("axCompany") };
            //    client.ClientCredentials.Windows.ClientCredential = new NetworkCredential { Domain = AppSettings.GetByKey("axDomain"), UserName = AppSettings.GetByKey("axUserName"), Password = AppSettings.GetByKey("axPassword") };

            //    ret = client.updateCaseStatus(callContext, caseId, caseStatus);
            //}
            //catch (System.ServiceModel.FaultException<AifFault> aiffaultException)
            //{
            //    throw ValidationException.create(aiffaultException.Message, aiffaultException.HelpLink, aiffaultException.Source);
            //}
            //catch (Exception ex)
            //{
            //    throw ex;
            //}
            //finally
            //{
            //    client.Close();
            //}

            //return ret;

            try
            {
                var endpointAddress = SoapHelper.GetEndPointAddress();
                var binding         = SoapHelper.GetBinding();

                var client  = new HMCaseServiceClient(binding, endpointAddress);
                var channel = client.InnerChannel;

                using (OperationContextScope operationContextScope = new OperationContextScope(channel))
                {
                    SoapHelper.channelHelper();

                    updateCaseStatusResponse obj = ((HMCaseService)channel).updateCaseStatus(new updateCaseStatus()
                    {
                        _caseGUID = caseId, _caseStatus = caseStatus
                    });

                    if (obj.result)
                    {
                        ret = obj.result;
                    }
                    else
                    {
                        throw new ValidationException(CommonRepository.getErrorMessage(obj.Infolog));
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(ret);
        }
コード例 #13
0
        public bool updateCaseTransStatus(long caseTransRecId, HMServiceStatus serviceStatus, bool createCharge, long appointmentRecId, string batchId, string caseId, long resourceRecId = 0)
        {
            bool ret = false;

            //HMCaseServiceClient client = null;

            //try
            //{
            //    client = new HMCaseServiceClient();

            //    CallContext callContext = new CallContext { Company = AppSettings.GetByKey("axCompany") };
            //    client.ClientCredentials.Windows.ClientCredential = new NetworkCredential { Domain = AppSettings.GetByKey("axDomain"), UserName = AppSettings.GetByKey("axUserName"), Password = AppSettings.GetByKey("axPassword") };
            //    if (!string.IsNullOrEmpty(caseId))
            //    {
            //        ret = client.updateCaseTransStatus(callContext, caseTransRecId, serviceStatus, createCharge, appointmentRecId, batchId, new Guid(caseId), resourceRecId);
            //    }
            //    else
            //    {
            //        ret = client.updateCaseTransStatus(callContext, caseTransRecId, serviceStatus, createCharge, appointmentRecId, batchId, Guid.Empty, resourceRecId);
            //    }
            //}
            //catch (System.ServiceModel.FaultException<AifFault> aiffaultException)
            //{
            //    throw ValidationException.create(aiffaultException.Message, aiffaultException.HelpLink, aiffaultException.Source);
            //}
            //catch (Exception ex)
            //{
            //    throw ex;
            //}
            //finally
            //{
            //    client.Close();
            //}

            //return ret;

            try
            {
                updateCaseTransStatusResponse obj;

                var endpointAddress = SoapHelper.GetEndPointAddress();
                var binding         = SoapHelper.GetBinding();

                var client  = new HMCaseServiceClient(binding, endpointAddress);
                var channel = client.InnerChannel;
                using (OperationContextScope operationContextScope = new OperationContextScope(channel))
                {
                    SoapHelper.channelHelper();
                    if (!string.IsNullOrEmpty(caseId))
                    {
                        obj = ((HMCaseService)channel).updateCaseTransStatus(new updateCaseTransStatus()
                        {
                            _caseTransRecId = caseTransRecId, _serviceStatus = serviceStatus, createCharge = createCharge, _apptRecId = appointmentRecId, _batchId = batchId, _caseId = new Guid(caseId), _resourceRecId = resourceRecId
                        });
                    }
                    else
                    {
                        obj = ((HMCaseService)channel).updateCaseTransStatus(new updateCaseTransStatus()
                        {
                            _caseTransRecId = caseTransRecId, _serviceStatus = serviceStatus, createCharge = createCharge, _apptRecId = appointmentRecId, _batchId = batchId, _caseId = Guid.Empty, _resourceRecId = resourceRecId
                        });
                    }

                    if (obj.result)
                    {
                        ret = obj.result;
                    }
                    else
                    {
                        throw new ValidationException(CommonRepository.getErrorMessage(obj.Infolog));
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(ret);
        }
コード例 #14
0
        public long createPatient(HMPatientDataContract contract)
        {
            long ret = 0;

            //HMPatientServiceClient client = null;

            //try
            //{
            //    client = new HMPatientServiceClient();

            //    CallContext callContext = new CallContext { Company = AppSettings.GetByKey("axCompany") };
            //    client.ClientCredentials.Windows.ClientCredential = new NetworkCredential { Domain = AppSettings.GetByKey("axDomain"), UserName = AppSettings.GetByKey("axUserName"), Password = AppSettings.GetByKey("axPassword") };

            //    ret = client.createPatient(callContext, contract);
            //}
            //catch (System.ServiceModel.FaultException<AifFault> aiffaultException)
            //{
            //    throw ValidationException.create(aiffaultException.Message, aiffaultException.HelpLink, aiffaultException.Source);
            //}
            //catch (Exception ex)
            //{
            //    throw ex;
            //}
            //finally
            //{
            //    client.Close();
            //}

            try
            {
                var endpointAddress = SoapHelper.GetEndPointAddress();
                var binding         = SoapHelper.GetBinding();

                var client  = new HMPatientServiceClient(binding, endpointAddress);
                var channel = client.InnerChannel;
                using (OperationContextScope operationContextScope = new OperationContextScope(channel))
                {
                    SoapHelper.channelHelper();
                    createPatientResponse response = ((HMPatientService)channel).createPatient(new createPatient()
                    {
                        _contract = contract
                    });
                    if (response.result > 0)
                    {
                        // Helper.Files.SaveToCSV(response.result.ToString(), "ex", DateTime.Now, DateTime.Now);
                        ret = response.result;
                    }
                    else
                    {
                        new ValidationException(CommonRepository.getErrorMessage(response.Infolog));
                    }
                    //var result = ((HMPatientService)channel).getPatientBasicDetails(new getPatientBasicDetails() { _patientRecId = "0" }).result;
                }
            }
            catch (Exception ex)
            {
                //Helper.Files.SaveToCSV(ex.Message, "ex", DateTime.Now, DateTime.Now);
                throw ex;
            }

            return(ret);
        }