How it works

                   Click Here to Sign Up!

Members

Meditech Jobs

Groups

Videos

  • Add Videos
  • View All

How to get started

1. Become a Member

2. Join & Post Questions in our Groups

3. Read or Write a MEDITECH Blog

Hello All,

I am currently creating basic reports in Meditech NPR(MAGIC). My report specifications as follow:

1. Report from ADM.PAT(Main segment)

2. Fields.

3. Pull occur.seq.no.

Now I have created the report but not able to fetch occur.seq.no by looping it. Could any one please help me with the correct looping codes?

Thanks for your help in advance.

Tags: Computed, Field

Views: 243

Replies to This Discussion

Rajib:  This is one that works for me in a computed statement for the date.  You can also change to occur.type if you need to see that.

DAT=ZINT
JFY=L
LEN=6
VAL=IF{""^VAR^occur.seq.no,

VAL=DO{@Next(occur.seq.no)&'VAR @occur.date%1^DT,

VAL=IF{@occur.type^TYP="02" DT^VAR;
VAL=TYP="04" DT^VAR;TYP="05" DT^VAR}},VAR}

Thanks a lot for your reply. I will try this logic and will let you know for sure.

Joy Merritts said:

Rajib:  This is one that works for me in a computed statement for the date.  You can also change to occur.type if you need to see that.

DAT=ZINT
JFY=L
LEN=6
VAL=IF{""^VAR^occur.seq.no,

VAL=DO{@Next(occur.seq.no)&'VAR @occur.date%1^DT,

VAL=IF{@occur.type^TYP="02" DT^VAR;
VAL=TYP="04" DT^VAR;TYP="05" DT^VAR}},VAR}

Hi Rajib

I recommend you look at the online data definitions to resolve your issue.

 

You are not getting any values because occur.seq.no is in the adm.pat.occurences segment, not main.

 

If you changed your detail segment or made occur.seq.no a multiple, you should start seeing values.

 

David

 

occur.seq.no is in ADM.PAT segment adm.pat.occurances which is a child segment of adm.patient.file.

This makes @occur.seq.no a multiple within the patient record.

Assuming you just want to know what the last sequence number is try

@Last(occur.seq.no)

Thanks a lot. This logic works fine in my report and report is pulling records as expected. Thanks.



Joy Merritts said:

Rajib:  This is one that works for me in a computed statement for the date.  You can also change to occur.type if you need to see that.

DAT=ZINT
JFY=L
LEN=6
VAL=IF{""^VAR^occur.seq.no,

VAL=DO{@Next(occur.seq.no)&'VAR @occur.date%1^DT,

VAL=IF{@occur.type^TYP="02" DT^VAR;
VAL=TYP="04" DT^VAR;TYP="05" DT^VAR}},VAR}

RSS

© 2014   Inpact, LLC. All Rights Reserved.

Badges  |  Report an Issue  |  Terms of Service