getAdmissions() public method

public getAdmissions ( ConnectionSet cxns ) : IndexedHashtable
cxns gov.va.medora.mdo.dao.ConnectionSet
return IndexedHashtable
Ejemplo n.º 1
0
        public TaggedInpatientStayArray getAdmissions(string sitecode)
        {
            TaggedInpatientStayArray result = new TaggedInpatientStayArray();
            string msg = MdwsUtils.isAuthorizedConnection(mySession, sitecode);
            if (msg != "OK")
            {
                result.fault = new FaultTO(msg);
            }
            if (result.fault != null)
            {
                return result;
            }

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

            try
            {
                AbstractConnection cxn = mySession.ConnectionSet.getConnection(sitecode);
                EncounterApi api = new EncounterApi();
                InpatientStay[] stays = api.getAdmissions(cxn);
                result = new TaggedInpatientStayArray(sitecode, stays);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            return result;
        }