private string GetProfileData(int ptn_pk, int visitPK, int locationId)
        {
            string result = string.Empty;

            try
            {
                IKNHMEI             iANC = (IKNHMEI)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BKNHMEI, BusinessProcess.Clinical");
                Entities.Common.ANC anc  = iANC.GetANCData(ptn_pk, visitPK, locationId);

                result = SerializerUtil.ConverToJson <Entities.Common.ANC>(anc);
            }
            catch (Exception ex)
            {
                CLogger.WriteLog(ELogLevel.ERROR, "GetANCProfileData() exception: " + ex.ToString());
                ResponseType response = new ResponseType()
                {
                    Success = EnumUtil.GetEnumDescription(Success.False)
                };
                result = SerializerUtil.ConverToJson <ResponseType>(response);
            }
            finally
            {
            }
            return(result);
        }
        private string SaveProfileData(string nodeJson, int ptn_pk, int visitPK, int locationId, int userId)
        {
            string       result      = string.Empty;
            ResponseType ObjResponse = new ResponseType();

            try
            {
                Entities.Common.ANC anc     = SerializerUtil.ConverToObject <Entities.Common.ANC>(nodeJson);
                IKNHMEI             iknhmei = (IKNHMEI)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BKNHMEI, BusinessProcess.Clinical");
                anc.Ptn_pk     = ptn_pk;
                anc.Visit_Id   = visitPK;
                anc.LocationId = locationId;

                //result = SerializerUtil.ConverToJson<Triage>(triage);
                bool flag = true;
                int  visitId;
                flag = iknhmei.SaveUpdateProfile(anc, userId, locationId, out visitId);

                Session["PatientVisitId"] = visitId.ToString();
                this.hidVId.Value         = visitId.ToString();

                if (flag)
                {
                    ObjResponse.Success = EnumUtil.GetEnumDescription(Success.True);
                }
                else
                {
                    ObjResponse.Success = EnumUtil.GetEnumDescription(Success.False);
                }
            }
            catch (Exception ex)
            {
                if (ex.Message.ToLower().Contains("visit already exists"))
                {
                    ObjResponse.ErrorMessage = ex.Message;
                }
                ObjResponse.Success = EnumUtil.GetEnumDescription(Success.False);
            }
            finally
            {
            }

            result = SerializerUtil.ConverToJson <ResponseType>(ObjResponse);
            return(result);
        }