To Call an NPR Report with Parameters

Home/Support/OpenGate/To Call an NPR Report with Parameters

Home Forums Support OpenGate To Call an NPR Report with Parameters

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Shawn Kenny
    Keymaster
    Post count: 27

    Although its often suggested to recreate NPR reports in OpenGate syntax, OpenGate does proivide the flexibility of calling an NPR report from within OpenGate code. In many cases querying data out of MEDITECH will be quicker and more efficient if native OpenGate code is used but there are some instances where useers find it easier to call an NPR report, thus not reinventing the wheel so to speak.

    Link to .txt file version of query, use this version to avoid formatting issues:
    https://www.blueelm.com/wp-content/uploads/2016/11/Call-and-NPR-Report-using-OpenGate.txt
    PARAMETER DATABASE
    PARAMETER REPORT
    PARAMETER URN
    –the NPR report must have a parameter in it called URN
    PARAMETER USER
    PARAMETER PARAM1
    PARAMETER PARAM2
    PARAMETER PARAM3

    INITIALIZE {
    O(#X),IF{O(%X),%.ADO.OPEN.DB(DATABASE,”O(%X)”)}^ADO.ERR,
    K(/[“ADO”].DB),M(#DB,/[“ADO”].DB),O(#X),
    O(#S,”P”),M(/,#),O(/S,”P”),M(#,/),C(#U),
    %Z.date.in.magic(S(0))^/.DAT,
    URN^c.urn,PARAM1^c.param1,PARAM2^c.param2,PARAM3^c.param3,
    IF{USER;”MEDITECH”}^/.USR,
    $SEGS(\GN[/.DB],
    D(255,255,2)_”TBL”_D(255,255,31)_0^!,
    D(255,255,31)^!,
    O(!S,IF{%zportal.rpt[S(“J”)];A(0,%zportal.rpt[S(“J”)])}),
    IF{%[REPORT_”.R”] %[REPORT_”.R”](“”)X;”report not found”^!},
    O(!U),O(*S,%zportal.rpt[S(“J”)]),
    “”^X,DO{>* *^!},
    D(255,255,30,255,255,3)^!,
    C(*U),F(%zportal.rpt[S(“J”)]),
    C(/U,$U,%U)
    }

    select TABLE report report
    from /REPORT.HOLDER[QQQ]

    • This topic was modified 2 years, 6 months ago by  Shawn Kenny.
    • This topic was modified 2 years, 1 month ago by  Shawn Kenny.
    • This topic was modified 1 year ago by  Shawn Kenny.
    • This topic was modified 1 year ago by  Shawn Kenny.
    • This topic was modified 1 year ago by  Shawn Kenny.
    • This topic was modified 1 year ago by  Shawn Kenny.
    • This topic was modified 1 year ago by  Shawn Kenny.
    • This topic was modified 1 year ago by  Shawn Kenny.
    • This topic was modified 1 year ago by  Shawn Kenny.
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

Blue Elm Eventts

December 2018
S M T W T F S
« Aug    
 1
2345678
9101112131415
16171819202122
23242526272829
3031