getPatientsByClinic() public method

public getPatientsByClinic ( AbstractConnection cxn, string clinicId ) : Patient[]
cxn AbstractConnection
clinicId string
return Patient[]
Ejemplo n.º 1
0
        public TaggedPatientArray getPatientsByClinic(string sitecode, string clinicId)
        {
            TaggedPatientArray result = new TaggedPatientArray();
            string msg = MdwsUtils.isAuthorizedConnection(mySession, sitecode);
            if (msg != "OK")
            {
                result.fault = new FaultTO(msg);
            }
            else if (clinicId == "")
            {
                result.fault = new FaultTO("Missing clinicId");
            }
            if (result.fault != null)
            {
                return result;
            }

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

            try
            {
                AbstractConnection cxn = mySession.ConnectionSet.getConnection(sitecode);
                PatientApi patientApi = new PatientApi();
                Patient[] matches = patientApi.getPatientsByClinic(cxn, clinicId);
                result = new TaggedPatientArray(sitecode, matches);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            return result;
        }