How to get the parent node using the value from child node

How to get the value of parent node using the reference from child node.

I am having the below sample JSON.

“resultItems”: [ { “id”: 612562, “variables”: { “patient_lastName”: “Test”, “processEnrollmentRequest”: { “clinicalData”: { “patientstreet”: “100 Test STREET; Data 105B”, “patientMRN”: “Test_102111”, },

  {      ....      ....   } 

] I want the data in a below manner. If patientMRN=Test_102111, then i want to retrieve the id.

I have used the below expression $ .[?(@.patientMRN==’1221021′)] But this is returning me the nodes present inside the clinical data as below. { “patientstreet”: “100 Test STREET; Data 105B”, “patientMRN”: “Test_102111”, }

I want the whole JSON for that ID something as below.

 {         "id": 612562,            "variables": {              "patient_lastName": "Test",                 "processEnrollmentRequest": {                     "clinicalData": {                     "patientstreet": "100 Test STREET; Data 105B",                     "patientMRN": "Test_102111",   }   

Means if patientMRN is matching then I need to get the id.