public Task <PatientRes> CreatePatient(UpdatePatientReq req)
        {
            int Id = System.Int32.Parse(this.ControllerContext.RouteData.Values["PatientId"].ToString());

            req.Id = Id;
            return(SendAsync <UpdatePatientCommand, UpdatePatientReq, PatientRes>(req));
        }
示例#2
0
        public static void UpdatePatient(PatientBE Patient, MutualPorPacienteList mutualList, DateTime?nuevaFechaNacimiento)
        {
            UpdatePatientReq req = new UpdatePatientReq();

            req.BusinessData.AnteriorFechaNacimiento = nuevaFechaNacimiento;
            req.BusinessData.Patient = Patient;
            //MutualPorPacienteList wMutualPorPacienteList = new MutualPorPacienteList();
            //var mList = from m in mutualList select new MutualPorPacienteBE { IdMutual = m.IdMutual, IdPatient = Patient.PatientId };
            //wMutualPorPacienteList.AddRange(mList);
            req.BusinessData.Mutuales = mutualList;

            req.ContextInformation.UserId = frmBase_TabForm.IndentityUserInfo.ProviderId.ToString();

            UpdatePatientRes res = req.ExecuteService <UpdatePatientReq, UpdatePatientRes>(req);

            if (res.Error != null)
            {
                throw Fwk.Exceptions.ExceptionHelper.ProcessException(res.Error);
            }
        }
示例#3
0
        public static void UpdatePatient(PatientBE Patient, MutualPorPacienteList mutualList, DateTime? nuevaFechaNacimiento)
        {
            UpdatePatientReq req = new UpdatePatientReq();
            req.BusinessData.AnteriorFechaNacimiento = nuevaFechaNacimiento;
            req.BusinessData.Patient = Patient;
            //MutualPorPacienteList wMutualPorPacienteList = new MutualPorPacienteList();
            //var mList = from m in mutualList select new MutualPorPacienteBE { IdMutual = m.IdMutual, IdPatient = Patient.PatientId };
            //wMutualPorPacienteList.AddRange(mList);
            req.BusinessData.Mutuales = mutualList;

            req.ContextInformation.UserId = frmBase_TabForm.IndentityUserInfo.ProviderId.ToString();

            UpdatePatientRes res = req.ExecuteService<UpdatePatientReq, UpdatePatientRes>(req);
            if (res.Error != null)
                throw Fwk.Exceptions.ExceptionHelper.ProcessException(res.Error);

        }
示例#4
0
        public ModifyPatientResp UpdatePatient(long patientId, Customer customer, PrimaryCarePhysician pcp, BillingAccount billingAccount)
        {
            try
            {
                var client = new KareoServicesClient();

                var requestHeader = new RequestHeader
                {
                    ClientVersion = ClientVersion,
                    CustomerKey   = billingAccount.CustomerKey,
                    User          = billingAccount.UserName,
                    Password      = billingAccount.Password
                };

                // Create the patient to insert.
                var updatePatient = new PatientUpdate
                {
                    PatientID           = Convert.ToInt32(patientId),
                    FirstName           = customer.Name.FirstName,
                    MiddleName          = customer.Name.MiddleName,
                    LastName            = customer.Name.LastName,
                    DateofBirth         = customer.DateOfBirth,
                    Gender              = customer.Gender == Gender.Male ? GenderCode.Male : customer.Gender == Gender.Female ? GenderCode.Female : GenderCode.Unknown,
                    MedicalRecordNumber = customer.CustomerId.ToString(),
                    AddressLine1        = customer.Address.StreetAddressLine1,
                    AddressLine2        = customer.Address.StreetAddressLine2,
                    City         = customer.Address.City,
                    State        = customer.Address.StateCode,
                    ZipCode      = customer.Address.ZipCode.Zip,
                    HomePhone    = customer.HomePhoneNumber != null ? customer.HomePhoneNumber.FormatPhoneNumber : string.Empty,
                    WorkPhone    = customer.OfficePhoneNumber != null ? customer.OfficePhoneNumber.FormatPhoneNumber : string.Empty,
                    MobilePhone  = customer.MobilePhoneNumber != null ? customer.MobilePhoneNumber.FormatPhoneNumber : string.Empty,
                    EmailAddress = customer.Email != null?customer.Email.ToString() : string.Empty,
                                       PatientExternalID = customer.CustomerId.ToString()
                };

                // Set the practice we want to add this patient to
                var practice = new PracticeIdentifierReq
                {
                    PracticeName = billingAccount.Name
                };
                updatePatient.Practice = practice;

                // Create the case details for the patient
                var patientCase = new PatientCaseUpdateReq
                {
                    CaseName = CaseName,
                    //patientCase.PayerScenario
                    Active = true,
                    SendPatientStatements = true
                };
                updatePatient.Cases = new[] { patientCase };

                if (pcp != null)
                {
                    updatePatient.PrimaryCarePhysician = new PhysicianIdentifierReq
                    {
                        FullName = pcp.Name.FullName
                    };
                }

                // Create the create patient request object
                var request = new UpdatePatientReq
                {
                    RequestHeader = requestHeader,
                    Patient       = updatePatient
                };

                // Call the Create Patient method
                var response = client.UpdatePatient(request);

                // Check the response for an error
                if (response.ErrorResponse.IsError)
                {
                    throw new Exception(response.ErrorResponse.ErrorMessage);
                }

                if (!response.SecurityResponse.SecurityResultSuccess)
                {
                    throw new Exception(response.SecurityResponse.SecurityResult);
                }

                client.Close();

                return(response);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }