从JSON数组中提取数据并使用不是数组的父属性进行合并

时间:2017-09-27 23:36:22

标签: arrays json arraylist apache-nifi

我有以下 JSON

{
  "ARTGEntryJsonResult": {
    "AnnualChargeExemptWaverDate": null
    "Conditions": [
      ""
    ],
    "ConsumerInformation": {
      "DocumentLink": ""
    },
    "EntryType": "Medicine",
    "LicenceClass": "",
    "LicenceId": "152567"
    },
    "Products": [
      {
        "AdditionalInformation": [],
        "Components": [
          {
            "DosageForm": "Drug delivery system, transdermal",
            "RouteOfAdministration": "Transdermal",
            "VisualIdentification": "Dull, homogenous"
          }
        ],
        "Containers": [
          {
            "Closure": "",
            "Conditions": [
              "Store at room temperature"
            ],
            "LifeTime": "2 Years",
            "Material": null,
            "Temperature": "Store below 25 degrees Celsius",
            "Type": "Sachet"
          }
        ],
        "EffectiveDate": "2017-09-18",
        "GMDNCode": "",
        "GMDNTerm": "",
        "Ingredients": [
          {
            "Name": "Fentanyl",
            "Strength": "6.3000 mg"
          }
        ],
        "Name": "FENTANYL SANDOZ ",
        "Packs": [
          {
            "PoisonSchedule": "(S8) Controlled Drug",
            "Size": "1"
          },
          {
            "PoisonSchedule": "(S8) Controlled Drug",
            "Size": "10"
          },
          {
            "PoisonSchedule": "(S8) Controlled Drug",
            "Size": "2"
          },
          {
            "PoisonSchedule": "(S8) Controlled Drug",
            "Size": "3"
          },
          {
            "PoisonSchedule": "(S8) Controlled Drug",
            "Size": "4"
          },
          {
            "PoisonSchedule": "(S8) Controlled Drug",
            "Size": "5"
          },
          {
            "PoisonSchedule": "(S8) Controlled Drug",
            "Size": "7"
          },
          {
            "PoisonSchedule": "(S8) Controlled Drug",
            "Size": "8"
          }
        ],
        "SpecificIndications": [
          "Management of chronic pain requiring opioid analgesia."
        ],
        "StandardIndications": [],
        "Type": "Single Medicine Product",
        "Warnings": []
      }
    ],

  }
}

我可以使用 splitJson + EvaluateJsonPath 来提取它,但我将数组字段数据放在一行中。

我设法考虑这个JSON文件的示例:

LicenceId名称PoisonSchedule尺寸

152567 FENTANYL SANDOZ "(S8) Controlled Drug","(S8) Controlled Drug","(S8) Controlled Drug" 1,10,2

我真正想要的是:

LicenceId名称PoisonSchedule尺寸

152567 FENTANYL SANDOZ (S8) Controlled Drug 1

152567 FENTANYL SANDOZ (S8) Controlled Drug 10

152567 FENTANYL SANDOZ (S8) Controlled Drug 2

非常感谢任何想法!!!

由于

0 个答案:

没有答案