У меня есть следующий код
JSONArray jobj = new select_data().get_patient_summary(p_id);
JSONObject jInnerObject = new JSONObject();
jInnerObject.put("weight", weight.get(0));
jobj.put(jInnerObject);
Результат:
{
"data": [
{
"pre_transfusional_haemoglobin_level": "",
"rhesus_blood_group_system": "",
"patient_id": "1",
"surname": "Demetriou",
"DOB": "2004-02-04",
"health_insurance_information": "ac",
"name": "Andreas",
"blood_group": "",
"transfusion_frequency": ""
},
{
"weight": "90"
}
],
"success": 1
}
Могу ли я вставить «вес» в предыдущую строку, например:
{
"data": [
{
"pre_transfusional_haemoglobin_level": "",
"rhesus_blood_group_system": "",
"patient_id": "1",
"surname": "Demetriou",
"DOB": "2004-02-04",
"health_insurance_information": "ac",
"name": "Andreas",
"blood_group": "",
"transfusion_frequency": "",
"weight": "90"
},
],
"success": 1
}