public async Task <List <CheifComplaint> > getCheifComplaintFromClinicalTemplate(string caseId, string searchText, string appointmentId)
        {
            List <CheifComplaint> CheifComplaint = new List <CheifComplaint>();

            ClinicalTemplate clinicalTemplate = new ClinicalTemplate();

            string           encounterId = "";
            PatientEncounter patEnc      = new PatientEncounter();

            if (!string.IsNullOrEmpty(appointmentId))
            {
                patEnc = patEnc.encounterDetails((int)mzk_encountertype.Consultation, "", "", appointmentId).Result;

                if (patEnc != null)
                {
                    encounterId = patEnc.EncounterId;
                }
            }
            else if (!string.IsNullOrEmpty(caseId))
            {
                patEnc.CaseId        = caseId;
                patEnc.EncounterType = ((int)mzk_encountertype.PrimaryAssessment).ToString();
                List <PatientEncounter> listEnc = null;

                listEnc = patEnc.getEncounterDetails(patEnc).Result;

                if (listEnc != null && listEnc.FirstOrDefault() != null)
                {
                    encounterId = listEnc.First().EncounterId;
                }
            }

            List <ClinicalTemplateNarration> listNarration = clinicalTemplate.getPatientsClinicalTempalteNarration("", encounterId, "", false, 0, false, searchText);

            foreach (ClinicalTemplateNarration narration in listNarration)
            {
                CheifComplaint model = new CheifComplaint();

                if (!string.IsNullOrEmpty(narration.comments))
                {
                    model.Complaint = narration.comments;
                }

                CheifComplaint.Add(model);
            }


            return(CheifComplaint);
        }
        public async Task <HttpResponseMessage> saveClinicalTemplate(ClinicalTemplate inputmodel)
        {
            bool data;

            try
            {
                ApiResponseModel <string> model = new ApiResponseModel <string>()
                {
                };

                var client = ServiceFactory.GetService(typeof(ClinicalTemplate));
                data = await client.saveClinicalTemplate(inputmodel);

                model.data.records = data.ToString();

                return(Response.Success <string>(model));
            }
            catch (Exception ex)
            {
                return(Response.Exception(ex));
            }
        }
Beispiel #3
0
        public async Task <List <PatientHistory> > getPatientHistory(string patientguid, int type)
        {
            try
            {
                SoapEntityRepository  repo      = SoapEntityRepository.GetService();
                ClinicalTemplate      template  = new ClinicalTemplate();
                List <PatientHistory> modelList = new List <PatientHistory>();

                List <ClinicalTemplateNarration> patientNarration = template.getPatientsClinicalTempalteNarration(patientguid, "", "", true, type);
                PatientHistory model;

                foreach (ClinicalTemplateNarration narration in patientNarration)
                {
                    model = new PatientHistory();
                    string narrativeText = string.Empty;

                    model.createdDateTime = narration.createdDateTime;
                    model.userName        = narration.userName;
                    model.historyType     = narration.historyType;

                    narrativeText = narration.narrativeText;

                    if (!string.IsNullOrEmpty(narration.ans))
                    {
                        narrativeText = narrativeText.Replace("$1", narration.ans);
                    }
                    else if (narration.choicesName != null && narration.choicesName.Count() > 0)
                    {
                        string choices = string.Empty;

                        foreach (string item in narration.choicesName)
                        {
                            if (string.IsNullOrEmpty(choices))
                            {
                                choices = item;
                            }
                            else
                            {
                                choices += ", " + item;
                            }
                        }

                        narrativeText = narrativeText.Replace("$1", choices);
                    }
                    else
                    {
                        narrativeText = narrativeText.Replace("$1", string.Empty);
                    }

                    narrativeText = narrativeText.Replace("$2", narration.comments);

                    model.narrativeText = narrativeText;

                    modelList.Add(model);
                }

                return(modelList);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }