I trying to expose the note templates in openvista to a web interface and I'm just wondering how you guys generate a dialog when one clicks on a particular template. I already have a tree that displays all the templates. Now the problem is just generating the dialogs. Thanks in advance.
Templates are "Hard (TM)". I see from Hardhats that you're already browsing the Delphi sourcecode for CPRS, if you want another reference implementation for displaying them, you can take a peak at the OpenVista CIS sourcecode.
In particular, the UI pieces are here: http://bazaar.launchpad.net/~fireball-medsphere/openvista-cis/mainline/files/head:/src/OpenVistaCIS/src/gui/documents/templates/
In particular the different types of fields are handled by these classes: http://bazaar.launchpad.net/~fireball-medsphere/openvista-cis/mainline/files/head:/src/OpenVistaCIS/src/gui/documents/templates/fieldelements/
and the RPC calls are here: http://bazaar.launchpad.net/~fireball-medsphere/openvista-cis/mainline/annotate/head:/src/Medsphere.OpenVista.CIS.Remoting/Templates.cs
I would imagine that any implementation of template dialogs would require a fair amount of Ajax to implement the necessary lazy-loading of fields, validation, etc. Hope this helps!
The problem is how to generate template-dialogs like the ones in CPRS. I'm trying to port it to the web and all I need to know is how CPRS takes template definitions and then generates a dialog. For example, This is the boilerplate for a template:
REASON FOR VISIT/CHIEF COMPLAINT:
{FLD:VA*HEM/ONC CC HPI}
{FLD:VA*PC HPIINFO151}
{FLD:VA*WP-2LNIND2REQ}
INTERVAL HISTORY:
{FLD:VA*PC HXINFO9}
{FLD:VA*WP-INDENT2}
PHYSICAL EXAMINATION:
Temperature: |TEMPERATURE|
Pulse: |PULSE|
Respiration: |RESPIRATION|
BP: |BLOOD PRESSURE|
Pain: |PAIN|
Height: |PATIENT HEIGHT|
Weight: |PATIENT WEIGHT|
{FLD:VA*WP-INDENT4}
INTERVAL LABS:
{FLD:VA*WP-INDENT2}
ASSESSMENT & PLAN:
{FLD:VA*WP-INDENT2}
The attached picture shows you the dialog that is generated by this boilerplate text.
All I want to know is how CPRS transforms the text above to what appears in the attached picture. Thanks
You will need to parse/scan the boilerplate, when you hit any of the couple "special fields" (like the {FLD: FOO} ones or the |TEMPERATURE| ones), you'll need to handle those. From what I remember (and you'll have to check either the CIS or CPRS code to verify), the next piece after the FLD: piece is the type of field (VA*WP == Word Processor, ), and the part after the space is the unique ID/Name for that field. You can then make another call to get the details about the field based on the name, and use that information to populate that field UI. You'll need to make different handlers for each field type, etc, etc.
I don't think anybody can just "tell you how to make the UI" very easily because it involves a *lot* of details to do it all. See my statement about Note Templates being Hard (TM).