Examples of GTS usage for Medications.
gboutwell
#1 Posted : Thursday, May 9, 2013 10:22:30 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/9/2013(UTC)
Posts: 7
Points: 21
Location: Norton, KS

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
I'm looking for examples of how to use GTS, PIVL, EIVL, etc for expressing common and a few complex Medication 'frequencies'.

For instance:

Daily (aka Once Daily):

GTS Daily = new GTS();
PIVL<TS> pivl = new PIVL<TS>(new IVL<TS>(DateTime.UtcNow), new PQ(1, "d"));
pivl.InstitutionSpecified = true;
pivl.Operator = SetOperator.Intersect;
pivl.OriginalText = "Once daily";
Daily.Hull = pivl;

(Not even sure the above is correct)

B.I.D. (aka Twice Daily):

GTS 2xDaily = new GTS();
PIVL<TS> pivl = new PIVL<TS>(new IVL<TS>(DateTime.UtcNow), new PQ(12, "h"));
pivl.InstitutionSpecified = true;
pivl.Operator = SetOperator.Intersect;
pivl.OriginalText = "Twice daily";
2xDaily.Hull = pivl;

(Not even sure the above is correct)


P.R.N (aka As Needed) every 4-6 hours:

GTS AsNeededRangeOfHours = new GTS();
// ???? Don't even know where to start with this one.
// What do I create to describe 'repeats' every 4 - 6 hours?
//AsNeededRangeOfHours.Hull = ?????;

(Not even sure the above is correct)

And for example a more complex one:

P.R.N. (aka As Needed) T.I.D (Three Times Daily) at Meals

GTS ComplexPRNTID = new GTS();
// ???? Don't even know where to start with this one.
//ComplexPRNTID.Hull = ?????;

Any help or suggestions on the Types and how to combine them in combinations like that above would be greatly appreciated...

Thanks,

George
justin.fyfe1
#2 Posted : Friday, May 10, 2013 9:10:14 AM(UTC)

Rank: Administration

Medals: Mobile Tech Grasshopper: Mobile Tech GrasshopperHealth Informatics MVP

Groups: Registered, Administrators
Joined: 7/22/2010(UTC)
Posts: 96
Points: 297
Man
Location: Hamilton, ON

Thanks: 2 times
Was thanked: 17 time(s) in 17 post(s)
Hi George,

Thanks for the question, GTS is always a challenge.

The first is technically correct, though it will repeat each day on the hour, if you want to repeat the day you can set the precision of the TS to Day.

TS today = new TS(DateTime.UtcNow, DatePrecision.Day);
PIVL<TS> pivl = new PIVL<TS>(new IVL<TS>(today), new PQ(1, "d"));
pivl.InstitutionSpecified = true;
pivl.Operator = SetOperator.Intersect;
pivl.OriginalText = "Once daily";
GTS daily = pivl;

The second is correct, however (again) technically if you construct the TS with full time precision it will repeat every 12 hours. If you're just going to be displaying the GTS this is fine. You can also use the frequency property:

TS today = new TS(DateTime.UtcNow, DatePrecision.Day);
PIVL<TS> pivl = new PIVL<TS>();
pivl.Phase = new IVL<TS>(today);
pivl.Frequency= new RTO<INT,PQ>(2, new PQ(1, "d"));
pivl.InstitutionSpecified = true;
pivl.Operator = SetOperator.Intersect;
pivl.OriginalText = "Twice daily";
GTS daily = pivl;

Although, in DT R1 this will be formatted as <phase value="0.5" unit="d"/>.

The third example is a little more complex, I'm not sure how to represent this in DT R1, but will ponder it for a while. I'm thinking something like this is what you want:

TS today = new TS(DateTime.UtcNow, DatePrecision.Day);
IVL<PQ> fourtosix = new IVL<PQ>(new PQ(4, "h"), new PQ(6, "h"));
PIVL<TS> asNeeded = new PIVL<TS>(today, fourtosix);

However because of OOP constraints it isn't technically possible for IVL<T> : T (an extension cannot extend its template class in .NET). I will look into this more, perhaps we may need to change the definition of PIVL to allow for periods which are IVL<> ..

The last is a little more less challenging. I would think this:

TS today = new TS(DateTime.UtcNow, DatePrecision.Day);

EIVL<TS> atMeals = new EIVL<TS>(DomainTimingEventType.Meal, new IVL<PQ>(new PQ(-1, "h"), new PQ(1, "h")));
PIVL<TS> threeTimesDaily = new PIVL<TS>(new IVL<TS>(today), new RTO<INT, PQ>(3, new PQ(1, "d")));
threeTimesDaily.Operator = SetOperator.Intersect;
SXPR<TS> expression = new SXPR<TS>(atMeals, threeTimesDaily);
GTS prnTID = expression;

Would accomplish what you're looking for. You'll have to check your jurisdictional restrictions to the datatypes to ensure that DomainTimingEvent.Meal is allowed to be used (and that -1 .. 1 is a valid offset.

Hope that helps.

Cheers
-Justin
1 user thanked justin.fyfe1 for this useful post.
gboutwell on 6/3/2013(UTC)
gboutwell
#3 Posted : Monday, May 13, 2013 9:00:01 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/9/2013(UTC)
Posts: 7
Points: 21
Location: Norton, KS

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Justin,

It was good to know that I was on the right track in some ways. Thanks for the additional helps. I appreciate it. These will go a long way to helping us with Medicaiton Frequencies. Thank you.
gboutwell
#4 Posted : Monday, May 13, 2013 3:11:01 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/9/2013(UTC)
Posts: 7
Points: 21
Location: Norton, KS

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
Justin,

I'm getting an error on the line SXPR<TS> expression = new SXPR<TS>(atMeals, threeTimesDaily);

It says that SXPR<TS> does not have a constructor that takes two arguments. From the looks of it is looking for an Enumerable/List of SXCM terms.

Also, do you have any suggestions on how I can do something like the following:

EIVL<TS> atMeals = new EIVL<TS>(DomainTimingEventType.Meal, new IVL<PQ>(new PQ(-1, "h"), new PQ(1, "h")));
GTS frequency = atMeals;

Then latter add/intersect

PIVL<TS> Daily = new PIVL<TS>(new IVL<TS>(today), new PQ(1, "d"));

// Something like:
// frequency.Hull.Add(Daily) or frequency.Hull.Intersect(Daily);

I'm trying to build the GTS as a parse through the original text...
gboutwell
#5 Posted : Monday, May 13, 2013 3:15:42 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/9/2013(UTC)
Posts: 7
Points: 21
Location: Norton, KS

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
gboutwell wrote:
Justin,

I'm getting an error on the line SXPR<TS> expression = new SXPR<TS>(atMeals, threeTimesDaily);

It says that SXPR<TS> does not have a constructor that takes two arguments. From the looks of it is looking for an Enumerable/List of SXCM terms.



If I change the above to:

SXPR<TS> expression = new SXPR<TS>();
expression.Add(atMeals);
expression.Add(threeTimesDaily);

that works... :)
gboutwell
#6 Posted : Monday, May 13, 2013 5:12:12 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/9/2013(UTC)
Posts: 7
Points: 21
Location: Norton, KS

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
gboutwell wrote:


PIVL<TS> Daily = new PIVL<TS>(new IVL<TS>(today), new PQ(1, "d"));

// Something like:
// frequency.Hull.Add(Daily) or frequency.Hull.Intersect(Daily);



Kind of got this to work, don't know if it's correct but it does compile and appear to do roughly what I want:

// Initialize
GTS Freq = new GTS();

// First time through Parse
PIVL<TS> pivl = new PIVL<TS>();
pivl.Phase = new IVL<TS>(today);
pivl.Frequency = new RTO<INT, PQ>(3, new PQ(1, "d"));
pivl.InstitutionSpecified = true;
pivl.Operator = SetOperator.Intersect;
pivl.OriginalText = "TID";
Freq.Hull = pivl;

// Second time through Parse
EIVL<TS> trigger = new EIVL<TS>(DomainTimingEventType.Meal, new IVL<PQ>(new PQ(-1, "h"), new PQ(1, "h")));
trigger.Operator = SetOperator.Intersect;
trigger.OriginalText = "With Meals";
SXPR<TS> expression = new SXPR<TS>();
PIVL<TS> frequency = Freq.Hull as PIVL<TS>;
frequency.Operator = SetOperator.Intersect;
expression.Add(frequency);
expression.Add(trigger);
Freq.Hull = expression;

1 user thanked gboutwell for this useful post.
justin.fyfe1 on 7/12/2013(UTC)
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

SoClean Theme By Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.140 seconds.