Very powerful indeed!! IMHO reusing the existing RPCs is the way to
go. The beauty of this approach is we get to stand on the shoulders of
giants. These calls have been in production for how long? Used across
how many VAs, to care for how many people? See my point? The hard work
is done(for the most part).
Here is that approach(all you need is a DFN and "U" defined in the
session array).
getAllergies(sessid);
N U S U=$$getSessionValue^%zewdAPI("vista_U",sessid)
N DFN S DFN=$$getSessionValue^%zewdAPI("vista_DFN",sessid); patient
DFN
D LIST^ORQQAL(.ALGL,DFN) ;RPC: fetches allergies for cover sheet
N ALGRS,ALDESC
N ALCNT S ALCNT=""
F S ALCNT=$O(ALGL(ALCNT)) q:ALCNT="" D
. S ALDESC=$P(ALGL(ALCNT),U,2) ;allergy description
. S ALGRS(ALCNT)=ALDESC
D mergeArrayToSession^%zewdAPI(.ALGRS,"vista_Allergies",sessid);
Q ""
...And the session array it creates to populate any number of display
options on the client end.
^%zewdSession("session",0,"vista_Allergies",1)="CODEINE"
^%zewdSession("session",0,"vista_Allergies",2)="AMPICILLIN"
^%zewdSession("session",0,"vista_Allergies",3)="SULFONAMIDE/RELATED
ANTIMICROBIALS"
^%zewdSession("session",0,"vista_Allergies",4)="IBUPROFEN"
Michael I hope this answers your question, "With EWD, you can call the
RPCs that CPRS uses?"
I would be most happy to discuss this further. There is already a
project underway to build and share a library of EWD wrappers around
VISTA RPCs. I am fairly confident that the first batch of these will
be announced real soon, stay tuned!!
Anyone interested in helping out, this is totally volunteer and being
done without any sponsorship. If it sounds like something you would be
interested in, you can contact me off list and I can fill you in
more.
Exciting stuff!!
Zach