mathematical calculation in template

29 views
Skip to first unread message

pratap

unread,
Jan 6, 2009, 7:21:15 AM1/6/09
to Hardhats
Hi All

Do any one have idea about doing mathematical calculation like (2*3 ,
2+3 and so on) in template

if yes please guide me

Regards

Pratap

Brian Lord

unread,
Jan 6, 2009, 7:36:49 AM1/6/09
to Hard...@googlegroups.com
The short answer for how this needs to be done is to use a new object.
Objects in TIU are created using a mumps program that does a given
function or set of functions and returns values. The program is created
and then the link to the program is established in the TIU Document
Definition file using the "Object" data type.

Depending on how you want this to work it may take a few objects one for
entry of first value, one for mathematical interaction, one for second
value, and then finally one for the result, or you could put the left
side of the equation in a single object have it do all the parsing and
then have a second object for the results.

The above process of 2 or objects would actually be very easy, a single
object to do this would be fairly complex, depending on your programming
skills.

It is possible someone may have already setup a calculator object but I
am unaware of anyone having spent the time to do it.

If you have more questions you are welcome to contact me and I can give
you more info on how to do this.

Hope this helps some.

George Timson

unread,
Jan 6, 2009, 11:18:31 AM1/6/09
to Hardhats
FileMan Computed Expressions can be included in Input, Sort and Print
Templates.

Please study:
http://www.hardhats.org/fileman/u2/ce_frm.htm

--George Timson

kdt...@gmail.com

unread,
Jan 6, 2009, 11:45:42 AM1/6/09
to Hardhats
Are you talking about a template in Fileman, as George replied about?
Or a CPRS text template?

Kevin

pratap

unread,
Jan 7, 2009, 5:04:53 AM1/7/09
to Hardhats
Hey friends

Thanks all of you for your reply actually i am talking here about cprs
template and not about file man template

please give me a full detail if you people can as i have no idea about
this and need some good helping hand to over come

@ Brian Lord--- I think i need your help if you can provide some more
help as i have found your reply which match my needs

Looking forward for your reply

Regards
Pratap

kdt...@gmail.com

unread,
Jan 7, 2009, 11:19:09 AM1/7/09
to Hardhats
CPRS templates typically contain text. But they also contain "data
objects", i.e. |PATIENT NAME|. These data objects launch bits of code
on the server that return a string for inserting into the template.

You can create you own custom code to return custom code.

The problem is that I don't think you can pass parameters to the data
object server code. So you couldn't have a object like this |DOADD
(1,2)|.
But I created a object that would get the patients current weight, and
then look at the previously stored weight, and would return a string
showing how their weight has changed. But it would be launched like |
WT DELTA|, for example

Hope that helps.

Kevin

pratap

unread,
Jan 8, 2009, 1:08:34 AM1/8/09
to Hardhats
Hi Kevin

Thanks for you for your idea but still i need more help as i need like
if i have BSA(body surface area) of the patient and suppose a doctor
has prescribed a dosage of 100 mg/mm or some thing like that for a
duration of 6 month then i should be able to calculate the total
dosage automatically which will be mutiplication of
100(variable for every patient)*BSA*6month(again variable for each
patient)
so do you have some idea on how we can do this in templates.If yes
please help

Looking forward for your reply

Pratap

Stephen...@va.gov

unread,
Jan 8, 2009, 4:30:41 PM1/8/09
to Hardhats
Would you post code of |WT DELTA| as example?

kdt...@gmail.com

unread,
Jan 11, 2009, 2:21:40 PM1/11/09
to Hardhats
What you are describing should be possible. This is because you are
asking the routine to get it's inputs from the database, not from
CPRS.

But before we get into all that, you first need to learn how make a
basic routine that returns a simple "hello world" type string.

I want you to explore the OPTION: TIUFC CREATE DDEFS MGR

After that, you will be at a programmer's level routine, with access
to any and all data in your database. You will have to do you own
research as to where the data is etc.

Are you serious about wanting to know the total amount of a drug
dispensed in a past period of time? What is the clinical utility of
this? And is your provider doing the dispensing from inside VistA?

Kevin

Kevin Toppenberg

unread,
Jan 11, 2009, 2:26:34 PM1/11/09
to Hard...@googlegroups.com
I am going to attach my mumps file that has the supporting code for
most of my CPRS template objects. It is in linux text format. If you
are on Window$, I think that Wordpad will open it properly.

The function is $$WTDELTA.

The Object method that is used to launch this is:
S X=$$WTDELTA^TMGTIUOJ(+$G(DFN),.TIU)

Hope that helps.

Kevin

On Thu, Jan 8, 2009 at 4:30 PM, Stephen...@va.gov
<Stephen...@va.gov> wrote:
>
> Would you post code of |WT DELTA| as example?
>
>
> >
>



--
Thanks,
Kevin T
TMGTIUOJ.m
Reply all
Reply to author
Forward
0 new messages