Beispiel #1
0
        public static void CheckRpcParams(string ien, string fromDate = null, string toDate = null)
        {
            if (!isWellFormedIen(ien))
            {
                throw new InvalidlyFormedRecordIdException(ien);
            }

            //4/14/2011 David Parshan
            //Added toDate check, as there is the ability to have a valid
            //fromDate with a default "" toDate
            if (!String.IsNullOrEmpty(fromDate) && fromDate != "0" && toDate != "" && toDate != "0" && toDate != "-1")
            {
                DateUtils.CheckDateRange(fromDate, toDate);
            }
            else
            {
                if (!String.IsNullOrEmpty(fromDate) && fromDate != "0")
                {
                    if (!DateUtils.isWellFormedUtcDateTime(fromDate))
                    {
                        throw new MdoException(MdoExceptionCode.ARGUMENT_DATE_FORMAT, "Invalid 'from' date: " + fromDate);
                    }
                }
            }
        }
Beispiel #2
0
        public static string buildFromToDateScreenParam(string fromDate, string toDate, int node, int pieceNum)
        {
            if (fromDate == "")
            {
                return("");
            }
            DateUtils.CheckDateRange(fromDate, toDate);

            // Need test for valid dates.
            fromDate = VistaTimestamp.fromUtcFromDate(fromDate);
            toDate   = VistaTimestamp.fromUtcString(toDate);
            return("S FD=" + fromDate + ",TD=" + toDate + ",CDT=$P(^(" + node + "),U," + pieceNum + ") I CDT>=FD,CDT<TD");
        }
        internal DdrLister buildGetChemHemSpecimensQuery(string lrdfn, string fromDate, string toDate, string pieceNum)
        {
            DateUtils.CheckDateRange(fromDate, toDate);
            DdrLister query = new DdrLister(cxn);

            query.File = "63.04";
            query.Iens = "," + lrdfn + ",";

            // E flag note
            // .01 - DATE/TIME SPECIMEN TAKEN
            // .03 - DATE REPORT COMPLETED
            // .05 - SPECIMEN TYPE
            // .06 - ACCESSION
            // .08 - METHOD OR SITE
            // .112 - ACCESSIONING INSTITUTION
            query.Fields = ".01;.03;.05E;.06;.08;.112E";

            query.Flags  = "IP";
            query.Xref   = "#";
            query.Screen = buildChemHemSpecimensScreenParam(fromDate, toDate, pieceNum);
            query.Id     = "S X=$P(^(0),U,14) I X'= \"\" S Y=$P($G(^DIC(4,X,99)),U,1) D EN^DDIOL(Y)";
            return(query);
        }