getPatientsByWard() 공개 메소드

public getPatientsByWard ( AbstractConnection cxn, string wardId ) : Patient[]
cxn AbstractConnection
wardId string
리턴 Patient[]
예제 #1
0
파일: PatientLib.cs 프로젝트: OSEHRA/mdws
        public TaggedPatientArray getPatientsByWard(string sitecode, string wardId)
        {
            TaggedPatientArray result = new TaggedPatientArray();
            string msg = MdwsUtils.isAuthorizedConnection(mySession, sitecode);
            if (msg != "OK")
            {
                result.fault = new FaultTO(msg);
            }
            else if (wardId == "")
            {
                result.fault = new FaultTO("Missing wardId");
            }
            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.getPatientsByWard(cxn, wardId);
                result = new TaggedPatientArray(sitecode, matches);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            return result;
        }