FreeB Formats is and is not

From OpenWiki

Jump to: navigation, search

[edit] Boolean is/is_not function

Often you want to use a smarty {if}{else}{/if} statement to compel the template to behave very differently. For instance the X12 formats execute drastically differently if the patient is the dependant of the insured party, or if the patient is directly insured. For this reason, many of the data points in a FreeB claim can be accessed in a manner convenient to the smarty {if}{else}{/if} syntax. From the x12 format...

{if $subscriber->is("ins_self")}
         {*then the subscriber is the patient and loop 2300 goes here*}
         {*include the 2300 loop under the 2000B subscriber loop*}
         {*Lots of other things*}
{else}
         {*the patient and the subscriber are different people*}
         {*include the 2300 loop under the 2000C patient loop*}
         {*Different things*}          
{/if}

Generally you do not need to use a "get" statement on a data object to perform an if statment. At least if possible you should try to use an "is" statement. Of course you can also use the "is_not" statement which will give you the opposite boolean value. When $data->is("something") returns true, then $data->is_not("something") will return false.

[edit] Text Replace is/is_not function

The problem with a boolean is that there are many places where you want to use an is to selectively print a single character. For instance on the HCFA(CMS) 1500 if the patient is male you need to put an X in the box marked male. You can do this with the is boolean syntax like this...

boolean way:

{if $patient->is("male")}X{else}{""|pad:1}{/if}

This either places an X if the patient is male or a single blank if the patient is not male. The Text Replace syntax allows you to automatically replace the text with the second argument IF the value is true, or a blank if the statment is not true. That means that the following statement...

text replace way:

{$patient->is("Male","X")}

Will do the exact same thing as the first statement. This makes the templates much simpler and easier to read.

As with the boolean syntax you use is_not with text replacement. That means where $data->is("something","X") returns an " " $data->is_not("something","X") will return an "X".

Personal tools