Skip to content

Commit

Permalink
Merge pull request #96 from hmcts/RET-4397-OldCasesSupport
Browse files Browse the repository at this point in the history
RET-4397: Fix for Old Cases missing data
  • Loading branch information
fergusoshea committed Nov 10, 2023
2 parents ec2a996 + 7ace4be commit c46459c
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ else caseData.claimantIndType.claimant_first_names + " " + caseData.claimantIndT
"ET3Processing",
"ReviewReferralResponseLegalOps",
"ReviewReferralResponseAdmin",
"ET3Notification",
"IssueInitialConsiderationDirections",
"ReviewRule21Referral",
"SendEt3Notification"</text>
Expand Down Expand Up @@ -674,7 +673,7 @@ else 5000</text>
<text>if (caseData != null
and caseData.referralCollection != null
and count(caseData.referralCollection[count(value.referralReplyCollection)&gt;0])&gt;0
and sort(flatten(caseData.referralCollection.value.referralReplyCollection), function(x,y) date and time(x.value.replyDateTime) &gt; date and time(y.value.replyDateTime))[1].value.isUrgentReply = "Yes")
and sort(flatten(caseData.referralCollection.value.referralReplyCollection), function(x,y) date and time(if(x.value.replyDateTime!=null)then x.value.replyDateTime else "2023-01-01T00:00:00.000") &gt; date and time(if(y.value.replyDateTime!=null)then y.value.replyDateTime else "2023-01-01T00:00:00.000"))[1].value.isUrgentReply = "Yes")
then 1000
else 5000</text>
</outputEntry>
Expand Down Expand Up @@ -753,7 +752,7 @@ else 500</text>
<text>if (caseData!=null
and caseData.referralCollection != null
and count(caseData.referralCollection[count(value.referralReplyCollection)&gt;0])&gt;0
and sort(flatten(caseData.referralCollection.value.referralReplyCollection), function(x,y) date and time(x.value.replyDateTime) &gt; date and time(y.value.replyDateTime))[1].value.isUrgentReply = "Yes")
and sort(flatten(caseData.referralCollection.value.referralReplyCollection), function(x,y) date and time(if(x.value.replyDateTime!=null)then x.value.replyDateTime else "2023-01-01T00:00:00.000") &gt; date and time(if(y.value.replyDateTime!=null)then y.value.replyDateTime else "2023-01-01T00:00:00.000"))[1].value.isUrgentReply = "Yes")
then 100
else 500</text>
</outputEntry>
Expand Down Expand Up @@ -920,7 +919,7 @@ else 2</text>
<text>if (caseData!=null
and caseData.referralCollection != null
and count(caseData.referralCollection[count(value.referralReplyCollection)&gt;0])&gt;0
and sort(flatten(caseData.referralCollection.value.referralReplyCollection), function(x,y) date and time(x.value.replyDateTime) &gt; date and time(y.value.replyDateTime))[1].value.isUrgentReply = "Yes")
and sort(flatten(caseData.referralCollection.value.referralReplyCollection), function(x,y) date and time(if(x.value.replyDateTime!=null)then x.value.replyDateTime else "2023-01-01T00:00:00.000") &gt; date and time(if(y.value.replyDateTime!=null)then y.value.replyDateTime else "2023-01-01T00:00:00.000"))[1].value.isUrgentReply = "Yes")
then 1
else 2</text>
</outputEntry>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ else caseData.claimantIndType.claimant_first_names + " " + caseData.claimantIndT
"ET3Processing",
"ReviewReferralResponseLegalOps",
"ReviewReferralResponseAdmin",
"ET3Notification",
"IssueInitialConsiderationDirections",
"ReviewRule21Referral",
"SendEt3Notification"</text>
Expand Down Expand Up @@ -674,7 +673,7 @@ else 5000</text>
<text>if (caseData!=null
and caseData.referralCollection != null
and count(caseData.referralCollection[count(value.referralReplyCollection)&gt;0])&gt;0
and sort(flatten(caseData.referralCollection.value.referralReplyCollection), function(x,y) date and time(x.value.replyDateTime) &gt; date and time(y.value.replyDateTime))[1].value.isUrgentReply = "Yes")
and sort(flatten(caseData.referralCollection.value.referralReplyCollection), function(x,y) date and time(if(x.value.replyDateTime!=null)then x.value.replyDateTime else "2023-01-01T00:00:00.000") &gt; date and time(if(y.value.replyDateTime!=null)then y.value.replyDateTime else "2023-01-01T00:00:00.000"))[1].value.isUrgentReply = "Yes")
then 1000
else 5000</text>
</outputEntry>
Expand Down Expand Up @@ -753,7 +752,7 @@ else 500</text>
<text>if (caseData!=null
and caseData.referralCollection != null
and count(caseData.referralCollection[count(value.referralReplyCollection)&gt;0])&gt;0
and sort(flatten(caseData.referralCollection.value.referralReplyCollection), function(x,y) date and time(x.value.replyDateTime) &gt; date and time(y.value.replyDateTime))[1].value.isUrgentReply = "Yes")
and sort(flatten(caseData.referralCollection.value.referralReplyCollection), function(x,y) date and time(if(x.value.replyDateTime!=null)then x.value.replyDateTime else "2023-01-01T00:00:00.000") &gt; date and time(if(y.value.replyDateTime!=null)then y.value.replyDateTime else "2023-01-01T00:00:00.000"))[1].value.isUrgentReply = "Yes")
then 100
else 500</text>
</outputEntry>
Expand Down Expand Up @@ -920,7 +919,7 @@ else 2</text>
<text>if (caseData!=null
and caseData.referralCollection != null
and count(caseData.referralCollection[count(value.referralReplyCollection)&gt;0])&gt;0
and sort(flatten(caseData.referralCollection.value.referralReplyCollection), function(x,y) date and time(x.value.replyDateTime) &gt; date and time(y.value.replyDateTime))[1].value.isUrgentReply = "Yes")
and sort(flatten(caseData.referralCollection.value.referralReplyCollection), function(x,y) date and time(if(x.value.replyDateTime!=null)then x.value.replyDateTime else "2023-01-01T00:00:00.000") &gt; date and time(if(y.value.replyDateTime!=null)then y.value.replyDateTime else "2023-01-01T00:00:00.000"))[1].value.isUrgentReply = "Yes")
then 1
else 2</text>
</outputEntry>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ else null</text>
and additionalData.Data!=null
and additionalData.Data.referralCollection!=null
and count(additionalData.Data.referralCollection[count(value.referralReplyCollection)&gt;0])&gt;0)
then sort(flatten(additionalData.Data.referralCollection[value.referralReplyCollection!=null].value.referralReplyCollection), function(x,y) date and time(x.value.replyDateTime) &gt; date and time(y.value.replyDateTime)).value.directionTo[1]
then sort(flatten(additionalData.Data.referralCollection[value.referralReplyCollection!=null].value.referralReplyCollection), function(x,y) date and time(if(x.value.replyDateTime!=null)then x.value.replyDateTime else "2023-01-01T00:00:00.000") &gt; date and time(if(y.value.replyDateTime!=null)then y.value.replyDateTime else "2023-01-01T00:00:00.000")).value.directionTo[1]
else null</text>
</inputExpression>
</input>
Expand Down Expand Up @@ -67,7 +67,7 @@ else null</text>
and additionalData.Data!=null
and additionalData.Data.genericTseApplicationCollection!=null
and count(additionalData.Data.genericTseApplicationCollection[value.respondCollection!=null])&gt;0)
then sort(flatten(additionalData.Data.genericTseApplicationCollection[value.respondCollection!=null].value.respondCollection), function(x,y) date and time(x.value.dateTime) &gt; date and time(y.value.dateTime))[1].value.from
then sort(flatten(additionalData.Data.genericTseApplicationCollection[value.respondCollection!=null].value.respondCollection), function(x,y) date and time(if(x.value.dateTime!=null)then x.value.dateTime else "2023-01-01T00:00:00.000") &gt; date and time(if(y.value.dateTime!=null)then y.value.dateTime else "2023-01-01T00:00:00.000"))[1].value.from
else null</text>
</inputExpression>
</input>
Expand All @@ -77,7 +77,7 @@ else null</text>
and additionalData.Data!=null
and additionalData.Data.genericTseApplicationCollection!=null
and count(additionalData.Data.genericTseApplicationCollection[value.respondCollection!=null])&gt;0)
then sort(flatten(additionalData.Data.genericTseApplicationCollection[value.respondCollection!=null].value.respondCollection), function(x,y) date and time(x.value.dateTime) &gt; date and time(y.value.dateTime))[1].value.applicationType
then sort(flatten(additionalData.Data.genericTseApplicationCollection[value.respondCollection!=null].value.respondCollection), function(x,y) date and time(if(x.value.dateTime!=null)then x.value.dateTime else "2023-01-01T00:00:00.000") &gt; date and time(if(y.value.dateTime!=null)then y.value.dateTime else "2023-01-01T00:00:00.000"))[1].value.applicationType
else null</text>
</inputExpression>
</input>
Expand Down Expand Up @@ -408,7 +408,7 @@ else null</text>
</outputEntry>
<outputEntry id="LiteralExpression_0qcsldu">
<text>"Review Referral Response - "
+ sort(flatten(additionalData.Data.referralCollection[value.referralReplyCollection!=null].value.referralReplyCollection), function(x,y) date and time(x.value.replyDateTime) &gt; date and time(y.value.replyDateTime)).value.referralSubject[1]</text>
+ sort(flatten(additionalData.Data.referralCollection[value.referralReplyCollection!=null].value.referralReplyCollection), function(x,y) date and time(if(x.value.replyDateTime!=null)then x.value.replyDateTime else "2023-01-01T00:00:00.000") &gt; date and time(if(y.value.replyDateTime!=null)then y.value.replyDateTime else "2023-01-01T00:00:00.000")).value.referralSubject[1]</text>
</outputEntry>
<outputEntry id="LiteralExpression_0kmxycv">
<text></text>
Expand Down Expand Up @@ -450,7 +450,7 @@ else null</text>
</outputEntry>
<outputEntry id="LiteralExpression_08j7d7p">
<text>"Review Referral Response - "
+ sort(flatten(additionalData.Data.referralCollection[value.referralReplyCollection!=null].value.referralReplyCollection), function(x,y) date and time(x.value.replyDateTime) &gt; date and time(y.value.replyDateTime)).value.referralSubject[1]</text>
+ sort(flatten(additionalData.Data.referralCollection[value.referralReplyCollection!=null].value.referralReplyCollection), function(x,y) date and time(if(x.value.replyDateTime!=null)then x.value.replyDateTime else "2023-01-01T00:00:00.000") &gt; date and time(if(y.value.replyDateTime!=null)then y.value.replyDateTime else "2023-01-01T00:00:00.000")).value.referralSubject[1]</text>
</outputEntry>
<outputEntry id="LiteralExpression_0zcsqzi">
<text></text>
Expand Down Expand Up @@ -492,7 +492,7 @@ else null</text>
</outputEntry>
<outputEntry id="LiteralExpression_03wz7tv">
<text>"Review Referral Response - "
+ sort(flatten(additionalData.Data.referralCollection[value.referralReplyCollection!=null].value.referralReplyCollection), function(x,y) date and time(x.value.replyDateTime) &gt; date and time(y.value.replyDateTime)).value.referralSubject[1]</text>
+ sort(flatten(additionalData.Data.referralCollection[value.referralReplyCollection!=null].value.referralReplyCollection), function(x,y) date and time(if(x.value.replyDateTime!=null)then x.value.replyDateTime else "2023-01-01T00:00:00.000") &gt; date and time(if(y.value.replyDateTime!=null)then y.value.replyDateTime else "2023-01-01T00:00:00.000")).value.referralSubject[1]</text>
</outputEntry>
<outputEntry id="LiteralExpression_14hvioj">
<text></text>
Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/wa-task-initiation-employment-et_scotland.dmn
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ else null</text>
and additionalData.Data!=null
and additionalData.Data.referralCollection!=null
and count(additionalData.Data.referralCollection[count(value.referralReplyCollection)&gt;0])&gt;0)
then sort(flatten(additionalData.Data.referralCollection[value.referralReplyCollection!=null].value.referralReplyCollection), function(x,y) date and time(x.value.replyDateTime) &gt; date and time(y.value.replyDateTime)).value.directionTo[1]
then sort(flatten(additionalData.Data.referralCollection[value.referralReplyCollection!=null].value.referralReplyCollection), function(x,y) date and time(if(x.value.replyDateTime!=null)then x.value.replyDateTime else "2023-01-01T00:00:00.000") &gt; date and time(if(y.value.replyDateTime!=null)then y.value.replyDateTime else "2023-01-01T00:00:00.000")).value.directionTo[1]
else null</text>
</inputExpression>
</input>
Expand Down Expand Up @@ -67,7 +67,7 @@ else null</text>
and additionalData.Data!=null
and additionalData.Data.genericTseApplicationCollection!=null
and count(additionalData.Data.genericTseApplicationCollection[value.respondCollection!=null])&gt;0)
then sort(flatten(additionalData.Data.genericTseApplicationCollection[value.respondCollection!=null].value.respondCollection), function(x,y) date and time(x.value.dateTime) &gt; date and time(y.value.dateTime))[1].value.from
then sort(flatten(additionalData.Data.genericTseApplicationCollection[value.respondCollection!=null].value.respondCollection), function(x,y) date and time(if(x.value.dateTime!=null)then x.value.dateTime else "2023-01-01T00:00:00.000") &gt; date and time(if(y.value.dateTime!=null)then y.value.dateTime else "2023-01-01T00:00:00.000"))[1].value.from
else null</text>
</inputExpression>
</input>
Expand All @@ -77,7 +77,7 @@ else null</text>
and additionalData.Data!=null
and additionalData.Data.genericTseApplicationCollection!=null
and count(additionalData.Data.genericTseApplicationCollection[value.respondCollection!=null])&gt;0)
then sort(flatten(additionalData.Data.genericTseApplicationCollection[value.respondCollection!=null].value.respondCollection), function(x,y) date and time(x.value.dateTime) &gt; date and time(y.value.dateTime))[1].value.applicationType
then sort(flatten(additionalData.Data.genericTseApplicationCollection[value.respondCollection!=null].value.respondCollection), function(x,y) date and time(if(x.value.dateTime!=null)then x.value.dateTime else "2023-01-01T00:00:00.000") &gt; date and time(if(y.value.dateTime!=null)then y.value.dateTime else "2023-01-01T00:00:00.000"))[1].value.applicationType
else null</text>
</inputExpression>
</input>
Expand Down Expand Up @@ -408,7 +408,7 @@ else null</text>
</outputEntry>
<outputEntry id="LiteralExpression_0qcsldu">
<text>"Review Referral Response - "
+ sort(flatten(additionalData.Data.referralCollection[value.referralReplyCollection!=null].value.referralReplyCollection), function(x,y) date and time(x.value.replyDateTime) &gt; date and time(y.value.replyDateTime)).value.referralSubject[1]</text>
+ sort(flatten(additionalData.Data.referralCollection[value.referralReplyCollection!=null].value.referralReplyCollection), function(x,y) date and time(if(x.value.replyDateTime!=null)then x.value.replyDateTime else "2023-01-01T00:00:00.000") &gt; date and time(if(y.value.replyDateTime!=null)then y.value.replyDateTime else "2023-01-01T00:00:00.000")).value.referralSubject[1]</text>
</outputEntry>
<outputEntry id="LiteralExpression_0kmxycv">
<text></text>
Expand Down Expand Up @@ -450,7 +450,7 @@ else null</text>
</outputEntry>
<outputEntry id="LiteralExpression_08j7d7p">
<text>"Review Referral Response - "
+ sort(flatten(additionalData.Data.referralCollection[value.referralReplyCollection!=null].value.referralReplyCollection), function(x,y) date and time(x.value.replyDateTime) &gt; date and time(y.value.replyDateTime)).value.referralSubject[1]</text>
+ sort(flatten(additionalData.Data.referralCollection[value.referralReplyCollection!=null].value.referralReplyCollection), function(x,y) date and time(if(x.value.replyDateTime!=null)then x.value.replyDateTime else "2023-01-01T00:00:00.000") &gt; date and time(if(y.value.replyDateTime!=null)then y.value.replyDateTime else "2023-01-01T00:00:00.000")).value.referralSubject[1]</text>
</outputEntry>
<outputEntry id="LiteralExpression_0zcsqzi">
<text></text>
Expand Down Expand Up @@ -492,7 +492,7 @@ else null</text>
</outputEntry>
<outputEntry id="LiteralExpression_03wz7tv">
<text>"Review Referral Response - "
+ sort(flatten(additionalData.Data.referralCollection[value.referralReplyCollection!=null].value.referralReplyCollection), function(x,y) date and time(x.value.replyDateTime) &gt; date and time(y.value.replyDateTime)).value.referralSubject[1]</text>
+ sort(flatten(additionalData.Data.referralCollection[value.referralReplyCollection!=null].value.referralReplyCollection), function(x,y) date and time(if(x.value.replyDateTime!=null)then x.value.replyDateTime else "2023-01-01T00:00:00.000") &gt; date and time(if(y.value.replyDateTime!=null)then y.value.replyDateTime else "2023-01-01T00:00:00.000")).value.referralSubject[1]</text>
</outputEntry>
<outputEntry id="LiteralExpression_14hvioj">
<text></text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ public static Stream<Arguments> workType_ScenarioProvider() {
Arguments.of("ET3Processing", routineWork),
Arguments.of("ReviewReferralResponseLegalOps", routineWork),
Arguments.of("ReviewReferralResponseAdmin", routineWork),
Arguments.of("ET3Notification", routineWork),
Arguments.of("IssueInitialConsiderationDirections", routineWork),

Arguments.of("ReviewReferralJudiciary", decisionMakingWork),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ public static Stream<Arguments> workType_ScenarioProvider() {
Arguments.of("ET3Processing", routineWork),
Arguments.of("ReviewReferralResponseLegalOps", routineWork),
Arguments.of("ReviewReferralResponseAdmin", routineWork),
Arguments.of("ET3Notification", routineWork),
Arguments.of("IssueInitialConsiderationDirections", routineWork),

Arguments.of("ReviewReferralJudiciary", decisionMakingWork),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ private static Map<String, String> mapExpectedOutput(String taskId, String name,

private static String createApplications(String applicationType, String respondFrom) {
String respondCollection = "";
if (!"".equals(respondFrom)) {
if (!respondFrom.isEmpty()) {
respondCollection = String.format(RESPOND_COLLECTION, applicationType, respondFrom);
}

Expand All @@ -478,7 +478,7 @@ private static String createReferrals(

String replyCollection1 = "";
String replyCollection2 = "";
if (!"".equals(referralDirectionTo)) {
if (!referralDirectionTo.isEmpty()) {
LocalDateTime now = LocalDateTime.now();
String reply1 = String.format(REFERRALREPLY,
referralSubject1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ private static Map<String, String> mapExpectedOutput(String taskId, String name,

private static String createApplications(String applicationType, String respondFrom) {
String respondCollection = "";
if (!"".equals(respondFrom)) {
if (!respondFrom.isEmpty()) {
respondCollection = String.format(RESPOND_COLLECTION, applicationType, respondFrom);
}

Expand All @@ -478,7 +478,7 @@ private static String createReferrals(

String replyCollection1 = "";
String replyCollection2 = "";
if (!"".equals(referralDirectionTo)) {
if (!referralDirectionTo.isEmpty()) {
LocalDateTime now = LocalDateTime.now();
String reply1 = String.format(REFERRALREPLY,
referralSubject1,
Expand Down

0 comments on commit c46459c

Please sign in to comment.