getWards() public method

public getWards ( AbstractConnection cxn ) : HospitalLocation[]
cxn AbstractConnection
return HospitalLocation[]
Esempio n. 1
0
        public TaggedHospitalLocationArray getWards(string sitecode)
        {
            TaggedHospitalLocationArray result = new TaggedHospitalLocationArray();
            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();
                HospitalLocation[] wards = api.getWards(cxn);
                result = new TaggedHospitalLocationArray(sitecode, wards);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            return result;
        }