本文整理汇总了Java中org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.MALE属性的典型用法代码示例。如果您正苦于以下问题:Java AdministrativeGender.MALE属性的具体用法?Java AdministrativeGender.MALE怎么用?Java AdministrativeGender.MALE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender
的用法示例。
在下文中一共展示了AdministrativeGender.MALE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
@Override
public AdministrativeGender apply(String codeString) {
if (codeString != null && !"".equals(codeString) || codeString != null && !"".equals(codeString)) {
if ("male".equalsIgnoreCase(codeString) || "M".equalsIgnoreCase(codeString)) {
return AdministrativeGender.MALE;
} else if ("female".equalsIgnoreCase(codeString) || "F".equalsIgnoreCase(codeString)) {
return AdministrativeGender.FEMALE;
} else if ("other".equalsIgnoreCase(codeString) || "O".equalsIgnoreCase(codeString)) {
return AdministrativeGender.OTHER;
} else if ("unknown".equalsIgnoreCase(codeString) || "UN".equalsIgnoreCase(codeString)) {
return AdministrativeGender.UNKNOWN;
} else {
throw new IllegalArgumentException("Unknown AdministrativeGender code \'" + codeString + "\'");
}
} else {
return null;
}
}
示例2: apply
@Override
public AdministrativeGender apply(String codeString) {
if (codeString != null && !"".equals(codeString) || codeString != null && !"".equals(codeString)) {
if ("male".equalsIgnoreCase(codeString) || "M".equalsIgnoreCase(codeString)) {
return AdministrativeGender.MALE;
} else if ("female".equalsIgnoreCase(codeString) || "F".equalsIgnoreCase(codeString)) {
return Enumerations.AdministrativeGender.FEMALE;
} else if ("other".equalsIgnoreCase(codeString) || "O".equalsIgnoreCase(codeString)) {
return AdministrativeGender.OTHER;
} else if ("unknown".equalsIgnoreCase(codeString) || "UN".equalsIgnoreCase(codeString)) {
return AdministrativeGender.UNKNOWN;
} else {
throw new IllegalArgumentException("Unknown AdministrativeGender code \'" + codeString + "\'");
}
} else {
return null;
}
}
示例3: testBoundCodeableConceptSerialization
/**
* Verify that MaritalStatusCodeEnum (and, by extension, BoundCodeableConcepts in general) are serializable. Author: Nick Peterson ([email protected])
*/
@Test
public void testBoundCodeableConceptSerialization() {
AdministrativeGender maritalStatus = AdministrativeGender.MALE;
byte[] bytes = SerializationUtils.serialize(maritalStatus);
assertTrue(bytes.length > 0);
AdministrativeGender deserialized = SerializationUtils.deserialize(bytes);
assertEquals(AdministrativeGender.MALE, deserialized);
}
示例4: makeGenderFromCD
public AdministrativeGender makeGenderFromCD(Element cd) throws Exception {
String code = cd.getAttribute("code");
String system = cd.getAttribute("codeSystem");
if ("2.16.840.1.113883.5.1".equals(system)) {
if ("F".equals(code))
return AdministrativeGender.FEMALE;
if ("M".equals(code))
return AdministrativeGender.MALE;
}
throw new Exception("Unable to read Gender "+system+"::"+code);
}