|
6 | 6 | "RuleName": "8.Transform.UpdatedRecordExcludedAndDMS", |
7 | 7 | "LocalParams": [ |
8 | 8 | { |
9 | | - "Name": "IsPrimaryCareProviderNullOnUpdatedParticipant", |
10 | | - "Expression": "participant.PrimaryCareProvider == null" |
| 9 | + "Name": "DMSInSMU", |
| 10 | + "Expression": "participant.CurrentPosting == \"DMS\" && excludedSMUList.Contains(participant.PrimaryCareProvider)" |
11 | 11 | }, |
12 | 12 | { |
13 | | - "Name": "IsPrimaryCareProviderNullDatabaseParticipant", |
14 | | - "Expression": "databaseParticipant.PrimaryCareProvider == null" |
| 13 | + "Name": "WelshCurrentPosting", |
| 14 | + "Expression": "dbLookup.RetrievePostingCategory(participant.CurrentPosting) == \"WALES\"" |
15 | 15 | }, |
16 | 16 | { |
17 | | - "Name": "IsNewRecordInSMU", |
18 | | - "Expression": "participant.CurrentPosting == \"DMS\" && (IsPrimaryCareProviderNullOnUpdatedParticipant ? false : !excludedSMUList.Contains(participant.PrimaryCareProvider)) || new string[] { \"English\", \"NHAIS\", \"Cipher\", \"ENG\", \"IM\" }.Contains(participant.CurrentPosting)" |
19 | | - }, |
20 | | - { |
21 | | - "Name": "IsOldRecordInSMU", |
22 | | - "Expression": "databaseParticipant.CurrentPosting == \"DMS\" && (IsPrimaryCareProviderNullDatabaseParticipant ? false : excludedSMUList.Contains(databaseParticipant.PrimaryCareProvider)) || new string[] { \"Welsh\", \"NHAIS\", \"Cipher\", \"CYM\" }.Contains(databaseParticipant.CurrentPosting)" |
| 17 | + "Name": "NoTransformationRequired", |
| 18 | + "Expression": "existingParticipant.PrimaryCareProvider == null && existingParticipant.ReasonForRemoval == \"ORR\"" |
23 | 19 | } |
24 | 20 | ], |
25 | | - "Expression": "participant.RecordType == Actions.Amended && IsNewRecordInSMU && IsOldRecordInSMU", |
| 21 | + "Expression": "participant.RecordType == Actions.Amended && (DMSInSMU || WelshCurrentPosting) && !NoTransformationRequired", |
26 | 22 | "Actions": { |
27 | 23 | "OnSuccess": { |
28 | 24 | "Name": "TransformAction", |
|
48 | 44 | } |
49 | 45 | } |
50 | 46 | }, |
| 47 | + { |
| 48 | + "RuleName": "8a.Transform.NoTransformButError", |
| 49 | + "LocalParams": [ |
| 50 | + { |
| 51 | + "Name": "DMSInSMU", |
| 52 | + "Expression": "participant.CurrentPosting == \"DMS\" && excludedSMUList.Contains(participant.PrimaryCareProvider)" |
| 53 | + }, |
| 54 | + { |
| 55 | + "Name": "WelshCurrentPosting", |
| 56 | + "Expression": "dbLookup.RetrievePostingCategory(participant.CurrentPosting) == \"WALES\"" |
| 57 | + },{ |
| 58 | + "Name": "NoTransformationRequired", |
| 59 | + "Expression": "existingParticipant.PrimaryCareProvider == null && existingParticipant.ReasonForRemoval == \"ORR\"" |
| 60 | + } |
| 61 | + ], |
| 62 | + "Expression": "participant.RecordType == Actions.Amended && (DMSInSMU || WelshCurrentPosting) && NoTransformationRequired", |
| 63 | + "Actions": { |
| 64 | + "OnSuccess": { |
| 65 | + "Name": "TransformAction", |
| 66 | + "Context": { |
| 67 | + "transformFields": [ |
| 68 | + { |
| 69 | + "isExpression": false, |
| 70 | + "field": "PrimaryCareProvider", |
| 71 | + "value": null |
| 72 | + } |
| 73 | + ] |
| 74 | + } |
| 75 | + } |
| 76 | + } |
| 77 | + }, |
51 | 78 | { |
52 | 79 | "RuleName": "00.Other.InvalidFlag.TrueAndNoPrimaryCareProvider", |
53 | 80 | "Expression": "(!string.IsNullOrEmpty(participant.PrimaryCareProvider) && participant.InvalidFlag == \"1\") OR participant.RecordType == Actions.Removed", |
|
0 commit comments