Groovy help - just a few lines of code needed immediately.
$15-25 USD / hour
I need a groovy function that will loop through an object and replace the keys if there is a match in another java object.
Here are my 2 example objects.
def sys1data2 = ["patientinfo":[
"accountname":"123457900",
"account_no":"ACC64",
"phone":"4075551212",
"website":"[login to view URL]"
],
"orginfo":[
"accountname":"123457900",
"account":"ACC64",
"phe":"4075551212",
"website":"[login to view URL]"
]
]
def replaceKeysWith = ["orginfo":[
"accountname":"accname",
"account_no":"accnum",
"phone":"phonenum",
"website":"webadd",
"phe":"pho",
"account":"pid"
],
"patientinfo":[
"accountname":"accname",
"account_no":"accnum",
"phone":"phonenum",
"website":"webadd",
"phe":"pho",
"account":"pid"
]
]
Need a function that returns this as output.
Output = "patientinfo":[
"accname":"123457900",
"accnum":"ACC64",
"phonenum":"4075551212",
"webadd":"[login to view URL]"
],
"orginfo":[
"accname":"123457900",
"account":"ACC64",
"pho":"4075551212",
"webadd":"[login to view URL]"
]
]
Project ID: #17081724