Print Form Conversion

From FeMR Wiki
Jump to navigation Jump to search

Check "Regular expressions" in replace options The find statements are using the "UltraEdit" syntax, select it from drop down. Unless noted for specific replacement value, "Replace with:" should be set to null

The macro PrintConvert.mac functions; it expects a file titled PrintConvertWorkForm.txt and outputs the file PrintConvertOutput.csv

  • Note on PrintConvertOutput.csv, prior to pasting the filtered data I hit the "End" key to move to the far right of each column worth of previous steps. This led to the file having extra spacing on the far right side and may have contributed to excel fields not being properly formatted in some small parts.

Pull Index

The following steps are set in macro PrintConvert.mac

  • Remove characters leading the index id **There is a space behind the ? that is required to work correctly**
[A-Z0-9a-z(. ,)="]+intFormIndex+ ? 
  • Remove characters tailing the index id; the first is for lines without a hyphen, the second is for lines with a hyphen
))+[A-Z0-9a-z.+'( <-=&/>)",]+$
))+[A-Z0-9a-z.+'( <-=&/>)",]+-+[A-Z0-9a-z( )"]+$
  • Select all, copy and paste remainder info into index of spreadsheet, don't delete line breaks or title rows

Pull Table

The following steps are set in macro PrintConvert.mac

  • Remove characters leading the table name; the first does not work for CBSet, the second works only for CBSet
[A-Z0-9a-z.+( =)]+.Tables("
[A-Z0-9a-z.+( =)]+Data, "
  • Remove characters tailing the table name; the first is for lines without a hyphen, the second is for lines with a hyphen
"+[A-Z0-9a-z.+'( <-=&/>)",]+$
"+[A-Z0-9a-z.+'( <-=&/>)",]+-+[A-Z0-9a-z( )"]+$
  • Rename filtered table names as required
  1. Replace "Aftercare" with "tblAftercare"
  2. Replace "Assailants" with "tblAssailants"
  3. Replace "COC" with "tblCOC"
  4. Replace "Evidence" with "tblEvidence"
  5. Replace "Exam" with "tblExam"
  6. Replace "InjuryLog" with "tblInjuryLog"
  7. Replace "InjuryLog2" with "tblInjuryLog2"
  8. Replace "Patient" with "tblPatientMaster"
  • Replace "%" with ","
  • Select all, copy and paste remainder info into table of spreadsheet, don't delete line breaks or title rows

Pull Column

The following steps are set in macro PrintConvert.mac

  • Remove characters leading the column name; the first does not work for CBSet, the second works only for CBSet
[A-Z0-9a-z.+( =")]+.Item("
[A-Z0-9a-z.+( =,")]+0, "
  • Remove characters tailing the column name; the first is for lines without a hyphen, the second is for lines with a hyphen
"+[A-Z0-9a-z.+'( <-=&/>)",]+$
"+[A-Z0-9a-z.+'( <-=&/>)",]+-+[A-Z0-9a-z( )"]+$
  • Replace "%" with ","
  • Select all, copy and paste remainder info into column of spreadsheet, don't delete line breaks or title rows

Pull SpecialStatementType

The following steps are set in macro PrintConvert.mac

  • Replace the following with "CBSet"
[A-Z0-9a-z.,+=() "]+CBset+[A-Z0-9a-z.,+=() "]+$
  • Replace the following with "CheckSet"
[A-Z0-9a-z.,+=() "]+CheckSet+[A-Z0-9a-z.,+=() "]+$
  • Replace the following with "CheckSet"
[ ]+doc+[A-Z0-9a-z(.)+= ]+CheckSet+[A-Z0-9a-z(.)+= ,"]+-1)+$
  • Replace the following with "If"
[ ]+If+[A-Z0-9a-z.,+=<&/>() "]+$
  • Replace the following with "If"
[ ]+If+[A-Z0-9a-z.+'( <-=&/>)",]+-+[A-Z0-9a-z( )"]+$
  • Replace the following with "If"
[ ]+ElseIf+[A-Z0-9a-z.,+=() "]+$
  • Replace non-conditional lines but keep the spacing for copy into spreadsheet; the first is for lines without a hyphen, the second is for lines with a hyphen
[ ]+doc+[A-Z0-9a-z.,+=() "]+$
[ ]+doc+[A-Z0-9a-z.+'( <-=&/>)",]+-+[A-Z0-9a-z( )&</>=,"]+$
  • Replace "%" with ","
  • Select all, copy and paste remainder info into column of spreadsheet, don't delete line breaks or title rows

Pull CompareValue

The following steps are set in macro PrintConvert.mac

  • Remove characters leading the if and elseif compare value
[ ]+If+[A-Z0-9a-z.,(") ]+= "
[ ]+ElseIf+[A-Z0-9a-z.,(") ]+= "
  • Remove characters tailing the if and elseif compare value; the first is for lines without a hyphen, the second is for lines with a hyphen
" Then+[A-Z0-9a-z.+"=(&/<'> )]+$
" Then+[A-Z0-9a-z.+"=(&/<'> )]+-+[A-Z0-9a-z( )&</>=,"]+$
  • Replace non-conditional lines but keep the spacing for copy into spreadsheet; the first is for lines without a hyphen, the second is for lines with a hyphen
[ ]+doc+[A-Z0-9a-z.,+=() "']+$
[ ]+doc+[A-Z0-9a-z.+'( <-=&/>)",]+-+[A-Z0-9a-z( )&</>=,"]+$

Replace "%" with ","

  • Select all, copy and paste remainder info into column of spreadsheet, don't delete line breaks or title rows

Pull SetValue

The following steps are set in macro PrintConvert.mac

  • Remove characters leading the if set value **Note the space behind the equal sign is required to work properly**
[A-Z0-9a-z., (")]+=+[A-Z0-9a-z. (")+]+= 
  • Replace non-conditional lines but keep the spacing for copy into spreadsheet; the first is for lines without a hyphen, the second is for lines with a hyphen
[ ]+doc+[A-Z0-9a-z.,+=() "]+$
[ ]+doc+[A-Z0-9a-z.+'( <-=&/>)",]+-+[A-Z0-9a-z( )&</>=,"']+$
  • Remove double quotes
  • Replace "%" with ","
  • Select all, copy and paste remainder info into column of spreadsheet, don't delete line breaks or title rows