Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Shared String - Editing - Help Post Reply Post New Topic
Author Message
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet Topic: Shared String - Editing - Help
    Posted: 09 Jul 2020 at 10:41am
I have a report that is using this formula currently.

shared stringvar cpt;

if not isnull({Authorization_ProcedureData.Code}) and {Authorization_ProcedureData.Code} <> '' Then
    if instr(cpt , ',' + {Authorization_ProcedureData.Code})=0 then
        cpt := cpt + ',' + {Authorization_ProcedureData.Code};

''

*****
I want to now see if it is possible to be able to add something to this report, to do this:

If {Authorization_ProcedureData.Code} in ['550','551','552','559','580','581','582','589']
Then 'G0300'
Else
If {Authorization_ProcedureData.Code} in ['420','421','422','424','429']
Then 'G0151'
Else
If {Authorization_ProcedureData.Code} in ['430','431','432','434','439']
Then 'G0152'
Else
If {Authorization_ProcedureData.Code} in ['441','442','444','449']
Then 'G0153'
Else
If {Authorization_ProcedureData.Code} in ['570','571','572','579']
Then 'G0156'
Else
If {Authorization_ProcedureData.Code} in ['560','561','562','569']
Then 'G0155'

******
Can this be done and if so how?

TIA

Always appreciate the help!
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 22 Jul 2020 at 10:01am
It's not clear where you want to add this. Is this a value to add this. Is this a value to add to the existing formula?

-Dell
IP IP Logged
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet Posted: 23 Jul 2020 at 1:09pm
I would like to add it to the existing formula(s) if that is where it will work.

The report is working off quite a few formulas that are related to the CPT Codes and I am not sure how to now add that when the report pulls in a CPT code of one of these CPT codes being used;
'550','551','552','559','580','581','582','589'

I want it to change that to G0300 every time.

The multiple formulas already on the report, I am not familiar with them and they are below, if that helps at all.

Formula is called: AllCPT and does this:
shared stringvar cpt;
mid(cpt,2)

Formula is called: AllCPTDescp and does this
shared stringvar cptdesc;
mid(cptdesc,2);

I just don't know how those formulas work and how to add my new need or where to add it in the report.

Thank you if any of this makes help and sense.

Always appreciate the help!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 19 Aug 2020 at 7:31am
Hi,

The first formula that you referenced, is creating a unique string of codes.

If I understand what you are asking, you want to replace the those codes with a different identifier.

If so, I would do something like this:
local stringvar code:={Authorization_ProcedureData.Code};

insert your if statement here, instead of then 'G0300' replace it with THEN code := 'G0300'

then in the original code, replace {Authorization_ProcedureData.Code} with code. This will build a string of unique codes but will substitute your code for the existing codes

Hopefully this is clearer than mud.

IP IP Logged
BoltzGirl
Groupie
Groupie
Avatar

Joined: 22 Jan 2013
Online Status: Offline
Posts: 89
Quote BoltzGirl Replybullet Posted: 19 Aug 2020 at 12:18pm
Howdy lockwelle

Everything you explained was crystal clear up until the end.

When you explain to then go back to the original code, replace {Authorization_ProcedureData.Code} with code. Do you mean with the new code I created.

What I did was created new formula as you explained as CPT1 and did this:
local stringvar code:={Authorization_ProcedureData.Code};

If {Authorization_ProcedureData.Code} like ['550','551','552','559','580','581','582','589']
Then 'G0300'
Else
{Authorization_ProcedureData.Code}

Are you saying to now take that new formula CPT1 and put it in the original CPT code formula that has this:

shared stringvar cpt1;

if not isnull({Authorization_ProcedureData.Code}) and {Authorization_ProcedureData.Code} <> '' Then
    if instr(cpt1 , ',' + {Authorization_ProcedureData.Code})=0 then
        cpt1 := cpt1 + ',' + {Authorization_ProcedureData.Code};

''

Always appreciate the help!
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 20 Aug 2020 at 5:13am
Hi,

this is what I meant:

local stringvar code:={Authorization_ProcedureData.Code};

If {Authorization_ProcedureData.Code} like ['550','551','552','559','580','581','582','589']
Then code:='G0300'
Else
code:={Authorization_ProcedureData.Code}

Are you saying to now take that new formula CPT1 and put it in the original CPT code formula that has this:

shared stringvar cpt1;

if not isnull(code) and code <> '' Then
    if instr(cpt1 , ',' + code)=0 then
        cpt1 := cpt1 + ',' + code;


simply replace the field Authorization_ProcedureData.Code with the variable we just created called 'code'

HTH
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

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



This page was generated in 0.000 seconds.