Browse Source

接收服务第一次提交

singlese7en 2 years ago
parent
commit
9db67f4964

+ 39 - 0
KC_HL7_HN.sln

@@ -0,0 +1,39 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.21005.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "KC_HL7_HN", "http://localhost:27299", "{D566F73B-B29E-4C6E-B5B7-9E717C57BFB9}"
+	ProjectSection(WebsiteProperties) = preProject
+		UseIISExpress = "true"
+		TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0"
+		Debug.AspNetCompiler.VirtualPath = "/localhost_27299"
+		Debug.AspNetCompiler.PhysicalPath = "F:\Work\HL7\KC_HL7_HN\KC_HL7_HN_Webservice\Service\"
+		Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_27299\"
+		Debug.AspNetCompiler.Updateable = "true"
+		Debug.AspNetCompiler.ForceOverwrite = "true"
+		Debug.AspNetCompiler.FixedNames = "false"
+		Debug.AspNetCompiler.Debug = "True"
+		Release.AspNetCompiler.VirtualPath = "/localhost_27299"
+		Release.AspNetCompiler.PhysicalPath = "F:\Work\HL7\KC_HL7_HN\KC_HL7_HN_Webservice\Service\"
+		Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_27299\"
+		Release.AspNetCompiler.Updateable = "true"
+		Release.AspNetCompiler.ForceOverwrite = "true"
+		Release.AspNetCompiler.FixedNames = "false"
+		Release.AspNetCompiler.Debug = "False"
+		SlnRelativePath = "F:\Work\HL7\KC_HL7_HN\KC_HL7_HN_Webservice\Service\"
+		DefaultWebSiteLanguage = "Visual C#"
+	EndProjectSection
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{D566F73B-B29E-4C6E-B5B7-9E717C57BFB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{D566F73B-B29E-4C6E-B5B7-9E717C57BFB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

+ 75 - 0
Service/App_Code/Common.cs

@@ -0,0 +1,75 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Web;
+using System.Xml;
+
+/// <summary>
+/// Common 的摘要说明
+/// </summary>
+public class Common
+{
+    public static string MsgRtnEntity = "<MCCI_IN000002UV01 ITSVersion=\"XML_1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"urn:hl7-org:v3\" xsi:schemaLocation=\"urn:hl7-org:v3 ../multicacheschemas/MCCI_IN000002UV01.xsd\"><id root=\"2.16.156.10011.2.5.1.1\" extension=\"{0}\"/><creationTime value=\"{1}\"/><interactionId root=\"2.16.156.10011.2.5.1.2\" extension=\"MCCI_IN000002UV01\"/>\r\n<processingCode code=\"P\"/><processingModeCode/><acceptAckCode code=\"AL\"/><receiver typeCode=\"RCV\"><device classCode=\"DEV\" determinerCode=\"INSTANCE\"><id><item root=\"2.16.156.10011.2.5.1.3\" extension=\"@111\"/></id></device></receiver><sender typeCode=\"SND\"><device classCode=\"DEV\" determinerCode=\"INSTANCE\"><id><item root=\"2.16.156.10011.2.5.1.3\" extension=\"@222\"/></id></device></sender><acknowledgement typeCode=\"{2}\"><targetMessage><id root=\"2.16.156.10011.2.5.1.1\" extension=\"{3}\"/></targetMessage><acknowledgementDetail><text value=\"{4}\"/></acknowledgementDetail></acknowledgement></MCCI_IN000002UV01>";
+	public Common()
+	{
+		//
+		// TODO: 在此处添加构造函数逻辑
+		//
+	}
+
+    public string GetFile()
+    {
+        StreamReader reader = new StreamReader(@"F:\Work\HL7\KC_HL7_HN\Bin\tools.xml");
+        return reader.ReadToEnd(); 
+    }
+
+    public ReciveEntity Resolve(string msgHeader,string msgContent)
+    {
+        ReciveEntity rec = new ReciveEntity();
+        XmlNode doc = OperateXmlUtil.GetContentRootNode(msgHeader);
+        rec.MsgConID = doc.SelectSingleNode("msgNo").InnerText;
+        rec.MsgContent = msgContent;
+        rec.Sequeue = 100000000;
+        rec.ErrNum = 0;
+        switch (doc.SelectSingleNode("serverName").InnerText)
+        {
+            case "OutPatientInfoAdd":
+                rec.MessageID = "ADT";//门诊挂号
+                rec.MessageType = "ADT^A04";
+                break;
+            case "OutPatientInfoUpdate":
+                rec.MessageID = "ADT";//门诊挂号更新
+                rec.MessageType = "ADT^A05";
+                break;
+            case "InPatientInfoAdd":
+                rec.MessageID = "ADT";//住院就诊
+                rec.MessageType = "ADT^A01";
+                break;
+            case "InPatientInfoUpdate":
+                rec.MessageID = "ADT";//住院就诊更新
+                rec.MessageType = "ADT^A02";
+                break;
+            case "OrganizationInfoRegister":
+                rec.MessageID = "MFN";//单位注册
+                rec.MessageType = "MFN^Z2B";
+                break;
+            case "OrganizationInfoUpdate":
+                rec.MessageID = "MFN";//单位更新
+                rec.MessageType = "MFN^Z2C";
+                break;
+            case "ProviderInfoRegister":
+                rec.MessageID = "PMU";//人员注册
+                rec.MessageType = "PMU^B01";
+                break;
+            case "ProviderInfoUpdate":
+                rec.MessageID = "PMU";//人员更新
+                rec.MessageType = "PMU^B02";
+                break;
+        }
+       
+        rec.IP = "local";
+        rec.Remark = msgHeader;
+        return rec;
+    }
+}

+ 237 - 0
Service/App_Code/OperateXmlUtil.cs

@@ -0,0 +1,237 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Web;
+using System.Xml;
+
+/// <summary>
+/// Class1 的摘要说明
+/// </summary>
+public class OperateXmlUtil
+{
+    public OperateXmlUtil()
+	{
+		//
+		// TODO: 在此处添加构造函数逻辑
+		//
+	}
+
+    private static string DefaultPath = "REC";
+    /// <summary>
+    /// 
+    /// </summary>
+    private static XmlDocument _xmlDoc;
+    /// <summary>
+    /// 
+    /// </summary>
+    private static XmlDocument xmlDoc
+    {
+        get
+        {
+            if (_xmlDoc == null)
+            {
+                _xmlDoc = new XmlDocument();
+            }
+            return _xmlDoc;
+        }
+        set
+        {
+            _xmlDoc = value;
+        }
+    }
+
+    /// <summary>
+    /// 获取指定工号的配置文件节点
+    /// </summary>
+    /// <param name="siteName"></param>
+    /// <param name="siteNo"></param>
+    /// <param name="empCode"></param>
+    /// <returns></returns>
+    public static XmlNode GetSiteNode(string siteName, string siteNo, string empCode)
+    {
+        try
+        {
+            string configPath = string.Format("{0}\\{1}{2}.xml", DefaultPath, siteName, siteNo);
+            if (!File.Exists(configPath))
+            {
+                if (!Directory.Exists(DefaultPath))
+                    Directory.CreateDirectory(DefaultPath);
+                CreateConfigFile(configPath);
+                XmlNode rootNode = GetRootNode(configPath);
+                InsertNode(configPath, rootNode, "Emp" + empCode, string.Empty);
+            }
+            xmlDoc.Load(configPath);
+            XmlNode configRootNode = GetRootNode(configPath);
+            XmlNode empNode = configRootNode.SelectSingleNode("Emp" + empCode);
+            if (empNode == null)
+            {
+                InsertNode(configPath, configRootNode, "Emp" + empCode, string.Empty);
+            }
+            return empNode;
+        }
+        catch
+        {
+            return null;
+        }
+    }
+
+    /// <summary>
+    /// 新建一个xml配置文件
+    /// </summary>
+    /// <param name="filePath"></param>
+    /// <returns></returns>
+    public static bool CreateConfigFile(string filePath)
+    {
+        try
+        {
+            XmlDocument xml = new XmlDocument();
+            XmlNode rootNode = xml.CreateElement("Root");
+            xml.AppendChild(rootNode);
+            xml.Save(filePath);
+            return true;
+        }
+        catch
+        {
+            return false;
+        }
+    }
+
+    /// <summary>
+    /// 获取配置文件的根节点
+    /// </summary>
+    /// <returns></returns>
+    public static XmlNode GetRootNode(string filePath)
+    {
+        try
+        {
+            xmlDoc.Load(filePath);
+            XmlNode empNode = xmlDoc.SelectSingleNode("Root");
+            return empNode;
+        }
+        catch { return null; }
+    }
+
+    public static XmlNode GetContentRootNode(string Content)
+    {
+        try
+        {
+            xmlDoc.LoadXml(Content);
+            XmlNode empNode = xmlDoc.SelectSingleNode("root");
+            return empNode;
+        }
+        catch { return null; }
+    }
+    /// <summary>
+    /// 获取配置文件
+    /// </summary>
+    /// <param name="siteName"></param>
+    /// <param name="siteNo"></param>
+    /// <returns></returns>
+    public static string GetConfigPath(string siteName, string siteNo)
+    {
+        string configPath = string.Format("{0}\\{1}{2}.xml", DefaultPath, siteName, siteNo);
+        return configPath;
+    }
+
+    /// <summary>
+    /// 插入一个指定名称的节点
+    /// </summary>
+    /// <param name="configPath"></param>
+    /// <param name="ParentNode"></param>
+    /// <param name="nodeName"></param>
+    /// <returns></returns>
+    public static Boolean InsertNode(string configPath, XmlNode ParentNode, string nodeName, string value)
+    {
+        try
+        {
+            XmlDocument doc = ParentNode.OwnerDocument;
+            XmlNode childNode = ParentNode.SelectSingleNode(nodeName);
+            if (childNode != null)
+            {
+                childNode.InnerText = value;
+                doc.Save(configPath);
+                return true;
+            }
+            XmlNode newNode = doc.CreateElement(nodeName);
+            newNode.InnerText = value;
+            ParentNode.AppendChild(newNode);
+            doc.Save(configPath);
+            return true;
+        }
+        catch
+        {
+            return false;
+        }
+    }
+
+    /// <summary>
+    /// 给指定节点插入指定值
+    /// </summary>
+    /// <param name="configPath"></param>
+    /// <param name="node"></param>
+    /// <param name="value"></param>
+    /// <returns></returns>
+    public static Boolean SetNodeValue(string configPath, XmlNode node, string value)
+    {
+        try
+        {
+            xmlDoc.Load(configPath);
+            node.InnerText = value;
+            xmlDoc.Save(configPath);
+            return true;
+        }
+        catch
+        {
+            return false;
+        }
+    }
+
+    /// <summary>
+    /// 给指定节点插入指定属性
+    /// </summary>
+    /// <param name="configPath"></param>
+    /// <param name="node"></param>
+    /// <param name="attributeName"></param>
+    /// <param name="attributeValue"></param>
+    /// <returns></returns>
+    public static Boolean InsertNodeAttribute(string configPath, XmlNode node, string attributeName, string attributeValue)
+    {
+        try
+        {
+            xmlDoc.Load(configPath);
+            XmlElement element = (XmlElement)node;
+            element.SetAttribute(attributeName, attributeValue);
+            xmlDoc.Save(configPath);
+            return true;
+        }
+        catch
+        {
+            return false;
+        }
+    }
+
+    /// <summary>
+    /// 获取指定名称的子节点
+    /// </summary>
+    /// <param name="parentNode"></param>
+    /// <param name="childNodeName"></param>
+    /// <returns></returns>
+    public static XmlNode GetChildNode(string configPath, XmlNode parentNode, string childNodeName)
+    {
+        try
+        {
+            XmlNode childNode = parentNode.SelectSingleNode(childNodeName);
+            if (childNode == null)
+            {
+                InsertNode(configPath, parentNode, childNodeName, string.Empty);
+                childNode = parentNode.SelectSingleNode(childNodeName);
+            }
+            return childNode;
+        }
+        catch
+        {
+            return null;
+        }
+    }
+}

+ 116 - 0
Service/App_Code/ReciveEntity.cs

@@ -0,0 +1,116 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+/// <summary>
+/// ReciveEntity 的摘要说明
+/// </summary>
+public class ReciveEntity
+{
+    public int SeqNo
+    {
+        get;
+        set;
+    }
+
+    public string SourceID
+    {
+        get;
+        set;
+    }
+
+    public string MsgConID
+    {
+        get;
+        set;
+    }
+    public string MsgHeader
+    {
+        get;
+        set;
+    }
+    public string MsgContent
+    {
+        get;
+        set;
+    }
+    public string ReplyMsg
+    {
+        get;
+        set;
+    }
+
+    public DateTime ReceivingTime
+    {
+        get;
+        set;
+    }
+    public string IP
+    {
+        get;
+        set;
+    }
+    public int TaskStatus
+    {
+        get;
+        set;
+    }
+    public DateTime StartTime
+    {
+        get;
+        set;
+    }
+    public DateTime EndTime
+    {
+        get;
+        set;
+    }
+    public string TaskIP
+    {
+        get;
+        set;
+    }
+    public string TaskMac
+    {
+        get;
+        set;
+    }
+    public string TaskMsg
+    {
+        get;
+        set;
+    }
+    public string MessageID
+    {
+        get;
+        set;
+    }
+    public string MessageType
+    {
+        get;
+        set;
+    }
+    public string Remark
+    {
+        get;
+        set;
+    }
+    public int Sequeue
+    {
+        get;
+        set;
+    }
+    public int ErrNum
+    {
+        get;
+        set;
+    }
+	public ReciveEntity()
+	{
+		//
+		// TODO: 在此处添加构造函数逻辑
+		//
+        
+	}
+}

+ 90 - 0
Service/App_Code/SqlQuery.cs

@@ -0,0 +1,90 @@
+using SI.Common;
+using System;
+
+
+public class SqlQuery
+{
+    
+    private Sql _QueryHCare;
+
+    private Sql QueryHCare
+    {
+        get
+        {
+            if (_QueryHCare == null)
+            {
+                try
+                {
+                    _QueryHCare = new Sql("HealthCare");
+                }
+                catch
+                {
+                    _QueryHCare = new Sql("HealthCare");
+                }
+            }
+            return _QueryHCare;
+        }
+    }
+
+    /* 查询操作
+     * QueryHCare.Command.Clear();
+     * QueryHCare.Command.Add("select * from table");
+     * QueryHCare.ParamByName("StartTime").SetDate(StartTime);
+     * QueryHCare.ExecuteQuery();
+     * 
+     * 
+     */
+    public SqlQuery()
+	{
+        
+	}
+
+    public int SaveQuery(ReciveEntity msg)
+    {
+        string SqlStr = @"insert into HL7_Receive(ID,
+SourceID,
+MsgConID,
+MsgContent,
+ReceivingTime,
+IP,
+ReplyMsg,
+TaskStatus,
+MessageID, 
+MessageType ,Sequeue,Remark
+)
+values(
+@ID,
+@SourceID,
+@MsgConID,
+@MsgContent,
+@ReceivingTime,
+@IP,
+@ReplyMsg,
+1, 
+@MessageID, 
+@MessageType ,@Sequeue,@Remark
+)";
+        try
+        {
+            QueryHCare.Command.Clear();
+            QueryHCare.Command.Add(SqlStr);
+            QueryHCare.ParamByName("ID").SetString(Guid.NewGuid());
+            QueryHCare.ParamByName("SourceID").SetString("MediII");
+            QueryHCare.ParamByName("MsgConID").SetString(msg.MsgConID);
+            QueryHCare.ParamByName("MsgContent").SetText(msg.MsgContent);
+            QueryHCare.ParamByName("ReceivingTime").SetDateTime(DateTime.Now); //为什么用系统时间,返回消息需要带时间,为统一比对
+            QueryHCare.ParamByName("IP").SetString(msg.IP);
+            QueryHCare.ParamByName("ReplyMsg").SetText(msg.ReplyMsg);
+            QueryHCare.ParamByName("MessageID").SetString(msg.MessageID);
+            QueryHCare.ParamByName("MessageType").SetString(msg.MessageType);
+            QueryHCare.ParamByName("Sequeue").SetInt32(msg.Sequeue);
+            QueryHCare.ParamByName("Remark").SetText(msg.Remark);
+
+            return QueryHCare.ExecuteNonQuery();
+        }
+        catch
+        {
+            return 0;
+        }
+    }
+}

+ 59 - 0
Service/App_Code/WebService.cs

@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.Services;
+
+/// <summary>
+/// WebService 的摘要说明
+/// </summary>
+[WebService(Namespace = "http://tempuri.org/")]
+[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
+// 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消注释以下行。 
+// [System.Web.Script.Services.ScriptService]
+public class WebService : System.Web.Services.WebService {
+
+    
+    public WebService () {
+
+        //如果使用设计的组件,请取消注释以下行 
+        //InitializeComponent(); 
+    }
+
+    [WebMethod]
+    public string HelloWorld() {
+        return "Hello World";
+    }
+
+    [WebMethod]
+    public string CallInterface(string msgHeader, string msgBody)
+    {
+        if (string.IsNullOrWhiteSpace(msgHeader))
+            return "空入参";
+        string msgID = "";
+        SI.Common.SILogUtil.Debug(msgHeader);
+        SI.Common.SILogUtil.Debug(msgBody);
+        
+        try
+        {
+            Common com=new Common();
+            var tmp = com.Resolve(msgHeader, msgBody);
+            msgID = tmp.MsgConID;
+
+            SqlQuery query = new SqlQuery();
+            //ReciveEntity rec = new ReciveEntity();
+            string rtn = string.Format(Common.MsgRtnEntity, Guid.NewGuid(), DateTime.Now, "AA", tmp.MsgConID, "接收成功");
+            tmp.ReplyMsg = rtn;
+            query.SaveQuery(tmp);
+            return rtn;
+        }
+        catch(Exception ex)
+        {
+            string rtn = string.Format(Common.MsgRtnEntity, Guid.NewGuid(), DateTime.Now, "AE", msgID, ex.Message);
+            return rtn;
+        }
+
+        
+    }
+    
+}

+ 40 - 0
Service/App_Data/PublishProfiles/KC_Receive.pubxml

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+您 Web 项目的发布/打包进程将使用此文件。您可以通过编辑此 MSBuild 文件
+来自定义该进程的行为。若要了解与此相关的详细信息,请访问 http://go.microsoft.com/fwlink/?LinkID=208121。
+-->
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <WebPublishMethod>MSDeploy</WebPublishMethod>
+    <LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
+    <LastUsedPlatform>Any CPU</LastUsedPlatform>
+    <SiteUrlToLaunchAfterPublish />
+    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
+    <ExcludeApp_Data>False</ExcludeApp_Data>
+    <MSDeployServiceURL>localhost</MSDeployServiceURL>
+    <DeployIisAppPath>KCReceive</DeployIisAppPath>
+    <RemoteSitePhysicalPath />
+    <SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
+    <MSDeployPublishMethod>InProc</MSDeployPublishMethod>
+    <EnableMSDeployBackup>False</EnableMSDeployBackup>
+    <UserName />
+    <_SavePWD>False</_SavePWD>
+    <PublishDatabaseSettings>
+      <Objects xmlns="">
+        <ObjectGroup Name="HealthCare" Order="1" Enabled="False">
+          <Destination Path="" />
+          <Object Type="DbDacFx">
+            <PreSource Path="Data Source=localhost;Initial Catalog=HL7_Platform;Integrated Security=False;Persist Security Info=True;User ID=sa;Password=123" includeData="False" />
+            <Source Path="$(IntermediateOutputPath)AutoScripts\HealthCare_IncrementalSchemaOnly.dacpac" dacpacAction="Deploy" />
+          </Object>
+          <UpdateFrom Type="Web.Config">
+            <Source MatchValue="Data Source=localhost;&#xD;&#xA;                       Initial Catalog=HL7_Platform;&#xD;&#xA;                       Persist Security Info=True;&#xD;&#xA;                       Integrated Security=False;&#xD;&#xA;                       User ID=sa;Password=123" MatchAttributes="$(UpdateFromConnectionStringAttributes)" />
+          </UpdateFrom>
+        </ObjectGroup>
+      </Objects>
+    </PublishDatabaseSettings>
+  </PropertyGroup>
+  <ItemGroup>
+    <MSDeployParameterValue Include="$(DeployParameterPrefix)HealthCare-Web.config Connection String" />
+  </ItemGroup>
+</Project>

BIN
Service/Bin/SI.Common.dll.refresh


BIN
Service/Bin/log4net.dll.refresh


+ 2 - 0
Service/Bin/tools.xml

@@ -0,0 +1,2 @@
+<MCCI_IN000002UV01 ITSVersion="XML_1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:hl7-org:v3" xsi:schemaLocation="urn:hl7-org:v3 ../multicacheschemas/MCCI_IN000002UV01.xsd"><id root="2.16.156.10011.2.5.1.1" extension="{0}"/><creationTime value="{1}"/><interactionId root="2.16.156.10011.2.5.1.2" extension="MCCI_IN000002UV01"/>
+<processingCode code="P"/><processingModeCode/><acceptAckCode code="AL"/><receiver typeCode="RCV"><device classCode="DEV" determinerCode="INSTANCE"><id><item root="2.16.156.10011.2.5.1.3" extension="@111"/></id></device></receiver><sender typeCode="SND"><device classCode="DEV" determinerCode="INSTANCE"><id><item root="2.16.156.10011.2.5.1.3" extension="@222"/></id></device></sender><acknowledgement typeCode="{3}"><targetMessage><id root="2.16.156.10011.2.5.1.1" extension="{4}"/></targetMessage><acknowledgementDetail><text value="{5}"/></acknowledgementDetail></acknowledgement></MCCI_IN000002UV01>

BIN
Service/SI.Common.dll


+ 32 - 0
Service/Web.Debug.config

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- 有关使用 web.config 转换的详细信息,请访问 http://go.microsoft.com/fwlink/?LinkId=125889 -->
+
+<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
+  <!--
+    在下例中,“SetAttributes”转换将更改 
+    “connectionString”的值,以仅在“Match”定位器 
+    找到值为“MyDB”的特性“name”时使用“ReleaseSQLServer”。
+    
+    <connectionStrings>
+      <add name="MyDB" 
+        connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True" 
+        xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
+    </connectionStrings>
+  -->
+  <system.web>
+    <compilation xdt:Transform="RemoveAttributes(debug)" />
+    <!--
+      
+      在下例中,“Replace”转换将替换 
+      web.config 文件的整个 <customErrors> 节。
+      请注意,由于 
+      在 <system.web> 节点下仅有一个 customErrors 节,因此不需要使用“xdt:Locator”特性。
+      
+      <customErrors defaultRedirect="GenericError.htm"
+        mode="RemoteOnly" xdt:Transform="Replace">
+        <error statusCode="500" redirect="InternalError.htm"/>
+      </customErrors>
+    -->
+  </system.web>
+</configuration>

+ 16 - 0
Service/Web.config

@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<configuration>
+  <connectionStrings>
+
+    <add name="HealthCare" connectionString="Data Source=localhost;
+                       Initial Catalog=HL7_Platform;
+                       Persist Security Info=True;
+                       Integrated Security=False;
+                       User ID=sa;Password=123" providerName="System.Data.SqlClient"/>
+
+  </connectionStrings>
+  
+  <system.web>
+    <compilation  debug="true" targetFramework="4.0"/>
+  </system.web>
+</configuration>

+ 1 - 0
Service/WebService.asmx

@@ -0,0 +1 @@
+<%@ WebService Language="C#" CodeBehind="~/App_Code/WebService.cs" Class="WebService" %>

BIN
Service/log4net.dll


File diff suppressed because it is too large
+ 0 - 0
Service/mockDemo/MsgContent.txt


+ 48 - 0
Service/website.publishproj

@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+
+***********************************************************************************************
+website.publishproj
+
+警告: 请勿修改此文件,它将用于 Web 发布过程。
+
+版权所有 (C) Microsoft Corporation。保留所有权利。
+
+***********************************************************************************************
+-->
+
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>10.0.30319</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{552d3b29-3c1c-4ae0-a6d8-0935ecda1e44}</ProjectGuid>
+    <SourceWebPhysicalPath>$(MSBuildThisFileDirectory)</SourceWebPhysicalPath>
+    <SourceWebVirtualPath>/KC_HL7_HN</SourceWebVirtualPath>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <SourceWebProject>http://localhost:27299</SourceWebProject>
+    <SourceWebMetabasePath>/IISExpress/7.5/LM/W3SVC/29/ROOT</SourceWebMetabasePath>
+  </PropertyGroup>
+  <PropertyGroup>
+    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
+    <!-- for VS2010 we need to use 10.5 but for VS2012+ we should use VisualStudioVersion -->
+    <WebPublishTargetsVersion Condition=" '$(WebPublishTargetsVersion)' =='' and '$(VisualStudioVersion)' == 10.0 ">10.5</WebPublishTargetsVersion>
+    <WebPublishTargetsVersion Condition=" '$(WebPublishTargetsVersion)'=='' ">$(VisualStudioVersion)</WebPublishTargetsVersion>
+
+    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(WebPublishTargetsVersion)</VSToolsPath>
+    <_WebPublishTargetsPath Condition=" '$(_WebPublishTargetsPath)'=='' ">$(VSToolsPath)</_WebPublishTargetsPath>
+    <AssemblyFileVersion Condition="'$(AssemblyFileVersion)' == ''">1.0.0.0</AssemblyFileVersion>
+    <AssemblyVersion Condition="'$(AssemblyVersion)' == ''">1.0.0.0</AssemblyVersion>
+  </PropertyGroup>
+  <ItemGroup>
+    <AssemblyAttributes Include="AssemblyFileVersion">
+      <Value>$(AssemblyFileVersion)</Value>
+    </AssemblyAttributes>
+    <AssemblyAttributes Include="AssemblyVersion">
+      <Value>$(AssemblyVersion)</Value>
+    </AssemblyAttributes>
+  </ItemGroup>
+  <Import Project="$(_WebPublishTargetsPath)\Web\Microsoft.WebSite.Publishing.targets" />
+</Project>

+ 72 - 0
SqlQuery.cs

@@ -0,0 +1,72 @@
+using SI.Common;
+using System;
+
+
+public class SqlQuery
+{
+    
+    private Sql _QueryHCare;
+
+    private Sql QueryHCare
+    {
+        get
+        {
+            if (_QueryHCare == null)
+            {
+                try
+                {
+                    _QueryHCare = new Sql("HealthCare");
+                }
+                catch
+                {
+                    _QueryHCare = new Sql("HealthCare");
+                }
+            }
+            return _QueryHCare;
+        }
+    }
+
+    /* 查询操作
+     * QueryHCare.Command.Clear();
+     * QueryHCare.Command.Add("select * from table");
+     * QueryHCare.ParamByName("StartTime").SetDate(StartTime);
+     * QueryHCare.ExecuteQuery();
+     * 
+     * 
+     */
+    public SqlQuery()
+	{
+        {
+            string SqlStr = @"insert into HL7_Receive(ID,
+SourceID,
+MsgConID,
+MsgContent,
+ReceivingTime,
+IP,
+ReplyMsg,
+TaskStatus,
+MessageID, 
+MessageType ,Sequeue
+)
+values(
+@ID,
+@SourceID,
+@MsgConID,
+@MsgContent,
+@ReceivingTime,
+@IP,
+@ReplyMsg,
+1, 
+@MessageID, 
+@MessageType ,@Sequeue
+)";
+        QueryHCare.Command.Clear();
+        QueryHCare.Command.Add(SqlStr);
+        QueryHCare.ParamByName("ID").SetDate(Guid.NewGuid());
+        QueryHCare.ParamByName("ID").SetDate(Guid.NewGuid());
+        QueryHCare.ExecuteQuery();
+
+        }
+        
+	}
+}

Some files were not shown because too many files changed in this diff