示例#1
0
        public EncounterInformation AddEncInfo(EncounterInformation EncInfo)
        {
            EncounterInformation encinfo = _encounterinfo.FindAll().OrderBy(p => p.EncounterID).Last();

            EncInfo._id = ObjectId.GenerateNewId().ToString();
            Int32 encinfoid = encinfo.EncounterID + 1;

            EncInfo.EncounterID = encinfoid;
            if (EncInfo.EncounterType == "P")
            {
                EncInfo.EncounterType = "I,A";
            }
            _encounterinfo.Insert(EncInfo);
            return(EncInfo);
        }
示例#2
0
        public EncounterInformation UpdatePatient(EncounterInformation EncInfo)
        {
            var enciexist = GetByUserId(EncInfo.UserId);

            if (EncInfo.EncounterType == "P")
            {
                if (EncInfo.UserId != "a8a56c1d-203c-4c53-9d95-972dec7a2ef5" || EncInfo.UserId == "b6c625f5-653a-429f-b134-5b4d128ce4e8" || EncInfo.UserId == "a24e6d62-414d-4434-bbe3-b3eec3a026e7")
                {
                    EncInfo.EncounterType = "I,A";
                }
            }
            EncounterInformation enci = enciexist.Where(p => p._id == EncInfo._id).First();

            enci.AdmissionDate = EncInfo.AdmissionDate;
            enci.DischargeDate = EncInfo.DischargeDate;
            enci.Admissiondischargelocation = EncInfo.Admissiondischargelocation;

            _encounterinfo.Save(enci);

            return(enci);
        }