Skip to content

Commit 3ca15ad

Browse files
NIAD-3304: GP2GP Sending Adaptor not preserving legacy read codes on export when mapping allergies (#1137)
* NIAD-3304: GP2GP Sending Adaptor not preserving legacy read codes on export * Add test files for `active` and `resolved` allergies where both snomed and non-snomed codes are provided, with and without text field provided * Update `mapCodeableConceptToCdForAllergy` to provide translations in cases where the code is no an `UNK` null flavor.
1 parent 1964f7f commit 3ca15ad

9 files changed

+214
-0
lines changed

service/src/main/java/uk/nhs/adaptors/gp2gp/ehr/mapper/CodeableConceptCdMapper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ public String mapCodeableConceptToCdForAllergy(
103103

104104
if (ACTIVE_CLINICAL_STATUS.equals(allergyIntoleranceClinicalStatus.toCode())) {
105105
builder.mainCodeSystem(SNOMED_SYSTEM_CODE);
106+
builder.translations(getNonSnomedCodeCodings(codeableConcept));
106107
} else {
107108
builder.nullFlavor(true);
108109
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"resourceType": "AllergyIntolerance",
3+
"id": "0C1232CF-D34B-4C16-A5F4-0F6461C51A41",
4+
"meta": {
5+
"profile": [
6+
"https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-AllergyIntolerance-1"
7+
]
8+
},
9+
"identifier": [
10+
{
11+
"system": "https://EMISWeb/A82038",
12+
"value": "55D2363D57A248F49A745B2E03F5E93D0C1232CFD34B4C16A5F40F6461C51A41"
13+
}
14+
],
15+
"clinicalStatus": "resolved",
16+
"verificationStatus": "unconfirmed",
17+
"category": [ "medication" ],
18+
"code": {
19+
"coding": [
20+
{
21+
"system": "http://snomed.info/sct",
22+
"code": "292971006",
23+
"display": "Pivampicillin adverse reaction pt"
24+
},
25+
{
26+
"system": "http://read.info/readv2",
27+
"code": "TJ00800",
28+
"display": "Adverse reaction to pivampicillin pt"
29+
},
30+
{
31+
"system": "http://read.info/ctv3",
32+
"code": "TJ00800-1",
33+
"display": "Adverse reaction to pivampicillin"
34+
}
35+
]
36+
},
37+
"patient": {
38+
"reference": "Patient/55D2363D-57A2-48F4-9A74-5B2E03F5E93D"
39+
},
40+
"assertedDate": "2019-01-28T13:43:36.107+00:00",
41+
"recorder": {
42+
"reference": "Practitioner/2DB481A3-306A-4133-9491-1558161D6A2B"
43+
},
44+
"note": [
45+
{
46+
"text": "allergy with no date recorded"
47+
}
48+
]
49+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<code code="292971006" codeSystem="2.16.840.1.113883.2.1.3.2.4.15" displayName="Pivampicillin adverse reaction pt">
2+
<translation code="TJ00800" codeSystem="2.16.840.1.113883.2.1.6.2" displayName="Adverse reaction to pivampicillin pt" />
3+
<translation code="TJ00800-1" codeSystem="2.16.840.1.113883.2.1.3.2.4.14" displayName="Adverse reaction to pivampicillin" />
4+
</code>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"resourceType": "AllergyIntolerance",
3+
"id": "0C1232CF-D34B-4C16-A5F4-0F6461C51A41",
4+
"meta": {
5+
"profile": [
6+
"https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-AllergyIntolerance-1"
7+
]
8+
},
9+
"identifier": [
10+
{
11+
"system": "https://EMISWeb/A82038",
12+
"value": "55D2363D57A248F49A745B2E03F5E93D0C1232CFD34B4C16A5F40F6461C51A41"
13+
}
14+
],
15+
"clinicalStatus": "resolved",
16+
"verificationStatus": "unconfirmed",
17+
"category": [ "medication" ],
18+
"code": {
19+
"coding": [
20+
{
21+
"system": "http://snomed.info/sct",
22+
"code": "292971006",
23+
"display": "Pivampicillin adverse reaction pt"
24+
},
25+
{
26+
"system": "http://read.info/readv2",
27+
"code": "TJ00800",
28+
"display": "Adverse reaction to pivampicillin pt"
29+
},
30+
{
31+
"system": "http://read.info/ctv3",
32+
"code": "TJ00800-1",
33+
"display": "Adverse reaction to pivampicillin"
34+
}
35+
],
36+
"text": "Pivampicillin adverse reaction (rt)"
37+
},
38+
"patient": {
39+
"reference": "Patient/55D2363D-57A2-48F4-9A74-5B2E03F5E93D"
40+
},
41+
"assertedDate": "2019-01-28T13:43:36.107+00:00",
42+
"recorder": {
43+
"reference": "Practitioner/2DB481A3-306A-4133-9491-1558161D6A2B"
44+
},
45+
"note": [
46+
{
47+
"text": "allergy with no date recorded"
48+
}
49+
]
50+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<code code="292971006" codeSystem="2.16.840.1.113883.2.1.3.2.4.15" displayName="Pivampicillin adverse reaction pt">
2+
<translation code="TJ00800" codeSystem="2.16.840.1.113883.2.1.6.2" displayName="Adverse reaction to pivampicillin pt" />
3+
<translation code="TJ00800-1" codeSystem="2.16.840.1.113883.2.1.3.2.4.14" displayName="Adverse reaction to pivampicillin" />
4+
<originalText>Pivampicillin adverse reaction (rt)</originalText>
5+
</code>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"resourceType": "AllergyIntolerance",
3+
"id": "0C1232CF-D34B-4C16-A5F4-0F6461C51A41",
4+
"meta": {
5+
"profile": [
6+
"https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-AllergyIntolerance-1"
7+
]
8+
},
9+
"identifier": [
10+
{
11+
"system": "https://EMISWeb/A82038",
12+
"value": "55D2363D57A248F49A745B2E03F5E93D0C1232CFD34B4C16A5F40F6461C51A41"
13+
}
14+
],
15+
"clinicalStatus": "resolved",
16+
"verificationStatus": "unconfirmed",
17+
"category": [ "medication" ],
18+
"code": {
19+
"coding": [
20+
{
21+
"system": "http://snomed.info/sct",
22+
"code": "292971006",
23+
"display": "Pivampicillin adverse reaction pt"
24+
},
25+
{
26+
"system": "http://read.info/readv2",
27+
"code": "TJ00800",
28+
"display": "Adverse reaction to pivampicillin rt"
29+
},
30+
{
31+
"system": "http://read.info/ctv",
32+
"code": "TJ00800-1",
33+
"display": "Adverse reaction to pivampicillin"
34+
}
35+
]
36+
},
37+
"patient": {
38+
"reference": "Patient/55D2363D-57A2-48F4-9A74-5B2E03F5E93D"
39+
},
40+
"assertedDate": "2019-01-28T13:43:36.107+00:00",
41+
"recorder": {
42+
"reference": "Practitioner/2DB481A3-306A-4133-9491-1558161D6A2B"
43+
},
44+
"note": [
45+
{
46+
"text": "allergy with no date recorded"
47+
}
48+
]
49+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<code nullFlavor="UNK">
2+
<originalText>Pivampicillin adverse reaction pt</originalText>
3+
</code>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"resourceType": "AllergyIntolerance",
3+
"id": "0C1232CF-D34B-4C16-A5F4-0F6461C51A41",
4+
"meta": {
5+
"profile": [
6+
"https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-AllergyIntolerance-1"
7+
]
8+
},
9+
"identifier": [
10+
{
11+
"system": "https://EMISWeb/A82038",
12+
"value": "55D2363D57A248F49A745B2E03F5E93D0C1232CFD34B4C16A5F40F6461C51A41"
13+
}
14+
],
15+
"clinicalStatus": "resolved",
16+
"verificationStatus": "unconfirmed",
17+
"category": [ "medication" ],
18+
"code": {
19+
"coding": [
20+
{
21+
"system": "http://snomed.info/sct",
22+
"code": "292971006",
23+
"display": "Pivampicillin adverse reaction pt"
24+
},
25+
{
26+
"system": "http://read.info/readv2",
27+
"code": "TJ00800",
28+
"display": "Adverse reaction to pivampicillin pt"
29+
},
30+
{
31+
"system": "http://read.info/ctv",
32+
"code": "TJ00800-1",
33+
"display": "Adverse reaction to pivampicillin (rt)"
34+
}
35+
],
36+
"text": "Pivampicillin adverse reaction (rt)"
37+
},
38+
"patient": {
39+
"reference": "Patient/55D2363D-57A2-48F4-9A74-5B2E03F5E93D"
40+
},
41+
"assertedDate": "2019-01-28T13:43:36.107+00:00",
42+
"recorder": {
43+
"reference": "Practitioner/2DB481A3-306A-4133-9491-1558161D6A2B"
44+
},
45+
"note": [
46+
{
47+
"text": "allergy with no date recorded"
48+
}
49+
]
50+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<code nullFlavor="UNK">
2+
<originalText>Pivampicillin adverse reaction (rt)</originalText>
3+
</code>

0 commit comments

Comments
 (0)