Ejemplo n.º 1
0
        public TaggedHospitalLocationArray getClinics(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 (String.IsNullOrEmpty(sitecode))
            {
                sitecode = mySession.ConnectionSet.BaseSiteId;
            }

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