use of org.hl7.fhir.r4.model.Enumerations.AdministrativeGender in project org.hl7.fhir.core by hapifhir.
the class FamilyMemberHistory method setProperty.
@Override
public void setProperty(String name, Base value) throws FHIRException {
if (name.equals("identifier"))
this.getIdentifier().add(castToIdentifier(value));
else if (name.equals("patient"))
// Reference
this.patient = castToReference(value);
else if (name.equals("date"))
// DateTimeType
this.date = castToDateTime(value);
else if (name.equals("status"))
// Enumeration<FamilyHistoryStatus>
this.status = new FamilyHistoryStatusEnumFactory().fromType(value);
else if (name.equals("name"))
// StringType
this.name = castToString(value);
else if (name.equals("relationship"))
// CodeableConcept
this.relationship = castToCodeableConcept(value);
else if (name.equals("gender"))
// Enumeration<AdministrativeGender>
this.gender = new AdministrativeGenderEnumFactory().fromType(value);
else if (name.equals("born[x]"))
// Type
this.born = (Type) value;
else if (name.equals("age[x]"))
// Type
this.age = (Type) value;
else if (name.equals("deceased[x]"))
// Type
this.deceased = (Type) value;
else if (name.equals("note"))
// Annotation
this.note = castToAnnotation(value);
else if (name.equals("condition"))
this.getCondition().add((FamilyMemberHistoryConditionComponent) value);
else
super.setProperty(name, value);
}
use of org.hl7.fhir.r4.model.Enumerations.AdministrativeGender in project org.hl7.fhir.core by hapifhir.
the class FamilyMemberHistory method setProperty.
@Override
public Base setProperty(String name, Base value) throws FHIRException {
if (name.equals("identifier")) {
this.getIdentifier().add(castToIdentifier(value));
} else if (name.equals("definition")) {
this.getDefinition().add(castToReference(value));
} else if (name.equals("status")) {
value = new FamilyHistoryStatusEnumFactory().fromType(castToCode(value));
// Enumeration<FamilyHistoryStatus>
this.status = (Enumeration) value;
} else if (name.equals("notDone")) {
// BooleanType
this.notDone = castToBoolean(value);
} else if (name.equals("notDoneReason")) {
// CodeableConcept
this.notDoneReason = castToCodeableConcept(value);
} else if (name.equals("patient")) {
// Reference
this.patient = castToReference(value);
} else if (name.equals("date")) {
// DateTimeType
this.date = castToDateTime(value);
} else if (name.equals("name")) {
// StringType
this.name = castToString(value);
} else if (name.equals("relationship")) {
// CodeableConcept
this.relationship = castToCodeableConcept(value);
} else if (name.equals("gender")) {
value = new AdministrativeGenderEnumFactory().fromType(castToCode(value));
// Enumeration<AdministrativeGender>
this.gender = (Enumeration) value;
} else if (name.equals("born[x]")) {
// Type
this.born = castToType(value);
} else if (name.equals("age[x]")) {
// Type
this.age = castToType(value);
} else if (name.equals("estimatedAge")) {
// BooleanType
this.estimatedAge = castToBoolean(value);
} else if (name.equals("deceased[x]")) {
// Type
this.deceased = castToType(value);
} else if (name.equals("reasonCode")) {
this.getReasonCode().add(castToCodeableConcept(value));
} else if (name.equals("reasonReference")) {
this.getReasonReference().add(castToReference(value));
} else if (name.equals("note")) {
this.getNote().add(castToAnnotation(value));
} else if (name.equals("condition")) {
this.getCondition().add((FamilyMemberHistoryConditionComponent) value);
} else
return super.setProperty(name, value);
return value;
}
use of org.hl7.fhir.r4.model.Enumerations.AdministrativeGender in project gpconnect-demonstrator by nhsconnect.
the class PatientResourceProvider method valiateGender.
private void valiateGender(Patient patient) {
AdministrativeGender gender = patient.getGender();
if (gender != null) {
EnumSet<AdministrativeGender> genderList = EnumSet.allOf(AdministrativeGender.class);
Boolean valid = false;
for (AdministrativeGender genderItem : genderList) {
if (genderItem.toCode().equalsIgnoreCase(gender.toString())) {
valid = true;
break;
}
}
if (!valid) {
throw OperationOutcomeFactory.buildOperationOutcomeException(new InvalidRequestException(String.format("The supplied Patient gender %s is an unrecognised type.", gender)), SystemCode.BAD_REQUEST, IssueType.INVALID);
}
}
}
use of org.hl7.fhir.r4.model.Enumerations.AdministrativeGender in project gpconnect-demonstrator by nhsconnect.
the class PatientResourceProvider method validateGender.
// validateTelecomAndAddress
private void validateGender(Patient patient) {
AdministrativeGender gender = patient.getGender();
if (gender != null) {
EnumSet<AdministrativeGender> genderList = EnumSet.allOf(AdministrativeGender.class);
Boolean valid = false;
for (AdministrativeGender genderItem : genderList) {
if (genderItem.toCode().equalsIgnoreCase(gender.toString())) {
valid = true;
break;
}
}
if (!valid) {
throwInvalidRequest400_BadRequestException(String.format("The supplied Patient gender %s is an unrecognised type.", gender));
}
}
}
use of org.hl7.fhir.r4.model.Enumerations.AdministrativeGender in project quality-measure-and-cohort-service by Alvearie.
the class FhirTestBase method mockPatientRetrieval.
protected Patient mockPatientRetrieval(String id, AdministrativeGender gender, int ageInYears) {
Patient patient = getPatient(id, gender, ageInYears);
mockFhirResourceRetrieval(patient);
return patient;
}
Aggregations