XML TRAINING DOCUMENTATION Intro This document will introduce the way XML is built and used in AlphaFlex. You can create your own custom documents for your clients and have the option to set them up as a billable item. A billable item becomes a claim once it has been submitted and can be approved or rejected in Funding Source Billing. The following document will walk you through the three basic elements in creating XML documents and the necessary tools to get started. 1. Building the Word Document as a .docx file with XML Content Controls 2. Writing the XML code 3. Binding the XML code and the Word Document Content Controls using the Word 2007 Content Control Toolkit provided by Microsoft Tools Needed 1. 2. 3. 4. 5. Microsoft Word 2007 or later. Word 2010 is recommended. Word 2007 Content Control Toolkit (available by searching on www.microsoft.com) Understanding of XML tags Notepad editor (EditPad Lite or a similar notepad editor that can display Row Numbers) Time (You will want to ensure you schedule the necessary time to complete and test your xml document as it may be a time consuming process based on the complexity of your document but this should improve the more you learn) Setting up the Word document You will need Microsoft Word 2007 or better to create and open .docx XML embedded documents. First, you will want to enable the “Developer” option in Word. This is the tab you will use to add content controls in Word. In Word 2010, they can be enabled by 1. Clicking on the File tab and choosing Options from the left side: 2. Then you’ll want to click on Customize Ribbon: 1 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION This will show you a list of available tabs. Select the Developer option and click OK. You will now see a Developer tab in your Ribbon bar at the top of your Word program: Now you’re ready to add Content Controls to your Word document. 2 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION Content Controls Currently, we only use 2 different Content Controls. Plain Text: and Picture: The Plain Text Content Control will insert a new Control into your document. If you enter Design Mode, it will look like this: . The Plain Text Content Control is used throughout the document. These are the place holders for data gathered and entered within Alphaflex. In other words, you will begin your form within Alphaflex. For example, if you enter text in Alphaflex, we can pull that into your Plain Text Content Control. If you go in to the properties of the Plain Text Content Control, it will look like this where you can enter the title and the Tag. The Properties button is just below the Design Mode button shown above. We’ll go over this later but the Tag is very important while coding and binding the document. Once you learn the different types listed under XML Schema, you’ll probably want to make these the same name as your XML tags so they are easy to bind later. The Picture Content Control will be used as a signature control: The properties are very similar to those above: 3 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION The Word Content Controls will pull in data elements gathered from the Alphaflex database, such as client name and Medicaid ID, as well as data entered by the user during the Document Template creation in Alphaflex such as Document Create Date. Once the Word document has been created (maybe describe how you will know you are complete? Like Once you have added all of the necessary…. your document is complete … Also should they save this at anytime? Or just at the end?), it’s time to write the XML code. XML Schema Once the Content controls have all been placed in the .docx Word document, the next step is creating simple text containing tags of each content control field. This schema is used to build a way to store the information entered in the content controls, and is attached to the Word document behind the scenes. We will go into more detail on how to access this XML document later, but first, let’s look at what the XML document contains. The first line is always the same. It lets the system know what type of document this is and what version of XML is to be used. Open your simple text notepad and start with the following: <?xml version="1.0" encoding="windows-1252"?> This may change in the future if there is a new XML version or different way to encode this file. The next line will tell the system where to start with the Data Template: <DataTemplate> We’ll end that tag at the very end of the document with: </DataTemplate> Notice that every time you open a tag, <tag>, you have to eventually close it with a forward slash, </tag> If your code opens and closes the tag on the same line, you can use a shortcut at the end of the line. For example: <tag Type=”TEXTBOX” Description=”Testing ending on one line” /> The last several lines will be nearly the same as well. It starts by opening a data tag, <Data Type=”Data”> Everything within this tells the system where to look to pull data from the database. It will look like this unless you have dropdown or parts of the system that will pull multiple values. We’ll get into that part later but you’ll want to at least start with this: <Data Type="Data"> <ClientData DataType="DataField" SQLProcedure="csp_get_clin_doc_client_info"> <SqlParameters> <clnt_id /> 4 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION </SqlParameters> </ClientData> </Data> </DataTemplate> Notice that the very last line closes the top tag for <DataTemplate>. That will always be the first line of your code and the last line of your code, not included the very first line that gives the XML version. *Anytime that you use Required=”True” within a tag, then that field will have to be filled out within the form before it can be submitted. There are several different tags that we can use with the Content Controls that were added to the Word Document: Type=”FIELDHEADER” It’s generally a good idea to start your XML code with this. It’s a header. It can also be used to separate sections within the document. For instance, if you were viewing an Assessment, you would start with a FIELDHEADER called “Comprehensive Clinical Assessment”. Later, you may want to also use FIELDHEADER when you start the Diagnosis section. This will all show up on the Pop-Up Template when you access the Document Template. It doesn’t pull anything into the Word Document. I like to start a FIELDHEADER tag with hdr so I know to ignore it later when I bind the code to the Document. <hdr1_title Type=”FIELDHEADER” Description=”This is our TEST Document” /> Type=”TEXTBOX” This is probably the most popular XML tag that we’ll be using. It will pull in text entered by the user in the Pop-Up Template into the Word document. For instance, if you wanted the user to enter their title, the code would look something like this: <txt_title Type=”TEXTBOX” Description=”Enter your Title here:” /> The name of the tag is txt_title. You will probably want to enter that as the Tag in the Word Document prior to writing the code. The last step is to bind the document Content Controls with the XML tags, so it will make sense as you go along. When creating the Word Document, you may want to use something like this: 5 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION Type=”MULTILINE” You will use this Type the same way as the TEXTBOX. The only difference is, it gives room for multiple lines of text. <ml_text Type=”MULTILINE” Description=”This is a textbox for Multi Line:” /> Type=”LEGACYCHECKBOX” This is generally used in conjunction with the Type described below. Unfortunately, for checkboxes, Word does not provide a “Checkbox Content Control” in Word 2007. However, this functionality is available in Word 2010. To accommodate Word 2007 users, we use a Plain Text Content Control, and place a bracket on each outside of the Content Control. If the field is checked on the Template screen, the Content control will render an ‘X’ within the brackets. It will look something like this when adding the Content Control to the Word document: TIP: It may be helpful when naming checkbox controls, to give them a prefix that indicates they are indeed, a checkbox. For instance, for a checkbox that indicates if someone is handicapped, we could name it “chk_handicapped”. TIP 2: Notice the “Click here to enter text” in the middle. You can choose to remove that part if you want. It won’t show up after it has been rendered but it may be easier to see how the page is being set up if you remove it. Just make sure you leave at least one space inside. It should look like this if you decide to remove the middle text: This is how you would write a checkbox in XML. I like to start checkbox code with chk so I can recognize it easily later. You’ll soon figure out what works best for you: <chk_yes Type=”LEGACYCHECKBOX” Description=”Yes” /> 6 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION Type=”CHECKBOXLIST” Use this Type if you want to enclose a group of checkboxes. Open an XML tag, but leave it open. Enter the code, as described above, and close it after the last line of your checkbox tags: <chklist_healthy Type=”CHECKBOXLIST” Description=”Are you healthy?”> <chk_yes Type=”LEGACYCHECKBOX” Description=”Yes” /> <chk_no Type=”LEGACYCHECKBOX” Description=”No” /> <chk_maybe Type=”LEGACYCHECKBOX” Description=”Maybe?” /> </chklist_health> Notice that I opened the tag I decided to call chklist_healthy but did not close it until the last line. We cover this more in the example document. Type=”LABEL” This type is used for “Read Only” text in the Pop-Up Template that can also populate Content Controls within your Word Document. More importantly, it can be used to pull data from your system. A perfect example is the client’s name, Date of Birth, MRN, etc. I use lbl in the front of the tag so I can easily recognize it when I bind it later. Make note that if this is going to be a data field, such as the client’s name, you have to add DataField and DataFieldName to your tag. This lets the system know what you’re doing and where to find it. For now, you will always use DataField=”ClientData”. The DataFieldName will come from the list on the following page. You may want to print that and keep it handy while you enter code for quick reference. Here is an example of how to pull the client’s first name into your form: <lbl_clientfname Type=”LABEL” Description=”Client’s First Name:” DataField=”ClientData” DataFieldName=”clnt_fname” /> Type=”SIGNATURE” This is the control used to capture an electronic signature. These signatures can be used with most pointing devices, scribes, or even the patient’s finger swipe. It will show as a pink box in the Pop-Up Template. Here’s the code for a sample signature. Be sure to include SignDate=”” This will date and time stamp the signature. The DataField=”ClientData” is used when storing the signature to the system database. <sig_sample1 Type=”SIGNATURE” Description=”Sample Signature (Please Sign)” SignDate=”” DataField=”ClientData” /> Type=” DROPDOWN” There are two parts to the DROPDOWN type. The first is the placement of the actual dropdown in the form. The second contains the values in the DROPDOWN. The values are stored within the <Data Type=”Data”> tag. Also, keep the ReferenceData in mind. You will use that value later to reference this section and populate the dropdown: <dd_status Type="DROPDOWN" Description="Criminal Legal Status:" ReferenceData="drp_cls /> 7 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION I generally fill in all of the values for my dropdowns once I have completed the code since it’s located at the very bottom within the Data tag. But, of course, you can write it anytime. Here is what the very end of my code will look like with my dropdown values in bold: <Data Type="Data"> <drp_cls DataType="ReferenceData"> <Values> <none Description="None">None</none> <ngri Description="NGRI">NGRI</ngri> <court Description="Court Ordered Placement">Court Ordered Placement</court> <prob Description="Probation/Parole">Probation/Parole</prob> </Values> </drp_cls> <ClientData DataType="DataField" SQLProcedure="csp_get_clin_doc_client_info"> <SqlParameters> <clnt_id> </clnt_id> </SqlParameters> </ClientData> </Data> </DataTemplate> This last section starts by opening the Data tag, <Data Type=”Data”>. This will be closed at the end. The value code starts with the ReferenceData name you used in the above section. In this case, it is drp_cls. Leave this tag open until all of your values are finished. Then open a tag called Values and list all of the values below it. You can call these tags anything you want. Close the Values tag then close the ReferenceData tag. Additionally, you can populate DropDowns from data within Alphaflex. Right now only Insurance can be populated but we are working on adding more options to this control. Here is the code to populate a DropDown list with a list of insurances that the client has listed in Alphaflex: DD_inslist Type=”DROPDOWN” Description=”Select Client Insurance:” ReferenceData=”InsuranceData” /> Next, you’ll have to add this line within the Data tag at the bottom of your code: <InsuranceData DataType="ReferenceData" SQLProcedure="csp_sel_client_ins" SQLDescriptionField="insurance" SQLValueField="ins_id"> Notice that the tag is still open. Be sure to close it after the SqlParameters code is closed. The end of the code will look like this if it’s in the right place: 8 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION <InsuranceData DataType="ReferenceData" SQLProcedure="csp_sel_client_ins" SQLDescriptionField="insurance" SQLValueField="ins_id"> <SqlParameters> <clnt_id> </clnt_id> <clnt_ins_id>-1</clnt_ins_id> </SqlParameters> </InsuranceData> </Data> </DataTemplate> Type=”Date” This will display a date picker control where you can select a date. This feature currently only works with the MVC Custom Note. Here is an example of the code: <dt_today Type=”Date” Description=”Enter Today’s Date” /> Data Fields Below is a list of fields that can be used to pull data from within your system database. Use this with Type=”LABEL” described above. Example, the first one listed here will pull in the client’s full name using DataFieldName=“clnt_fullname”. When assigning the “DataFieldName” attribute to a tag, be sure to name it exactly as spelled below: - Demographic fields. clnt_fullname clnt_id current_dt mrn medicaid_num addr1 addr2 city state zip meds_yes_no clin_name clin_phone crisis_plan_id strategies recommendations after_crisis want_living_will active create_dt maiden_name ethnicity county fname lname dob ssn phone clnt_work_phone symptoms prevention living_will update_dt mname - Crisis Plan Info hc_power_attorney want_hc_power_attorney advanced_instruction want_advanced_instruction living_will_cb want_living_will_cb hc_power_attorney_cb want_hc_power_attorney_cb advanced_instruction_cb want_advanced_instruction_cb emergency_cont emergency_addr emergency_add2 emergency_city emergency_state emergency_zip emergency_citystatezip emergency_phone emergency_work emergency_relation emergency_relation_desc - Insurance Info priority1_ins_name priority1_policynum priority2_ins_name priority2_policynum priority3_ins_name priority3_policynum 9 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION - Medication Info med1_freq med1_desc med1_dosage med1_pescrib_dt med2_freq med2_desc med2_dosage med2_pescrib_dt med3_freq med3_des med3_dosage med3_pescrib_dt med4_freq med4_desc med4_dosage med4_pescrib_dt - Substance abuse info sa_yes_no sa1_drug sa1_length sa1_freq sa1_amount sa1_last_use_dt sa2_drug sa2_length sa2_freq sa2_amount sa2_last_use_dt sa3_drug sa3_length sa3_freq sa3_amount sa3_last_use_dt sa4_drug sa4_length sa4_freq sa4_amount sa4_last_use_dt - Allergy Info allergy1 allergy2 - allergy3 allergy4 Diagnosis Info axis1_diag_code axis1_diag_desc axis1_diag_date axis2_diag_code axis2_diag_desc axis2_diag_date axis3_diag_code axis3_diag_desc axis3_diag_date axis4_diag_code axis4_diag_desc axis4_diag_date axis5_diag_code axis5_diag_desc axis5_diag_date axis1_primary_diag_code axis1_primary_diag_desc axis1_primary_diag_date axis1_principle_diag_code axis1_principle_diag_desc axis1_principle_diag_date axis1_additional_diag_code axis1_additional_diag_desc axis1_additional_diag_date axis1_gaf_diag_code axis1_gaf_diag_desc axis1_gaf_diag_date axis2_primary_diag_code axis2_primary_diag_desc axis2_primary_diag_date axis2_principle_diag_code axis2_principle_diag_desc axis2_principle_diag_date axis2_additional_diag_code axis2_additional_diag_desc axis2_additional_diag_date axis2_gaf_diag_code axis2_gaf_diag_desc axis2_gaf_diag_date axis3_primary_diag_code axis3_primary_diag_desc axis3_primary_diag_date axis3_principle_diag_code axis3_principle_diag_desc axis3_principle_diag_date axis3_additional_diag_code axis3_additional_diag_desc axis3_additional_diag_date axis3_gaf_diag_code axis3_gaf_diag_desc axis3_gaf_diag_date axis4_primary_diag_code axis4_primary_diag_desc axis4_primary_diag_date axis4_principle_diag_code axis4_principle_diag_desc axis4_principle_diag_date axis4_additional_diag_code axis4_additional_diag_desc axis4_additional_diag_date axis4_gaf_diag_code axis4_gaf_diag_desc axis4_gaf_diag_date axis5_primary_diag_code axis5_primary_diag_desc axis5_primary_diag_date axis5_principle_diag_code axis5_principle_diag_desc axis5_principle_diag_date axis5_additional_diag_code axis5_additional_diag_desc axis5_additional_diag_date axis5_gaf_diag_code axis5_gaf_diag_desc axis5_gaf_diag_date clnt_ethnicity clnt_race clnt_gender clnt_primary_diagnosis1_code clnt_primary_diagnosis1_desc clnt_primary_diagnosis2_code clnt_primary_diagnosis2_desc clnt_primary_diagnosis3_code clnt_primary_diagnosis3_desc clnt_primary_diagnosis4_code clnt_primary_diagnosis4_desc clnt_primary_diagnosis1_date clnt_primary_diagnosis2_date 10 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION clnt_primary_diagnosis3_date clnt_primary_diagnosis4_date - Other Info company_name clnt_marital clnt_employment clnt_education clnt_primary_language clnt_episode_admin_dt clnt_episode_dis_dt clnt_asam_score1 clnt_asam_score2 clnt_asam_score3 clnt_asam_score4 generic_consent first_responder_name first_responder_contact first_responder_consent legally_responsible_name legally_responsible_contact legally_responsible_consent community_support1_name community_support1_contact community_support1_consent community_support2_name community_support2_contact community_support2_consent professional_support1_name professional_support1_contact professional_support1_consent professional_support2_name professional_support2_contact professional_support2_consent physician_support_name physician_support_contact physician_support_consent respite_provider_name respite_provider_contact respite_provider_consent Document Template Example Below, I’m going to go through the steps of creating a basic document template. It will contain the client’s name, MRN, DOB, SSN in the header of the document. We’ll add a couple of TextBoxes, MultiLine, Checkboxes, a Dropdown, and a date and signature at the bottom. Please view the document “XML Document Template Examples” for a more thorough walkthrough. Building the Word Document Create a new Word Document .docx file. Since this is client information, I generally put it in the header at the top. That way, if there are multiple pages, it will remain the header for all of them. Most required documentation requires this. I tend to switch in and out of the Design Mode so I can see the document without the tags for aesthetics and spacing. Start by double clicking the very top of the page to open the header part of the document and create your first Plain Text Content Control. I like naming these Content Controls the same as what I plan on naming them when I start writing the XML code. If the plan is to pull data from the database, such as the client’s name, I put the DataFieldName in it also: Don’t worry about entering the Tag if you plan on making the Title and Tag the same. It will autofill the Tag based on what you wrote as the Title. 11 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION Next, we’ll add the rest of the client information that we want in the header. It should look something similar to this. Keep in mind your spacing. Remember that data will be imported into these fields. Design Mode: Normal Mode: After finishing your Word Document and adding your Content Controls, it will look similar to this: Design Mode: 12 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION Normal Mode: Notice how I resized the signature Picture Content Controls at the bottom. Once you have created a Picture Content Control, if you click around the edges, you can see the resize controls. Also, notice that the Properties have the options to lock the control. You will probably want to select both of these checkboxes to ensure you have a locked signature. 13 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION Now it’s time to write the code. I generally keep the Word Document open in Design mode while I write the code so I can reference the Content Controls I have to write XML for. Here’s my code. I have added notes in RED to help explain what you’re looking at. <?xml version="1.0" encoding="windows-1252"?>All code begins with this <DataTemplate>All of these forms will begin and end with this tag <header1 Type="FIELDHEADER" Description="Client Information Form" />The Title of my document <company_name Type="LABEL" Description="Company Name:" DataField="ClientData" DataFieldName="company_name" />The company’s name <date Type="TEXTBOX" Description="Enter Today's Date:" />TextBox to enter today’s date <client_fullname Type="LABEL" Description="Client's Name:" DataField="ClientData" DataFieldName="client_fullname" />Client’s Name <mrn Type="LABEL" Description="MRN:" DataField="ClientData" DataFieldName="mrn" />Client’s MRN <dob Type="LABEL" Description="Date of Birth:" DataField="ClientData" DataFieldName="dob" />Client’s DOB <ssn Type="LABEL" Description="Social Security Number:" DataField="ClientData" DataFieldName="ssn" />Client’s SSN <txt_hear Type="TEXTBOX" Description="How did the client hear about us?" />TextBox question <ml_health Type="MULTILINE" Description="Please completely describe the client's overall health:" />Multi-Line TextBox <chklist1 Type="CHECKBOXLIST" Description="Is this a returning client?" >Beginning of CheckBox List <chk_yes Type="LEGACYCHECKBOX" Description="Yes" />Yes Checkbox <chk_no Type="LEGACYCHECKBOX" Description="No" />No Checkbox <chk_unsure Type="LEGACYCHECKBOX" Description="Unsure" />Unsure Checkbox </chklist1>End of CheckBox List <drp_mental Type="DROPDOWN" Description="Is this client mentally stable?" ReferenceData="drp_stable" />Dropdown <sig Type="SIGNATURE" Description="Client's Signature" SignDate="" DataField="ClientData" />First Signature <sig_date Type="SIGNATURE" Description="Signature Date" SignDate="" DataField="ClientData" />Second Signature <Data Type="Data">Beginning of Data <drp_stable DataType="ReferenceData" >Beginning Reference to a DropDown. This begins with the ReferenceData tag. <VALUES>Beginning of Dropdown Values <yes Description="Yes">Yes</yes>Dropdown Value #1. Notice the tag opens and closes around the word Yes. That is the value that will display in the Word Document. <no Description="No">No</no> Dropdown Value #2 <sometimes Description="Sometimes">Sometimes</sometimes> Dropdown Value #3 <helpcode Description="Client Needs Help - Will show as 911 in Document">Help - 911</helpcode> Dropdown Value #4. Notice that I changed the value that will show up in the Word Document. If this is selected in the Form, it will display as Help – 911 in the .docx file. </VALUES>End of Dropdown Values </drp_stable>End of Reference <ClientData DataType="DataField" SQLProcedure="csp_get_clin_doc_client_info">Tells the system how to handle DataFields <SqlParameters> <clnt_id> </clnt_id> </SqlParameters> </ClientData> </Data>End of Data </DataTemplate>End of Template 14 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION Here’s how it looks without my comments in RED. The spaces at the beginning of each row can be ignored. <?xml version="1.0" encoding="windows-1252"?> <DataTemplate> <header1 Type="FIELDHEADER" Description="Client Information Form" /> <company_name Type="LABEL" Description="Company Name:" DataField="ClientData" DataFieldName="company_name" /> <date Type="TEXTBOX" Description="Enter Today's Date:" /> <client_fullname Type="LABEL" Description="Client's Name:" DataField="ClientData" DataFieldName="client_fullname" /> <mrn Type="LABEL" Description="MRN:" DataField="ClientData" DataFieldName="mrn" /> <dob Type="LABEL" Description="Date of Birth:" DataField="ClientData" DataFieldName="dob" /> <ssn Type="LABEL" Description="Social Security Number:" DataField="ClientData" DataFieldName="ssn" /> <txt_hear Type="TEXTBOX" Description="How did the client hear about us?" /> <ml_health Type="MULTILINE" Description="Please completely describe the client's overall health:" /> <chklist1 Type="CHECKBOXLIST" Description="Is this a returning client?" > <chk_yes Type="LEGACYCHECKBOX" Description="Yes" /> <chk_no Type="LEGACYCHECKBOX" Description="No" /> <chk_unsure Type="LEGACYCHECKBOX" Description="Unsure" /> </chklist1> <drp_mental Type="DROPDOWN" Description="Is this client mentally stable?" ReferenceData="drp_stable" /> <sig Type="SIGNATURE" Description="Client's Signature" SignDate="" DataField="ClientData" /> <sig_date Type="SIGNATURE" Description="Signature Date" SignDate="" DataField="ClientData" /> <Data Type="Data"> <drp_stable DataType="ReferenceData" > <VALUES> <yes Description="Yes">Yes</yes> <no Description="No">No</no> <sometimes Description="Sometimes">Sometimes</sometimes> <helpcode Description="Client Needs Help - Will show as 911 in Document">Help - 911</helpcode> </VALUES> </drp_stable> <ClientData DataType="DataField" SQLProcedure="csp_get_clin_doc_client_info"> <SqlParameters> <clnt_id> </clnt_id> </SqlParameters> </ClientData> </Data> </DataTemplate> 15 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION Content Control Binding At this point, if you’ll want to Save and close the Word Document if you have it open but keep your text document handy. Make sure everything is saved. Next, open the Word 2007 Content Control Toolkit. Click on the yellow folder or click File and Open then Navigate to your .docx Word document and Open the File. The left pane contains all of the Word Content Controls. The right pane will eventually have the code we wrote. Go to your text document. At this point, you want to select and copy all the text on this screen. This is easily done by holding the CTRL key on your keyboard down and typing the letter A (for All). This will Select All text. Next hold the CTRL key down again and type the letter C (for Copy). This will Copy all of your highlighted text. Now we want to Paste all of the code to the Toolkit. While viewing the Toolkit again, on the right pane, it should read: Click on the blue link to create a new Custom XML. Then click on the Edit View tab. Delete the root text that’s in the window and we’ll Paste the text we saved. It’s easily done by clicking in the Edit View window contents, hold CTRL key and type the letter V (for Paste). 16 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION Your Window should now look similar to this: The next step is to check the code structure. Do this by clicking on the Red checkbox just below the Bind View tab: This will check all of the syntax in your code and will let you know if there are any issues. This can be very time consuming if you have a lot of holes in your code such as missing brackets, missing quotation marks, missing end tags, misspelled code, and so on. It will give you a reason, line, and position number: 17 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION If you are using Edit Pad Lite, or another good text editor, you have the option to turn on Line Numbers. This will give you a better idea of where the problem is occurring. This is especially helpful if you have several hundred lines of code. In this instance, it mentions an invalid attribute >. My first step is to look at the code around Line 6: I see that I am missing a quotation at the end of line 5, just before the end. Keep in mind that these line numbers are generally off by 1 row because of the XML version header at the top. Once you have corrected all of your syntax errors, you will receive this message: Now it’s time to go through and bind all of the code to your Content Controls. Start by clicking on the Bind View tab. (updated screenshot circling the Bind View tab) 18 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION Again, the Left Pane contains your Word Document Content Controls. On the Right Pane is a representation of the tags you wrote code for. Some of these will not need binding, such as FieldHeaders. They will already exist in both forms. The first Content Control says company_name. Find the icon on the right that you want to bind it to. In this case, I called the Tag the same as the Content Control to make this process as easy as possible. This Toolkit is a little quirky when it comes to binding. You have to click on the xml icon on the right side to highlight the selection, then release the mouse button and click again but “hold” it and slowly drag it to the left to the Content Control that it matches. In this case, click then click again and hold company_name and drag it to the left to the Content Control called company_name and release the mouse button. It should look like this: Notice that the XPath column has the tag name. That means the binding for that Content Control and XML Tag is complete. Continue through the Content Control list and bind everything else. Make note that checkboxes within a CheckBoxList are within the CheckBoxList Folder. You’ll want to expand that folder to see the CheckBoxes within: 19 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION Once you have completed the binding, there shouldn’t be any blank rows in the Left Pane. It should look similar to this: Click on the Save Icon and close the toolkit. Everything will be saved within the Word Document. Uploading a Document Template The next step is to upload your completed document for testing. 1. 2. 3. 4. 5. 6. Log into Alphaflex Navigate to Administrative Modules> System Data Maintenance Click on the Document Types tab. Select Add New Record Enter a Description for your Document Enter an Effective Date and End Date. This will determine the date range that this document will be available. 7. Determine if this is a “Billable” document. If this is related to a service code or procedure, click on the Billable checkbox. Submitting a Billable document will create a Billable Claim. The Claims will eventually be approved and sent to billing to be billed. 8. Click the Select button and navigate to your document. This is similar to how your screen should look: 20 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION 9. Finally, Click on Save. To view the document template from the Client’s Homepage as a Pop-Up Template, navigate to a client in your system. I’ll use my dummy test client, Harold Ford in this example. 1. Go to the Client’s Homepage and select the Document Templates tab. 2. Navigate to your document and click on Select. This will open the XML Pop-Up Template. If you still have errors with your document or the code, you will be able to see them here. 3. This is what it should look like in the Pop-Up Template: Here is the list of items I verified in the document I created to ensure the document did not have any errors. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Notice the FieldHeader at the top The TextBox The Label that pulled in the Client’s Name MRN DOB SSN TextBox MultiLine TextBox CheckBoxList with Checkboxes The DropDown List (You can create a blank row if you want) 21 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION 11. The two signatures (Be sure you click on Done after signing the document) The bottom of the Pop-Up Template has a few fields. You can enter an Author, who filled out the form. An Effective Date and End Date, and a Submit checkbox. If you select the Submit check box and Upload, it will lock the document and save it to the Client Documentation tab as a Read Only document. If you select Upload without selecting the Submit checkbox, it will be available for editing if you need to make changes later or gather other signatures. You can submit then later when the document is ready. If you click on the Preview/Save to PC button, it will open it in Microsoft Word, pulling all of the data into your document. 22 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION 23 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION Creating a Billable Document If this is a billable document, it’s handled slightly differently. Navigate to Clinical, Service Documentation. Search and select your client. Near the bottom of the page is a selection called Add New Custom Document: Select the name of your billable document. It will open in a new, MVC window. MVC stands for Model View Controller. It is an architectural design pattern that is used to separate an application. You will begin to see this type of module more and more as time goes on, in future updates. You’ll notice that this screen looks similar to the Pop-Up Template we viewed earlier but this includes additional options for billing on slide 2. Notice the 3 slides at the top. The first is the documentation slide, which is the screen you are viewing. Enter all of your documentation here. Also, notice the Clinician Pin field at the bottom. This will electronically sign the document based on the person that is logged in. 24 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION The second slide will look similar to a Billing Ticket. This is where you will enter all of your billing details: The last slide is the final Submission screen. Once this has been completed, have submitted the document it will be available on the Client’s Homepage under Client Documentation. It will also appear under Clinical, Service Documentation. The billing item created is now waiting for approval on Funding Source Billing for your billing team the same way a Service Note, or Billing Ticket works. 25 www.AlphaCM.com Last Updated: 1/6/2015 XML TRAINING DOCUMENTATION Shortcuts and XML Cheat Sheet I’m continually looking for shortcuts when writing XML. Here are a few that I have found and have used. Quick Access Toolbar The most important shortcut that I use is the Quick Access Toolbar within Word. You can set up shortcut keys to create your Content Controls, the Properties button, the Drawing Tools, and just about anything else. Once you have created the link on the Quick Access Toolbar, you can access these controls by simply holding the ALT key down and typing the corresponding number for the tool. Start by deciding what you want on your Toolbar. Here is how mine looks: These can be added by simply right-clicking on the tool you want to add and selecting Add to Quick Access Toolbar: Once you have added your tools, you can determine which number key will open the tool by typing the Alt key once on your keyboard. Type it again for the shortcut helper to go away: Note that ALT+7 will bring up my Plain Text Content Control and ALT+5 will bring up the properties. In other words, when I’m ready to create a new Content Control, I can just hold the ALT key down and type a 7 to create the control and a 5 to enter the properties. It’s much quicker than finding the icons for these. Also, you’ll see that ALT+09 will create a Picture Content Control for Signatures. I strongly suggest you build your Quick Access Toolbar when you come across something that you have to click on repeatedly. Keyboard Shortcuts and Hotkeys Most of the keyboard shortcuts and hotkeys that I use have been around for several years. Here they are: CTRL+A=Select All Text CTRL+C=Copy CTRL+X=Cut CTRL+V=Paste (CTRL+P is already used for Printing) CTRL+Z=Undo (Exceptionally helpful if you make a formatting mistake; it will revert what you just did) CTRL+Y=Redo CTRL+N=Create a New Window or File CTRL+S=Save File 26 www.AlphaCM.com Last Updated: 1/6/2015