本文整理汇总了Java中org.hl7.fhir.dstu3.model.HumanName类的典型用法代码示例。如果您正苦于以下问题:Java HumanName类的具体用法?Java HumanName怎么用?Java HumanName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HumanName类属于org.hl7.fhir.dstu3.model包,在下文中一共展示了HumanName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setPractitionerProvider
import org.hl7.fhir.dstu3.model.HumanName; //导入依赖的package包/类
private Practitioner setPractitionerProvider(Set<IndividualProvider> individualProviders) {
Practitioner sourcePractitionerResource = new Practitioner();
individualProviders.forEach((IndividualProvider individualProvider) ->
{
sourcePractitionerResource.setId(new IdType(individualProvider.getNpi()));
sourcePractitionerResource.addIdentifier().setSystem(fhirProperties.getNpi().getSystem()).setValue(individualProvider.getNpi());
//setting the name element
HumanName indName = new HumanName();
indName.setFamily(individualProvider.getLastName());
indName.addGiven(individualProvider.getFirstName());
sourcePractitionerResource.addName(indName);
//setting the address
sourcePractitionerResource.addAddress().addLine(individualProvider.getFirstLinePracticeLocationAddress())
.setCity(individualProvider.getPracticeLocationAddressCityName())
.setState(individualProvider.getPracticeLocationAddressStateName())
.setPostalCode(individualProvider.getPracticeLocationAddressPostalCode());
});
return sourcePractitionerResource;
}
示例2: main
import org.hl7.fhir.dstu3.model.HumanName; //导入依赖的package包/类
public static void main(String[] theArgs) {
// Create a resource instance
Patient pat = new Patient();
// Add a "name" element
HumanName name = pat.addName();
name.setFamily("Simpson").addGiven("Homer").addGiven("J");
// Add an "identifier" element
Identifier identifier = pat.addIdentifier();
identifier.setSystem("http://acme.org/MRNs").setValue("7000135");
// Model is designed to be chained
pat.addIdentifier().setSystem("http://acme.org/MRNs").setValue("12345");
}
示例3: getNameUseDstu2
import org.hl7.fhir.dstu3.model.HumanName; //导入依赖的package包/类
public org.hl7.fhir.instance.model.HumanName.NameUse getNameUseDstu2() {
switch (this.nameUse) {
case USUAL: return org.hl7.fhir.instance.model.HumanName.NameUse.USUAL;
case OLD: return org.hl7.fhir.instance.model.HumanName.NameUse.OLD;
case ANONYMOUS: return org.hl7.fhir.instance.model.HumanName.NameUse.ANONYMOUS;
case MAIDEN: return org.hl7.fhir.instance.model.HumanName.NameUse.MAIDEN;
default : return null;
}
}
示例4: testTransformer
import org.hl7.fhir.dstu3.model.HumanName; //导入依赖的package包/类
@Test
public void testTransformer(){
PractitionerEntity practitionerEntity = new PractitionerEntityBuilder()
.addName("Dr", "Jenny", "Jones")
.addAddress("Church Lane Surgery", "Holmfirth", null,
"Halifax", "West Yorkshire", "HX1 2TT")
.build();
Practitioner practitioner = transformer.transform(practitionerEntity);
assertThat(practitioner, not(nullValue()));
assertThat(practitioner.getId(), not(nullValue()));
assertThat(practitioner.getId(), equalTo((new Long(PractitionerEntityBuilder.DEFAULT_ID)).toString()));
assertThat(practitioner.getActive(), equalTo(true));
List<HumanName> practitionerNames = practitioner.getName();
assertThat(practitionerNames, not(nullValue()));
assertThat(practitionerNames.size(), equalTo(1));
//assertThat(practitionerNames.get(0).getUse(), equalTo(HumanName.NameUse.USUAL));
HumanName name = practitionerNames.get(0);
assertThat(name.getPrefixAsSingleString(), equalTo("Dr"));
assertThat(name.getGivenAsSingleString(), equalTo("Jenny"));
assertThat(name.getFamily(), equalTo("Jones"));
assertThat(practitioner.getAddress(), not(nullValue()));
List<Address> addresses = practitioner.getAddress();
assertThat(addresses.size(), equalTo(1));
Address address = addresses.get(0);
assertThat(address.getLine().get(0).getValue(), equalTo("Church Lane Surgery"));
assertThat(address.getLine().get(1).getValue(), equalTo("Holmfirth"));
assertThat(address.getLine().size(), equalTo(2));
assertThat(address.getDistrict(), equalTo("West Yorkshire"));
assertThat(address.getCity(), equalTo("Halifax"));
assertThat(address.getPostalCode(), equalTo("HX1 2TT"));
assertThat(address.getUse(), equalTo(Address.AddressUse.WORK));
}
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:38,代码来源:PractitionerEntityToFHIRPractitionerTransformerTest.java
示例5: testTransformSimplePatientEntity
import org.hl7.fhir.dstu3.model.HumanName; //导入依赖的package包/类
@Test
public void testTransformSimplePatientEntity() throws FHIRException {
LocalDate dateOfBirth = LocalDate.of(1996, 6, 21);
final PatientEntity patientEntity = new PatientEntityBuilder()
.setDateOfBirth(dateOfBirth)
.build();
final Patient patient = transformer.transform(patientEntity);
assertThat(patient, not(nullValue()));
assertThat(patient.getActive(), equalTo(true));
assertThat(patient.getName().size(), equalTo(1));
HumanName name = patient.getName().get(0);
assertThat(name.getGivenAsSingleString(), equalTo("John"));
assertThat(name.getFamily(), equalTo("Smith"));
assertThat(name.getUse(), equalTo(HumanName.NameUse.USUAL));
assertThat(name.getPrefixAsSingleString(), equalTo("Mr"));
assertThat(patient.getGender(), equalTo(Enumerations.AdministrativeGender.MALE));
assertThat(patient.getBirthDate(), not(nullValue()));
LocalDate patientDoB = DateUtils.asLocalDate(patient.getBirthDate());
assertThat(patientDoB, equalTo(dateOfBirth));
}
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:28,代码来源:PatientEntityToFHIRPatientTransformerTest.java
示例6: addName
import org.hl7.fhir.dstu3.model.HumanName; //导入依赖的package包/类
public PractitionerEntityBuilder addName(String prefix, String givenName, String familyName){
PractitionerName name = new PractitionerName();
name.setFamilyName(familyName);
name.setGivenName(givenName);
name.setPrefix(prefix);
name.setNameUse(HumanName.NameUse.USUAL);
names.add(name);
return this;
}
开发者ID:nhsconnect,项目名称:careconnect-reference-implementation,代码行数:10,代码来源:PractitionerEntityBuilder.java
示例7: build
import org.hl7.fhir.dstu3.model.HumanName; //导入依赖的package包/类
public PatientEntity build() {
final PatientEntity patientEntity = new PatientEntity();
patientEntity.setId(patientId);
patientEntity.setActive(active);
patientEntity.setDateOfBirth(DateUtils.asDate(dateOfBirth));
patientEntity.setGender("MALE");
final PatientName name = patientEntity.addName();
name.setNameUse(HumanName.NameUse.USUAL);
name.setGivenName("John");
name.setFamilyName("Smith");
name.setPrefix("Mr");
// KGM 18/12/2017 Removed following line. Add name does this functionality
// patientEntity.getNames().add(name);
return patientEntity;
}
示例8: getName
import org.hl7.fhir.dstu3.model.HumanName; //导入依赖的package包/类
public List<HumanName> getName()
{
try
{
return adaptedClass.getName();
}
catch (Exception e)
{
throw new RuntimeException("Error getting Name", e);
}
}
示例9: testSerialization2
import org.hl7.fhir.dstu3.model.HumanName; //导入依赖的package包/类
/**
* Contributed by Travis from iSalus
*/
@Test
public void testSerialization2() {
Patient patient = new Patient();
patient.addName(new HumanName().addGiven("George").setFamily("Washington"));
patient.addName(new HumanName().addGiven("George2").setFamily("Washington2"));
patient.addAddress(new Address().addLine("line 1").addLine("line 2").setCity("city").setState("UT"));
patient.addAddress(new Address().addLine("line 1b").addLine("line 2b").setCity("cityb").setState("UT"));
patient.setBirthDate(new Date());
testIsSerializable(patient);
}
示例10: searchByIdentifier
import org.hl7.fhir.dstu3.model.HumanName; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Search()
public List searchByIdentifier(
@RequiredParam(name=Patient.SP_IDENTIFIER) TokenParam theIdentifier) {
ourLastMethod = "searchByIdentifier";
ArrayList<Patient> retVal = new ArrayList<Patient>();
retVal.add((Patient) new Patient().addName(new HumanName().setFamily("FAMILY")).setId("1"));
return retVal;
}
示例11: searchByIdentifier
import org.hl7.fhir.dstu3.model.HumanName; //导入依赖的package包/类
@Search()
public List<Patient> searchByIdentifier() {
ArrayList<Patient> retVal = new ArrayList<Patient>();
retVal.add((Patient) new Patient().addName(new HumanName().addGiven("FAMILY")).setId("1"));
retVal.add((Patient) new Patient().addName(new HumanName().addGiven("FAMILY")).setId("2"));
return retVal;
}
示例12: search
import org.hl7.fhir.dstu3.model.HumanName; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Search()
public List search(
@OptionalParam(name=Patient.SP_IDENTIFIER) TokenParam theIdentifier,
@Count() Integer theParam
) {
ourLastMethod = "search";
ourLastParam = theParam;
ArrayList<Patient> retVal = new ArrayList<Patient>();
for (int i = 1; i < 100; i++) {
retVal.add((Patient) new Patient().addName(new HumanName().setFamily("FAMILY")).setId("" + i));
}
return retVal;
}
示例13: searchWithNoCountParam
import org.hl7.fhir.dstu3.model.HumanName; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Search(queryName="searchWithNoCountParam")
public List searchWithNoCountParam() {
ourLastMethod = "searchWithNoCountParam";
ourLastParam = null;
ArrayList<Patient> retVal = new ArrayList<Patient>();
for (int i = 1; i < 100; i++) {
retVal.add((Patient) new Patient().addName(new HumanName().setFamily("FAMILY")).setId("" + i));
}
return retVal;
}
示例14: search
import org.hl7.fhir.dstu3.model.HumanName; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Search()
public List search(
@Sort SortSpec theSortSpec
) {
ourLastMethod = "search";
ourLastSortSpec = theSortSpec;
ArrayList<Patient> retVal = new ArrayList<Patient>();
for (int i = 1; i < 100; i++) {
retVal.add((Patient) new Patient().addName(new HumanName().setFamily("FAMILY")).setId("" + i));
}
return retVal;
}
示例15: search01
import org.hl7.fhir.dstu3.model.HumanName; //导入依赖的package包/类
@Search()
public List<Patient> search01(
@OptionalParam(name = "param1") StringAndListParam theParam1) {
ourLastMethod = "search01";
ourLastParam1 = theParam1;
ArrayList<Patient> retVal = new ArrayList<Patient>();
retVal.add((Patient) new Patient().addName(new HumanName().setFamily("FAMILY")).setId("1"));
return retVal;
}