Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capture 6M of data after 2M of start date?

Status
Not open for further replies.

records333

Technical User
Mar 16, 2012
41
US
I would like to capture encounter dates 6M before test date, 6M after test date- starting 2M after test date


{PAT_ENC_HSP.HOSP_ADMSN_TIME} < {Test.Date} and

{PAT_ENC_HSP.HOSP_ADMSN_TIME} > ('m', +2, {Test.Date}) or

{PAT_ENC_HSP.HOSP_ADMSN_TIME} in dateadd('m',-6,{Test.Date}to dateadd('m',+6,{Test.Date})and
 
Sorry, but this makes no sense and your formula does not help - a date can never be both before a given date and more 2 months after that same date.

The starting point to developing code is being able to articulate what you need in a logical manner. In need, sample data and the outcome you are looking for can help, but the logical explanation is essential.



Cheers
Pete


 
The goal is to capture encounters 6M before CC Date, and 6M after CC Date ( starting 2M after CC Date). Let me know thoughts on the following:

//{PAT_ENC_HSP.HOSP_ADMSN_TIME} < {Care_Coordination.CC Date}and

//{PAT_ENC_HSP.HOSP_ADMSN_TIME} > dateadd ('m', 2,({Care_Coordination.CC Date})) or

//{PAT_ENC_HSP.HOSP_ADMSN_TIME} in dateadd('m',-6,{Care_Coordination.CC Date}) to dateadd('m',+6,{Care_Coordination.CC Date})
 
Nope - it doesn't help. You have simply restated the earlier post which doesn't make any sense (to me at least - it is possible I am just getting old and stupid of course).

What do you mean by "...6M after CC Date (starting 2M after CC Date)...".

My thought on you formula is that no record can satisfy the first 2 lines of your formula, ie having a {PAT_ENC_HSP.HOSP_ADMSN_TIME} simutaneously before and after the {PAT_ENC_HSP.HOSP_ADMSN_TIME}. As I said before, maybe sample data can help explain it.

I am happy to try to help, but unless unless you can explain to me what you need (in a way that even I can understand), you will need to wait for someone else to assist.


Sorry!
Pete
 

x number of patients had health education
of those patients that had health education date, what is total number of hospital visits?
of those total numbers of visits, how many visits were 6M before educattion date?
how many visits were 6M after education date only counting visits (2) months after education date?
 
Ok, it's becoming clearer.

Assuming you want to count all hospital visits for people with Health education, regardless of when that education was in relation to the Admission Date the Record Selection would need to include all Patients with Education:

[Code Record_Selection]
Not(Isnull({Care_Coordination.CC_DATE}))
[/Code]

For Total Visits, insert a Summary (Count) on any of the fields.

For Number of Visits up to 6 months before the Education Date, use a Running Total:
Field: {PAT_ENC_HSP.PATIENT}
Type: Count
Evaluate: Use a formula

{PAT_ENC_HSP.HOSP_ADMSN_TIME} in [DateAdd("m", -6, {Care_Coordination.CC_DATE}) to {Care_Coordination.CC_DATE}]

For Number of visits between 2 months and 6 months Post the Education Date, use a Running Total:

Field: {PAT_ENC_HSP.PATIENT}
Type: Count
Evaluate: Use a formula

{PAT_ENC_HSP.HOSP_ADMSN_TIME} in [DateAdd("m", 2, {Care_Coordination.CC_DATE}) to DateAdd("m", 6, {Care_Coordination.CC_DATE})]


Hope this helps.

Cheers
Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top