コード例 #1
0
        public TaggedPatientArrays match(string target)
        {
            TaggedPatientArrays result = new TaggedPatientArrays();

            if (!mySession.ConnectionSet.IsAuthorized)
            {
                result.fault = new FaultTO("Connections not ready for operation", "Need to login?");
            }
            else if (String.IsNullOrEmpty(target))
            {
                result.fault = new FaultTO("Missing target");
            }
            if (result.fault != null)
            {
                return(result);
            }

            try
            {
                PatientApi       api = new PatientApi();
                IndexedHashtable t   = api.match(mySession.ConnectionSet, target);
                return(new TaggedPatientArrays(t));
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            return(result);
        }
コード例 #2
0
ファイル: UserLib.cs プロジェクト: govtmirror/RAPTOR-1
        // DON'T SEE A USERLOOKUPBYNAME FUNCTION ON USERAPI
        public TaggedUserArrays lookupMS(string target, string maxRex)
        {
            TaggedUserArrays result = new TaggedUserArrays();
            string           msg    = MdwsUtils.isAuthorizedConnection(mySession);

            if (msg != "OK")
            {
                result.fault = new FaultTO(msg);
            }
            else if (target == "")
            {
                result.fault = new FaultTO("Missing target");
            }
            //else if (!StringUtils.isNumeric(maxRex))
            //{
            //    result.fault = new FaultTO("Non-numeric maxRex");
            //}
            if (result.fault != null)
            {
                return(result);
            }

            try
            {
                KeyValuePair <string, string> kvp = new KeyValuePair <string, string>("NAME", target);
                UserApi          api = new UserApi();
                IndexedHashtable t   = api.userLookup(mySession.ConnectionSet, kvp, maxRex);
                result = new TaggedUserArrays(t);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            return(result);
        }
コード例 #3
0
ファイル: EncounterLib.cs プロジェクト: govtmirror/RAPTOR-1
        public TaggedVisitArrays getMentalHealthVisits()
        {
            TaggedVisitArrays result = new TaggedVisitArrays();

            if (!mySession.ConnectionSet.IsAuthorized)
            {
                result.fault = new FaultTO("Connections not ready for operation", "Need to login?");
            }
            if (result.fault != null)
            {
                return(result);
            }

            try
            {
                EncounterApi     api = new EncounterApi();
                IndexedHashtable t   = api.getMentalHealthVisits(mySession.ConnectionSet);
                return(new TaggedVisitArrays(t));
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e);
                return(result);
            }

            return(null);
        }
コード例 #4
0
 public TaggedClaimArrays(IndexedHashtable t)
 {
     if (t.Count == 0)
     {
         return;
     }
     arrays = new TaggedClaimArray[t.Count];
     for (int i = 0; i < t.Count; i++)
     {
         if (t.GetValue(i) == null)
         {
             arrays[i] = new TaggedClaimArray((string)t.GetKey(i));
         }
         else if (t.GetValue(i).GetType().IsAssignableFrom(typeof(Exception)))
         {
             arrays[i] = new TaggedClaimArray((string)t.GetKey(i), (Exception)t.GetValue(i));
         }
         else if (t.GetValue(i).GetType().IsArray)
         {
             arrays[i] = new TaggedClaimArray((string)t.GetKey(i), (Claim[])t.GetValue(i));
         }
         else
         {
             arrays[i] = new TaggedClaimArray((string)t.GetKey(i), (Claim)t.GetValue(i));
         }
     }
     count = t.Count;
 }
コード例 #5
0
 public TaggedCytologyRptArrays(IndexedHashtable t)
 {
     if (t.Count == 0)
     {
         return;
     }
     arrays = new TaggedCytologyRptArray[t.Count];
     for (int i = 0; i < t.Count; i++)
     {
         if (t.GetValue(i) == null)
         {
             arrays[i] = new TaggedCytologyRptArray((string)t.GetKey(i));
         }
         else if (MdwsUtils.isException(t.GetValue(i)))
         {
             arrays[i] = new TaggedCytologyRptArray((string)t.GetKey(i), (Exception)t.GetValue(i));
         }
         else if (t.GetValue(i).GetType().IsArray)
         {
             arrays[i] = new TaggedCytologyRptArray((string)t.GetKey(i), (CytologyReport[])t.GetValue(i));
         }
         else
         {
             arrays[i] = new TaggedCytologyRptArray((string)t.GetKey(i), (CytologyReport)t.GetValue(i));
         }
     }
     count = t.Count;
 }
コード例 #6
0
        public TaggedFaultArray(IndexedHashtable ihs)
        {
            if (ihs == null || ihs.Count == 0)
            {
                return;
            }

            IList <TaggedFault> temp = new List <TaggedFault>();

            for (int i = 0; i < ihs.Count; i++)
            {
                if (MdwsUtils.isException(ihs.GetValue(i)))
                {
                    temp.Add(new TaggedFault((string)ihs.GetKey(i), (Exception)ihs.GetValue(i)));
                }
            }

            if (temp.Count > 0)
            {
                // we want to remove the exceptions from the hashtable because, in container objects, the constructors
                // for each of the property objects handle exception info. we need to keep the tag though so results collections are consistent
                foreach (TaggedFault tf in temp)
                {
                    ihs.Remove(tf.tag);
                    ihs.Add(tf.tag, null);
                }

                faults = new TaggedFault[temp.Count];
                temp.CopyTo(faults, 0);
            }
        }
コード例 #7
0
 public TaggedOefOifArrays(IndexedHashtable t)
 {
     if (t.Count == 0)
     {
         return;
     }
     arrays = new TaggedOefOifArray[t.Count];
     for (int i = 0; i < t.Count; i++)
     {
         if (MdwsUtils.isException(t.GetValue(i)))
         {
             fault = new FaultTO((Exception)t.GetValue(i));
         }
         else if (t.GetValue(i) == null)
         {
             arrays[i] = new TaggedOefOifArray((string)t.GetKey(i));
         }
         else if (t.GetValue(i).GetType().IsArray)
         {
             arrays[i] = new TaggedOefOifArray((string)t.GetKey(i), (OEF_OIF[])t.GetValue(i));
         }
         else
         {
             arrays[i] = new TaggedOefOifArray((string)t.GetKey(i), (OEF_OIF)t.GetValue(i));
         }
     }
     count = t.Count;
 }
コード例 #8
0
        public TaggedTextArray getDiscontinueReasons()
        {
            TaggedTextArray result = new TaggedTextArray();

            if (MdwsUtils.isAuthorizedConnection(mySession) == "OK")
            {
                result.fault = new FaultTO("Connections not ready for operation", "Need to login?");
            }
            if (result.fault != null)
            {
                return(result);
            }

            try
            {
                MedsApi          medsApi = new MedsApi();
                IndexedHashtable ht      = medsApi.getDiscontinueReasons(mySession.ConnectionSet);
                return(new TaggedTextArray(ht));
            }
            catch (Exception exc)
            {
                result.fault = new FaultTO(exc);
            }
            return(result);
        }
コード例 #9
0
ファイル: EncounterLib.cs プロジェクト: govtmirror/RAPTOR-1
        public TaggedIcdRptArrays getIcdSurgeryReports(string fromDate, string toDate, int nrpts)
        {
            TaggedIcdRptArrays result = new TaggedIcdRptArrays();

            if (!mySession.ConnectionSet.IsAuthorized)
            {
                result.fault = new FaultTO("Connections not ready for operation", "Need to login?");
            }
            else if (fromDate == "")
            {
                result.fault = new FaultTO("Missing fromDate");
            }
            else if (toDate == "")
            {
                result.fault = new FaultTO("Missing toDate");
            }
            if (result.fault != null)
            {
                return(result);
            }

            try
            {
                EncounterApi     api = new EncounterApi();
                IndexedHashtable t   = api.getIcdSurgeryReports(mySession.ConnectionSet, fromDate, toDate, nrpts);
                result = new TaggedIcdRptArrays(t);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e);
            }
            return(result);
        }
コード例 #10
0
ファイル: EncounterLib.cs プロジェクト: govtmirror/RAPTOR-1
        public TaggedInpatientStayArrays getStayMovementsByDateRange(string fromDate, string toDate)
        {
            TaggedInpatientStayArrays result = new TaggedInpatientStayArrays();

            if (!mySession.ConnectionSet.IsAuthorized)
            {
                result.fault = new FaultTO("Connections not ready for operation", "Need to login?");
            }
            else if (fromDate == "")
            {
                result.fault = new FaultTO("Missing fromDate");
            }
            else if (toDate == "")
            {
                result.fault = new FaultTO("Missing toDate");
            }
            if (result.fault != null)
            {
                return(result);
            }

            try
            {
                EncounterApi     api = new EncounterApi();
                IndexedHashtable t   = api.getStayMovementsByDateRange(mySession.ConnectionSet, fromDate, toDate);
                result = new TaggedInpatientStayArrays(t);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e);
            }
            return(result);
        }
コード例 #11
0
ファイル: EncounterLib.cs プロジェクト: govtmirror/RAPTOR-1
        public TaggedTextArray getCareTeamReports()
        {
            TaggedTextArray result = new TaggedTextArray();

            if (!mySession.ConnectionSet.IsAuthorized)
            {
                result.fault = new FaultTO("Connections not ready for operation", "Need to login?");
            }
            if (result.fault != null)
            {
                return(result);
            }

            try
            {
                EncounterApi     api = new EncounterApi();
                IndexedHashtable t   = api.getCareTeamReports(mySession.ConnectionSet);
                result = new TaggedTextArray(t);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e);
            }
            return(result);
        }
コード例 #12
0
        public TaggedTextArray getNoteTitles(string sitecode, string target, string direction)
        {
            TaggedTextArray result = new TaggedTextArray();
            string          msg    = MdwsUtils.isAuthorizedConnection(_mySession, sitecode);

            if (msg != "OK")
            {
                result.fault = new FaultTO(msg);
            }

            if (sitecode == null)
            {
                sitecode = _mySession.ConnectionSet.BaseSiteId;
            }

            if (direction == "")
            {
                direction = "1";
            }

            try
            {
                AbstractConnection             cxn = _mySession.ConnectionSet.getConnection(sitecode);
                Dictionary <string, ArrayList> x   = _api.getNoteTitles(cxn, target, direction);
                IndexedHashtable t = new IndexedHashtable();
                t.Add(sitecode, x);
                result = new TaggedTextArray(t);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            return(result);
        }
コード例 #13
0
        public IndexedHashtable disconnect()
        {
            int lth = cxnTable.Count;

            QueryThread[] queries = new QueryThread[lth];
            Thread[]      threads = new Thread[lth];
            for (int i = 0; i < lth; i++)
            {
                queries[i] = new QueryThread(cxnTable.GetValue(i), "disconnect", new Object[0]);
                threads[i] = new Thread(new ThreadStart(queries[i].execute));
                threads[i].Start();
            }
            IndexedHashtable result = new IndexedHashtable(lth);

            for (int i = 0; i < lth; i++)
            {
                string key = (string)cxnTable.GetKey(i);
                threads[i].Join();
                if (queries[i].isExceptionResult())
                {
                    result.Add(key, queries[i].Result);
                }
                else
                {
                    result.Add(key, "OK");
                }
            }
            cxnTable.Clear();
            return(result);
        }
コード例 #14
0
        public TaggedNoteArrays getNotesWithText(string fromDate, string toDate, int nNotes)
        {
            TaggedNoteArrays result = new TaggedNoteArrays();

            if (!_mySession.ConnectionSet.IsAuthorized)
            {
                result.fault = new FaultTO("Connections not ready for operation", "Need to login?");
            }
            else if (fromDate == "")
            {
                result.fault = new FaultTO("Missing fromDate");
            }
            else if (toDate == "")
            {
                result.fault = new FaultTO("Missing toDate");
            }
            if (result.fault != null)
            {
                return(result);
            }

            try
            {
                NoteApi          api = new NoteApi();
                IndexedHashtable t   = api.getNotes(_mySession.ConnectionSet, fromDate, toDate, nNotes);
                result = new TaggedNoteArrays(t);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e);
            }
            return(result);
        }
コード例 #15
0
ファイル: MedsLib.cs プロジェクト: monkeyglasses/mdws
        public TaggedTextArray getMedsAdminLog(string fromDate, string toDate, int nrpts)
        {
            TaggedTextArray result = new TaggedTextArray();

            if (!mySession.ConnectionSet.IsAuthorized)
            {
                result.fault = new FaultTO("Connections not ready for operation", "Need to login?");
            }
            else if (fromDate == "")
            {
                result.fault = new FaultTO("Missing fromDate");
            }
            else if (toDate == "")
            {
                result.fault = new FaultTO("Missing toDate");
            }
            if (result.fault != null)
            {
                return(result);
            }

            try
            {
                IndexedHashtable t = Medication.getMedsAdminLog(mySession.ConnectionSet, fromDate, toDate, nrpts);
                result = new TaggedTextArray(t);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e);
            }
            return(result);
        }
コード例 #16
0
        public TaggedTextArray disconnectAll()
        {
            TaggedTextArray result = new TaggedTextArray();

            if (mySession.ConnectionSet == null || mySession.ConnectionSet.Count == 0)
            {
                result.fault = new FaultTO(NO_CONNECTIONS);
            }
            if (result.fault != null)
            {
                return(result);
            }
            try
            {
                IndexedHashtable t = mySession.ConnectionSet.disconnectAll();
                result = new TaggedTextArray(t);
                mySession.ConnectionSet.Clear();
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }

            return(result);
        }
コード例 #17
0
        public TaggedTextArray ddrListerMS(
            string file,
            string iens,
            string fields,
            string flags,
            string maxrex,
            string from,
            string part,
            string xref,
            string screen,
            string identifier)
        {
            TaggedTextArray result = new TaggedTextArray();

            try
            {
                ToolsApi         api = new ToolsApi();
                IndexedHashtable s   = api.ddrLister(mySession.ConnectionSet, file, iens, fields, flags, maxrex, from, part, xref, screen, identifier);
                result = new TaggedTextArray(s);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            return(result);
        }
コード例 #18
0
        public TaggedLabTestArrays(IndexedHashtable labTests)
        {
            if (labTests == null || labTests.Count == 0)
            {
                return;
            }

            arrays = new TaggedLabTestArray[labTests.Count];

            for (int i = 0; i < labTests.Count; i++)
            {
                string tag = (string)labTests.GetKey(i);

                if (labTests.GetValue(i) == null)
                {
                    arrays[i] = new TaggedLabTestArray(tag);
                }
                if (labTests.GetValue(i) is IList <LabTest> )
                {
                    arrays[i] = new TaggedLabTestArray(tag, (IList <LabTest>)labTests.GetValue(i));
                }
                else if (labTests.GetValue(i) is LabTest[])
                {
                    arrays[i] = new TaggedLabTestArray(tag);
                }
                else if (labTests.GetValue(i) is LabTest)
                {
                    arrays[i] = new TaggedLabTestArray(tag);
                }
                else
                {
                    return;
                }
            }
        }
 public TaggedMentalHealthInstrumentAdministrationArrays(IndexedHashtable t)
 {
     if (t.Count == 0)
     {
         return;
     }
     arrays = new TaggedMentalHealthInstrumentAdministrationArray[t.Count];
     for (int i = 0; i < t.Count; i++)
     {
         if (t.GetValue(i) == null)
         {
             arrays[i] = new TaggedMentalHealthInstrumentAdministrationArray((string)t.GetKey(i));
         }
         else if (t.GetValue(i).GetType().IsArray)
         {
             arrays[i] = new TaggedMentalHealthInstrumentAdministrationArray((string)t.GetKey(i), (MentalHealthInstrumentAdministration[])t.GetValue(i));
         }
         else if (MdwsUtils.isException(t.GetValue(i)))
         {
             fault = new FaultTO((Exception)t.GetValue(i));
         }
         else
         {
             arrays[i] = new TaggedMentalHealthInstrumentAdministrationArray((string)t.GetKey(i), (List <MentalHealthInstrumentAdministration>)t.GetValue(i));
         }
     }
     count = t.Count;
 }
コード例 #20
0
        public TaggedHealthSummaryArray getHealthSummary(string healthSummaryId, string healthSummaryName)
        {
            TaggedHealthSummaryArray result = new TaggedHealthSummaryArray();
            string msg = MdwsUtils.isAuthorizedConnection(mySession);

            if (msg != "OK")
            {
                result.fault = new FaultTO(msg);
                return(result);
            }
            if ((mySession.Patient == null) || (string.IsNullOrEmpty(mySession.Patient.LocalPid)))
            {
                result.fault = new FaultTO("Need to select a patient before calling this method.");
                return(result);
            }
            if (string.IsNullOrEmpty(healthSummaryId) && string.IsNullOrEmpty(healthSummaryName))
            {
                result.fault = new FaultTO("Missing health summary Id OR health summary name. Please provide one of the parameters.");
                return(result);
            }

            try
            {
                IndexedHashtable hs = ClinicalApi.getHealthSummary(mySession.ConnectionSet, new MdoDocument(healthSummaryId, healthSummaryName));
                result.Init(hs);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            return(result);
        }
コード例 #21
0
        public TaggedUserArrays getStaffByCriteria(string siteCode, string searchTerm, string firstName, string lastName, string type)
        {
            TaggedUserArrays result = new TaggedUserArrays();

            if (!mySession.ConnectionSet.IsAuthorized)
            {
                result.fault = new FaultTO("Connection not established or authorized");
            }
            else if (String.IsNullOrEmpty(type))
            {
                result.fault = new FaultTO("Missing type of search {email, phone, firstAndLast, firstOrLast}");
            }
            else if (String.IsNullOrEmpty(siteCode))
            {
                result.fault = new FaultTO("Missing siteCode");
            }
            if (result.fault != null)
            {
                return(result);
            }

            try
            {
                IndexedHashtable ht = ClinicalApi.getStaffByCriteria(mySession.ConnectionSet, siteCode, searchTerm, firstName, lastName, type);
                result = new TaggedUserArrays(ht);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e);
            }

            return(result);
        }
コード例 #22
0
        public TaggedTextArray getNhinData(string types)
        {
            TaggedTextArray result = new TaggedTextArray();

            if (!mySession.ConnectionSet.IsAuthorized)
            {
                result.fault = new FaultTO("Connections not ready for operation", "Need to login?");
            }
            if (result.fault != null)
            {
                return(result);
            }

            try
            {
                IndexedHashtable t = ClinicalApi.getNhinData(mySession.ConnectionSet, types,
                                                             mySession.MdwsConfiguration.AllConfigs[conf.MdwsConfigConstants.MDWS_CONFIG_SECTION][conf.MdwsConfigConstants.NHIN_TYPES]);
                result = new TaggedTextArray(t);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e);
            }
            return(result);
        }
コード例 #23
0
        public TaggedTextArray getCrisisNotes(string fromDate, string toDate, int nrpts)
        {
            TaggedTextArray result = new TaggedTextArray();

            string msg = MdwsUtils.isAuthorizedConnection(_mySession);

            if (msg != "OK")
            {
                result.fault = new FaultTO(msg);
            }
            else if (fromDate == "")
            {
                result.fault = new FaultTO("Missing fromDate");
            }
            else if (toDate == "")
            {
                result.fault = new FaultTO("Missing toDate");
            }
            if (result.fault != null)
            {
                return(result);
            }

            try
            {
                NoteApi          api = new NoteApi();
                IndexedHashtable t   = api.getCrisisNotes(_mySession.ConnectionSet, fromDate, toDate, nrpts);
                return(new TaggedTextArray(t));
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e);
                return(result);
            }
        }
コード例 #24
0
        public IndexedHashtable connect(AbstractCredentials credentials, AbstractPermission permission, DataSource validationDataSource)
        {
            permission.IsPrimary = true;
            QueryTemplate qt = new ConnectQuery(this);

            if (validationDataSource == null)
            {
                validationDataSource = new DataSource();
            }
            qt.QueryMethod("AbstractConnection", "authorizedConnect", new object[] { credentials, permission, validationDataSource });
            IndexedHashtable t = buildResults();

            // KLUGE:  This is here to make the number of connections come out right.
            // Note that the first element in the table will be a connection, but
            // the rest either User or Exception.
            if (HasBaseConnection && myResults.Count < myCxns.Count)
            {
                IndexedHashtable t2 = new IndexedHashtable(myCxns.Count);
                t2.Add(BaseConnection.DataSource.SiteId.Id, BaseConnection);
                for (int i = 0; i < t.Count; i++)
                {
                    t2.Add(t.GetKey(i), t.GetValue(i));
                }
                t = t2;
            }
            return(t);
        }
コード例 #25
0
        public TaggedNoteArrays getDischargeSummaries(String fromDate, String toDate, int nNotes)
        {
            TaggedNoteArrays result = new TaggedNoteArrays();

            string msg = MdwsUtils.isAuthorizedConnection(_mySession);

            if (msg != "OK")
            {
                result.fault = new FaultTO(msg);
            }
            else if (fromDate == "")
            {
                result.fault = new FaultTO("Missing fromDate");
            }
            else if (toDate == "")
            {
                result.fault = new FaultTO("Missing toDate");
            }
            if (result.fault != null)
            {
                return(result);
            }

            try
            {
                NoteApi          api = new NoteApi();
                IndexedHashtable t   = api.getDischargeSummaries(_mySession.ConnectionSet, fromDate, toDate, nNotes);
                result = new TaggedNoteArrays(t);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e);
            }
            return(result);
        }
コード例 #26
0
 /// <summary>
 /// Use this contructor for results from the VPR so only the correct note type is built for a request. "documents" for all notes, "dischargeSummaries" for that specific note type
 /// </summary>
 /// <param name="t"></param>
 /// <param name="noteType"></param>
 public TaggedNoteArrays(IndexedHashtable t, string noteType)
 {
     if (t == null || t.Count == 0)
     {
         return;
     }
     count  = t.Count;
     arrays = new TaggedNoteArray[t.Count];
     for (int i = 0; i < t.Count; i++)
     {
         if (t.GetValue(i) == null)
         {
             arrays[i] = new TaggedNoteArray((string)t.GetKey(i));
         }
         else if (MdwsUtils.isException(t.GetValue(i)))
         {
             arrays[i] = new TaggedNoteArray((string)t.GetKey(i), (Exception)t.GetValue(i));
         }
         else if (t.GetValue(i).GetType() == typeof(System.Collections.Hashtable))
         {
             if (noteType.Equals("documents"))
             {
                 buildAllNotes(t, i);
             }
             else if (noteType.Equals("dischargeSummaries"))
             {
                 buildDischargeSummaries(t, i);
             }
         }
     }
 }
コード例 #27
0
        public IndexedHashtable connect()
        {
            int lth = cxnTbl.Count;

            QueryThread[] queries = new QueryThread[lth];
            Thread[]      threads = new Thread[lth];
            for (int i = 0; i < lth; i++)
            {
                queries[i] = new QueryThread(cxnTbl.GetValue(i), "connect", new Object[0]);
                threads[i] = new Thread(new ThreadStart(queries[i].execute));
                threads[i].Start();
            }
            IndexedHashtable result = new IndexedHashtable(lth);

            for (int i = 0; i < lth; i++)
            {
                string key = (string)cxnTbl.GetKey(i);
                threads[i].Join();

                //Need to report result whether it's a connection or an exception.
                if (queries[i].isExceptionResult())
                {
                    result.Add(key, queries[i].Result);
                    Connection cxn = (Connection)cxnTbl.GetValue(i);
                    cxn.ErrorMessage = ((Exception)queries[i].Result).Message;
                    cxn.IsConnected  = false;
                }
                else
                {
                    result.Add(key, ((Connection)cxnTbl.GetValue(key)).DataSource);
                }
            }
            return(result);
        }
コード例 #28
0
        public TaggedImagingExamArrays(IndexedHashtable ihs)
        {
            if (ihs == null || ihs.Count <= 0)
            {
                return;
            }

            this.count = ihs.Count;
            arrays     = new TaggedImagingExamArray[ihs.Count];

            for (int i = 0; i < ihs.Count; i++)
            {
                if (ihs.GetValue(i) == null)
                {
                    arrays[i] = new TaggedImagingExamArray((string)ihs.GetKey(i));
                }
                else if (MdwsUtils.isException(ihs.GetValue(i)))
                {
                    arrays[i] = new TaggedImagingExamArray((string)ihs.GetKey(i), ihs.GetValue(i) as Exception);
                }
                else if (ihs.GetValue(i).GetType() == typeof(Hashtable))
                {
                    arrays[i] = new TaggedImagingExamArray((string)ihs.GetKey(i), ((Hashtable)ihs.GetValue(i))["radiologyExams"] as IList <ImagingExam>);
                }
            }
        }
コード例 #29
0
        private IndexedHashtable mergeNotesAndDischargeSummaries(IndexedHashtable tNotes, IndexedHashtable tSummaries)
        {
            if (tNotes == null)
            {
                return(tSummaries);
            }
            if (tSummaries == null)
            {
                return(tNotes);
            }
            IndexedHashtable result = new IndexedHashtable(tNotes.Count + tSummaries.Count);

            for (int i = 0; i < tNotes.Count; i++)
            {
                Note[]    notes           = (Note[])tNotes.GetValue(i);
                int       notesLength     = (notes == null ? 0 : notes.Length);
                string    key             = (string)tNotes.GetKey(i);
                Note[]    summaries       = (Note[])tSummaries.GetValue(key);
                int       summariesLength = (summaries == null ? 0 : summaries.Length);
                ArrayList lst             = new ArrayList(notesLength + summariesLength);
                for (int j = 0; j < notesLength; j++)
                {
                    lst.Add(notes[j]);
                }
                for (int j = 0; j < summariesLength; j++)
                {
                    lst.Add(summaries[j]);
                }
                result.Add(key, (Note[])lst.ToArray(typeof(Note)));
            }
            return(result);
        }
コード例 #30
0
        public TaggedOrderArrays getOrdersForPatient()
        {
            TaggedOrderArrays result = new TaggedOrderArrays();

            if (!(MdwsUtils.isAuthorizedConnection(mySession) == "OK"))
            {
                result.fault = new FaultTO("Connections not ready for operation", "Need to login?");
            }
            else if (mySession.Patient == null)
            {
                result.fault = new FaultTO("No patient selected", "Need to select patient");
            }
            if (result.fault != null)
            {
                return(result);
            }

            try
            {
                IndexedHashtable t = Order.getOrdersForPatient(mySession.ConnectionSet);
                result = new TaggedOrderArrays(t);
            }
            catch (Exception exc)
            {
                result.fault = new FaultTO(exc);
            }
            return(result);
        }
コード例 #31
0
ファイル: ConnectionManager.cs プロジェクト: OSEHRA/mdo
 public ConnectionManager(DataSource src)
 {
     this.modality = src.Modality;
     DaoFactory df = DaoFactory.getDaoFactory(DaoFactory.getConstant(src.Protocol));
     Connection cxn = df.getConnection(src);
     cxnTbl = new IndexedHashtable();
     addConnection(cxn);
 }
コード例 #32
0
ファイル: MultiSourceQuery.cs プロジェクト: OSEHRA/mdo
 public static IndexedHashtable execute2(IndexedHashtable cxnTable, string daoName, string methodName, Object[] args)
 {
     if (cxnTable == null || cxnTable.Count == 0)
     {
         throw new Exception("No connections!");
     }
     int lth = cxnTable.Count;
     QueryThread[] queries = new QueryThread[lth];
     Thread[] threads = new Thread[lth];
     for (int i = 0; i < lth; i++)
     {
         if (cxnTable.GetValue(i).GetType().IsAssignableFrom(typeof(Exception)))
         {
             continue;
         }
         Connection cxn = (Connection)cxnTable.GetValue(i);
         if (!cxn.IsConnected)
         {
             continue;
         }
         Object dao = ((Connection)cxnTable.GetValue(i)).getDao(daoName);
         if (dao == null)
         {
             continue;
         }
         queries[i] = new QueryThread(dao, methodName, args);
         threads[i] = new Thread(new ThreadStart(queries[i].execute));
         threads[i].Start();
     }
     IndexedHashtable result = new IndexedHashtable(cxnTable.Count);
     for (int i = 0; i < threads.Length; i++)
     {
         if (cxnTable.GetValue(i).GetType().IsAssignableFrom(typeof(Exception)))
         {
             result.Add((string)cxnTable.GetKey(i), (Exception)cxnTable.GetValue(i));
             continue;
         }
         Connection cxn = (Connection)cxnTable.GetValue(i);
         if (!cxn.IsConnected)
         {
             result.Add((string)cxnTable.GetKey(i), new Exception("Source is not connected"));
             continue;
         }
         Object dao = ((Connection)cxnTable.GetValue(i)).getDao(daoName);
         if (dao == null)
         {
             result.Add((string)cxnTable.GetKey(i), new Exception("Invalid dao: " + daoName));
             continue;
         }
         threads[i].Join();
         result.Add((String)cxnTable.GetKey(i), queries[i].Result);
     }
     return result;
 }
コード例 #33
0
ファイル: ConnectionSet.cs プロジェクト: OSEHRA/mdo
        public IndexedHashtable connect(AbstractCredentials credentials, AbstractPermission permission, DataSource validationDataSource)
        {
            permission.IsPrimary = true;
            QueryTemplate qt = new ConnectQuery(this);
            if (validationDataSource == null)
            {
                validationDataSource = new DataSource();
            }
            qt.QueryMethod("AbstractConnection", "authorizedConnect", new object[] { credentials, permission, validationDataSource });
            IndexedHashtable t = buildResults();

            // KLUGE:  This is here to make the number of connections come out right.
            // Note that the first element in the table will be a connection, but
            // the rest either User or Exception.
            if (HasBaseConnection && myResults.Count < myCxns.Count)
            {
                IndexedHashtable t2 = new IndexedHashtable(myCxns.Count);
                t2.Add(BaseConnection.DataSource.SiteId.Id, BaseConnection);
                for (int i = 0; i < t.Count; i++)
                {
                    t2.Add(t.GetKey(i), t.GetValue(i));
                }
                t = t2;
            }
            return t;
        }
コード例 #34
0
ファイル: MultiSourceQuery.cs プロジェクト: OSEHRA/mdo
        public IndexedHashtable connect()
        {
            int lth = cxnTable.Count;
            QueryThread[] queries = new QueryThread[lth];
            Thread[] threads = new Thread[lth];
            for (int i = 0; i < lth; i++)
            {
                queries[i] = new QueryThread(cxnTable.GetValue(i), "connect", new Object[0]);
                //queries[i].execute();
                threads[i] = new Thread(new ThreadStart(queries[i].execute));
                threads[i].Start();
            }
            IndexedHashtable result = new IndexedHashtable(lth);
            for (int i = 0; i < lth; i++)
            {
                string key = (string)cxnTable.GetKey(i);
                threads[i].Join();

                //Need to report result whether it's a connection or an exception.
                if (queries[i].isExceptionResult())
                {
                    result.Add(key,queries[i].Result);
                }
                else
                {
                    result.Add(key,((Connection)cxnTable.GetValue(key)).DataSource);
                }
            }

            //Now for all the results that failed to connect, we remove them from the connection table.
            for (int i = 0; i < lth; i++)
            {
                if (queries[i].isExceptionResult())
                {
                    string key = (string)cxnTable.GetKey(i);
                    cxnTable.Remove(key);
                    cxnTable.Add(key, queries[i].Result);
                }
            }
            return result;
        }
コード例 #35
0
ファイル: MultiSourceQuery.cs プロジェクト: OSEHRA/mdo
 public IndexedHashtable disconnectRemoteSites()
 {
     int lth = cxnTable.Count - 1;
     if (lth <= 0)
     {
         return null;
     }
     QueryThread[] queries = new QueryThread[lth];
     Thread[] threads = new Thread[lth];
     for (int i = 0; i < lth; i++)
     {
         queries[i] = new QueryThread(cxnTable.GetValue(i+1), "disconnect", new Object[0]);
         threads[i] = new Thread(new ThreadStart(queries[i].execute));
         threads[i].Start();
     }
     IndexedHashtable result = new IndexedHashtable(lth);
     for (int i = 0; i < lth; i++)
     {
         string key = (string)cxnTable.GetKey(i + 1);
         threads[i].Join();
         if (queries[i].isExceptionResult())
         {
             result.Add(key, queries[i].Result);
         }
         else
         {
             result.Add(key, "OK");
         }
     }
     for (int i = 0; i < result.Count; i++)
     {
         cxnTable.Remove(result.GetKey(i));
     }
     return result;
 }
コード例 #36
0
ファイル: MultiSourceQuery.cs プロジェクト: OSEHRA/mdo
 public IndexedHashtable execute(String daoName, String methodName, Object[] args)
 {
     int lth = cxnTable.Count;
     QueryThread[] queries = new QueryThread[lth];
     Thread[] threads = new Thread[lth];
     for (int i = 0; i < lth; i++)
     {
         if (cxnTable.GetValue(i).GetType().IsAssignableFrom(typeof(Exception)))
         {
             continue;
         }
         Object dao = ((Connection)cxnTable.GetValue(i)).getDao(daoName);
         queries[i] = new QueryThread(dao, methodName, args);
         threads[i] = new Thread(new ThreadStart(queries[i].execute));
         threads[i].Start();
     }
     IndexedHashtable result = new IndexedHashtable(cxnTable.Count);
     for (int i=0; i<threads.Length; i++)
     {
         if (cxnTable.GetValue(i).GetType().IsAssignableFrom(typeof(Exception)))
         {
             result.Add((string)cxnTable.GetKey(i),(Exception)cxnTable.GetValue(i));
             continue;
         }
         try
         {
             threads[i].Join();
             result.Add((String)cxnTable.GetKey(i), queries[i].Result);
         }
         catch (Exception)
         {
             //throw new MdoException(e);
         }
     }
     return result;
 }
コード例 #37
0
ファイル: MultiSourceQuery.cs プロジェクト: OSEHRA/mdo
 public MultiSourceQuery(IndexedHashtable cxnTable)
 {
     this.cxnTable = cxnTable;
 }
コード例 #38
0
ファイル: VistaChemHemDao.cs プロジェクト: OSEHRA/mdo
 internal IndexedHashtable toChemHemSpecimens(string[] response, ref string fromDate, ref string toDate)
 {
     IndexedHashtable result = new IndexedHashtable(response.Length);
     for (int i = 0; i < response.Length; i++)
     {
         string[] flds = StringUtils.split(response[i], StringUtils.CARET);
         LabSpecimen specimen = new LabSpecimen();
         specimen.Id = flds[0];
         specimen.ReportDate = VistaTimestamp.toUtcString(flds[2]);
         specimen.CollectionDate = VistaTimestamp.toUtcString(flds[1]);
         if (i == 0)
         {
             fromDate = specimen.CollectionDate;
         }
         if (i == response.Length-1)
         {
             toDate = specimen.CollectionDate;
         }
         specimen.Name = flds[3];
         specimen.AccessionNumber = flds[4];
         if (flds.Length > 6)
         {
             specimen.Site = flds[5];
         }
         if (flds.Length > 7)
         {
             specimen.Facility = new SiteId(flds[7], flds[6]);
         }
         string key = flds[1] + '^' + flds[4];
         result.Add(key, specimen);
     }
     return result;
 }
コード例 #39
0
ファイル: ConnectionSet.cs プロジェクト: OSEHRA/mdo
 internal IndexedHashtable buildResults()
 {
     IndexedHashtable result = new IndexedHashtable();
     if (myResults != null)
     {
         for (int i = 0; i < myResults.Count; i++)
         {
             result.Add(myResults.GetKey(i), myResults.GetValue(i));
         }
     }
     if (myExceptions != null)
     {
         for (int i = 0; i < myExceptions.Count; i++)
         {
             result.Add(myExceptions.GetKey(i), myExceptions.GetValue(i));
         }
     }
     return result;
 }
コード例 #40
0
ファイル: VistaEncounterDao.cs プロジェクト: OSEHRA/mdo
 internal IndexedHashtable toUniqueCheckinIds(string[] response)
 {
     if (response == null || response.Length == 0)
     {
         return null;
     }
     IndexedHashtable t = new IndexedHashtable(response.Length);
     for (int i = 0; i < response.Length; i++)
     {
         if (String.IsNullOrEmpty(response[i]))
         {
             continue; // per http://trac.medora.va.gov/web/ticket/2713 - found a blank record in a test site. can't do anything with stay since can't locate checkin id 
         }
         if (t.ContainsKey(response[i]))
         {
             continue;
         }
         t.Add(response[i], null);
     }
     return t;
 }
コード例 #41
0
ファイル: ConnectionManager.cs プロジェクト: OSEHRA/mdo
        public IndexedHashtable disconnect()
        {
            if (cxnTbl.Count == 0)
            {
                throw new Exception("No connections");
            }

            // Only disconnect from the ones that are connected
            IndexedHashtable myCxns = getConnections();

            int lth = myCxns.Count;
            QueryThread[] queries = new QueryThread[lth];
            Thread[] threads = new Thread[lth];
            for (int i = 0; i < lth; i++)
            {
                queries[i] = new QueryThread(myCxns.GetValue(i), "disconnect", new Object[0]);
                threads[i] = new Thread(new ThreadStart(queries[i].execute));
                threads[i].Start();
            }
            IndexedHashtable result = new IndexedHashtable(lth);
            for (int i = 0; i < lth; i++)
            {
                string key = (string)myCxns.GetKey(i);
                threads[i].Join();
                if (queries[i].isExceptionResult())
                {
                    result.Add(key, queries[i].Result);
                }
                else
                {
                    result.Add(key, "OK");
                }
            }

            // We only disconnected from connected connections, but we want to clear
            // the entire table
            cxnTbl = new IndexedHashtable();
            return result;
        }
コード例 #42
0
ファイル: ConnectionManager.cs プロジェクト: OSEHRA/mdo
 IndexedHashtable getConnections()
 {
     IndexedHashtable result = new IndexedHashtable();
     for (int i = 0; i < cxnTbl.Count; i++)
     {
         Connection cxn = (Connection)cxnTbl.GetValue(i);
         if (cxn.IsConnected)
         {
             result.Add(cxn.SiteId.Key, cxn);
         }
     }
     if (result.Count == 0)
     {
         return null;
     }
     return result;
 }
コード例 #43
0
ファイル: ConnectionManager.cs プロジェクト: OSEHRA/mdo
 public ConnectionManager(Connection cxn)
 {
     this.modality = cxn.DataSource.Modality;
     cxnTbl = new IndexedHashtable();
     addConnection(cxn);
 }
コード例 #44
0
ファイル: VistaOrdersDao.cs プロジェクト: OSEHRA/mdo
 internal IndexedHashtable toOrderHashtable(string response)
 {
     if (StringUtils.isEmpty(response))
     {
         return null;
     }
     string[] lines = StringUtils.split(response, StringUtils.CRLF);
     IndexedHashtable t = new IndexedHashtable(lines.Length - 1);
     for (int i = 1; i < lines.Length; i++)
     {
         if (StringUtils.isEmpty(lines[i]))
         {
             continue;
         }
         string[] flds = StringUtils.split(lines[i], StringUtils.CARET);
         Order order = new Order();
         order.Id = flds[0];
         order.Timestamp = VistaTimestamp.toDateTime(flds[2]);
         t.Add(order.Id, order);
     }
     return t;
 }
コード例 #45
0
ファイル: ConnectionManager.cs プロジェクト: OSEHRA/mdo
 public ConnectionManager(string modality)
 {
     this.modality = modality;
     cxnTbl = new IndexedHashtable();
 }
コード例 #46
0
ファイル: VistaOrdersDao.cs プロジェクト: OSEHRA/mdo
        // From CPRS:
        //{           1   2    3     4      5     6   7   8   9    10    11    12    13    14     15     16  17    18
        //{ Pieces: ~IFN^Grp^ActTm^StrtTm^StopTm^Sts^Sig^Nrs^Clk^PrvID^PrvNam^ActDA^Flag^DCType^ChrtRev^DEA#^VA#^DigSig}
        internal Order[] completeOrders(IndexedHashtable t, string response)
        {
            if (StringUtils.isEmpty(response))
            {
                return new Order[0];
            }

            Dictionary<string, OrderType> orderTypes = getOrderTypes();

            string[] lines = StringUtils.split(response, StringUtils.CRLF);
            ArrayList lst = new ArrayList();
            lines = StringUtils.trimArray(lines);
            Order currentOrder = null;
            for (int lineIdx = 0; lineIdx < lines.Length; lineIdx++)
            {
                if (String.IsNullOrEmpty(lines[lineIdx]))
                {
                    continue;
                }
                if (lines[lineIdx].StartsWith("~"))
                {
                    if (currentOrder != null)
                    {
                        lst.Add(currentOrder);
                    }
                    currentOrder = new Order();
                    string[] flds = StringUtils.split(lines[lineIdx], StringUtils.CARET);
                    if (flds == null || flds.Length < 15)
                    {
                        continue; // TBD - should throw exception? data not in expected format
                    }
                    currentOrder.Id = flds[0].Substring(1);
                    if(orderTypes.ContainsKey(flds[1]))
                    {
                        currentOrder.Type = orderTypes[flds[1]];
                    }
                    currentOrder.Timestamp = VistaTimestamp.toDateTime(flds[2]);
                    currentOrder.StartDate = VistaTimestamp.toDateTime(flds[3]);
                    if (flds[4] != "")
                    {
                        currentOrder.StopDate = VistaTimestamp.toDateTime(flds[4]);
                    }
                    currentOrder.Status = decodeOrderStatus(flds[5]);
                    currentOrder.SigStatus = decodeSignatureStatus(flds[6]);
                    currentOrder.VerifyingNurse = flds[7];
                    currentOrder.VerifyingClerk = flds[8];
                    currentOrder.Provider = new User();
                    currentOrder.Provider.Uid = flds[9];
                    currentOrder.Provider.Name = new PersonName(flds[10]);
                    currentOrder.Flag = flds[12] == "1";
                    currentOrder.ChartReviewer = flds[14];
                    if (flds.Length > 17)
                    {
                        //currentOrder.
                    }
                }
                else if (lines[lineIdx].StartsWith("t"))
                {
                    currentOrder.Text += (lines[lineIdx].Substring(1) + StringUtils.CRLF);
                }
            }
            if (currentOrder != null)
            {
                lst.Add(currentOrder);
            }

            return (Order[])lst.ToArray(typeof(Order));
        }
コード例 #47
0
ファイル: ConnectionManager.cs プロジェクト: OSEHRA/mdo
        public IndexedHashtable disconnectRemoteSites()
        {
            if (cxnTbl.Count < 2)
            {
                throw new Exception("No remote connections");
            }

            // Only disconnect from the ones that are connected
            IndexedHashtable myCxns = getConnections();

            int lth = myCxns.Count - 1;
            QueryThread[] queries = new QueryThread[lth];
            Thread[] threads = new Thread[lth];
            for (int threadIdx = 0, cxnIdx = 1; threadIdx < lth; threadIdx++, cxnIdx++)
            {
                queries[threadIdx] = new QueryThread(myCxns.GetValue(cxnIdx), "disconnect", new Object[0]);
                threads[threadIdx] = new Thread(new ThreadStart(queries[threadIdx].execute));
                threads[threadIdx].Start();
            }
            IndexedHashtable result = new IndexedHashtable(lth);
            for (int threadIdx = 0, cxnIdx = 1; threadIdx < lth; threadIdx++, cxnIdx++)
            {
                string key = (string)myCxns.GetKey(cxnIdx);
                threads[threadIdx].Join();
                if (queries[threadIdx].isExceptionResult())
                {
                    result.Add(key, queries[threadIdx].Result);
                }
                else
                {
                    result.Add(key, "OK");
                }
            }

            // Now remove all but the logon connection from the table
            Connection loginCxn = LoginConnection;
            cxnTbl = new IndexedHashtable();
            cxnTbl.Add(loginCxn.SiteId.Key, loginCxn);
            return result;
        }
コード例 #48
0
ファイル: VistaOrdersDao.cs プロジェクト: OSEHRA/mdo
 internal MdoQuery buildGetOrdersRequest(IndexedHashtable t)
 {
     VistaQuery vq = new VistaQuery("ORWORR GET4LST");
     vq.addParameter(vq.LITERAL, "2");
     vq.addParameter(vq.LITERAL, VistaTimestamp.fromDateTime(DateTime.Now));
     DictionaryHashList lst = new DictionaryHashList();
     for (int i = 0; i < t.Count; i++)
     {
         lst.Add(Convert.ToString(i + 1), ((Order)t.GetValue(i)).Id);
     }
     vq.addParameter(vq.LIST, lst);
     return vq;
 }
コード例 #49
0
ファイル: ConnectionManager.cs プロジェクト: OSEHRA/mdo
 public void addConnections(IndexedHashtable t)
 {
     for (int i = 0; i < t.Count; i++)
     {
         Connection cxn = (Connection)t.GetValue(i);
         addConnection(cxn);
     }
 }
コード例 #50
0
ファイル: ConnectionManager.cs プロジェクト: OSEHRA/mdo
 public void addConnection(Connection cxn)
 {
     if (cxnTbl == null)
     {
         cxnTbl = new IndexedHashtable();
         this.modality = cxn.DataSource.Modality;
     }
     checkModality(cxn);
     if (!cxnTbl.ContainsKey(cxn.DataSource.SiteId.Id))
     {
         cxnTbl.Add(cxn.SiteId.Key,cxn);
     }
 }
コード例 #51
0
ファイル: ConnectionManager.cs プロジェクト: OSEHRA/mdo
        public IndexedHashtable connect()
        {
            int lth = cxnTbl.Count;
            QueryThread[] queries = new QueryThread[lth];
            Thread[] threads = new Thread[lth];
            for (int i = 0; i < lth; i++)
            {
                queries[i] = new QueryThread(cxnTbl.GetValue(i), "connect", new Object[0]);
                threads[i] = new Thread(new ThreadStart(queries[i].execute));
                threads[i].Start();
            }
            IndexedHashtable result = new IndexedHashtable(lth);
            for (int i = 0; i < lth; i++)
            {
                string key = (string)cxnTbl.GetKey(i);
                threads[i].Join();

                //Need to report result whether it's a connection or an exception.
                if (queries[i].isExceptionResult())
                {
                    result.Add(key, queries[i].Result);
                    Connection cxn = (Connection)cxnTbl.GetValue(i);
                    cxn.ErrorMessage = ((Exception)queries[i].Result).Message;
                    cxn.IsConnected = false;
                }
                else
                {
                    result.Add(key, ((Connection)cxnTbl.GetValue(key)).DataSource);
                }
            }
            return result;
        }