use of org.hl7.fhir.r4.model.Encounter.EncounterStatus.UNKNOWN in project odm2fhir by num-codex.
the class MalignantNeoplasticDiseases method createCondition.
private Condition createCondition(ItemData generalCoding, ItemData answerCoding) {
var condition = (Condition) new Condition().addIdentifier(createIdentifier(CONDITION, generalCoding)).setRecordedDateElement(// TODO Set actual DateTime value
UNKNOWN_DATE_TIME).addCategory(createCodeableConcept(createCoding(SNOMED_CT, "394593009", "Medical oncology (qualifier value)"))).setMeta(createMeta(MALIGNANT_NEOPLASTIC_DISEASE));
for (var coding : createCodings(answerCoding)) {
switch(coding.getCode()) {
case "active":
case "remission":
condition.setClinicalStatus(ACTIVE).setVerificationStatus(CONFIRMED);
break;
case "410594000":
condition.setVerificationStatus(REFUTED);
break;
default:
case "261665006":
condition.addModifierExtension(DATA_PRESENCE_UNKNOWN);
break;
// already caught by case "261665006"
case "unknown":
}
}
var codeableConcept = createCodeableConcept(generalCoding);
return codeableConcept.isEmpty() ? new Condition() : condition.setCode(codeableConcept);
}
use of org.hl7.fhir.r4.model.Encounter.EncounterStatus.UNKNOWN in project odm2fhir by num-codex.
the class SOFAScore method createObservation.
private Observation createObservation(List<ItemData> itemDatas, ItemData sofaTotalScore, ItemData dateCoding) {
var observation = (Observation) new Observation().addIdentifier(createIdentifier(OBSERVATION, sofaTotalScore).setType(OBI).setAssigner(getOrganizationReference())).setStatus(FINAL).setEffective(createDateTimeType(dateCoding)).addCategory(SURVEY).setCode(createCodeableConcept(createCoding(ECRF_PARAMETER_CODES, "06", "SOFA-Score")).setText("Sepsis-related organ failure assessment score")).setMeta(createMeta(NUMStructureDefinition.SOFA_SCORE));
itemDatas.stream().map(ItemData::getValue).filter(StringUtils::isNotBlank).forEach(code -> observation.addComponent(new ObservationComponentComponent().setCode(createCodeableConcept(createCoding(SOFA_SCORE, chop(code), getDisplay(chop(code)))).setText(getDefinition(chop(code)))).setValue(createCodeableConcept(createCoding(SOFA_SCORE, code, getDisplay(code))).setText(getDefinition(code)))));
if (sofaTotalScore.isEmpty()) {
observation.setDataAbsentReason(UNKNOWN);
} else {
observation.setValue(new IntegerType().setValue(Integer.valueOf(sofaTotalScore.getValue())));
}
return observation;
}
use of org.hl7.fhir.r4.model.Encounter.EncounterStatus.UNKNOWN in project pathling by aehrc.
the class TerminologyServiceIntegrationTest method testCorrectlyBuildsClosureKnownAndUnknownSystems.
@Test
void testCorrectlyBuildsClosureKnownAndUnknownSystems() {
when(mockUUIDFactory.nextUUID()).thenReturn(UUID.fromString("5d1b976d-c50c-445a-8030-64074b83f355"));
final Relation actualRelation = terminologyService.getSubsumesRelation(setOfSimpleFrom(CD_SNOMED_107963000, CD_SNOMED_VER_63816008, CD_SNOMED_72940011000036107, CD_AST_VIC, new Coding("uuid:unknown", "unknown", "Unknown")));
// It appears that in the response all codings are versioned regardless
// of whether the version was present in the request
final Relation expectedRelation = RelationBuilder.empty().add(CD_SNOMED_VER_107963000, CD_SNOMED_VER_63816008).build();
assertEquals(expectedRelation, actualRelation);
}
use of org.hl7.fhir.r4.model.Encounter.EncounterStatus.UNKNOWN in project eCRNow by drajer-health.
the class CdaEicrGeneratorTest method getPatientData.
public Patient getPatientData() {
Patient p = new Patient();
p.setId("5474974");
Extension ext1 = new Extension();
ext1.setUrl("http://hl7.org/fhir/us/core/StructureDefinition/us-core-race");
Extension subext1 = new Extension();
subext1.setUrl("ombCategory");
Coding st1 = new Coding();
st1.setSystem("http://hl7.org/fhir/v3/NullFlavor");
st1.setCode("UNK");
st1.setDisplay("Unknown");
Type tp1 = (Type) st1;
subext1.setValue(tp1);
ext1.addExtension(subext1);
Extension ext = new Extension();
ext.setUrl("http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity");
Extension subext = new Extension();
subext.setUrl("text");
StringType st = new StringType("Unavailable");
Type tp = (Type) st;
subext.setValue(tp);
ext.addExtension(subext);
p.addExtension(ext1);
p.addExtension(ext);
return p;
}
use of org.hl7.fhir.r4.model.Encounter.EncounterStatus.UNKNOWN in project CRD by HL7-DaVinci.
the class CdsConnectFileStore method processFhirFiles.
private void processFhirFiles(List<CdsConnectFile> files, String topic) {
// process the fhir resource files
// setup the proper FHIR Context for the version of FHIR we are dealing with
FhirContext r4ctx = new org.hl7.davinci.r4.FhirComponents().getFhirContext();
IParser r4parser = r4ctx.newJsonParser();
// suppress the unknown element warnings
r4parser.setParserErrorHandler(new SuppressParserErrorHandler());
// process all of the files found within the topic/artifact
for (CdsConnectFile file : files) {
String path = file.getPath();
String filename = file.getFilename();
if (filename.endsWith(".json")) {
logger.info(" process: FHIR Resource: " + filename);
String[] parts = filename.split("-");
if (parts.length > 2) {
// String resourceType = parts[0];
String fhirVersion = parts[1];
String name = parts[2];
IBaseResource baseResource = null;
byte[] fileContents = file.getCqlBundle();
if (fhirVersion.equalsIgnoreCase("R4")) {
baseResource = r4parser.parseResource(new ByteArrayInputStream(fileContents));
}
processFhirResource(baseResource, path, filename, fhirVersion, topic);
}
}
}
}
Aggregations