Пример #1
0
        public TaggedHospitalLocationArray getLocations(string sitecode, string target, string direction)
        {
            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;
            }

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

            try
            {
                AbstractConnection cxn       = mySession.ConnectionSet.getConnection(sitecode);
                EncounterApi       api       = new EncounterApi();
                HospitalLocation[] locations = api.getLocations(cxn, target, direction);
                result = new TaggedHospitalLocationArray(sitecode, locations);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            return(result);
        }