Add additionalContext and error

This commit is contained in:
dotasek 2023-04-28 16:49:56 -04:00
parent 6a0efdfe0b
commit c28a100f02
2 changed files with 40 additions and 2 deletions

View File

@ -1,6 +1,7 @@
package org.hl7.fhir.convertors.conv43_50.resources43_50;
import org.hl7.fhir.convertors.context.ConversionContext43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Canonical43_50;
import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Instant43_50;
@ -39,6 +40,11 @@ public class SubscriptionStatus43_50 {
if (src.hasTopic()) {
tgt.setTopicElement(Canonical43_50.convertCanonical(src.getTopicElement()));
}
if (src.hasError()) {
for (org.hl7.fhir.r5.model.CodeableConcept srcError : src.getError()) {
tgt.addError(CodeableConcept43_50.convertCodeableConcept(srcError));
}
}
return tgt;
}
@ -53,6 +59,11 @@ public class SubscriptionStatus43_50 {
if (src.hasFocus()) {
tgt.setFocus(Reference43_50.convertReference(src.getFocus()));
}
if (src.hasAdditionalContext()) {
for (org.hl7.fhir.r5.model.Reference ref : src.getAdditionalContext()) {
tgt.addAdditionalContext(Reference43_50.convertReference(ref));
}
}
return tgt;
}
@ -113,6 +124,11 @@ public class SubscriptionStatus43_50 {
if (src.hasTopic()) {
tgt.setTopicElement(Canonical43_50.convertCanonical(src.getTopicElement()));
}
if (src.hasError()) {
for (org.hl7.fhir.r4b.model.CodeableConcept srcError : src.getError()) {
tgt.addError(CodeableConcept43_50.convertCodeableConcept(srcError));
}
}
return tgt;
}
@ -127,6 +143,11 @@ public class SubscriptionStatus43_50 {
if (src.hasFocus()) {
tgt.setFocus(Reference43_50.convertReference(src.getFocus()));
}
if (src.hasAdditionalContext()) {
for (org.hl7.fhir.r4b.model.Reference ref : src.getAdditionalContext()) {
tgt.addAdditionalContext(Reference43_50.convertReference(ref));
}
}
return tgt;
}

View File

@ -10,10 +10,27 @@
"eventsSinceSubscriptionStart" : "1000",
"notificationEvent" : [{
"eventNumber" : "1000",
"timestamp" : "2022-02-10T15:12:28-05:00"
"timestamp" : "2022-02-10T15:12:28-05:00",
"additionalContext": [
{
"reference": "http://example.org/FHIR/R5/Patient/ABC"
}
]
}],
"subscription" : {
"reference" : "http://example.org/FHIR/R5/Subscription/123"
},
"topic" : "http://example.org/FHIR/R5/SubscriptionTopic/admission"
"topic" : "http://example.org/FHIR/R5/SubscriptionTopic/admission",
"error": [
{
"code": {
"coding": [
{
"code": "no-response ",
"system": "http://terminology.hl7.org/CodeSystem/subscription-error"
}
]
}
}
]
}