Announcement

Collapse
No announcement yet.

Problems managing message information

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems managing message information

    Hi to all,
    i have a bad problem trying to scan all OBR-ORC segments of an HL7 message.
    I have a message like this:

    Code:
    MSH|^~\&|XXXX|AOB RIS-PACS|XXXXXXX|XXXXXXXXXXX|||ORM^O01|1|P|2.3.1||||||8859/1
    PID|||XXXXXXXXXXX^^^AOB~XXXXXXXXXXX^^^CF||XXXXX^XXXXXXX||XXXXXXXX|M|||XXXXXXXXXXXXXX^^XXXXX^XXXXXX^XXXXXXX^ITALIA^H~^^^^^^C||~|||||XXXXXXXXXXXX^^^AOB|||||XXXXXXX|||XXXXXXX
    PV1|||||||||||||||||||2070038266^^^AOB||||||||||||||||||||||||||||||||V
    ORC|XO|^AOB|47889^EbitRIS|2070038266|SC||^^^20070226130800||20070226130757|^PAOLOENNE||^[email protected]
    OBR||^AOB|47889^EbitRIS|8827^8827 - RADIOGRAFIA DEL FEMORE, GINOCCHIO E GAMBA^MedTrak^8827^8827 - RADIOGRAFIA DEL FEMORE, GINOCCHIO E GAMBA^RISolution|||||||||\F\\F\R0\F\\F\|||^[email protected]||40290|40317|69013||||CR|||^^^20070226130800||||^\F\\F\R0\F\\F\
    ORC|XO|2070038266.4^AOB|47891^EbitRIS|2070038266|SC||^^^20070226130800||20070226130757|^PAOLOENNE||^[email protected]
    OBR||2070038266.4^AOB|47891^EbitRIS|8827^8827 - RADIOGRAFIA DEL FEMORE, GINOCCHIO E GAMBA^MedTrak^8827^8827 - RADIOGRAFIA DEL FEMORE, GINOCCHIO E GAMBA^RISolution|||||||||\F\\F\R0\F\\F\|||^[email protected]||40290|40317|69013||||DX|||^^^20070226130800||||^\F\\F\R0\F\\F\
    ORC|XO|2070038266.1^AOB|47892^EbitRIS|2070038266|SC||^^^20070226130800||20070226130757|^PAOLOENNE||^[email protected]
    OBR||2070038266.1^AOB|47892^EbitRIS|87441^87441 - RADIOGRAFIA DEL TORACE DI ROUTINE, NAS^MedTrak^87441^87441 - RADIOGRAFIA DEL TORACE DI ROUTINE, NAS^RISolution|||||||||\F\\F\R0\F\\F\|||^[email protected]||40290|40317|69013||||DX|||^^^20070226130800||||^\F\\F\R0\F\\F\
    ORC|XO|2070038266.2^AOB|47893^EbitRIS|2070038266|SC||^^^20070226130800||20070226130757|^PAOLOENNE||^[email protected]
    OBR||2070038266.2^AOB|47893^EbitRIS|8722^8722 - RADIOGRAFIA DELLA COLONNA CERVICALE^MedTrak^8722^8722 - RADIOGRAFIA DELLA COLONNA CERVICALE^RISolution|||||||||\F\\F\R0\F\\F\|||^[email protected]||40290|40317|69013||||DX|||^^^20070226130800||||^\F\\F\R0\F\\F\
    ORC|XO|^AOB|47894^EbitRIS|2070038266|SC||^^^20070226130800||20070226130757|^PAOLOENNE||^[email protected]
    OBR||^AOB|47894^EbitRIS|88772.69013^88772 - ECO(COLOR)DOPPLER ARTI SUP.,INF.,DISTR,(AR^MedTrak^88772.69013^88772 - ECO(COLOR)DOPPLER ARTI SUP.,INF.,DISTR,(AR^RISolution|||||||||\F\\F\R0\F\\F\|||^[email protected]||40290|40317|69013||||US|||^^^20070226130800||||^\F\\F\R0\F\\F\
    I try to extract all ORC-OBR pairs and to get some values from them in this way:

    Code:
     var orm_path = 'ORM_O01.ORCOBRRQDRQ1ODSODTRXONTEDG1RXRRXCNTEOBXNTECTIBLG';
    
    
     for (var k=0; k<msg[orm_path].length(); k++) {
    	logger.info(&#039;PRINTED k key:&#039;+k+msg[orm_path][&#039;ORC&#039;][&#039;ORC.3&#039;][&#039;EI.1&#039;][k]);
    	logger.info(&#039;PRINTED k value:&#039;+k+msg[orm_path][&#039;ORC&#039;][&#039;ORC.2&#039;][&#039;EI.1&#039;][k]);
    
    }
    this is what I read from logger:
    Code:
      PRINTED k key:047889
      PRINTED k value:02070038266.4
      PRINTED k key:147891
      PRINTED k value:12070038266.1
      PRINTED k key:247892
      PRINTED k value:22070038266.2
      PRINTED k key:347893
      PRINTED k value:3undefined
      PRINTED k key:447894
      PRINTED k value:4undefined
    As you can see, while [&#039;ORC&#039;][&#039;ORC.3&#039;][&#039;EI.1&#039;] follows the correct order, [&#039;ORC&#039;][&#039;ORC.2&#039;][&#039;EI.1&#039;] do not. This is a
    very bad problem for me, because I can&#039;t use the k index in order to manage message information correctly.
    where is the problem? Could this be a bug?

    Thanks to all,
    asulis

  • #2
    Re: Problems managing message information

    Should&#039;nt be;
    Code:
      logger.info(&#039;PRINTED k key:&#039;+k+msg[orm_path][&#039;ORC&#039;][k][&#039;ORC.3&#039;][&#039;EI.1&#039;]);
      logger.info(&#039;PRINTED k value:&#039;+k+msg[orm_path][&#039;ORC&#039;][k][&#039;ORC.2&#039;][&#039;EI.1&#039;]);

    Comment


    • #3
      Re: Problems managing message information

      Or:
      Code:
      logger.info(&#039;PRINTED k key:&#039;+k+msg[orm_path][k][&#039;ORC&#039;][&#039;ORC.3&#039;][&#039;EI.1&#039;]);
        logger.info(&#039;PRINTED k value:&#039;+k+msg[orm_path][k][&#039;ORC&#039;][&#039;ORC.2&#039;][&#039;EI.1&#039;]);
      Chris Lang

      Comment


      • #4
        Re: Problems managing message information

        Thank you very much. Now all transformations seem to work properly.
        Regards,
        asulis

        Comment

        Working...
        X