public async Task <IActionResult> AddDrugBillingInvoice(BillingInvoice billingInvoice)
        {
            try
            {
                var result = await _billingRepository.AddDrugBillInvoice(billingInvoice);

                PatientTariffByPayorResponse response = new PatientTariffByPayorResponse()
                {
                    TariffAmount    = null,
                    ResponseMessage = result.Item2,
                    Status          = result.Item1
                };
                return(Ok(response));
            }
            catch (Exception ex)
            {
                return(BadRequest());
            }
        }
        public async Task <IActionResult> CreateOrderInvestigation(AddConsultationOrderDto model)
        {
            try
            {
                var result = await _orderInvestigationRepository.AddConsultationOrder(model);

                PatientTariffByPayorResponse response = new PatientTariffByPayorResponse()
                {
                    TariffAmount    = null,
                    ResponseMessage = result.Item2,
                    Status          = result.Item1
                };
                return(Ok(response));
            }
            catch (Exception ex)
            {
                var status = false;
                return(BadRequest(ex.Message));
            }
        }
        public async Task <IActionResult> GetDrugTarriffByDrugId(int accountId, int tariffId, int drugid, int locationId)
        {
            try
            {
                var patienttariff = await _billingRepository.getDrugTarrifByDrugId(accountId, tariffId, drugid, locationId);

                PatientTariffByPayorResponse response = new PatientTariffByPayorResponse()
                {
                    TariffAmount    = patienttariff.Item3,
                    ResponseMessage = patienttariff.Item2,
                    Status          = patienttariff.Item1
                };

                return(Ok(response));
            }
            catch (Exception ex)
            {
                return(BadRequest());
            }
        }
        public async Task <IActionResult> GetPatientTarrifByPayor(int accountId, string patientId, int servicecode, int locationId)
        {
            try
            {
                //patientId = "1011302952"; servicecode = 145; accountId = 1;

                var patienttariff = await _billingRepository.getPatientTarrifByPayor(accountId, patientId, servicecode, locationId);

                PatientTariffByPayorResponse response = new PatientTariffByPayorResponse()
                {
                    TariffAmount    = patienttariff.Item3,
                    ResponseMessage = patienttariff.Item2,
                    Status          = patienttariff.Item1
                };

                return(Ok(response));
            }
            catch (Exception ex)
            {
                return(BadRequest());
            }
        }
        public async Task <IActionResult> AddPrivatePatientConsultationBillingInvoice(BillingInvoice billingInvoice)
        {
            try
            {
                //patientId = "1011302952"; servicecode = 145; accountId = 1;

                var _billingInvoice = await _billingRepository.WritePatientConsultationBill(billingInvoice);

                PatientTariffByPayorResponse response = new PatientTariffByPayorResponse()
                {
                    TariffAmount    = _billingInvoice.Item3,
                    ResponseMessage = _billingInvoice.Item2,
                    Status          = _billingInvoice.Item1
                };

                return(Ok(response));
            }
            catch (Exception ex)
            {
                return(BadRequest());
            }
        }