public EMR CreatEMR(Patient patient)
        {
            EMR emr = new EMR();

            emr.Ppubkey  = patient.PublicKey;
            emr.Ehistory = "姓名:" + patient.Name;
            emr.Ehistory = emr.Ehistory + "\r\n" + DateTime.Now.ToString() + "病例创建";
            emrRepository.Add(emr);
            return(emr);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            HappContext        dbContext         = new HappContext();
            IEMRRepository     eMRRepository     = new EMRRepository(dbContext);
            ISessionRepository sessionRepository = new SessionRepository(dbContext);
            EMR eMR = new EMR()
            {
                ID = Guid.NewGuid(), Ppubkey = "P@u0d?#1N3z"
            };

            eMRRepository.Add(eMR);
            dbContext.SaveChanges();
        }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            EMR emr = Service.DoctorService.unLockEMR(textBox1.Text, textBox2.Text, doctor);

            if (emr != null)
            {
                MessageBox.Show("解锁成功");
                ShowEMR showEMR = new ShowEMR(emr, Service);
                showEMR.Show();
            }
            else
            {
                MessageBox.Show("解锁失败");
            }
        }
        void PackCommand(EMR aCommand)
        {
            BinaryFormatter fFormatter    = new BinaryFormatter();
            MemoryStream    fMemoryStream = new MemoryStream(2048);

            fMemoryStream.Seek(0, SeekOrigin.Begin);

            fFormatter.Serialize(fMemoryStream, aCommand);

            byte[] sendBytes = fMemoryStream.GetBuffer();


            BufferChunk chunk = new BufferChunk(sendBytes);
            //PackCommand(chunk);
        }
Exemple #5
0
        public bool LockEMR(EMR emr, string session)
        {
            string publicKey  = emr.Ppubkey;
            string sessionKey = session;
            Code   code       = codeRepository.FindByKey(sessionKey);

            if (code.Cpubkey.Equals(publicKey))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #6
0
        public EMR unLockEMR(string publickey, string sessionkey, Doctor doctor)
        {
            EMR         emr         = emrRepository.FindByPatientPubKey(publickey);
            CodeService codeService = new CodeService(context);

            bool l = codeService.LockEMR(emr, sessionkey);

            if (l)
            {
                return(emr);
            }
            else
            {
                return(null);
            }
        }
        public async Task <Result> RunTask(string groupId, string taskId)
        {
            JobConfiguration jobConfiguration = TaskConfigurationService.GetTaskConfiguration(groupId, taskId);

            try
            {
                await EMR.RunJob(EMRClient, jobConfiguration);

                return(new Result()
                {
                    ErrorCode = Constants.ErrorCodes.OK
                });
            }
            catch (Exception exception) { }

            return(new Result()
            {
                ErrorCode = Constants.ErrorCodes.FAILURE
            });
        }
Exemple #8
0
 public void ModifyEMR(EMR emr, string text, Doctor dr)
 {
     emr.Ehistory = emr.Ehistory + "\r\n\r\n" + "时间:" + DateTime.Now.ToString() + "\r\n具体:\r\n\t" + text;
     emr.Ehistory = emr.Ehistory + "\r\n\t\t\t" + "主任医师:" + dr.Name + "\t签名:" + dr.PublicKey;
     emrRepository.Modify(emr);
 }
Exemple #9
0
        public EMR FindEMRbyID(Guid guid)
        {
            EMR emr = emrRepository.FindById(guid);

            return(emr);
        }
Exemple #10
0
 public AddText(EMR emr, ServiceUse service)
 {
     this.emr = emr;
     Service  = service;
     InitializeComponent();
 }
Exemple #11
0
 public void LockEMR(EMR emr)
 {
     throw new NotImplementedException();
 }
Exemple #12
0
        public EMR FindEMR(string patient)
        {
            EMR emr = emrRepository.FindByPatientPubKey(patient);

            return(emr);
        }
Exemple #13
0
 public ShowEMR(EMR emr, ServiceUse service)
 {
     this.Service = service;
     this.emr     = emr;
     InitializeComponent();
 }
 /// <summary>
 /// 电子病历
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void button1_Click(object sender, EventArgs e)
 {
     EMR.SetValue(this.GetCurrentPatient());
     EMR.Show();
 }