예제 #1
0
        public void SerializeHL7()
        {
            var prov = HCAssignmentDataProviderFactory.GetProvider();

            List <MSH> msh = prov.GetMSH();

            List <Tuple <String, String> > hl7Messages = new List <Tuple <string, string> >();

            foreach (var item in msh)
            {
                hl7Messages.Add(new Tuple <string, string>(
                                    item.MSH_ID, prov.GetHL7Message(Convert.ToInt32(item.MSH_ID)
                                                                    )));
            }

            string output = JsonConvert.SerializeObject(hl7Messages);

            File.WriteAllText(@"c:\temp\hl7Messages.json", output);

            string input = File.ReadAllText(@"c:\temp\hl7Messages.json");


            List <Tuple <String, String> > two = JsonConvert.DeserializeObject <List <Tuple <String, String> > >(input);

            Assert.IsTrue(two.Count > 0);
        }
예제 #2
0
        public ActionResult Save(int MSH_ID, string Note, List <ChangeSetData> ChangeSet)
        {
            var    prov         = HCAssignmentDataProviderFactory.GetProvider();
            String errorMessage = "";
            String username     = System.Web.HttpContext.Current.User.Identity.Name;
            var    success      = prov.Save(username, MSH_ID, Note == null ? "" : Note, ChangeSet, out errorMessage);

            return(Json(new ResponseStatus()
            {
                Success = success == true ? ResponseStatus.ApiResponseStatus.Success : ResponseStatus.ApiResponseStatus.Failure,
                ErrorMessage = errorMessage
            }));
        }
예제 #3
0
        public ActionResult FailedQueItems()
        {
            var prov = HCAssignmentDataProviderFactory.GetProvider();

            List <MSH> msh = prov.GetMSH();

            var tree = TreeViewHelper.Transform(msh);

            var ret = new TreeViewData()
            {
                MSHData     = msh,
                TreeData    = tree,
                AssignCodes = prov.GetAssignmentCodes(),
                TreeConfig  = new TreeConfig()
            };

            return(Json(ret, JsonRequestBehavior.AllowGet));
        }
예제 #4
0
        public String HL7Data(int msh_id)
        {
            var prov = HCAssignmentDataProviderFactory.GetProvider();

            return(prov.GetHL7Message(msh_id));
        }