// date, type, diagnosis, result, indications, treatment, id_doctor, id_history public void CreateStudy(Study Obj) { string param = "/study"; Study_Tr studyTr = new Study_Tr(); studyTr.study = Obj; string json = JsonConvert.SerializeObject(studyTr); RESTHelper.PostJSON(param, json); }
public static void OrderDrugs(List <Drug> pDrugs) { string param = "/drug/order"; Drug_Tr transaction = new Drug_Tr(); transaction.drugs = pDrugs; string json = JsonConvert.SerializeObject(transaction); RESTHelper.PostJSON(param, json); }
//{"antecedent":{"name":"lalo","description":"descripcion","type":"heredofamiliar","clinical_history_id":"1"}} return id private void CreateAntecedent(Antecedent pAntecedent) { string param = "/antecedent"; Antecedent_Tr transaction = new Antecedent_Tr(); transaction.antecedent = pAntecedent; string json = JsonConvert.SerializeObject(transaction); RESTHelper.PostJSON(param, json); }
//{"ailment":{"main_symptom":"enfermo","date_of_detection":"2016-02-02","symptom_location":"brazo","colateral_symptom":"enfermo","clinical_history_id":1}} return id /// <summary> /// Crea un nuevo padecimiento /// </summary> /// <param name=""></param> public static int CreateAilment(Ailment pAilment) { string param = "/ailment"; Ailment_Tr transaction = new Ailment_Tr(); transaction.ailment = pAilment; string json = JsonConvert.SerializeObject(transaction); RESTHelper.PostJSON(param, json); return(0); }
public static void CreatePhysicalExploration(PhysicalExploration exploration) { //{"last_exploration":{"temperature":18.0,"observations":null,"heart_rate":17,"breathing_frec":17,"blood_pressure":17.0} //{"exploration":{"temperature":17.0,"blood_pressure":17.0,"heart_rate":17,"breathing_frec":17,"observations":"lalala","clinical_history_id":"1"}} string param = "/exploration"; PhysicalExploration_Tr transaction = new PhysicalExploration_Tr(); transaction.exploration = exploration; string json = JsonConvert.SerializeObject(transaction); RESTHelper.PostJSON(param, json); }
// {"patient":{"name":"lalo","last_name":"lalo","date_of_birth":"2010-02-02","address":"calle","phone":"456456","gender":"M","curp":"AAAA000000HAAAAA00","rfc":"AAAA000000000","email":"*****@*****.**"}} //{"id":1013,"clinical_history_id":4} public static void CreatePatient(Patient obj) { string param = "/patient"; Patient_Tr pTransaction = new Patient_Tr(); pTransaction.patient = obj; string json = JsonConvert.SerializeObject(pTransaction); string jsonText = RESTHelper.PostJSON(param, json); var jss = new JsonSerializer(); // var des = jss.Deserialize<Dictionary<string, string>>(jsonText); }
/// <summary> /// Crea un empleado /// </summary> /// <param name="emp">Objeto empleado</param> public static string CreateEmployee(Employee emp) { //{ "employee":{ "name":"lalo","last_name":"lalo","date_birth":"2010-02-02","gender":"M","curp":"AAAA000000HAAAAA00","rfc":"AAAA000000000","address":"address","email":"*****@*****.**","phone":"4777867","profession":"doctor","job":"doctor","specialty_id":1} } string param = "/employee"; Employe_Tr empTr = new Employe_Tr(); empTr.employee = emp; //string json = String.Format("{ \"employee\":{ \"name\":\"{0}\",\"last_name\":\"{1}\",\"date_birth\":\"{2}\",\"gender\":\"{3}\",\"curp\":\"{4}\",\"rfc\":\"{5}\",\"address\":\"{6}\",\"email\":\"{7}\",\"phone\":\"{8}\",\"profession\":\"{9}\",\"job\":\"{10}\",\"specialty_id\":{11}} }", emp.name, emp.last_name, emp.date_birth, emp.gender, emp.curp, emp.rfc, emp.address, emp.email, emp.phone, emp.profession, emp.job, emp.specialty_id.ToString()); string json = JsonConvert.SerializeObject(empTr); string resp = RESTHelper.PostJSON(param, json); return(resp); }
public static bool CreateAdminUsr(int id, string username, string password) { //id_admin, username, password string param = String.Format("/administrative/user"); AdminUsr usr = new AdminUsr(); usr.id_admin = id; usr.username = username; usr.password = password; string json = JsonConvert.SerializeObject(usr); RESTHelper.PostJSON(param, json); return(false); }
public static bool CreateDoctorUsr(int id, string username, string password) { //id_doctor, username, password string param = String.Format("/doctor/user"); DoctorUsr usr = new DoctorUsr(); usr.id_doctor = id; usr.username = username; usr.password = password; string json = JsonConvert.SerializeObject(usr); RESTHelper.PostJSON(param, json); return(false); }