22. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 6/7/2019 7:15:10 AM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

22.1 Files compared

# Location File Last Modified
1 C:\AraxisMergeCompare\Pri_un\CRS_EFR Helpers.cs Wed May 22 19:56:16 2019 UTC
2 C:\AraxisMergeCompare\Pri_re\CRS_EFR Helpers.cs Mon Jun 3 13:15:24 2019 UTC

22.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 1274
Changed 1 2
Inserted 0 0
Removed 0 0

22.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

22.4 Active regular expressions

No regular expressions were active.

22.5 Comparison detail

  1   using Syst em;
  2   using Syst em.Collect ions;
  3   using Syst em.Collect ions.Gener ic;
  4   using Syst em.Collect ions.Speci alized;
  5   using Syst em.Linq;
  6   using Syst em.Web;
  7   using Syst em.Web.UI;
  8   using Syst em.Web.UI. WebControl s;
  9   using Syst em.Web.Con figuration ;
  10   using Syst em.Compone ntModel;
  11   using Vete ransAffair s.Registri es.Busines s;
  12   using Vete ransAffair s.Registri es.Busines sManager;
  13  
  14   namespace  CRS_EFR
  15   {
  16  
  17       /// <s ummary>
  18       /// Su mmary desc ription fo r Helpers
  19       /// </ summary>
  20       public  static cl ass Helper s
  21       {
  22           //  TODO!!!
  23             private st atic strin g USER_NAM E = " DN S         \\
D NS     ";
  24  
  25           pr ivate stat ic string[ ] _countri es = new s tring[] {
  26            " Afghanista n", "Alban ia", "Alge ria", "Ame rican Samo a", "Andor ra",
  27            " Angola", " Anguilla",  "Antarcti ca", "Anti gua And Ba rbuda", "A rgentina",
  28            " Armenia",  "Aruba", " Australia" , "Austria ", "Azerba ijan",
  29               "Bahamas" , "Bahrain ", "Bangla desh", "Ba rbados", " Belarus",
  30               "Belgium" , "Belize" , "Benin",  "Bermuda" , "Bhutan" ,
  31               "Bolivia" , "Bosnia  Hercegovin a", "Botsw ana", "Bou vet Island ", "Brazil ",
  32               "Brunei D arussalam" , "Bulgari a", "Burki na Faso",  "Burundi",  "Byelorus sian SSR",
  33               "Cambodia ", "Camero on", "Cana da", "Cape  Verde", " Cayman Isl ands",
  34               "Central  African Re public", " Chad", "Ch ile", "Chi na", "Chri stmas Isla nd",
  35                "Colombi a", "Comor os", "Cong o", "Cook  Islands",
  36               "Costa Ri ca", "Cote  D'Ivoire" , "Croatia ", "Cuba",  "Cyprus",
  37               "Czech Re public", " Czechoslov akia", "De nmark", "D jibouti",  "Dominica" ,
  38               "Dominica n Republic ", "East T imor", "Ec uador", "E gypt", "El  Salvador" ,
  39               "England" , "Equator ial Guinea ", "Eritre a", "Eston ia", "Ethi opia",
  40               "Falkland  Islands",  "Faroe Is lands", "F iji", "Fin land", "Fr ance",
  41               "Gabon",  "Gambia",  "Georgia",  "Germany" , "Ghana",
  42               "Gibralta r", "Great  Britain",  "Greece",  "Greenlan d", "Grena da",
  43               "Guadelou pe", "Guam ", "Guatem ela", "Gue rnsey", "G uiana",
  44               "Guinea",  "Guinea-B issau", "G uyana", "H aiti", "He ard Island s",
  45               "Honduras ", "Hong K ong", "Hun gary", "Ic eland", "I ndia",
  46               "Indonesi a", "Iran" , "Iraq",  "Ireland",  "Isle Of  Man",
  47               "Israel",  "Italy",  "Jamaica",  "Japan",  "Jersey",
  48               "Jordan",  "Kazakhst an", "Keny a", "Kirib ati", "Kor ea, South" ,
  49               "Korea, N orth", "Ku wait", "Ky rgyzstan",  "Lao Peop le's Dem.  Rep.", "La tvia",
  50               "Lebanon" , "Lesotho ", "Liberi a", "Libya ", "Liecht enstein",
  51               "Lithuani a", "Luxem bourg", "M acau", "Ma cedonia",  "Madagasca r",
  52               "Malawi",  "Malaysia ", "Maldiv es", "Mali ", "Malta" ,
  53               "Mariana  Islands",  "Marshall  Islands",  "Martiniqu e", "Mauri tania", "M auritius",
  54               "Mayotte" , "Mexico" , "Microne sia", "Mol dova", "Mo naco",
  55               "Mongolia ", "Montse rrat", "Mo rocco", "M ozambique" , "Myanmar ",
  56               "Namibia" , "Nauru",  "Nepal",  "Netherlan ds", "Neth erlands An tilles",
  57               "Neutral  Zone", "Ne w Caledoni a", "New Z ealand", " Nicaragua" , "Niger",
  58               "Nigeria" , "Niue",  "Norfolk I sland", "N orthern Ir eland", "N orway",
  59               "Oman", " Pakistan",  "Palau",  "Panama",  "Papua New  Guinea",
  60               "Paraguay ", "Peru",  "Philippi nes", "Pit cairn", "P oland",
  61               "Polynesi a", "Portu gal", "Pue rto Rico",  "Qatar",  "Reunion",
  62               "Romania" , "Russian  Federatio n", "Rwand a", "Saint  Helena",  "Saint Kit ts",
  63               "Saint Lu cia", "Sai nt Pierre" , "Saint V incent", " Samoa", "S an Marino" ,
  64               "Sao Tome  and Princ ipe", "Sau di Arabia" , "Scotlan d", "Seneg al", "Seyc helles",
  65               "Sierra L eone", "Si ngapore",  "Slovakia" , "Sloveni a", "Solom on Islands ",
  66               "Somalia" , "South A frica", "S outh Georg ia", "Spai n", "Sri L anka",
  67               "Sudan",  "Suriname" , "Svalbar d", "Swazi land", "Sw eden",
  68               "Switzerl and", "Syr ian Arab R epublic",  "Taiwan",  "Tajikista ", "Tanzan ia",
  69               "Thailand ", "Togo",  "Tokelau" , "Tonga",  "Trinidad  and Tobag o",
  70               "Tunisia" , "Turkey" , "Turkmen istan", "T urks and C aicos Isla nds", "Tuv alu",
  71               "Uganda",  "Ukraine" , "United  Arab Emira tes", "Uni ted Kingdo m", "Unite d States",
  72               "Uruguay" , "Uzbekis tan", "Van uatu", "Va tican City  State", " Venezuela" ,
  73               "Vietnam" , "Virgin  Islands",  "Wales", " Western Sa hara", "Ye men",
  74               "Yugoslav ia", "Zair e", "Zambi a", "Zimba bwe"};
  75  
  76  
  77           // / <summary >
  78           // / Create t hree new c hange hist ory record s when una ccepting a  lab resul t
  79           // / </summar y>
  80           // / <param n ame="workC aseId"></p aram>
  81           // / <param n ame="labAc tivityId"> </param>
  82           // / <param n ame="inter preationAc tivityId"> </param>
  83           pr ivate stat ic void Cr eateChange HistoryRec ordsWhenUn accept(
  84                int work CaseId, in t labActiv ityId, int  interprea tionActivi tyId)
  85           {
  86                LABRESUL T_CHANGE_T RACKING ch angeHistor y = null;
  87                string u rl = strin g.Empty;
  88  
  89                // Provi der letter  archived
  90                url = st ring.Forma t("../LabR esultsInte rpretation Letters.as px?activit yId={0}&in tActivityI d={1}&RptT ype={2}&Ca seId={3}",  labActivi tyId, inte rpreationA ctivityId,  "1", work CaseId);
  91                changeHi story = Cr eateNewCha ngeHistory Object(wor kCaseId, E FRSharedCo nstant.Lab ResultsCha ngeHistory ProviderLe tterArchiv ed, url);
  92                CreatOne ChangeHist oryRecord( changeHist ory);
  93  
  94                // Patie nt letter  archived
  95                url = st ring.Forma t("../LabR esultsInte rpretation Letters.as px?activit yId={0}&in tActivityI d={1}&RptT ype={2}&Ca seId={3}",  labActivi tyId, inte rpreationA ctivityId,  "0", work CaseId);
  96                changeHi story = Cr eateNewCha ngeHistory Object(wor kCaseId, E FRSharedCo nstant.Lab ResultsCha ngeHistory PatientLet terArchive d, url);
  97                CreatOne ChangeHist oryRecord( changeHist ory);
  98  
  99                // Unacc ept contac t log crea ted
  100                changeHi story = Cr eateNewCha ngeHistory Object(wor kCaseId, E FRSharedCo nstant.Lab ResultsCha ngeHistory ContactLog Created, s tring.Empt y);
  101                CreatOne ChangeHist oryRecord( changeHist ory);
  102           }
  103  
  104           // / <summary >
  105           // / Create a  new chang e history  object
  106           // / </summar y>
  107           // / <param n ame="workC aseId"></p aram>
  108           // / <param n ame="descr iptionText "></param>
  109           // / <param n ame="navig ationUrl"> </param>
  110           // / <returns ></returns >
  111           pr ivate stat ic LABRESU LT_CHANGE_ TRACKING C reateNewCh angeHistor yObject(
  112                int work CaseId, st ring descr iptionText , string n avigationU rl)
  113           {
  114                LABRESUL T_CHANGE_T RACKING ch angeHistor y = new LA BRESULT_CH ANGE_TRACK ING();
  115  
  116                changeHi story.WKF_ CASE_ID =  workCaseId ;
  117                changeHi story.CHAN GE_DATE =  DateTime.N ow;
  118                changeHi story.CHAN GE_DESCRIP TION = des criptionTe xt;
  119                if (!str ing.IsNull OrEmpty(na vigationUr l))
  120                {
  121                    chan geHistory. NAVIGATION _URL = nav igationUrl ;
  122                }
  123  
  124                return c hangeHisto ry;
  125           }
  126  
  127           // / <summary >
  128           // / Insert a  new recor d to LABRE SULT_CHANG E_TRACKING  table
  129           // / </summar y>
  130           // / <param n ame="chang eTracking" ></param>
  131           pr ivate stat ic void Cr eatOneChan geHistoryR ecord(LABR ESULT_CHAN GE_TRACKIN G changeTr acking)
  132           {
  133                LabResul tsTracking Manager ma nager = ne w LabResul tsTracking Manager();
  134                changeTr acking.Set AsChangeTr ackingRoot ();
  135                changeTr acking.Set AsInsertOn Submit();
  136                manager. Update(cha ngeTrackin g);
  137           }
  138           // / <summary >
  139           // / Unaccept  a lab res ults
  140           // / </summar y>
  141           // / <param n ame="labRe sultsActiv ity"></par am>
  142           pu blic stati c void Una cceptLabRe sults(WKF_ CASE_ACTIV ITY labRes ultsActivi ty,
  143                                                     WKF_ CASE workC ase)
  144           {
  145                Workflow CaseManage r wfcManag er = new W orkflowCas eManager() ;
  146                LabResul tsManager  labManager  = new Lab ResultsMan ager();
  147                bool cha ngeToInpro cess = tru e;
  148  
  149                WKF_CASE _ACTIVITY  letterActi vity =
  150                    GetI nterpretat ionLetterW orkcaseAct ivity(labR esultsActi vity.WKF_C ASE_ID,
  151                    (int )WorkflowC aseManager .WorkFlowC aseActivit yType.Inte rpretation Diagnosis) ;
  152  
  153                if (lett erActivity  != null)
  154                {
  155                    // T he letter  is in proc ess 
  156                    // D elete the  letter rec ord and up date the a ctivity re cord to Ne w as statu s
  157                    if ( letterActi vity.STD_W KFACTIVITY STS_ID ==  (int)Workf lowCaseAct ivityStatu s.InProces s)
  158                    {
  159                         //Delete t he interpr etation le tter recor
  160                         Helpers.De leteInterp reationLet ter(letter Activity.W KF_CASE_AC TIVITY_ID) ;
  161  
  162                         //Delete i nterpretat ion letter  activity  record
  163                         wfcManager .DeleteWor kCaseActiv ity(letter Activity.W KF_CASE_AC TIVITY_ID) ;
  164  
  165  
  166                    }
  167                    // T he letter  is complet ed
  168                    else  if (lette rActivity. STD_WKFACT IVITYSTS_I D == (int) WorkflowCa seActivity Status.Int erpreted)
  169                    {
  170                         changeToIn process =  false;
  171  
  172                         // Create  a new cont act log
  173                         ContactLog Manager.Co ntactLog l astPrinted Contact =  Helpers.Ge tLastPrint edContactL og((int)wo rkCase.REF ERRAL_ID);
  174                         if (lastPr intedConta ct != null )
  175                         {
  176                             string  contactMe ssage = "L ab results  were unac cepted for  an Interp retation L etter that  was print ed by "
  177                                 +  lastPrinte dContact.C ontactInit iator + "  on "
  178                                 +  lastPrinte dContact.C ontactDate  + ".";
  179  
  180                             Create NewContact Log((int)w orkCase.PA TIENT_ID,
  181                                 (i nt)workCas e.REFERRAL _ID, EFRSh aredConsta nt.Contact LogReasonU naccepted,  contactMe ssage, EFR SharedCons tant.Conta ctLogMetho dSystem);
  182                         }
  183  
  184                         // Create  a new copy  of the cu rrent lab  results ac tivity 
  185                         labManager .CreateNew CopyOfCurr entLabResu lts(labRes ultsActivi ty.WKF_CAS E_ACTIVITY _ID);
  186  
  187                         // Archive  the curre nt lab res ults activ ity 
  188                         wfcManager .UpdateAct ivityStatu s(labResul tsActivity .WKF_CASE_ ACTIVITY_I D,
  189                             (int)W orkflowCas eActivityS tatus.Acce pted, true );
  190  
  191                         //Archive  the interp reted lett er 
  192                         wfcManager .UpdateAct ivityStatu s(letterAc tivity.WKF _CASE_ACTI VITY_ID,
  193                             (int)W orkflowCas eActivityS tatus.Inte rpreted, t rue);
  194  
  195                         // Create  change his tory recor ds
  196                         CreateChan geHistoryR ecordsWhen Unaccept(l abResultsA ctivity.WK F_CASE_ID,
  197                             labRes ultsActivi ty.WKF_CAS E_ACTIVITY _ID,
  198                             letter Activity.W KF_CASE_AC TIVITY_ID) ;
  199                    }
  200                }
  201  
  202                if (chan geToInproc ess)
  203                {
  204                    //Ch ange the a ctivity st atus to In  Process
  205                    wfcM anager.Upd ateActivit yStatus(la bResultsAc tivity.WKF _CASE_ACTI VITY_ID,
  206           (i nt)Workflo wCaseActiv ityStatus. InProcess,  false);
  207                }
  208  
  209           }
  210  
  211           // / <summary >
  212           // / Create a  new conta ct log
  213           // / </summar y>
  214           // / <param n ame="patie nt"></para m>
  215           // / <param n ame="refer ralId"></p aram>
  216           // / <param n ame="reaso n"></param >
  217           // / <param n ame="conta ctMessage" ></param>
  218           // / <param n ame="contr actMethod" ></param>
  219           pu blic stati c void Cre ateNewCont actLog(int  patientId , int refe rralId,
  220                string r eason, str ing contac tMessage,  string con tactMethod )
  221           {
  222                //Get Pa tient
  223                PatientM anager pat ientManage r = new Pa tientManag er();
  224                PATIENT  patient =  patientMan ager.Selec tByPatient ID(patient Id);
  225  
  226                //Popula te new con tact log o bject
  227                CONTACT_ LOG contac t = new CO NTACT_LOG( );
  228  
  229                contact. REFERRAL_I D = referr alId;
  230                contact. CONTACT_FI RST_NAME =  patient.F IRST_NAME;
  231                contact. CONTACT_LA ST_NAME =  patient.LA ST_NAME;
  232                contact. CONTACT_DA TE = DateT ime.Now;
  233                contact. CONTACT_ME THOD_TEXT  = contactM ethod;
  234                contact. CONTACT_EM AIL = null ;
  235                contact. CONTACT_AD DR1 = pati ent.ADDRES S_LINE1;
  236                contact. CONTACT_AD DR2 = pati ent.ADDRES S_LINE2;
  237                contact. CONTACT_AD DR3 = pati ent.ADDRES S_LINE3;
  238                contact. CONTACT_CI TY = patie nt.CITY;
  239                contact. CONTACT_ST ATE = pati ent.STATE;
  240                contact. CONTACT_PO STAL = pat ient.POSTA L_CODE;
  241                contact. CONTACT_ZI PPLUS4 = p atient.ZIP _PLUS_4;
  242                contact. CONTACT_CO UNTRY = pa tient.COUN TRY;
  243                contact. CONTACT_RE ASON_TEXT  = reason;
  244                contact. TELEMEDICI NE_PATIENT _FLAG = fa lse;
  245                contact. TELEMEDICI NE_PROVIDE R_FLAG = f alse;
  246                contact. INPATIENT_ EVAL_RECOM _FLAG = fa lse;
  247                contact. CONTACT_ME SSAGE_TEXT  = contact Message;
  248  
  249                contact. SetAsChang eTrackingR oot();
  250                contact. SetAsInser tOnSubmit( );
  251  
  252                ContactL ogManager  manager =  new Contac tLogManage r();
  253                manager. Update(con tact);
  254           }
  255  
  256           // / <summary >
  257           // / Get the  last print ed contact  log recor d
  258           // / </summar y>
  259           // / <param n ame="refer ralId"></p aram>
  260           // / <returns ></returns >
  261           pu blic stati c ContactL ogManager. ContactLog  GetLastPr intedConta ctLog(int  referralId )
  262           {
  263                ContactL ogManager. ContactLog  contactLo g = null;
  264  
  265                ContactL ogManager  manager =  new Contac tLogManage r();
  266                List<Con tactLogMan ager.Conta ctLog> con tacts = ma nager.Sele ctByID(ref erralId).T oList();
  267                foreach  (ContactLo gManager.C ontactLog  contact in  contacts)
  268                {
  269                    if ( contact.Co ntactReaso n == EFRSh aredConsta nt.Contact LogReasonP rinted)
  270                    {
  271                         contactLog  = contact ;
  272                         break;
  273                    }
  274                }
  275  
  276                return c ontactLog;
  277           }
  278  
  279           // / <summary >
  280           // / Get a st ring from  an object
  281           // / </summar y>
  282           // / <param n ame="sessi onVariable "></param>
  283           // / <returns ></returns >
  284           pu blic stati c string G etStringFr omObject(o bject sess ionVariabl e)
  285           {
  286                string r esult = st ring.Empty ;
  287  
  288                if (sess ionVariabl e != null)
  289                {
  290                    resu lt = sessi onVariable .ToString( );
  291                }
  292  
  293                return r esult;
  294           }
  295  
  296           // / <summary >
  297           // / Delete a n interpre tation let ter by wor k flow cas e acivity  ID
  298           // / </summar y>
  299           // / <param n ame="workc aseActivit yId"></par am>
  300           // / <returns ></returns >
  301           pu blic stati c int Dele teInterpre ationLette r(int work caseActivi tyId)
  302           {
  303                LabResul tsIntrprtn Manager ma nager = ne w LabResul tsIntrprtn Manager();
  304                return m anager.Del eteInterpr etationLet ter(workca seActivity Id);
  305           }
  306  
  307  
  308           // / <summary >
  309           // / Get the  work flow  case activ ity record  for inter pretation  letter
  310           // / </summar y>
  311           // / <param n ame="workc aseId"></p aram>
  312           // / <param n ame="activ ityTypeId" ></param>
  313           // / <returns ></returns >
  314           pu blic stati c WKF_CASE _ACTIVITY  GetInterpr etationLet terWorkcas eActivity( int workca seId, int  activityTy peId)
  315           {
  316                Workflow CaseManage r wfcManag er = new W orkflowCas eManager() ;
  317                return w fcManager. SelectByCa seIdAndAct ivityTypeI d(workcase Id,
  318                    acti vityTypeId );
  319           }
  320  
  321           // / <summary >
  322           // / Unaccept  lab resul ts functio nality sho uld only b e accessib le to 
  323           // / the "TEF SC Coordin ator (supe ruser)" ro le.   
  324           // / </summar y>
  325           // / <param n ame="activ ityStatusI d"></param >
  326           pu blic stati c void Una cceptLabRe sults(int  activitySt atusId, in t workcase Id, Button  button)
  327           {
  328                button.E nabled = t rue;
  329                if (acti vityStatus Id == (int )WorkflowC aseActivit yStatus.Ac cepted)
  330                {
  331                    butt on.Text =  "Unaccept" ;
  332  
  333                    WKF_ CASE_ACTIV ITY activi ty
  334                         = GetInter pretationL etterWorkc aseActivit y(workcase Id,
  335                         (int)Workf lowCaseMan ager.WorkF lowCaseAct ivityType. Interpreta tionDiagno sis);
  336  
  337                    stri ng message 1 = "Are y ou sure th at you wan t to Unacc ept this l ab result? ";
  338                    stri ng message 2 = string .Empty;
  339                    stri ng message 3 = string .Empty;
  340                    stri ng message 4 = string .Empty;
  341                    stri ng message 5 = string .Empty;
  342                    stri ng message 6 = string .Empty;
  343                    if ( activity ! = null)
  344                    {
  345                         if (activi ty.STD_WKF ACTIVITYST S_ID == (i nt)Workflo wCaseActiv ityStatus. InProcess)
  346                         {
  347                             messag e2 = "Inte pretation  letters ha ve been st arted but  not comple ted.";
  348                             messag e3 = "Thes e letters  will be de leted.";
  349                         }
  350                         else if (a ctivity.ST D_WKFACTIV ITYSTS_ID  == (int)Wo rkflowCase ActivitySt atus.Inter preted)
  351                         {
  352                             messag e2 = "Inte rpretation  letters h ave been c ompleted." ;
  353                             messag e3 = "The  contact lo g has been  updated." ;
  354                             messag e4 = "Thes e letters  will be sa ved as par t of the c hange hist ory for th is lab res ult.";
  355                             messag e5 = "A ne w contact  log entry  will be cr eated.";
  356                         }
  357                    }
  358                    butt on.OnClien tClick = " return Dis playWarnin gMessage(' "
  359                         + message1  + "', '"  + message2  + "', '"  + message3  + "', '"
  360                         + message4  + "', '"  + message5  + "', '"  + message6  + "');";
  361                }
  362                else
  363                {
  364                    butt on.Text =  "Accept";
  365                    butt on.OnClien tClick = " return con firm('Plea se note th at after p ressing th e Accept b utton this  record wi ll become  static (no n-editable ). Are you  sure that  you want  to accept  this lab r esult?');" ;
  366                }
  367           }
  368  
  369           // / <summary >
  370           // / Returns  an array w ith all co untries
  371           // / </summar y>     
  372           pu blic stati c StringCo llection G etCountrie s()
  373           {
  374                StringCo llection c ountries =  new Strin gCollectio n();
  375                countrie s.AddRange (_countrie s);
  376                return c ountries;
  377           }
  378           // / <summary >
  379           // / Returns  sorted lis t of all c ountries
  380           // / </summar y>
  381           // / <param n ame="inser tEmpty"></ param>
  382           // / <returns ></returns >
  383           pu blic stati c SortedLi st GetCoun tries(bool  insertEmp ty)
  384           {
  385                SortedLi st countri es = new S ortedList( );
  386                if (inse rtEmpty)
  387                    coun tries.Add( "", "Pleas e select o ne...");
  388                foreach  (String co untry in _ countries)
  389                    coun tries.Add( country, c ountry);
  390                return c ountries;
  391           }
  392           // / <summary >
  393           // / highligh ts control s on selec tion 
  394           // / </summar y>
  395           // / <param n ame="conta iner"></pa ram>
  396           // / <param n ame="class Name"></pa ram>
  397           pu blic stati c void Set InputContr olsHighlig ht(Control  container , string c lassName)
  398           {
  399                foreach  (Control c tl in cont ainer.Cont rols)
  400                {
  401                    if ( ctl is Tex tBox || ct l is DropD ownList ||
  402                         ctl is Lis tBox || ct l is Check Box || ctl  is RadioB utton ||
  403                         ctl is Rad ioButtonLi st || ctl  is CheckBo xList)
  404                    {
  405                         WebControl  wctl = ct l as WebCo ntrol;
  406                         if (wctl ! = null)
  407                         {
  408                             wctl.A ttributes. Add("onfoc us", strin g.Format(" this.class Name = '{0 }';", clas sName));
  409                             wctl.A ttributes. Add("onblu r", "this. className  = '';");
  410                         }
  411                    }
  412                    else
  413                    {
  414                         if (ctl.Co ntrols.Cou nt > 0)
  415                             SetInp utControls Highlight( ctl, class Name);
  416                    }
  417                }
  418           }
  419           // public sta tic void S etUpHealth FactorChec kBoxes(Con trol conta iner, int  factorId)
  420           // {
  421  
  422           //     foreac h (Control  ctl in co ntainer.Co ntrols)
  423           //     {
  424           //         if  (ctl is C heckBoxLis t)
  425           //         {
  426           //                  Chec kBoxList b oxList = c tl as Chec kBoxList;
  427  
  428           //                  List Item item  = boxList. Items.Find ByValue(fa ctorId.ToS tring());
  429           //                  if ( item != nu ll)
  430           //                  {
  431           //                       //if we fi nd factor  nothing el se to do h ere 
  432           //                       item.Selec ted = true ;
  433           //                       return;
  434           //                  }   
  435           //         }
  436           //         el se
  437           //         {
  438           //              if (ctl. Controls.C ount > 0)
  439           //                  SetU pHealthFac torCheckBo xes(ctl, f actorId);
  440           //         }
  441           //     }    
  442           // }
  443           // / <summary >
  444           // / Utility  to build a  control l ist of pre -defined c ontrol typ e within a  container (usually p anel)
  445           // / </summar y>
  446           // / <param n ame="conta iner"></pa ram>
  447           // / <param n ame="type" ></param>
  448           // / <returns ></returns >
  449           pu blic stati c List<Con trol> Buil dControlLi st(Control  container , Type typ e)
  450           {
  451                List<Con trol> cont rolList =  new List<C ontrol>();
  452  
  453                AddContr olsToList( container. Controls,  type, cont rolList);
  454  
  455                return c ontrolList ;
  456           }
  457           pr ivate stat ic void Ad dControlsT oList(Cont rolCollect ion collec tion, Type  type, Lis t<Control>  listToFil l)
  458           {
  459                foreach  (Control c ontrol in  collection )
  460                {
  461                    if ( control.Ge tType().Eq uals(type) )
  462                    {
  463  
  464                         listToFill .Add(contr ol);
  465  
  466  
  467                    }
  468                    else
  469                    {
  470                         if (contro l.Controls .Count > 0 )
  471                             AddCon trolsToLis t(control. Controls,  type, list ToFill);
  472  
  473                    }
  474                }
  475           }
  476           pu blic stati c bool isV alidIntege r(string v alueToChec k)
  477           {
  478                int temp Int; // no t used but  req'd par am
  479                return i nt.TryPars e(valueToC heck, out  tempInt);
  480           }
  481  
  482           pu blic stati c bool isV alidString (string va lueToCheck )
  483           {
  484                return ! string.IsN ullOrEmpty (valueToCh eck);
  485           }
  486  
  487           pu blic stati c string G etConfigEn try(string  key)
  488           {
  489                var valu e = string .Empty;
  490  
  491                if (WebC onfigurati onManager. AppSetting s.Count >  0)
  492                    valu e = WebCon figuration Manager.Ap pSettings. Get(key);
  493  
  494                return v alue;
  495           }
  496  
  497           // / <summary >
  498           // / useful f unction to  convert t o various  nullable t ypes from  string
  499           // / </summar y>
  500           // / <typepar am name="T "></typepa ram>
  501           // / <param n ame="input "></param>
  502           // / <returns ></returns >
  503           pu blic stati c T? Conve rtStringTo Nullable<T >(string i nput) wher e T : stru ct
  504           {
  505                T? resul t = null;
  506  
  507                TypeConv erter conv erter = Ty peDescript or.GetConv erter(type of(T));
  508  
  509                if (stri ng.IsNullO rEmpty(inp ut))
  510                    resu lt = null;
  511                else
  512                    resu lt = (T)co nverter.Co nvertFromS tring(inpu t);
  513  
  514                return r esult;
  515           }
  516  
  517           pu blic stati c T? ToNul lable<T>(t his string  s) where  T : struct
  518           {
  519                T? resul t = new T? ();
  520  
  521                if (!str ing.IsNull OrEmpty(s)  && s.Trim ().Length  > 0)
  522                {
  523                    Type Converter  conv = Typ eDescripto r.GetConve rter(typeo f(T));
  524                    resu lt = (T)co nv.Convert From(s);
  525                }
  526  
  527                return r esult;
  528           }
  529  
  530           pu blic stati c int GetI ntFromStri ng(string  inString)
  531           {
  532                int retu rnInt = 0;
  533                int temp Int;
  534                bool res ult = int. TryParse(i nString, o ut tempInt );
  535                if (resu lt)
  536                {
  537                    retu rnInt = te mpInt;
  538                }
  539                return r eturnInt;
  540           }
  541  
  542           pu blic stati c string G etShortDat eStringFro mNullableD ate(DateTi me? inDate )
  543           {
  544                string r eturnStrin g = "";
  545                if (inDa te.HasValu e)
  546                {
  547                    retu rnString =  Convert.T oDateTime( inDate).To ShortDateS tring();
  548                }
  549                return r eturnStrin g;
  550           }
  551  
  552           pu blic stati c string G etCrsSetti ng(string  name)
  553           {
  554                string r eturnStrin g = "";
  555  
  556                Registri esLinqData Context dc  = new Reg istriesLin qDataConte xt();
  557  
  558                var sett ings = (fr om s in dc .CRS_SETTI NGSs
  559                                 wh ere s.NAME  == name
  560                                 se lect s.VAL UE).Single OrDefault( );
  561  
  562                if (sett ings == nu ll)
  563                    sett ings = "";
  564  
  565                returnSt ring = set tings.ToSt ring();
  566  
  567                return r eturnStrin g;
  568           }
  569           pu blic stati c int GetD efaultTime out()
  570           {
  571                return 6 00;
  572           }
  573  
  574           pu blic stati c void Rem oveAllLett ersFromPri ntQueue()
  575           {
  576                LabResul tsIntrprtn Manager ma nager = ne w LabResul tsIntrprtn Manager();
  577                LETTER_B ATCH_PRINT ING_STATUS  batchPrin tStatus =  manager.Ge tBatchPrin tingStatus ();
  578  
  579                if (batc hPrintStat us != null )
  580                {
  581                    batc hPrintStat us.SetAsCh angeTracki ngRoot();
  582                    if ( batchPrint Status.PAT IENT_FRAGM ENT_BATCH_ PRINTED
  583                         && batchPr intStatus. PROVIDER_F RAGMENT_BA TCH_PRINTE D)
  584                    {
  585                         var letter s = manage r.GetAllIn terpretati onLettersI nPrintQueu e((int)Efr WorkCaseTy pe.Fragmen tAnalysis) ;
  586                         letters.Fo rEach(lett er => mana ger.Update Interpreta tionLetter PrintQueue (letter, f alse));
  587                         batchPrint Status.PAT IENT_FRAGM ENT_BATCH_ PRINTED =  false;
  588                         batchPrint Status.PRO VIDER_FRAG MENT_BATCH _PRINTED =  false;
  589                         batchPrint Status.Set AsUpdateOn Submit();
  590                         HttpContex t.Current. Session.Re move("Prin tCompleted Letters");
  591                    }
  592  
  593                    if ( batchPrint Status.PRO VIDER_BIO_ BATCH_PRIN TED
  594                         && batchPr intStatus. PATIENT_BI O_BATCH_PR INTED)
  595                    {
  596                         var letter s = manage r.GetAllIn terpretati onLettersI nPrintQueu e((int)Efr WorkCaseTy pe.Biologi calMonitor ing);
  597                         letters.Fo rEach(lett er => mana ger.Update Interpreta tionLetter PrintQueue (letter, f alse));
  598                         batchPrint Status.PRO VIDER_BIO_ BATCH_PRIN TED = fals e;
  599                         batchPrint Status.PAT IENT_BIO_B ATCH_PRINT ED = false ;
  600                         batchPrint Status.Set AsUpdateOn Submit();
  601                         HttpContex t.Current. Session.Re move("Prin tCompleted Letters");
  602                    }
  603  
  604                    if ( batchPrint Status.LIN QEntitySta te == Enti tyState.Mo dified)
  605                    {
  606                         manager.Up dateLetter BatchPrint ingStatus( batchPrint Status);
  607                    }
  608                }
  609           }
  610  
  611           pu blic stati c bool IsD estination UrlLocal(s tring pDes tinationUr l, string  currentHos t)
  612           {
  613                bool isV alidUrl =  false;
  614                string l ocalHost =  string.Co ncat("http s://", cur rentHost,  "/");
  615                string n ewUrl = st ring.Conca t(localHos t, pDestin ationUrl);
  616                Uri dest inationUrl ;
  617                Uri.TryC reate(newU rl, UriKin d.Absolute , out dest inationUrl );
  618                if (dest inationUrl  != null & & currentH ost == des tinationUr l.Host)
  619                {
  620                    isVa lidUrl = t rue;
  621                }
  622                return i sValidUrl;
  623           }
  624  
  625           pu blic stati c int GetT imeoutValu e()
  626           {
  627                const in t max = 60 00;
  628  
  629                int time OutValue =  GetIntFro mString(Ge tConfigEnt ry("Comman dTimeout") );
  630                if (time OutValue >  max)
  631                    time OutValue =  max;
  632                else
  633                    time OutValue =  GetDefaul tTimeout() ;
  634  
  635                return t imeOutValu e;
  636           }
  637       }
  638   }