Created
September 14, 2016 17:32
-
-
Save srbhbook/273ce98244ae13572ae27842a5282298 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
{ | |
"action": "add_billed_code", | |
"tenantCode": "ACH", | |
"encounterList": [{ | |
"encounterNumber": "3678754", | |
"mrn": "000645230", | |
"codeList": [{ | |
"type": "Secondary", | |
"statusCode": "Original", | |
"ordinality": "9999", | |
"code": "71010", | |
"procedureDateTime": "20160417", | |
"unitAmount": "166.00", | |
"quantity": "1", | |
"extendedAmount": "166.00", | |
"chargeCode": "4401010", | |
"deptCode": "4040", | |
"modifier1": "TC", | |
"revenueCode": "0324", | |
"providerId": "92038" | |
}] | |
}, { | |
"encounterNumber": "3678730", | |
"mrn": "000804678", | |
"codeList": [{ | |
"type": "Secondary", | |
"statusCode": "Original", | |
"ordinality": "9999", | |
"code": "73110", | |
"procedureDateTime": "20160416", | |
"unitAmount": "199.00", | |
"quantity": "1", | |
"extendedAmount": "199.00", | |
"chargeCode": "4409360", | |
"deptCode": "4040", | |
"modifier1": "TC", | |
"revenueCode": "0320", | |
"providerId": "92038" | |
}] | |
}, { | |
"encounterNumber": "3678671", | |
"mrn": "000605067", | |
"codeList": [{ | |
"type": "Secondary", | |
"statusCode": "Original", | |
"ordinality": "9999", | |
"code": "84443", | |
"procedureDateTime": "20160416", | |
"unitAmount": "148.25", | |
"quantity": "1", | |
"extendedAmount": "148.25", | |
"chargeCode": "4110886", | |
"deptCode": "4011", | |
"revenueCode": "0301", | |
"providerId": "00701" | |
}] | |
}, { | |
"encounterNumber": "3678577", | |
"mrn": "000608599", | |
"codeList": [{ | |
"type": "Secondary", | |
"statusCode": "Original", | |
"ordinality": "9999", | |
"code": "84443", | |
"procedureDateTime": "20160416", | |
"unitAmount": "69.50", | |
"quantity": "1", | |
"extendedAmount": "69.50", | |
"chargeCode": "4171812", | |
"deptCode": "4011", | |
"revenueCode": "0301", | |
"providerId": "95544" | |
}] | |
}] | |
} | |
*/ | |
//The easy way is to just read in the entire message in memory, parse it from JSON into an object, and then return a message for each encounter: | |
var queue = $gc('queue'); | |
if (!queue) { | |
queue = new java.util.LinkedList(); | |
var obj = JSON.parse(org.apache.commons.io.IOUtils.toString(reader)); | |
for each (encounter in obj.encounterList) { | |
queue.add(JSON.stringify(encounter)); | |
} | |
$gc('queue', queue); | |
} | |
var message = queue.poll(); | |
if (!message) { | |
globalChannelMap.remove('queue'); | |
} | |
return message; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment