use of org.hl7.fhir.r4.model.Observation.ObservationStatus.FINAL in project pathling by aehrc.
the class BatchProvider method batch.
@Transaction
@OperationAccess("batch")
public Bundle batch(@Nullable @TransactionParam final Bundle bundle) {
checkUserInput(bundle != null, "Bundle must be provided");
final Map<ResourceType, List<IBaseResource>> resourcesForUpdate = new EnumMap<>(ResourceType.class);
final Bundle response = new Bundle();
response.setType(BATCHRESPONSE);
// the responses should these operations be successful.
for (final Bundle.BundleEntryComponent entry : bundle.getEntry()) {
processEntry(resourcesForUpdate, response, entry);
}
if (!resourcesForUpdate.isEmpty()) {
// Merge in any updated resources into their respective tables.
update(resourcesForUpdate);
}
return response;
}
use of org.hl7.fhir.r4.model.Observation.ObservationStatus.FINAL in project pathling by aehrc.
the class BatchProvider method addResponse.
private void addResponse(@Nonnull final Bundle response, @Nonnull final IBaseResource preparedResource) {
final BundleEntryComponent responseEntry = response.addEntry();
final BundleEntryResponseComponent responseElement = new BundleEntryResponseComponent();
responseElement.setStatus("200");
responseEntry.setResponse(responseElement);
responseEntry.setResource((Resource) preparedResource);
}
use of org.hl7.fhir.r4.model.Observation.ObservationStatus.FINAL in project pathling by aehrc.
the class TestData method newQuestionnaire.
/**
* Returns a FHIR Questionnaire resource for testing purposes.
*/
public static Questionnaire newQuestionnaire() {
final Questionnaire questionnaire = new Questionnaire();
questionnaire.setId("Questionnaire/1");
final QuestionnaireItemComponent item = questionnaire.addItem();
item.addEnableWhen().setAnswer(new DecimalType(TEST_VERY_SMALL_DECIMAL_SCALE_6));
item.addInitial().setValue(new DecimalType(TEST_VERY_BIG_DECIMAL));
// This nested item will be discarded on import, as we currently skip recursive elements.
final QuestionnaireItemComponent nestedItem = item.addItem();
nestedItem.addInitial().setValue(new DecimalType(TEST_SMALL_DECIMAL));
return questionnaire;
}
use of org.hl7.fhir.r4.model.Observation.ObservationStatus.FINAL in project pathling by aehrc.
the class TestData method newCondition.
/**
* Returns a FHIR Condition for testing purposes.
*/
public static Condition newCondition() {
final Condition condition = new Condition();
// Condition based on example from FHIR:
// https://www.hl7.org/fhir/condition-example.json.html
condition.setId("example");
condition.setLanguage("en_US");
// Narrative text
final Narrative narrative = new Narrative();
narrative.setStatusAsString("generated");
narrative.setDivAsString("This data was generated for test purposes.");
final XhtmlNode node = new XhtmlNode();
node.setNodeType(NodeType.Text);
node.setValue("Severe burn of left ear (Date: 24-May 2012)");
condition.setText(narrative);
condition.setSubject(new Reference("Patient/example").setDisplay("Here is a display for you."));
final CodeableConcept verificationStatus = new CodeableConcept();
verificationStatus.addCoding(new Coding(ConditionVerStatus.CONFIRMED.getSystem(), ConditionVerStatus.CONFIRMED.toCode(), ConditionVerStatus.CONFIRMED.getDisplay()));
condition.setVerificationStatus(verificationStatus);
// Condition code
final CodeableConcept code = new CodeableConcept();
code.addCoding().setSystem("http://snomed.info/sct").setCode("39065001").setDisplay("Severe");
condition.setSeverity(code);
// Severity code
final CodeableConcept severity = new CodeableConcept();
severity.addCoding().setSystem("http://snomed.info/sct").setCode("24484000").setDisplay("Burn of ear").setUserSelected(true);
condition.setSeverity(severity);
// Onset date time
final DateTimeType onset = new DateTimeType();
onset.setValueAsString("2012-05-24");
condition.setOnset(onset);
return condition;
}
use of org.hl7.fhir.r4.model.Observation.ObservationStatus.FINAL in project pathling by aehrc.
the class TestData method newConditionWithExtensions.
public static Condition newConditionWithExtensions() {
// Condition
// - extension:
// - url: uuid:ext1
// - value: ext1
// - extension:
// - url: uuid:ext2
// - value: 2
// - extension:
// - url: uuid:ext4
// - extension
// - url: uuid:nested
// - value: nested
// - identifier
// - id: uuid:identifier1
// - extension:
// - url: uuid:ext10
// - value: ext10
// - extension:
// - url: uuid:ext11
// - value: 11
// - stage
// - type
// - extension
// - url: uuid:ext12
// - value: ext12
final Condition conditionWithExtension = new Condition();
conditionWithExtension.setId("someId");
final Extension nestedExtension = new Extension("uuid:ext4");
nestedExtension.addExtension(new Extension("uuid:nested", new StringType("nested")));
conditionWithExtension.setExtension(Arrays.asList(new Extension("uuid:ext1", new StringType("ext1")), new Extension("uuid:ext2", new IntegerType(2)), nestedExtension));
conditionWithExtension.setMeta(new Meta().setVersionId("MetVersion"));
conditionWithExtension.setOnset(new Range());
conditionWithExtension.setSeverity(new CodeableConcept().addCoding(new Coding("sys", "code", "name")));
final Identifier identifier = conditionWithExtension.getIdentifierFirstRep();
identifier.setId("uuid:identifier1");
identifier.setExtension(Arrays.asList(new Extension("uuid:ext10", new StringType("ext10")), new Extension("uuid:ext11", new IntegerType(11))));
final ConditionStageComponent stage = conditionWithExtension.getStageFirstRep();
stage.getType().setExtension(Collections.singletonList(new Extension("uuid:ext12", new StringType("ext12"))));
return conditionWithExtension;
}
Aggregations