Replies: 2 comments 19 replies
-
Can you just provide a before and after message? Reading someone's code is way harder. |
Beta Was this translation helpful? Give feedback.
-
Of course, so Original message segment obr28 look like this : The result i want is :MESSAGE 1 |
Beta Was this translation helpful? Give feedback.
-
Hi, so my goal is to read the orignal message obr28 segment. On that segment i have multiple occurance. Im able to identified each one and put on a variable. After that i do a copy of hl7 and remove de obr28 segment before recreate the new one with the new value. So on that script i want to generate and send new HL7 for each occurance in the obr28 segment. The problem i have, i not able tu put new value on the message. See the code :
// Accéder au segment OBR
// Fonction récursive pour une copie profonde d'un objet
function deepCopy(obj) {
if (obj === null || typeof obj !== 'object') {
return obj;
}
}
var newHL7Messages = [];
var obrSegment = msg['OBR'];
// Initialiser une variable pour stocker toutes les occurrences des médecins en CC
var obrData = [];
// Afficher la structure du message
logger.info('Message Structure: ' + msg.toString());
if (obrSegment) {
logger.info('Entered the OBR condition');
logger.info('OBR Segment Size: ' + obrSegment.length());
logger.info('OBR Segment Content: ' + obrSegment.toString());
}
Beta Was this translation helpful? Give feedback.
All reactions