use of org.hl7.fhir.r4.model.FamilyMemberHistory in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeFamilyMemberHistory.
protected void composeFamilyMemberHistory(Complex parent, String parentType, String name, FamilyMemberHistory element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "FamilyMemberHistory", name, element, index);
for (int i = 0; i < element.getIdentifier().size(); i++) composeIdentifier(t, "FamilyMemberHistory", "identifier", element.getIdentifier().get(i), i);
for (int i = 0; i < element.getInstantiatesCanonical().size(); i++) composeCanonical(t, "FamilyMemberHistory", "instantiatesCanonical", element.getInstantiatesCanonical().get(i), i);
for (int i = 0; i < element.getInstantiatesUri().size(); i++) composeUri(t, "FamilyMemberHistory", "instantiatesUri", element.getInstantiatesUri().get(i), i);
if (element.hasStatusElement())
composeEnum(t, "FamilyMemberHistory", "status", element.getStatusElement(), -1);
if (element.hasDataAbsentReason())
composeCodeableConcept(t, "FamilyMemberHistory", "dataAbsentReason", element.getDataAbsentReason(), -1);
if (element.hasPatient())
composeReference(t, "FamilyMemberHistory", "patient", element.getPatient(), -1);
if (element.hasDateElement())
composeDateTime(t, "FamilyMemberHistory", "date", element.getDateElement(), -1);
if (element.hasNameElement())
composeString(t, "FamilyMemberHistory", "name", element.getNameElement(), -1);
if (element.hasRelationship())
composeCodeableConcept(t, "FamilyMemberHistory", "relationship", element.getRelationship(), -1);
if (element.hasSex())
composeCodeableConcept(t, "FamilyMemberHistory", "sex", element.getSex(), -1);
if (element.hasBorn())
composeType(t, "FamilyMemberHistory", "born", element.getBorn(), -1);
if (element.hasAge())
composeType(t, "FamilyMemberHistory", "age", element.getAge(), -1);
if (element.hasEstimatedAgeElement())
composeBoolean(t, "FamilyMemberHistory", "estimatedAge", element.getEstimatedAgeElement(), -1);
if (element.hasDeceased())
composeType(t, "FamilyMemberHistory", "deceased", element.getDeceased(), -1);
for (int i = 0; i < element.getReasonCode().size(); i++) composeCodeableConcept(t, "FamilyMemberHistory", "reasonCode", element.getReasonCode().get(i), i);
for (int i = 0; i < element.getReasonReference().size(); i++) composeReference(t, "FamilyMemberHistory", "reasonReference", element.getReasonReference().get(i), i);
for (int i = 0; i < element.getNote().size(); i++) composeAnnotation(t, "FamilyMemberHistory", "note", element.getNote().get(i), i);
for (int i = 0; i < element.getCondition().size(); i++) composeFamilyMemberHistoryFamilyMemberHistoryConditionComponent(t, "FamilyMemberHistory", "condition", element.getCondition().get(i), i);
}
use of org.hl7.fhir.r4.model.FamilyMemberHistory in project elexis-server by elexis.
the class FamilyMemberHistoryTest method createFamilyMemberHistory.
@Test
public void createFamilyMemberHistory() {
FamilyMemberHistory familyMemberHistory = new FamilyMemberHistory();
Narrative narrative = new Narrative();
String divEncodedText = "Test\nText".replaceAll("(\r\n|\r|\n)", "<br />");
narrative.setDivAsString(divEncodedText);
familyMemberHistory.setText(narrative);
MethodOutcome outcome = client.create().resource(familyMemberHistory).execute();
assertNotNull(outcome);
assertTrue(outcome.getCreated());
assertNotNull(outcome.getId());
FamilyMemberHistory readFamilyMemberHistory = client.read().resource(FamilyMemberHistory.class).withId(outcome.getId()).execute();
assertNotNull(readFamilyMemberHistory);
assertEquals(outcome.getId().getIdPart(), readFamilyMemberHistory.getIdElement().getIdPart());
}
use of org.hl7.fhir.r4.model.FamilyMemberHistory in project elexis-server by elexis.
the class FamilyMemberHistoryResourceProvider method findFamilyMemberHistory.
@Search()
public List<FamilyMemberHistory> findFamilyMemberHistory(@RequiredParam(name = FamilyMemberHistory.SP_PATIENT) IdType patientId) {
if (patientId != null && !patientId.isEmpty()) {
Optional<IPatient> patient = modelService.load(patientId.getIdPart(), IPatient.class);
if (patient.isPresent()) {
if (patient.get().isPatient()) {
List<FamilyMemberHistory> ret = new ArrayList<>();
List<IFamilyMemberHistory> findings = findingsService.getPatientsFindings(patientId.getIdPart(), IFamilyMemberHistory.class);
if (findings != null && !findings.isEmpty()) {
for (IFamilyMemberHistory iFinding : findings) {
Optional<FamilyMemberHistory> fhirFamilyMemberHistory = getTransformer().getFhirObject(iFinding);
if (fhirFamilyMemberHistory.isPresent()) {
ret.add(fhirFamilyMemberHistory.get());
}
}
}
return ret;
}
}
}
return Collections.emptyList();
}
use of org.hl7.fhir.r4.model.FamilyMemberHistory in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeFamilyMemberHistoryFamilyMemberHistoryConditionComponent.
protected void composeFamilyMemberHistoryFamilyMemberHistoryConditionComponent(Complex parent, String parentType, String name, FamilyMemberHistory.FamilyMemberHistoryConditionComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "condition", name, element, index);
if (element.hasCode())
composeCodeableConcept(t, "FamilyMemberHistory", "code", element.getCode(), -1);
if (element.hasOutcome())
composeCodeableConcept(t, "FamilyMemberHistory", "outcome", element.getOutcome(), -1);
if (element.hasOnset())
composeType(t, "FamilyMemberHistory", "onset", element.getOnset(), -1);
for (int i = 0; i < element.getNote().size(); i++) composeAnnotation(t, "FamilyMemberHistory", "note", element.getNote().get(i), i);
}
use of org.hl7.fhir.r4.model.FamilyMemberHistory in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeFamilyMemberHistoryFamilyMemberHistoryConditionComponent.
protected void composeFamilyMemberHistoryFamilyMemberHistoryConditionComponent(Complex parent, String parentType, String name, FamilyMemberHistory.FamilyMemberHistoryConditionComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "condition", name, element, index);
if (element.hasCode())
composeCodeableConcept(t, "FamilyMemberHistory", "code", element.getCode(), -1);
if (element.hasOutcome())
composeCodeableConcept(t, "FamilyMemberHistory", "outcome", element.getOutcome(), -1);
if (element.hasContributedToDeathElement())
composeBoolean(t, "FamilyMemberHistory", "contributedToDeath", element.getContributedToDeathElement(), -1);
if (element.hasOnset())
composeType(t, "FamilyMemberHistory", "onset", element.getOnset(), -1);
for (int i = 0; i < element.getNote().size(); i++) composeAnnotation(t, "FamilyMemberHistory", "note", element.getNote().get(i), i);
}
Aggregations