I have been searching for a solution to remove specific JSON array elements, but I have not found one yet. Here is the JSON data I am working with:
[
{
"KODE": [
{
"name": "kode",
"value": [
{
"value": "DIAG001",
"RankNum": 1
},
{
"value": "DIAG002",
"RankNum": 1
},
{
"value": "DIAG003",
"RankNum": 1
},
{
"value": "DIAG004",
"RankNum": 1
}
]
}
],
"HEALING": [
{
"name": "Encountrance",
"value": [
{
"Diagnosis_Code": "DIAG001",
"Name": "Subsequent"
},
{
"Diagnosis_Code": "DIAG002",
"Name": "Initial"
},
{
"Diagnosis_Code": "DIAG003",
"Name": "Initial"
},
{
"Diagnosis_Code": "DIAG004",
"Name": "Subsequent"
}
]
}
]
}
]
I need to remove the parent JSON array of KODE and HEALING so that my JSON looks like this:
[
{
"name": "kode",
"value": [
{
"value": "DIAG001",
"RankNum": 1
},
{
"value": "DIAG002",
"RankNum": 1
},
{
"value": "DIAG003",
"RankNum": 1
},
{
"value": "DIAG004",
"RankNum": 1
}
]
},
{
"name": "Encountrance",
"value": [
{
"Diagnosis_Code": "DIAG001",
"Name": "Subsequent"
},
{
"Diagnosis_Code": "DIAG002",
"Name": "Initial"
},
{
"Diagnosis_Code": "DIAG003",
"Name": "Initial"
},
{
"Diagnosis_Code": "DIAG004",
"Name": "Subsequent"
}
]
}
]
Can anyone provide guidance on how to achieve this programmatically?