我在排序jsonarray中遇到了一些问题。
这是我输入的json数组
[ { "search":{ "mode":"match" }, "resource":{ "prescriber":{}, "identifier":[], "medicationReference":{}, "dosageInstruction":[ { "route":{}, "method":{}, "timing":{ "repeat":{ "period":1, "periodUnits":"d", "boundsPeriod":{ "start":"11/15/2016", "end":"11/23/2016" }, "frequency":1 } }, "doseQuantity":{ "unit":"mg", "code":"mg", "system":"dasdsadasd", "value":10 }, "asNeededBoolean":false, "text":"Take 10 mg by mouth nightly." } ], "dispenseRequest":{ "validityPeriod":{ "start":"11/15/2016", "end":"11/23/2016" } }, "patient":{ "reference":"asdasdsada", "display":"Jason Argonaut" }, "id":"T5YI1tCzs--JEvCICFbx8zgB", "dateWritten":"11/13/2016", "resourceType":"MedicationOrder", "status":"active" }, "fullUrl":"asdsadasa", "link":[ { "url":"dassad", "relation":"self" } ] }, { "search":{ "mode":"match" }, "resource":{ "prescriber":{ "reference":"dsfsd", "display":"Physician Cdr Inpatient, MD" }, "identifier":[ { "system":"urn:oid:1.2.840.114350.1.13.0.1.7.2.798268", "use":"usual", "value":"971103" }, { "system":"urn:oid:1.2.840.114350.1.13.0.1.7.3.798268.801", "use":"usual", "value":"971103:2802249019" } ], "medicationReference":{ "reference":"dfsdf", "display":"amphetamine-dextroamphetamine XR (ADDERALL XR) 15 MG 24 hr capsule" }, "dosageInstruction":[ { "route":{ "coding":[ { "system":"urn:oid:1.2.840.114350.1.13.0.1.7.4.698288.330", "code":"15", "display":"Oral" } ], "text":"Oral" }, "method":{ "coding":[ { "system":"urn:oid:1.2.840.114350.1.13.0.1.7.4.798268.8600", "code":"11", "display":"Take" } ], "text":"Take" }, "timing":{ "repeat":{ "period":1, "periodUnits":"d", "boundsPeriod":{ "start":"11/07/2015", "end":"12/07/2015" }, "frequency":1 } }, "doseQuantity":{ "unit":"capsule", "value":1 }, "asNeededBoolean":false, "text":"Take 1 capsule (15 mg total) by mouth every morning. Max Daily Amount: 15 mg" } ], "dispenseRequest":{ "validityPeriod":{ "start":"11/07/2015", "end":"12/07/2015" }, "quantity":{ "unit":"capsule", "value":30 }, "numberOfRepeatsAllowed":0, "expectedSupplyDuration":{ "unit":"days", "code":"d", "system":"urn:oid:2.16.840.1.113883.6.8", "value":30 } }, "patient":{ "reference":"https://open-ic.epic.com/FHIR/api/FHIR/DSTU2/Patient/Tbt3KuCY0B5PSrJvCu2j-PlK.aiHsu2xUjUM8bWpetXoB", "display":"Jason Argonaut" }, "id":"TsmsDHh.ouMCg8QqhDaAMSAB", "dateWritten":"11/07/2015", "resourceType":"MedicationOrder", "status":"active" }, "fullUrl":"https://open-ic.epic.com/FHIR/api/FHIR/DSTU2/MedicationOrder/TsmsDHh.ouMCg8QqhDaAMSAB", "link":[ { "url":"https://open-ic.epic.com/FHIR/api/FHIR/DSTU2/MedicationOrder/TsmsDHh.ouMCg8QqhDaAMSAB", "relation":"self" } ] } ]
我想使用嵌套键
以降序排序对此数组进行排序资源 - >剂量指示 - >时间 - >重复 - > boundsPeriod - >启动
如何实现这一目标?