select() public method

public select ( ) : Patient
return Patient
Beispiel #1
0
 public InpatientStay getStayMovements(string checkinId)
 {
     DdrLister query = buildGetInpatientMovesByCheckinIdQuery(checkinId);
     string[] response = query.execute();
     if (response == null || response.Length == 0)
     {
         return null;
     }
     Adt[] adts = toAdt(response);
     VistaPatientDao patientDao = new VistaPatientDao(cxn);
     Patient p = patientDao.select(adts[0].Patient.LocalPid);
     InpatientStay result = new InpatientStay();
     result.MovementCheckinId = checkinId;
     result.Adts = adts;
     result.Patient = p;
     return result;
 }
Beispiel #2
0
 public InpatientStay[] getStayMovementsByDateRange(string fromTS, string toTS)
 {
     IndexedHashtable checkinIds = getUniqueInpatientMovementIds(fromTS, toTS);
     if (checkinIds == null || checkinIds.Count == 0)
     {
         return new InpatientStay[] { };
     }
     ArrayList lst = new ArrayList(checkinIds.Count);
     VistaPatientDao patientDao = new VistaPatientDao(cxn);
     for (int i = 0; i < checkinIds.Count; i++)
     {
         Adt[] adts = getInpatientMovesByCheckinId((string)checkinIds.GetKey(i));
         Patient p = patientDao.select(adts[0].Patient.LocalPid);
         InpatientStay s = new InpatientStay();
         s.Adts = adts;
         s.Patient = p;
         s.MovementCheckinId = (string)checkinIds.GetKey(i);
         lst.Add(s);
     }
     return (InpatientStay[])lst.ToArray(typeof(InpatientStay));
 }
Beispiel #3
0
        public InpatientStay[] getStayMovementsByPatient(string dfn)
        {
            VistaPatientDao pDao = new VistaPatientDao(cxn);

            // first get all ADT's for pid
            Adt[] adts = getInpatientMoves(dfn);
            if (adts.Length == 0)
            {
                return new InpatientStay[] { };
            }

            List<string> checkinIds = new List<string>();
            // build list of unique checkinId's
            foreach (Adt adt in adts)
            {
                if (!checkinIds.Contains(adt.CheckInId))
                {
                    checkinIds.Add(adt.CheckInId);
                }
            }

            VistaPatientDao patientDao = new VistaPatientDao(cxn);
            ArrayList lst = new ArrayList();
            for (int i = 0; i < checkinIds.Count; i++)
            {
                Adt[] adtAry = getInpatientMovesByCheckinId((string)checkinIds[i]);
                Patient p = patientDao.select(adtAry[0].Patient.LocalPid);
                InpatientStay s = new InpatientStay();
                s.Adts = adtAry;
                s.Patient = p;
                s.MovementCheckinId = (string)checkinIds[i];
                lst.Add(s);
            }
            return (InpatientStay[])lst.ToArray(typeof(InpatientStay));
        }