private bool UpdateQ_ClickStatusQ_Nurse(ChangeQueueModel param, string slip_seq) { //UpdateQ_ClickStatusQ_Nurse /* Update Q normal/express to service Chula*/ string result = ""; CUKioskService.WS_KioskQSoapClient ws = new CUKioskService.WS_KioskQSoapClient(); //QChulaService.WS_KioskQSoapClient ws = new QChulaService.WS_KioskQSoapClient(); DataSet ds = ws.UpdateQ_ClickStatusQ_Nurse(slip_seq, param.q_status, param.status_clinic_scanning, param.status_send_clinic, param.nurse_channel_comp_id, param.crtd_by, param.status_voice_call); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { result = ds.Tables[0].Rows[0]["ws_result"].ToString(); if (result == "S") { return(true); } else { return(false); } } else { return(false); } }
public HttpResponseMessage GenQFlowNormal([FromBody] ChangeQueueModel param) { try { string slip_seq = param.slip_seq.ToString(); if (UpdateQ_ClickStatusQ_Nurse(param, slip_seq)) { if (UpdateQShowQAll2_Check(slip_seq, "N")) { return(this.Request.CreateResponse <string>(HttpStatusCode.OK, "ส่งตรวจไปยังช่องบริการ 1-5 เรียบร้อย")); } else { return(this.Request.CreateResponse <string>(HttpStatusCode.BadRequest, "problem when call service UpdateQShowQAll2 !!")); } } else { return(this.Request.CreateResponse <string>(HttpStatusCode.BadRequest, "problem when call service UpdateQ_ClickStatusQ_Nurse normal queue !!")); } } catch (Exception ex) { return(this.Request.CreateResponse <string>(HttpStatusCode.InternalServerError, ex.Message)); } }
private bool InsertLogQueue(ChangeQueueModel param, List <PatientTransheadModel> patient, List <InsFlowGenQueueComModel> inscom, string q9) { try { using (var context = new KioskChulaiPadEntities()) { if (param != null) { string queue_no_old = patient[0].queue_no; string flag_queue_old = "N"; string q_action_old = "C"; string queue_no_express = q9; string flag_queue_express = "E"; string q_action_express = "W"; string crdby = param.crtd_by; /* insert log queue old*/ context.q_expr_ins_kiosk_qExpress_log_ipad(queue_no_old, flag_queue_old, q_action_old, crdby); /* insert log queue express*/ context.q_expr_ins_kiosk_qExpress_log_ipad(queue_no_express, flag_queue_express, q_action_express, crdby); return(true); } else { return(false); } } } catch { return(false); } }
private List <kiosk_transhead> GetLastTransHead(ChangeQueueModel param, List <PatientTransheadModel> patient, string q9) { try { List <kiosk_transhead> tranheadresult; using (var context = new KioskChulaiPadEntities()) { if (param != null && patient != null) { /* select */ DateTime?regisdate = param.regis_date.Date; string hn_no = patient[0].hn_no; tranheadresult = (from val in context.kiosk_transhead where val.hn_no == hn_no && val.queue_no == q9 && val.register_date == regisdate && val.queue_status != "C" select val).ToList(); return(tranheadresult); } else { return(new List <kiosk_transhead>()); } } } catch { return(new List <kiosk_transhead>()); } }
private bool UpdateMapQueue(ChangeQueueModel param, List <PatientTransheadModel> patient, List <kiosk_transhead> tranheadresult, QueueNineModel q9) { try { using (var context = new KioskChulaiPadEntities()) { if (param != null && patient != null && tranheadresult != null) { /* insert */ int slip_seq_express = tranheadresult[0].slip_seq; string queue_no_express = q9.q_no; int slip_seq_old = param.slip_seq; string queue_no_old = patient[0].queue_no; string activeflag = "Y"; string crdby = param.crtd_by; context.q_expr_ins_kiosk_map_qexpress_ipad(slip_seq_express, queue_no_express, slip_seq_old, queue_no_old, activeflag, crdby); /*update queue_id to service chula*/ //bool updateslipseq = UpdateQ_SlipSeq(q9.q_id, slip_seq_express.ToString()); return(UpdateQ_SlipSeq(q9.q_id, slip_seq_express.ToString())); } else { return(false); } } } catch { return(false); } }
private bool InsertTranshead(ChangeQueueModel param, List <PatientTransheadModel> patient, List <InsFlowGenQueueComModel> inscom, string q9) { try { using (var context = new KioskChulaiPadEntities()) { if (param != null && patient != null && inscom != null) { /* insert */ string sliptype = "Q"; string sliptypedetail = "12"; string sliptypeflag = "1"; DateTime?regisdate = param.regis_date.Date; TimeSpan?registime = param.regis_date.TimeOfDay; TimeSpan?outtime = DateTime.Now.TimeOfDay; string buildingcode = inscom[0].building_code != null ? inscom[0].building_code : ""; string floor = inscom[0].floor != null ? inscom[0].floor : ""; string zone = inscom[0].zone != null ? inscom[0].zone : ""; string locatcode = inscom[0].locat_code != null ? inscom[0].locat_code : ""; string locatname = inscom[0].locat_name != null ? inscom[0].locat_name : ""; string comcode = inscom[0].com_code != null ? inscom[0].com_code : ""; int? computercode = inscom[0].computer_code; string computername = inscom[0].com_name != null ? inscom[0].com_name : ""; string kioskgroupcode = inscom[0].kiosk_group_code != null ? inscom[0].kiosk_group_code : ""; string timetype = "I"; string idcard = patient[0].idcard_no; string hn_no = patient[0].hn_no; string patientname = patient[0].pateint_name; DateTime?patientbirth = patient[0].pateint_dob; string patientfilelocationtype = patient[0].patient_file_location_type; string patientfilelocationcode = patient[0].patient_file_location_code; string patientfilelocationname = patient[0].patient_file_location_name; DateTime?patientfileasof = patient[0].patient_file_asof; string patientflag = patient[0].patient_flag; string queueno = q9; string queueflag = patient[0].flag_queue; string queuestatus = patient[0].queue_status; string flagchangeright = patient[0].flag_change_right; string flagchooseright = patient[0].flag_choose_right; string flagremarkright = patient[0].flag_remark_right; string printresult = patient[0].print_result; string crdby = param.crtd_by; context.q_expr_ins_kiosk_transhead_ipad(sliptype, sliptypedetail, sliptypeflag, regisdate, registime, outtime, buildingcode, floor, zone, locatcode, locatname, comcode, computercode, computername, kioskgroupcode, timetype, idcard, hn_no, patientname, patientbirth, patientfilelocationtype, patientfilelocationcode, patientfilelocationname, patientfileasof, queueno, queueflag, queuestatus, patientflag, flagchangeright, flagchooseright, flagremarkright, printresult, crdby); return(true); } else { return(false); } } } catch { return(false); } }
public HttpResponseMessage Post([FromBody] ChangeQueueModel param) { List <InsFlowGenQueueComModel> inscom = SelectComKiosk(param.com_name); QueueNineModel qnine = GenQNine(param, inscom); return(Request.CreateResponse(HttpStatusCode.OK, "qid:" + qnine.q_id + " qno:" + qnine.q_no + " channel:" + qnine.channel_group_name)); }
private QueueNineModel GenQNine(ChangeQueueModel param, List <InsFlowGenQueueComModel> inscom) { /* Generate Q express from service Chula*/ QueueNineModel queue = new QueueNineModel(); //QChulaService.WS_KioskQSoapClient ws = new QChulaService.WS_KioskQSoapClient(); CUKioskService.WS_KioskQSoapClient ws = new CUKioskService.WS_KioskQSoapClient(); DataSet ds = ws.CreateQ_NoHN(param.slip_type_detail, param.slip_type_flag, inscom[0].locat_name, param.slip_no, param.crtd_by); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { queue.channel_group_name = ds.Tables[0].Rows[0]["channel_group_id"].ToString(); queue.q_no = ds.Tables[0].Rows[0]["q_no"].ToString(); queue.q_id = ds.Tables[0].Rows[0]["q_id"].ToString(); queue.ws_result = ds.Tables[0].Rows[0]["ws_result"].ToString(); } return(queue); }
public HttpResponseMessage GenQ9([FromBody] ChangeQueueModel param) { try { //string q9 = CallSoap.GenQExpress(param.slip_type_detail, param.slip_type_flag, param.location_desc, param.crtd_by); //res.Content = new StringContent(q9, System.Text.Encoding.UTF8); CUKioskService.WS_KioskQSoapClient ws = new CUKioskService.WS_KioskQSoapClient(); DataSet ds = ws.CreateQ_NoHN("ipad", "5", "พยาบาลคัดแยกอาการตรวจสอบอาการด้วย ipad", "ipad", "ipad01"); //QChulaService.WS_KioskQSoapClient ws = new QChulaService.WS_KioskQSoapClient(); //DataSet ds = ws.CreateQ_NoHN(param.slip_type_detail, param.slip_type_flag, param.location_desc, param.p_slip_no, param.crtd_by); var result = ds.Tables[0].AsEnumerable().ToList(); return(Request.CreateResponse(HttpStatusCode.OK, result)); //return Request.CreateResponse(HttpStatusCode.OK, "90002"); } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message)); } }
private string UpdateQueueStatus(ChangeQueueModel param) { try { using (var context = new KioskChulaiPadEntities()) { if (param != null) { /* update old queue to "C" = Cancel */ context.q_expr_upd_kiosk_transhead_queue_status_ipad(param.slip_seq, "C", param.crtd_by); return("true"); } else { return("param null"); } } } catch (Exception ex) { return(ex.Message); } }
public HttpResponseMessage GenQFlowExpress([FromBody] ChangeQueueModel param) { try { /*====get location ipad for insert======*/ //select db.q_expr_sel_kiosk_com_cat_ipad //========param computer_name = 'IPAD001' List <InsFlowGenQueueComModel> inscom = SelectComKiosk(param.com_name); //List<QueueExpressResultModel> expressresult = new List<QueueExpressResultModel>(); List <PatientTransheadModel> patient = SelectPatientTranshead(param.slip_seq); //QueueExpressResultModel expressResultModel = new QueueExpressResultModel(); List <q_express_Result> resultq9 = new List <q_express_Result>(); q_express_Result qresultmodel = new q_express_Result(); /*====update queue status======*/ //update db.q_expr_upd_kiosk_transhead_queue_status_ipad //========param queue_status = 'C' ,slip_seq ,last_chg_by string updateresult = UpdateQueueStatus(param); if (updateresult == "true") { /*====select patient info transhead ======*/ //gen queue 9 if (inscom.Count > 0 && patient.Count > 0) { QueueNineModel qnine = GenQNine(param, inscom); string q9 = ""; if (qnine.ws_result != null && qnine.ws_result == "S") { q9 = qnine.q_no; } else { return(Request.CreateResponse(HttpStatusCode.BadRequest, "problem when call express queue service !!")); } //q9 = q9 != "" ? q9 : "9" + patient[0].queue_no; /*====insert transhead ======*/ //insert db.q_expr_ins_kiosk_transhead_ipad //========param queue_status = 'C' ,slip_seq ,last_chg_by if (InsertTranshead(param, patient, inscom, q9)) { List <kiosk_transhead> tranheadresult = GetLastTransHead(param, patient, q9); if (tranheadresult.Count > 0) { if (UpdateMapQueue(param, patient, tranheadresult, qnine)) { //insert db.q_expr_ins_kiosk_qExpress_log_ipad if (InsertLogQueue(param, patient, inscom, q9)) { //expressResultModel.queue_no = patient[0].queue_no; //expressResultModel.queue_no_express = q9; //expressResultModel.patient_name = patient[0].pateint_name; //expressResultModel.hn_no = patient[0].hn_no; //expressresult.Add(expressResultModel); //add to list //call service q string slip_seq_new = tranheadresult[0].slip_seq.ToString(); bool updateqstatus = UpdateQ_ClickStatusQ_Nurse(param, slip_seq_new); if (updateqstatus) { if (this.UpdateQShowQAll2_Check(slip_seq_new, "N")) { qresultmodel.qexpress = q9; resultq9.Add(qresultmodel); return(Request.CreateResponse(HttpStatusCode.OK, resultq9.ToList())); } else { qresultmodel.qexpress = "problem when call service UpdateQShowQAll2_Check !!"; resultq9.Add(qresultmodel); return(Request.CreateResponse(HttpStatusCode.BadRequest, resultq9.ToList())); } } else { qresultmodel.qexpress = "problem when call service UpdateQ_ClickStatusQ_Nurse !!"; resultq9.Add(qresultmodel); return(Request.CreateResponse(HttpStatusCode.BadRequest, resultq9.ToList())); } } else { qresultmodel.qexpress = "problem when insert log queue !!"; resultq9.Add(qresultmodel); return(Request.CreateResponse(HttpStatusCode.BadRequest, resultq9.ToList())); } } else { qresultmodel.qexpress = "problem when update map queue !!"; resultq9.Add(qresultmodel); return(Request.CreateResponse(HttpStatusCode.BadRequest, resultq9.ToList())); } } else { qresultmodel.qexpress = "problem when select old transhead !!"; resultq9.Add(qresultmodel); return(Request.CreateResponse(HttpStatusCode.BadRequest, resultq9.ToList())); } } else { qresultmodel.qexpress = "problem when insert transhead !!"; resultq9.Add(qresultmodel); return(Request.CreateResponse(HttpStatusCode.BadRequest, resultq9.ToList())); } } else { qresultmodel.qexpress = "problem when select computer or device name !!"; resultq9.Add(qresultmodel); return(Request.CreateResponse(HttpStatusCode.BadRequest, resultq9.ToList())); } } else { qresultmodel.qexpress = "problem when update queue status !!" + updateresult; resultq9.Add(qresultmodel); return(Request.CreateResponse(HttpStatusCode.BadRequest, resultq9.ToList())); } } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message + ex.InnerException.Message)); } }