public GetDrugMdsPropertyHqResponse getDrugMdsPropertyHq(GetDrugMdsPropertyHqRequest request) { HttpContext.Current.Request.InputStream.Position = 0; var requestStr = new StreamReader(HttpContext.Current.Request.InputStream, Encoding.UTF8).ReadToEnd(); WorkContext = new WorkContextSoapHeader(); /* * HttpContext.Current.Request.InputStream.Position = 0; * * var jsonString = new StreamReader(HttpContext.Current.Request.InputStream, Encoding.UTF8).ReadToEnd(); */ try { var file = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, string.Format("bin/Data/DM/getDrugMdsPropertyHq/{0}.xml", 1)); var relativeItemCode = request.Arg0.ItemCode[0]; if (RuleMappingHelper.ItemCode_HKID_Mapping.ContainsKey(relativeItemCode)) { relativeItemCode = RuleMappingHelper.ItemCode_HKID_Mapping[relativeItemCode]; } file = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, string.Format("bin/Data/DM/getDrugMdsPropertyHq/{0}.xml", relativeItemCode)); var doc = XDocument.Load(file); XNamespace x = "http://schemas.xmlsoap.org/soap/envelope/"; XNamespace x2 = "http://biz.dms.pms.model.ha.org.hk/"; var element = doc.Descendants(x + "Body") .Descendants(x2 + "getDrugMdsPropertyHqResponse").First(); var str = element.ToString().Replace("ns2:getDrugMdsPropertyHqRespons", "getDrugMdsPropertyHqRespons"); var response = XmlHelper.XmlDeserialize <GetDrugMdsPropertyHqResponse>(str); /* * var element1 = doc.Descendants(x + "Body") * .Descendants(x2 + "getDrugMdsPropertyHqResponse") * .Descendants("return"); * var returnStrs = string.Format(@"<getDrugMdsPropertyHqResponse>{0}</getDrugMdsPropertyHqResponse>", string.Join("", element1.Select(item => item.ToString()).ToArray())); * var response = XmlHelper.XmlDeserialize<GetDrugMdsPropertyHqResponse>(returnStrs); */ return(response); } catch (Exception ex) { ex = ex; //Logger ex return(new GetDrugMdsPropertyHqResponse()); } }
public SearchHKPMIPatientByCaseNoResponse searchHKPMIPatientByCaseNo(SearchHKPMIPatientByCaseNo caseNo) { WorkContext = new WorkContextSoapHeader(); return(new SearchHKPMIPatientByCaseNoResponse { PatientDemoEnquiry = SoapProcessHelper.DoProcess() }); }
public SearchHKPMIPatientByCaseNoResponse searchHKPMIPatientByCaseNo(SearchHKPMIPatientByCaseNo searchHKPMIPatientByCaseNo) { WorkContext = new WorkContextSoapHeader(); HttpContext.Current.Request.InputStream.Position = 0; var requestStr = new StreamReader(HttpContext.Current.Request.InputStream, Encoding.UTF8).ReadToEnd(); var patHospCode = ConfigurationManager.AppSettings["patHospCode"]; if (false == searchHKPMIPatientByCaseNo.HospitalCode.Equals(patHospCode, StringComparison.OrdinalIgnoreCase)) { return(new SearchHKPMIPatientByCaseNoResponse { }); } return(new SearchHKPMIPatientByCaseNoResponse { PatientDemoEnquiry = SoapParserHelper.LoadSamplePatientDemoEnquiry(searchHKPMIPatientByCaseNo.CaseNo) }); }
public PreparationService() { WorkContext = null; }
public DrugMasterService() { WorkContext = null; }