HookEmHorns
Programmer
My client sent me a form they want immunization dates to pull onto (last 5 per Category). Earlier today, LBass helped me set up the below mentioned formula that works fantastic. I currently have 5 formula's all similiar with the exception of what pulls to {cusASIISC_ImmunizationsGet.Sequence}.
My 5 formulas @DTPDate1, @DTPDate2, @DTPDate3, @DTPDate4 and @DTPDate5
In my form, I have #1, #2, #3, #4 and #5 listed left to right. @DTPDate1 going to #1, @DTPDate2 going to #2 and so on to #5 gettin @DTPDate5.
How I am telling which one is the oldest is based on this field - {cusASIISC_ImmunizationsGet.Sequence}. The most recent one gets the 0. The second oldest = 1, then = 2 and so on <see examples above>.
My client tells me I have it backwards and instead of having the most recent date in #1, they want the oldest one in #1. I thought if I just moved my formulas on my page around it would fix my issue and I could move on.
Issue I am finding is this. Lets say I have five spaces to fill in a date but the patient only had 2 injections on 2 distinct dates. If I moved them around, space #5 and space #4 would be populated with what I want in #1 and #2.
I need a way to check if all the dates have a value and if not move it down the chain. Make sense? Clear as mud! I think if you jot it on paper and visually see what I am saying it will make sense. I think. LOL
As always any suggestions or help is appreciated.
My 5 formulas @DTPDate1, @DTPDate2, @DTPDate3, @DTPDate4 and @DTPDate5
Code:
@DTPDate1 =
if {cusASIISC_ImmunizationsGet.Sequence} = 0 and
(
{cusASIISC_ImmunizationsGet.Category} = "Diphtheria, Tetanus, Pertussis" or
{cusASIISC_ImmunizationsGet.ImmunCode} = "90696" or
{cusASIISC_ImmunizationsGet.ImmunCode} = "90723" or
{cusASIISC_ImmunizationsGet.ImmunCode} = "90698"
) then
{cusASIISC_ImmunizationsGet.ImmunDte}
Code:
@DTPDate2 =
if {cusASIISC_ImmunizationsGet.Sequence} = 1 and
(
{cusASIISC_ImmunizationsGet.Category} = "Diphtheria, Tetanus, Pertussis" or
{cusASIISC_ImmunizationsGet.ImmunCode} = "90696" or
{cusASIISC_ImmunizationsGet.ImmunCode} = "90723" or
{cusASIISC_ImmunizationsGet.ImmunCode} = "90698"
) then
{cusASIISC_ImmunizationsGet.ImmunDte}
Code:
@DTPDate3 =
if {cusASIISC_ImmunizationsGet.Sequence} = 2 and
(
{cusASIISC_ImmunizationsGet.Category} = "Diphtheria, Tetanus, Pertussis" or
{cusASIISC_ImmunizationsGet.ImmunCode} = "90696" or
{cusASIISC_ImmunizationsGet.ImmunCode} = "90723" or
{cusASIISC_ImmunizationsGet.ImmunCode} = "90698"
) then
{cusASIISC_ImmunizationsGet.ImmunDte}
Code:
@DTPDate4 =
if {cusASIISC_ImmunizationsGet.Sequence} = 3 and
(
{cusASIISC_ImmunizationsGet.Category} = "Diphtheria, Tetanus, Pertussis" or
{cusASIISC_ImmunizationsGet.ImmunCode} = "90696" or
{cusASIISC_ImmunizationsGet.ImmunCode} = "90723" or
{cusASIISC_ImmunizationsGet.ImmunCode} = "90698"
) then
{cusASIISC_ImmunizationsGet.ImmunDte}
Code:
@DTPDate5 =
if {cusASIISC_ImmunizationsGet.Sequence} = 4 and
(
{cusASIISC_ImmunizationsGet.Category} = "Diphtheria, Tetanus, Pertussis" or
{cusASIISC_ImmunizationsGet.ImmunCode} = "90696" or
{cusASIISC_ImmunizationsGet.ImmunCode} = "90723" or
{cusASIISC_ImmunizationsGet.ImmunCode} = "90698"
) then
{cusASIISC_ImmunizationsGet.ImmunDte}
In my form, I have #1, #2, #3, #4 and #5 listed left to right. @DTPDate1 going to #1, @DTPDate2 going to #2 and so on to #5 gettin @DTPDate5.
How I am telling which one is the oldest is based on this field - {cusASIISC_ImmunizationsGet.Sequence}. The most recent one gets the 0. The second oldest = 1, then = 2 and so on <see examples above>.
My client tells me I have it backwards and instead of having the most recent date in #1, they want the oldest one in #1. I thought if I just moved my formulas on my page around it would fix my issue and I could move on.
Code:
How it is now:
#1 = @DTPDate1, #2 = @DTPDate2, #3 = @DTPDate3, #4 = @DTPDate4 and #5 = @DTPDate5
How I thought I could switch it to fix the issue:
#1 = @DTPDate5, #2 = @DTPDate4, #3 = @DTPDate3, #4 = @DTPDate2 and #5 = @DTPDate1
Issue I am finding is this. Lets say I have five spaces to fill in a date but the patient only had 2 injections on 2 distinct dates. If I moved them around, space #5 and space #4 would be populated with what I want in #1 and #2.
I need a way to check if all the dates have a value and if not move it down the chain. Make sense? Clear as mud! I think if you jot it on paper and visually see what I am saying it will make sense. I think. LOL
As always any suggestions or help is appreciated.