Пример #1
0
        /// <summary>
        /// Uses the SCREEN param and field .16 to traverse the PATIENT file backwards searching for the last record created after the specified date
        /// </summary>
        /// <param name="siteId"></param>
        /// <param name="vistaDate">Defaults to '3131031' - the date the IEN problem was first discovered</param>
        /// <returns></returns>
        internal static String getLastPatientIenByDate(String siteId, String vistaDate)
        {
            String result = new VistaDaoFactory().getVistaDao(
                ConfigurationManager.AppSettings[config.AppConfigSettingsConstants.VistaDaoType])
                            .getVariableValueQuery(siteId, "$G(^DIA(2,$O(^DIA(2,\"A\"),-1),0))");

            String lastIen = gov.va.medora.utils.StringUtils.split(result, gov.va.medora.utils.StringUtils.CARET)[0];

            Int64 trash = 0;

            if (String.IsNullOrEmpty(result) || Int64.TryParse(lastIen, out trash))
            {
                throw new downstream.domain.exception.LastPatientIenFromAuditException();
            }

            return(lastIen);
        }
Пример #2
0
        internal static String getComment(String siteId, String iens)
        {
            try
            {
                String[] subResults = new VistaDaoFactory().getVistaDao(ConfigurationManager.AppSettings[config.AppConfigSettingsConstants.VistaDaoType]).ddrLister(siteId, "63.041", iens, ".01", "IP", "", "", "", "#", "", "");

                if (subResults == null || subResults.Length == 0)
                {
                    return(String.Empty);
                }

                char[]        delim = new char[] { '^' };
                StringBuilder sb    = new StringBuilder();
                for (int i = 0; i < subResults.Length; i++)
                {
                    sb.AppendLine(subResults[i].Split(delim)[1]);
                }

                return(sb.ToString());
            }
            catch (Exception)  { }

            return(String.Empty);
        }