コード例 #1
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);
        }
コード例 #2
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);
        }
コード例 #3
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);
        }
コード例 #4
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);
        }