<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Macros</title><link>https://sourceforge.net/p/quickviewhl7/wiki/Macros/</link><description>Recent changes to Macros</description><atom:link href="https://sourceforge.net/p/quickviewhl7/wiki/Macros/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 01 Aug 2014 03:00:44 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/quickviewhl7/wiki/Macros/feed" rel="self" type="application/rss+xml"/><item><title>Macros modified by Les Ferguson</title><link>https://sourceforge.net/p/quickviewhl7/wiki/Macros/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v5
+++ v6
@@ -179,8 +179,13 @@
     &lt;li&gt;LoadFile(bucket-name, file-name) returns string&lt;/li&gt;
     &lt;li&gt;LoadHL7(bucket-name, file-name) returns HL7Message object&lt;/li&gt;
     &lt;li&gt;SaveToBucket(bucket-name, file-name, HL7-string, bool-allow-overwrite)&lt;/li&gt;
-    &lt;li&gt;GenerateBucketList(element-id, bucket-name) generates a dropdown list element&lt;/li&gt;
     &lt;li&gt;SelectBucketContents(bucket-name) returns array of file names&lt;/li&gt;
+    &lt;li&gt;GenerateBucketList(element-id, bucket-name) generates a dropdown list element
+        &lt;ul&gt;
+            &lt;li&gt;element-id - the id assigned to the HTML select element which is created&lt;/li&gt;
+            &lt;li&gt;bucket-name - the default bucket to be selected&lt;/li&gt;
+        &lt;/ul&gt;
+    &lt;/li&gt;
   
   
 
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Les Ferguson</dc:creator><pubDate>Fri, 01 Aug 2014 03:00:44 -0000</pubDate><guid>https://sourceforge.net62cac7443f958b1eaa2a1e0a7648890f4889c1e9</guid></item><item><title>Macros modified by Les Ferguson</title><link>https://sourceforge.net/p/quickviewhl7/wiki/Macros/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -1,33 +1,24 @@
 &lt;h3&gt;Macros&lt;/h3&gt;
 &lt;p&gt;
-   Macros are HTML files, although they must be formatted as valid XML, e.g. no unclosed tag shortcuts etc.
-   The HTML provides the user interface and JavaScript methods are used to provide the macro functionality.  Macro files
-   must contain certain elements for them to be recognized by the application.  At startup the application scans the
-   macro folder to find valid macro files (see &lt;b&gt;Configuration - Settings&lt;/b&gt; for details).  The macros which are discovered
-   will be listed in the &lt;b&gt;Macros&lt;/b&gt; menu.
-&lt;/p&gt;
-&lt;p&gt;
-   The macro can access a number of objects provided by the host application, including the HL7 message currently being edited,
-   the predefined databases (&lt;b&gt;Configuration - Databases&lt;/b&gt;) and file I/O methods for reading and writing files to/from the
-   predefined bucket locations (&lt;b&gt;Configuration - Message Buckets&lt;/b&gt;) - these are the only folders that the macro is allowed
-   to perform file I/O on, for security and safety reasons.
-&lt;/p&gt;
-&lt;p&gt;
-   Macros are loaded and executed in a web browser panel, provided by Windows, which follows the security settings of your
-   system.  It is possible for your security settings to disallow certain activities which may affect macros running in
-   QuickViewHL7 - I have not encountered problems yet and have not had any reports of such from users.
-&lt;/p&gt;
-&lt;p&gt;
-   The web browser panel will be referred to in this documentation as the macro host.  The window which contains the macro host
-   also has an embedded 'console' panel, which is used to display error text and other outputs from the macro scripts.  This is referred to as the console below.
-&lt;/p&gt;
-&lt;p&gt;
-   Refer to the example macro files for complete examples of the following specifications, detailed code examples are not shown here.
+Macros are HTML files, although they must be formatted as valid XML, e.g. no unclosed tag shortcuts etc.
+The HTML provides the user interface and JavaScript methods are used to provide the macro functionality.  Macro files must contain certain elements for them to be recognized by the application.  At startup the application scans the macro folder to find valid macro files (see &lt;b&gt;Configuration - Settings&lt;/b&gt; for details). The macros which are discovered will be listed in the &lt;b&gt;Macros&lt;/b&gt; menu.
+&lt;/p&gt;
+&lt;p&gt;
+The macro can access a number of objects provided by the host application, including the HL7 message currently being edited, the predefined databases (&lt;b&gt;Configuration - Databases&lt;/b&gt;) and file I/O methods for reading and writing files to/from the predefined bucket locations (&lt;b&gt;Configuration - Message Buckets&lt;/b&gt;) - these are the only folders that the macro is allowed to perform file I/O on, for security and safety reasons.
+&lt;/p&gt;
+&lt;p&gt;
+Macros are loaded and executed in a web browser panel, provided by Windows, which follows the security settings of your system.  It is possible for your security settings to disallow certain activities which may affect macros running in QuickViewHL7 - I have not encountered problems yet and have not had any reports of such from users.
+&lt;/p&gt;
+&lt;p&gt;
+The web browser panel will be referred to in this documentation as the macro host.  The window which contains the macro host also has an embedded 'console' panel, which is used to display error text and other outputs from the macro scripts.  This is referred to as the console below.
+&lt;/p&gt;
+&lt;p&gt;
+Refer to the example macro files for complete examples of the following specifications, detailed code examples are not shown here.
 &lt;/p&gt;
 &lt;h3&gt;Macro XML Blocks&lt;/h3&gt;
 &lt;b&gt;Macro Header&lt;/b&gt;
 &lt;p&gt;
-   An XML header block must be included, defining metadata about the macro (see example macro files).  The header declares a 'qvm' namespace, used to identify XML elements which relate to the QuickViewHL7 macro manager. Elements of the header are:
+An XML header block must be included, defining metadata about the macro (see example macro files).  The header declares a 'qvm' namespace, used to identify XML elements which relate to the QuickViewHL7 macro manager. Elements of the header are:
 &lt;/p&gt;
 
@@ -45,8 +36,8 @@
    
@@ -55,169 +46,158 @@
 &lt;br /&gt;&lt;b&gt;Include Directives&lt;/b&gt;&lt;p&gt;
-   A single XML fragment may be used to specify file include directives.  The includes XML fragment will
-   not be present when the document is loaded into the macro hoost at run-time, this section will be replaced 
-   with the contents of the include file specified.
-&lt;/p&gt;
-&lt;p&gt;
-   File pathnames are relative to the location of the macro file, so subdirectories below the macro
-   location may be used.  The macro file location must be accessable (at least readable) to the user who
-   started the application, and these include files should therefore also be accessable.
-&lt;/p&gt;
-&lt;p&gt;
-   There are a variety of security issues which can cause the web browser panel to fail to load includes
-   when using the standard HTML include statements, while attempting to load local file-system hosted
-   files instead of files served up by a web server.  Rather than tackle all the causes and user
-   interventions associated with these issues, I am implementing this file insertion technique, which
-   simply depends on the user access rights etc. of the person running the application.
+A single XML fragment may be used to specify file include directives.  The includes XML fragment will
+not be present when the document is loaded into the macro hoost at run-time, this section will be replaced with the contents of the include file specified.
+&lt;/p&gt;
+&lt;p&gt;
+File pathnames are relative to the location of the macro file, so subdirectories below the macro
+location may be used.  The macro file location must be accessable (at least readable) to the user who
+started the application, and these include files should therefore also be accessable.
+&lt;/p&gt;
+&lt;p&gt;
+There are a variety of security issues which can cause the web browser panel to fail to load includes
+when using the standard HTML include statements, while attempting to load local file-system hosted
+files instead of files served up by a web server.  Rather than tackle all the causes and user
+interventions associated with these issues, I am implementing this file insertion technique, which
+simply depends on the user access rights etc. of the person running the application.
 &lt;/p&gt;
 Include types:
 &lt;table&gt;
    &lt;tr&gt;&lt;/tr&gt;&lt;tr&gt;
        &lt;td class="CodeText"&gt;errortrapping&lt;/td&gt;
        &lt;td&gt;
-           Error trapping determines how the macro host will try to handle runtime erros in the macro.
-           errortrapping options: [browser,console,ignore] default is console.  When a trappable error occurs
+           Error trapping determines how the macro host will try to handle runtime errors in the macro.
+           errortrapping options: (browser,console,ignore) default is console.  When a trappable error occurs
            in the script, it can be displayed in the console, displayed as an HTML exception in the browser
            view, or ignored (probably not a good idea).
        &lt;/td&gt;
 
 &lt;/tr&gt;&lt;/table&gt;
-   
-       
-       
-   
-   
-       
-       
-   
-   
-       
-       
-   
-&lt;table&gt;&lt;tr&gt;&lt;td class="CodeText"&gt;css&lt;/td&gt;&lt;td&gt;
-           the named file will be embedded in a &lt;span class="CodeText"&gt;&amp;lt;style&amp;gt;&lt;/span&gt; section - the file itself should not contain the style tags.
-       &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="CodeText"&gt;js&lt;/td&gt;&lt;td&gt;
-           the named file will be embedded in a JavaScript &lt;span class="CodeText"&gt;&amp;lt;script&amp;gt;&lt;/span&gt; section - the file should not contain the script tags.
-       &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;i&gt;other&lt;/i&gt;&lt;/td&gt;&lt;td&gt;
-           The file will be embedded in the HTML without any wrapper tags, in this case
-           the file should contain whatever element tags are required to make it valid part of the HTML.
-       &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
-&lt;p&gt;
-   Note: at this time, only one includes section will be identified and replaced in the document.
+
+  css
+  
+the named file will be embedded in a &lt;span class="CodeText"&gt;&amp;lt;style&amp;gt;&lt;/span&gt; section - the file itself should not contain the style tags.
+  
+
+
+  js
+  
+the named file will be embedded in a JavaScript &lt;span class="CodeText"&gt;&amp;lt;script&amp;gt;&lt;/span&gt; section - the file should not contain the script tags.
+  
+
+
+  &lt;i&gt;other&lt;/i&gt;
+  
+The file will be embedded in the HTML without any wrapper tags, in this case
+the file should contain whatever element tags are required to make it valid part of the HTML.
+  
+
+
+&lt;/p&gt;&lt;p&gt;
+Note: at this time, only one includes section will be identified and replaced in the document.
 &lt;/p&gt;   
 &lt;p&gt;
-   Some of the example files include minified jQuery 1.8 (which is also installed with the macro files).  This is not 
-   required in your macros, but I have used it for convenience, mainly to use jQuery selectors instead of getElementById().  
-   As jQuery is documented in many places on the web, not much explanation of it is given in the macros.
+Some of the example files include minified jQuery 1.8 (which is also installed with the macro files).  This is not required in your macros, but I have used it for convenience, mainly to use jQuery selectors instead of getElementById().  As jQuery is documented in many places on the web, not much explanation of it is given in the macros.
 &lt;/p&gt;
 &lt;h3&gt;Script Blocks&lt;/h3&gt;
 &lt;p&gt;
-   After a macro is loaded and made ready to run, the JavaScript function &lt;span class="CodeText"&gt;MacroStart()&lt;/span&gt; will be called.  This is where
-   your macro should perform initialisation and begin doing things which do not need to wait for user interaction.
-   As an alternative, some of the example macros which include jQuery are using the jQuery &lt;span class="CodeText"&gt;$(document).ready()&lt;/span&gt; method 
-   instead if using &lt;span class="CodeText"&gt;MacroStart()&lt;/span&gt;
+After a macro is loaded and made ready to run, the JavaScript function &lt;span&gt;MacroStart()&lt;/span&gt; will be called.  This is where your macro should perform initialisation and begin doing things which do not need to wait for user interaction. As an alternative, some of the example macros which include jQuery are using the jQuery &lt;span class="CodeText"&gt;$(document).ready()&lt;/span&gt; method 
+instead if using &lt;span class="CodeText"&gt;MacroStart()&lt;/span&gt;
 &lt;/p&gt;

 &lt;h3&gt;Macro Host Environment Methods&lt;/h3&gt;
 &lt;p&gt;
-   The macro host environment provides several methods to the scripting run-time:
+The macro host environment provides several methods to the scripting run-time:
 &lt;/p&gt;
 
-   
-       
-       
-   
-   
-       
-       
-   
-   
-       
-       
-   
-   
-       
-       
-   
-   
-       
-       
-   
-   
-       
-       
-   
+
+  
+  
+
+
+  
+  
+
+
+  
+  
+
+
+  
+  
+
+
+  
+  
+
+
+  
+  
+&lt;table class="DocTable"&gt;&lt;tr&gt;&lt;td class="CodeText"&gt;CurrentEditorFocus()&lt;/td&gt;&lt;td&gt;
-           Method returning an HL7 index object, with these properties:
-           &lt;ul&gt;
-               &lt;li&gt;Segmentidx&lt;/li&gt;
-               &lt;li&gt;FieldIdx&lt;/li&gt;
-               &lt;li&gt;RepeatIdx&lt;/li&gt;
-               &lt;li&gt;ComponentIdx&lt;/li&gt;
-           &lt;/ul&gt;
-       &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="CodeText"&gt;PreferredEditorFocus(segment-index, field-index)&lt;/td&gt;&lt;td&gt;
-           Tells the editor which segment and field should be selected AFTER the macro has exited.  If field-index is less than zero then the segment
-           will be selected and not expanded.  Useful after the macro has updated part of the file in the editor, when you want it to be in focus afterwards.
-       &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="CodeText"&gt;CloseMacroWindow()&lt;/td&gt;&lt;td&gt;
-           Terminates the macro and closes its host window.
-       &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="CodeText"&gt;NewHL7(string)&lt;/td&gt;&lt;td&gt;
-           Returns a HL7Message object, after parsing the provided string.
-       &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="CodeText"&gt;ConOut(string [, arguments])&lt;/td&gt;&lt;td&gt;
-           Writes a string out to the console, when you want to trace what is happening in your script.  
-           The string may use C# formatting notation, if arguments are included,
-           e.g. &lt;span class="CodeText"&gt;window.external.ConOut("Segment index={0}, type='{1}'", segIndex, segType)&lt;/span&gt;
-       &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="CodeText"&gt;RefreshEditorOnClose()&lt;/td&gt;&lt;td&gt;
-           Method which should be called if your script has changed the HL7 message in the editor.  Tells the application
-           that the current file has been changed, makes the editor tree view refresh after the macro has closed.
-       &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="CodeText"&gt;CurrentEditorFocus()&lt;/td&gt;&lt;td&gt;
+Method returning an HL7 index object, with these properties:
+&lt;ul&gt;
+  &lt;li&gt;Segmentidx&lt;/li&gt;
+  &lt;li&gt;FieldIdx&lt;/li&gt;
+  &lt;li&gt;RepeatIdx&lt;/li&gt;
+  &lt;li&gt;ComponentIdx&lt;/li&gt;
+&lt;/ul&gt;
+  &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="CodeText"&gt;PreferredEditorFocus(segment-index, field-index)&lt;/td&gt;&lt;td&gt;
+Tells the editor which segment and field should be selected AFTER the macro has exited.  If field-index is less than zero then the segment will be selected and not expanded.  Useful after the macro has updated part of the file in the editor, when you want it to be in focus afterwards.
+  &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="CodeText"&gt;CloseMacroWindow()&lt;/td&gt;&lt;td&gt;
+Terminates the macro and closes its host window.
+  &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="CodeText"&gt;NewHL7(string)&lt;/td&gt;&lt;td&gt;
+Returns a HL7Message object, after parsing the provided string.
+  &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="CodeText"&gt;ConOut(string [, arguments])&lt;/td&gt;&lt;td&gt;
+Writes a string out to the console, when you want to trace what is happening in your script. The string may use C# formatting notation, if arguments are included, e.g. &lt;span class="CodeText"&gt;window.external.ConOut("Segment index={0}, type='{1}'", segIndex, segType)&lt;/span&gt;
+  &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="CodeText"&gt;RefreshEditorOnClose()&lt;/td&gt;&lt;td&gt;
+Method which should be called if your script has changed the HL7 message in the editor.  Tells the application that the current file has been changed, makes the editor tree view refresh after the macro has closed.
+  &lt;/td&gt;&lt;/tr&gt;
 &lt;/table&gt;

 &lt;h3&gt;Macro Host Environment Objects&lt;/h3&gt;
 &lt;p&gt;
-   The macro host run-time environment provides a number of objects which allow the macro script to access and interact with
-   the QuickViewHL7 application.  These objects are accessed as members of &lt;span class="CodeText"&gt;window.external&lt;/span&gt;.  A summary of
-   the available objects follows.
+The macro host run-time environment provides a number of objects which allow the macro script to access and interact with the QuickViewHL7 application.  These objects are accessed as members of &lt;span class="CodeText"&gt;window.external&lt;/span&gt;.  A summary of the available objects follows.
 &lt;/p&gt;
 
-   
-       
-       
-   
-   
-       
-       
-   
-   
-       
-       
-   
-&lt;table class="DocTable"&gt;&lt;tr&gt;&lt;td class="CodeText"&gt;CurrentHL7&lt;/td&gt;&lt;td&gt;
-           An HL7Message object representing the file currently being edited.  Members of this object are:
-           &lt;ul&gt;
-               &lt;li&gt;SegmentCount() returns int&lt;/li&gt;
-               &lt;li&gt;TypeCount(segment-type) returns the number of segments with specified type&lt;/li&gt;
-               &lt;li&gt;FindSegment(type, instance) returns segment-index&lt;/li&gt;
-               &lt;li&gt;GetSegment(segment-index) returns string&lt;/li&gt;
-               &lt;li&gt;SetSegment(segment-index, string)&lt;/li&gt;
-               &lt;li&gt;InsertSegment(segment-index, string)&lt;/li&gt;
-               &lt;li&gt;DeleteSegment(segment-index)&lt;/li&gt;
-               &lt;li&gt;GetField(segment-index, field-index) returns string&lt;/li&gt;
-               &lt;li&gt;GetFieldJSON(segment-index, field-index) returns JSON string&lt;/li&gt;
-               &lt;li&gt;SetField(segment-index, field-index, string)&lt;/li&gt;
-               &lt;li&gt;GetUniqueKey(type) use type 'guid' to get a guid, anything else returns a timestamp&lt;/li&gt;
-               &lt;li&gt;LoadHL7(string)&lt;/li&gt;
-               &lt;li&gt;LoadSegments(HL7Segments-object)&lt;/li&gt;
-               &lt;li&gt;ToString() returns the full HL7 message&lt;/li&gt;
-           &lt;/ul&gt;
-       &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="CodeText"&gt;IO&lt;/td&gt;&lt;td&gt;
-           An object providing file I/O methods:
-           &lt;ul&gt;
-               &lt;li&gt;LoadFile(bucket-name, file-name) returns string&lt;/li&gt;
-               &lt;li&gt;LoadHL7(bucket-name, file-name) returns HL7Message object&lt;/li&gt;
-               &lt;li&gt;SaveToBucket(bucket-name, file-name, HL7-string, bool-allow-overwrite)&lt;/li&gt;
-               &lt;li&gt;GenerateBucketList(element-id, bucket-name) generates a dropdown list element&lt;/li&gt;
-               &lt;li&gt;SelectBucketContents(bucket-name) returns array of file names&lt;/li&gt;
-           &lt;/ul&gt;
-       &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ScriptDatabase&lt;/td&gt;&lt;td&gt;
-           An object providing database methods:
-           &lt;ul&gt;
-               &lt;li&gt;ExecuteNonQuery(database-name, sql) returns outcome string&lt;/li&gt;
-               &lt;li&gt;SelectToJSON(database-name, sql) returns a JSON object definition with these properties:
-                   &lt;ul&gt;
-                       &lt;li&gt;Error - if something went wrong&lt;/li&gt;
-                       &lt;li&gt;RowCount - number of rows retrieved&lt;/li&gt;
-                       &lt;li&gt;Rows - array of rows, each of which is a dictionary of column-names and values.&lt;/li&gt;
-                   &lt;/ul&gt;
-               &lt;/li&gt;
-           &lt;/ul&gt;
-       &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
+
+  CurrentHL7
+  
+An HL7Message object representing the file currently being edited.  Members of this object are:
+  &lt;ul&gt;
+    &lt;li&gt;SegmentCount() returns int&lt;/li&gt;
+    &lt;li&gt;TypeCount(segment-type) returns the number of segments with specified type&lt;/li&gt;
+    &lt;li&gt;FindSegment(type, instance) returns segment-index&lt;/li&gt;
+    &lt;li&gt;GetSegment(segment-index) returns string&lt;/li&gt;
+    &lt;li&gt;SetSegment(segment-index, string)&lt;/li&gt;
+    &lt;li&gt;InsertSegment(segment-index, string)&lt;/li&gt;
+    &lt;li&gt;DeleteSegment(segment-index)&lt;/li&gt;
+    &lt;li&gt;GetField(segment-index, field-index) returns string&lt;/li&gt;
+    &lt;li&gt;GetFieldJSON(segment-index, field-index) returns JSON string&lt;/li&gt;
+    &lt;li&gt;SetField(segment-index, field-index, string)&lt;/li&gt;
+    &lt;li&gt;GetUniqueKey(type) use type 'guid' to get a guid, anything else returns a timestamp&lt;/li&gt;
+    &lt;li&gt;LoadHL7(string)&lt;/li&gt;
+    &lt;li&gt;LoadSegments(HL7Segments-object)&lt;/li&gt;
+    &lt;li&gt;ToString() returns the full HL7 message&lt;/li&gt;
+  &lt;/ul&gt;
+  
+
+
+  IO
+  
+An object providing file I/O methods:
+  &lt;ul&gt;
+    &lt;li&gt;LoadFile(bucket-name, file-name) returns string&lt;/li&gt;
+    &lt;li&gt;LoadHL7(bucket-name, file-name) returns HL7Message object&lt;/li&gt;
+    &lt;li&gt;SaveToBucket(bucket-name, file-name, HL7-string, bool-allow-overwrite)&lt;/li&gt;
+    &lt;li&gt;GenerateBucketList(element-id, bucket-name) generates a dropdown list element&lt;/li&gt;
+    &lt;li&gt;SelectBucketContents(bucket-name) returns array of file names&lt;/li&gt;
+  &lt;/ul&gt;
+  
+
+
+  ScriptDatabase
+  
+An object providing database methods:
+    &lt;ul&gt;
+      &lt;li&gt;ExecuteNonQuery(database-name, sql) returns outcome string&lt;/li&gt;
+      &lt;li&gt;SelectToJSON(database-name, sql) returns a JSON object definition with these properties:
+      &lt;ul&gt;
+        &lt;li&gt;Error - if something went wrong&lt;/li&gt;
+        &lt;li&gt;RowCount - number of rows retrieved&lt;/li&gt;
+        &lt;li&gt;Rows - array of rows, each of which is a dictionary of column-names and values.&lt;/li&gt;
+      &lt;/ul&gt;
+     &lt;/li&gt;
+  &lt;/ul&gt;
+  
+
+
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Les Ferguson</dc:creator><pubDate>Sat, 19 Jul 2014 16:38:57 -0000</pubDate><guid>https://sourceforge.netb2e8fce33da2ea2d590fca7d0bd6d87c04fd09f4</guid></item><item><title>Macros modified by Les Ferguson</title><link>https://sourceforge.net/p/quickviewhl7/wiki/Macros/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -71,9 +71,7 @@
    interventions associated with these issues, I am implementing this file insertion technique, which
    simply depends on the user access rights etc. of the person running the application.
 &lt;p&gt;&lt;/p&gt;
-&lt;p&gt;
-   Include types:
-&lt;/p&gt;
+Include types:
 &lt;table&gt;
    &lt;tr&gt;
        &lt;td class="CodeText"&gt;css&lt;/td&gt;

&lt;/tr&gt;&lt;/table&gt;&lt;/pre&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Les Ferguson</dc:creator><pubDate>Sat, 19 Jul 2014 16:26:36 -0000</pubDate><guid>https://sourceforge.net1847252f43fbe5be35ec2edaec7c122996ab14c6</guid></item><item><title>Macros modified by Les Ferguson</title><link>https://sourceforge.net/p/quickviewhl7/wiki/Macros/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -19,8 +19,7 @@
 &lt;p&gt;&lt;/p&gt;
 &lt;p&gt;
    The web browser panel will be referred to in this documentation as the macro host.  The window which contains the macro host
-   also has an embedded 'console' panel, which is used to display error text and other outputs from the macro scripts.  This is
-   referred to as the console below.
+   also has an embedded 'console' panel, which is used to display error text and other outputs from the macro scripts.  This is referred to as the console below.
 &lt;/p&gt;
 &lt;p&gt;
    Refer to the example macro files for complete examples of the following specifications, detailed code examples are not shown here.
@@ -28,8 +27,7 @@
 &lt;h3&gt;Macro XML Blocks&lt;/h3&gt;
 &lt;b&gt;Macro Header&lt;/b&gt;
 &lt;/p&gt;&lt;p&gt;
-   An XML header block must be included, defining metadata about the macro (see example macro files).  The header declares a
-   'qvm' namespace, used to identify XML elements which relate to the QuickViewHL7 macro manager. Elements of the header are:
+   An XML header block must be included, defining metadata about the macro (see example macro files).  The header declares a 'qvm' namespace, used to identify XML elements which relate to the QuickViewHL7 macro manager. Elements of the header are:
 &lt;/p&gt;
 &lt;table&gt;
    &lt;tr&gt;

&lt;/tr&gt;&lt;/table&gt;&lt;/pre&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Les Ferguson</dc:creator><pubDate>Sat, 19 Jul 2014 16:23:48 -0000</pubDate><guid>https://sourceforge.nete84a1923520e30bb9636ba6fbde3c33be5a3989d</guid></item><item><title>Macros modified by Les Ferguson</title><link>https://sourceforge.net/p/quickviewhl7/wiki/Macros/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -31,7 +31,7 @@
    An XML header block must be included, defining metadata about the macro (see example macro files).  The header declares a
    'qvm' namespace, used to identify XML elements which relate to the QuickViewHL7 macro manager. Elements of the header are:
 &lt;p&gt;&lt;/p&gt;
-
+&lt;table class="DocTable"&gt;&lt;/table&gt;&lt;table&gt;
    &lt;tr&gt;
        &lt;td class="CodeText"&gt;macroname&lt;/td&gt;
        &lt;td&gt;
@@ -76,7 +76,7 @@
 &lt;p&gt;
    Include types:
 &lt;/p&gt;
-
+&lt;table class="DocTable"&gt;&lt;/table&gt;&lt;table&gt;
    &lt;tr&gt;
        &lt;td class="CodeText"&gt;css&lt;/td&gt;
        &lt;td&gt;

&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/pre&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Les Ferguson</dc:creator><pubDate>Sat, 19 Jul 2014 16:22:23 -0000</pubDate><guid>https://sourceforge.net6e7d0d9fba3f5e2c82935f52a425a0c2a1fc992b</guid></item><item><title>Macros modified by Les Ferguson</title><link>https://sourceforge.net/p/quickviewhl7/wiki/Macros/</link><description>&lt;div class="markdown_content"&gt;&lt;h3&gt;Macros&lt;/h3&gt;
&lt;p&gt;
    Macros are HTML files, although they must be formatted as valid XML, e.g. no unclosed tag shortcuts etc.
    The HTML provides the user interface and JavaScript methods are used to provide the macro functionality.  Macro files
    must contain certain elements for them to be recognized by the application.  At startup the application scans the
    macro folder to find valid macro files (see &lt;b&gt;Configuration - Settings&lt;/b&gt; for details).  The macros which are discovered
    will be listed in the &lt;b&gt;Macros&lt;/b&gt; menu.
&lt;/p&gt;
&lt;p&gt;
    The macro can access a number of objects provided by the host application, including the HL7 message currently being edited,
    the predefined databases (&lt;b&gt;Configuration - Databases&lt;/b&gt;) and file I/O methods for reading and writing files to/from the
    predefined bucket locations (&lt;b&gt;Configuration - Message Buckets&lt;/b&gt;) - these are the only folders that the macro is allowed
    to perform file I/O on, for security and safety reasons.
&lt;/p&gt;
&lt;p&gt;
    Macros are loaded and executed in a web browser panel, provided by Windows, which follows the security settings of your
    system.  It is possible for your security settings to disallow certain activities which may affect macros running in
    QuickViewHL7 - I have not encountered problems yet and have not had any reports of such from users.
&lt;/p&gt;
&lt;p&gt;
    The web browser panel will be referred to in this documentation as the macro host.  The window which contains the macro host
    also has an embedded 'console' panel, which is used to display error text and other outputs from the macro scripts.  This is
    referred to as the console below.
&lt;/p&gt;
&lt;p&gt;
    Refer to the example macro files for complete examples of the following specifications, detailed code examples are not shown here.
&lt;/p&gt;
&lt;h3&gt;Macro XML Blocks&lt;/h3&gt;
&lt;p&gt;&lt;b&gt;Macro Header&lt;/b&gt;&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;br /&gt;
    An XML header block must be included, defining metadata about the macro (see example macro files).  The header declares a&lt;br /&gt;
    'qvm' namespace, used to identify XML elements which relate to the QuickViewHL7 macro manager. Elements of the header are:&lt;br /&gt;
&lt;/p&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table class="DocTable"&gt;
&lt;tr&gt;
&lt;td class="CodeText"&gt;macroname&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;
            Used as the caption in the &lt;b&gt;Macros&lt;/b&gt; menu.&lt;br /&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="CodeText"&gt;purpose&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;
            Appears as tooltip text when you mouse over a macro name in the menu.&lt;br /&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="CodeText"&gt;errortrapping&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;
            Error trapping determines how the macro host will try to handle runtime erros in the macro.&lt;br /&gt;
            errortrapping options: &lt;span&gt;[browser,console,ignore]&lt;/span&gt; default is console.  When a trappable error occurs&lt;br /&gt;
            in the script, it can be displayed in the console, displayed as an HTML exception in the browser&lt;br /&gt;
            view, or ignored (probably not a good idea).&lt;br /&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;b&gt;Include Directives&lt;/b&gt;&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;
    A single XML fragment may be used to specify file include directives.  The includes XML fragment will&lt;br /&gt;
    not be present when the document is loaded into the macro hoost at run-time, this section will be replaced &lt;br /&gt;
    with the contents of the include file specified.&lt;br /&gt;
&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;
    File pathnames are relative to the location of the macro file, so subdirectories below the macro&lt;br /&gt;
    location may be used.  The macro file location must be accessable (at least readable) to the user who&lt;br /&gt;
    started the application, and these include files should therefore also be accessable.&lt;br /&gt;
&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;
    There are a variety of security issues which can cause the web browser panel to fail to load includes&lt;br /&gt;
    when using the standard HTML include statements, while attempting to load local file-system hosted&lt;br /&gt;
    files instead of files served up by a web server.  Rather than tackle all the causes and user&lt;br /&gt;
    interventions associated with these issues, I am implementing this file insertion technique, which&lt;br /&gt;
    simply depends on the user access rights etc. of the person running the application.&lt;br /&gt;
&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;
    Include types:&lt;br /&gt;
&lt;/p&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table class="DocTable"&gt;
&lt;tr&gt;
&lt;td class="CodeText"&gt;css&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;
            the named file will be embedded in a &lt;span class="CodeText"&gt;&amp;lt;style&amp;gt;&lt;/span&gt; section - the file itself should not contain the style tags.&lt;br /&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="CodeText"&gt;js&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;
            the named file will be embedded in a JavaScript &lt;span class="CodeText"&gt;&amp;lt;script&amp;gt;&lt;/span&gt; section - the file should not contain the script tags.&lt;br /&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;i&gt;other&lt;/i&gt;&lt;/td&gt;
&lt;td&gt;&lt;br /&gt;
            The file will be embedded in the HTML without any wrapper tags, in this case&lt;br /&gt;
            the file should contain whatever element tags are required to make it valid part of the HTML.&lt;br /&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;
    Note: at this time, only one includes section will be identified and replaced in the document.&lt;br /&gt;
&lt;/p&gt; &lt;br /&gt;
&lt;p&gt;&lt;br /&gt;
    Some of the example files include minified jQuery 1.8 (which is also installed with the macro files).  This is not &lt;br /&gt;
    required in your macros, but I have used it for convenience, mainly to use jQuery selectors instead of getElementById().&lt;br /&gt;
    As jQuery is documented in many places on the web, not much explanation of it is given in the macros.&lt;br /&gt;
&lt;/p&gt;&lt;br /&gt;
&lt;h3&gt;Script Blocks&lt;/h3&gt;&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;
    After a macro is loaded and made ready to run, the JavaScript function &lt;span class="CodeText"&gt;MacroStart()&lt;/span&gt; will be called.  This is where&lt;br /&gt;
    your macro should perform initialisation and begin doing things which do not need to wait for user interaction.&lt;br /&gt;
    As an alternative, some of the example macros which include jQuery are using the jQuery &lt;span class="CodeText"&gt;$(document).ready()&lt;/span&gt; method &lt;br /&gt;
    instead if using &lt;span class="CodeText"&gt;MacroStart()&lt;/span&gt;&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;/p&gt;
&lt;h3&gt;Macro Host Environment Methods&lt;/h3&gt;
&lt;p&gt;
    The macro host environment provides several methods to the scripting run-time:
&lt;/p&gt;
&lt;table class="DocTable"&gt;
&lt;tr&gt;
&lt;td class="CodeText"&gt;CurrentEditorFocus()&lt;/td&gt;
&lt;td&gt;
            Method returning an HL7 index object, with these properties:
            &lt;ul&gt;
&lt;li&gt;Segmentidx&lt;/li&gt;
&lt;li&gt;FieldIdx&lt;/li&gt;
&lt;li&gt;RepeatIdx&lt;/li&gt;
&lt;li&gt;ComponentIdx&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="CodeText"&gt;PreferredEditorFocus(segment-index, field-index)&lt;/td&gt;
&lt;td&gt;
            Tells the editor which segment and field should be selected AFTER the macro has exited.  If field-index is less than zero then the segment
            will be selected and not expanded.  Useful after the macro has updated part of the file in the editor, when you want it to be in focus afterwards.
        &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="CodeText"&gt;CloseMacroWindow()&lt;/td&gt;
&lt;td&gt;
            Terminates the macro and closes its host window.
        &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="CodeText"&gt;NewHL7(string)&lt;/td&gt;
&lt;td&gt;
            Returns a HL7Message object, after parsing the provided string.
        &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="CodeText"&gt;ConOut(string [, arguments])&lt;/td&gt;
&lt;td&gt;
            Writes a string out to the console, when you want to trace what is happening in your script.  
            The string may use C# formatting notation, if arguments are included,
            e.g. &lt;span class="CodeText"&gt;window.external.ConOut("Segment index={0}, type='{1}'", segIndex, segType)&lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="CodeText"&gt;RefreshEditorOnClose()&lt;/td&gt;
&lt;td&gt;
            Method which should be called if your script has changed the HL7 message in the editor.  Tells the application
            that the current file has been changed, makes the editor tree view refresh after the macro has closed.
        &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;h3&gt;Macro Host Environment Objects&lt;/h3&gt;
&lt;p&gt;
    The macro host run-time environment provides a number of objects which allow the macro script to access and interact with
    the QuickViewHL7 application.  These objects are accessed as members of &lt;span class="CodeText"&gt;window.external&lt;/span&gt;.  A summary of
    the available objects follows.
&lt;/p&gt;
&lt;table class="DocTable"&gt;
&lt;tr&gt;
&lt;td class="CodeText"&gt;CurrentHL7&lt;/td&gt;
&lt;td&gt;
            An HL7Message object representing the file currently being edited.  Members of this object are:
            &lt;ul&gt;
&lt;li&gt;SegmentCount() returns int&lt;/li&gt;
&lt;li&gt;TypeCount(segment-type) returns the number of segments with specified type&lt;/li&gt;
&lt;li&gt;FindSegment(type, instance) returns segment-index&lt;/li&gt;
&lt;li&gt;GetSegment(segment-index) returns string&lt;/li&gt;
&lt;li&gt;SetSegment(segment-index, string)&lt;/li&gt;
&lt;li&gt;InsertSegment(segment-index, string)&lt;/li&gt;
&lt;li&gt;DeleteSegment(segment-index)&lt;/li&gt;
&lt;li&gt;GetField(segment-index, field-index) returns string&lt;/li&gt;
&lt;li&gt;GetFieldJSON(segment-index, field-index) returns JSON string&lt;/li&gt;
&lt;li&gt;SetField(segment-index, field-index, string)&lt;/li&gt;
&lt;li&gt;GetUniqueKey(type) use type 'guid' to get a guid, anything else returns a timestamp&lt;/li&gt;
&lt;li&gt;LoadHL7(string)&lt;/li&gt;
&lt;li&gt;LoadSegments(HL7Segments-object)&lt;/li&gt;
&lt;li&gt;ToString() returns the full HL7 message&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class="CodeText"&gt;IO&lt;/td&gt;
&lt;td&gt;
            An object providing file I/O methods:
            &lt;ul&gt;
&lt;li&gt;LoadFile(bucket-name, file-name) returns string&lt;/li&gt;
&lt;li&gt;LoadHL7(bucket-name, file-name) returns HL7Message object&lt;/li&gt;
&lt;li&gt;SaveToBucket(bucket-name, file-name, HL7-string, bool-allow-overwrite)&lt;/li&gt;
&lt;li&gt;GenerateBucketList(element-id, bucket-name) generates a dropdown list element&lt;/li&gt;
&lt;li&gt;SelectBucketContents(bucket-name) returns array of file names&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ScriptDatabase&lt;/td&gt;
&lt;td&gt;
            An object providing database methods:
            &lt;ul&gt;
&lt;li&gt;ExecuteNonQuery(database-name, sql) returns outcome string&lt;/li&gt;
&lt;li&gt;SelectToJSON(database-name, sql) returns a JSON object definition with these properties:
                    &lt;ul&gt;
&lt;li&gt;Error - if something went wrong&lt;/li&gt;
&lt;li&gt;RowCount - number of rows retrieved&lt;/li&gt;
&lt;li&gt;Rows - array of rows, each of which is a dictionary of column-names and values.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Les Ferguson</dc:creator><pubDate>Sat, 19 Jul 2014 16:20:49 -0000</pubDate><guid>https://sourceforge.netd4c9d180f883999a018d09d148c1fc80c021a38a</guid></item></channel></rss>