示例#1
0
 public bool RetrieveLabToEmrCheckupWithQuestionnaire(int tpr_id, LabClass.QuestionnaireResult questionnaire, string user)
 {
     try
     {
         using (InhCheckupDataContext cdc = new InhCheckupDataContext())
         {
             DateTime dateNow = Class.globalCls.GetServerDateTime();
             var      pregis  = cdc.trn_patient_regis.Where(x => x.tpr_id == tpr_id).FirstOrDefault();
             var      ques    = pregis.trn_ques_patients.FirstOrDefault();
             if (ques == null)
             {
                 ques = new trn_ques_patient
                 {
                     tqp_create_by   = user,
                     tqp_create_date = dateNow
                 };
                 pregis.trn_ques_patients.Add(ques);
             }
             ques.tqp_his_smok      = questionnaire.smoke;
             ques.tqp_fwm_pregnancy = questionnaire.pregnancy;
             ques.tqp_ill_med_diab  = questionnaire.diabetes;
             ques.tqp_update_by     = user;
             ques.tqp_update_date   = dateNow;
             cdc.SubmitChanges();
         }
         return(RetrieveLabToEmrCheckup(tpr_id, user));
     }
     catch (Exception ex)
     {
         Class.globalCls.MessageError("InsertLabCls", "RetrieveLabToEmrCheckupWithQuestionnaire", ex.Message);
         throw ex;
     }
     return(false);
 }
示例#2
0
        //
        public InterpretAllLabResult GetAllLabResult(APITrakcare.Episode episode, LabClass.QuestionnaireResult questionaire, APITrakcare.VitalSignResult vsresult, DateTime dob, char sex)
        {
            try
            {
                var maplab    = new LabClass.MapLabEmrCheckupCls().Mapping(episode);
                var labconfig = new LabClass.GetLabConfigCls().Get(questionaire, maplab, vsresult);
                var visitdate = episode.labdates.Select(x => x.labdate).FirstOrDefault();

                return(GetAllLabResult(visitdate, maplab, labconfig, dob, sex));
            }
            catch (Exception ex)
            {
                Class.globalCls.MessageError("InterpretLabCls", "GetAllLabResult", ex.Message);
                throw ex;
            }
        }