getPatientSitesByMpiPid() public method

Given a national identifier find the patient's sites
public getPatientSitesByMpiPid ( string mpiPid ) : TaggedTextArray
mpiPid string
return gov.va.medora.mdws.dto.TaggedTextArray
示例#1
0
        public TaggedNoteArrays getNotesForBhie(string pwd, string mpiPid, string fromDate, string toDate, string nNotes)
        {
            TaggedNoteArrays result = new TaggedNoteArrays();

            if (pwd != "iBnOfs55iEZ,d")
            {
                result.fault = new FaultTO("Invalid application password");
            }
            else if (String.IsNullOrEmpty(mpiPid))
            {
                result.fault = new FaultTO("Missing mpiPid");
            }
            else if (String.IsNullOrEmpty(fromDate))
            {
                result.fault = new FaultTO("Missing fromDate");
            }
            else if (String.IsNullOrEmpty(toDate))
            {
                result.fault = new FaultTO("Missing toDate");
            }
            if (result.fault != null)
            {
                return(result);
            }

            if (nNotes == "")
            {
                nNotes = "50";
            }

            try
            {
                int             maxNotes = Convert.ToInt16(nNotes);
                PatientLib      patLib   = new PatientLib(_mySession);
                TaggedTextArray sites    = patLib.getPatientSitesByMpiPid(mpiPid);
                if (sites == null)
                {
                    return(null);
                }
                if (sites.fault != null)
                {
                    result.fault = sites.fault;
                    return(result);
                }

                string sitelist = "";
                for (int i = 0; i < sites.count; i++)
                {
                    if ((string)sites.results[i].tag == "200")
                    {
                        continue;
                    }
                    if (sites.results[i].fault != null)
                    {
                    }
                    else
                    {
                        sitelist += (string)sites.results[i].tag + ',';
                    }
                }
                sitelist = sitelist.Substring(0, sitelist.Length - 1);

                AccountLib acctLib = new AccountLib(_mySession);
                sites = acctLib.visitSites("BHIE", sitelist, MdwsConstants.CPRS_CONTEXT);
                if (sites.fault != null)
                {
                    result.fault = sites.fault;
                    return(result);
                }

                PatientApi       patApi = new PatientApi();
                IndexedHashtable t      = patApi.setLocalPids(_mySession.ConnectionSet, mpiPid);
                NoteApi          api    = new NoteApi();
                IndexedHashtable tNotes = api.getNotes(_mySession.ConnectionSet, fromDate, toDate, maxNotes);
                IndexedHashtable tSumms = api.getDischargeSummaries(_mySession.ConnectionSet, fromDate, toDate, 50);
                result = new TaggedNoteArrays(mergeNotesAndDischargeSummaries(tNotes, tSumms));
            }
            catch (Exception ex)
            {
                result.fault = new FaultTO(ex);
            }
            finally
            {
                if (_mySession.ConnectionSet != null)
                {
                    _mySession.ConnectionSet.disconnectAll();
                }
            }
            return(result);
        }
示例#2
0
文件: NoteLib.cs 项目: OSEHRA/mdws
        public TaggedNoteArrays getNotesForBhie(string pwd, string mpiPid, string fromDate, string toDate, string nNotes)
        {
            TaggedNoteArrays result = new TaggedNoteArrays();
            if (String.Equals(pwd, _mySession.MdwsConfiguration.AllConfigs[ConfigFileConstants.PRIMARY_CONFIG_SECTION][MdwsConfigConstants.BHIE_PASSWORD]))
            {
                result.fault = new FaultTO("Invalid application password");
            }
            else if (String.IsNullOrEmpty(mpiPid))
            {
                result.fault = new FaultTO("Missing mpiPid");
            }
            else if (String.IsNullOrEmpty(fromDate))
            {
                result.fault = new FaultTO("Missing fromDate");
            }
            else if (String.IsNullOrEmpty(toDate))
            {
                result.fault = new FaultTO("Missing toDate");
            }
            if (result.fault != null)
            {
                return result;
            }

            if (nNotes == "")
            {
                nNotes = "50";
            }

            try
            {
                int maxNotes = Convert.ToInt16(nNotes);
                PatientLib patLib = new PatientLib(_mySession);
                TaggedTextArray sites = patLib.getPatientSitesByMpiPid(mpiPid);
                if (sites == null)
                {
                    return null;
                }
                if (sites.fault != null)
                {
                    result.fault = sites.fault;
                    return result;
                }

                string sitelist = "";
                for (int i = 0; i < sites.count; i++)
                {
                    if ((string)sites.results[i].tag == "200")
                    {
                        continue;
                    }
                    if (sites.results[i].fault != null)
                    {
                    }
                    else
                    {
                        sitelist += (string)sites.results[i].tag + ',';
                    }
                }
                sitelist = sitelist.Substring(0, sitelist.Length - 1);

                AccountLib acctLib = new AccountLib(_mySession);
                sites = acctLib.visitSites("BHIE", sitelist, MdwsConstants.CPRS_CONTEXT);
                if (sites.fault != null)
                {
                    result.fault = sites.fault;
                    return result;
                }

                PatientApi patApi = new PatientApi();
                IndexedHashtable t = patApi.setLocalPids(_mySession.ConnectionSet, mpiPid);
                NoteApi api = new NoteApi();
                IndexedHashtable tNotes = api.getNotes(_mySession.ConnectionSet, fromDate, toDate, maxNotes);
                IndexedHashtable tSumms = api.getDischargeSummaries(_mySession.ConnectionSet, fromDate, toDate, 50);
                result = new TaggedNoteArrays(mergeNotesAndDischargeSummaries(tNotes, tSumms));
            }
            catch (Exception ex)
            {
                result.fault = new FaultTO(ex);
            }
            finally
            {
                if (_mySession.ConnectionSet != null)
                {
                    _mySession.ConnectionSet.disconnectAll();
                }
            }
            return result;
        }