当前位置: 首页>>代码示例>>Java>>正文


Java Patient.setMaritalStatus方法代码示例

本文整理汇总了Java中ca.uhn.fhir.model.dstu2.resource.Patient.setMaritalStatus方法的典型用法代码示例。如果您正苦于以下问题:Java Patient.setMaritalStatus方法的具体用法?Java Patient.setMaritalStatus怎么用?Java Patient.setMaritalStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ca.uhn.fhir.model.dstu2.resource.Patient的用法示例。


在下文中一共展示了Patient.setMaritalStatus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: codes

import ca.uhn.fhir.model.dstu2.resource.Patient; //导入方法依赖的package包/类
@SuppressWarnings("unused")
public static void codes() {
   // START SNIPPET: codes
   Patient patient = new Patient();

   // You can set this code using a String if you want. Note that
   // for "closed" valuesets (such as the one used for Patient.gender)
   // you must use one of the strings defined by the FHIR specification.
   // You must not define your own.
   patient.getGenderElement().setValue("male");
   
   // HAPI also provides Java enumerated types which make it easier to
   // deal with coded values. This code achieves the exact same result
   // as the code above.
   patient.setGender(AdministrativeGenderEnum.MALE);
   
   // You can also retrieve coded values the same way
   String genderString = patient.getGenderElement().getValueAsString();
   AdministrativeGenderEnum genderEnum = patient.getGenderElement().getValueAsEnum();
   
   // The following is a shortcut to create
   patient.setMaritalStatus(MaritalStatusCodesEnum.M);
   // END SNIPPET: codes

}
 
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:26,代码来源:FhirDataModel.java

示例2: codeableConceptEnums

import ca.uhn.fhir.model.dstu2.resource.Patient; //导入方法依赖的package包/类
@SuppressWarnings("unused")
public static void codeableConceptEnums() {
   // START SNIPPET: codeableConceptEnums
   Patient patient = new Patient();
   
   // Set the CodeableConcept's first coding to use the code
   // and codesystem associated with the M value.
   patient.setMaritalStatus(MaritalStatusCodesEnum.M);
   
   // If you need to set other fields (such as the display name) after
   // using the Enum type, you may still do so.
   patient.getMaritalStatus().getCodingFirstRep().setDisplay("Married");
   patient.getMaritalStatus().getCodingFirstRep().setPrimary(true);
   patient.getMaritalStatus().getCodingFirstRep().setVersion("1.0");
   
   // You can use accessors to retrieve values from CodeableConcept fields
   
   // Returns "M"
   String code = patient.getMaritalStatus().getCodingFirstRep().getCode();

   // Returns "http://hl7.org/fhir/v3/MaritalStatus". This value was also
   // populated via the enum above.
   String codeSystem = patient.getMaritalStatus().getCodingFirstRep().getCode();
   
   // In many cases, Enum types can be used to retrieve values as well. Note that
   // the setter takes a single type, but the getter returns a Set, because the
   // field can technicaly contain more than one code and codesystem. BE CAREFUL
   // when using this method however, as no Enum will be returned in the case
   // that the field contains only a code other than the ones defined by the Enum. 
   Set<MaritalStatusCodesEnum> status = patient.getMaritalStatus().getValueAsEnum();
   // END SNIPPET: codeableConceptEnums

}
 
开发者ID:gajen0981,项目名称:FHIR-Server,代码行数:34,代码来源:FhirDataModel.java


注:本文中的ca.uhn.fhir.model.dstu2.resource.Patient.setMaritalStatus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。