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


Java ContactPoint类代码示例

本文整理汇总了Java中org.hl7.fhir.instance.model.ContactPoint的典型用法代码示例。如果您正苦于以下问题:Java ContactPoint类的具体用法?Java ContactPoint怎么用?Java ContactPoint使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ContactPoint类属于org.hl7.fhir.instance.model包,在下文中一共展示了ContactPoint类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buidContactInfo

import org.hl7.fhir.instance.model.ContactPoint; //导入依赖的package包/类
/**
 * Concatenate contact point information as a string of comma-separated
 * values.
 * 
 * @param patient
 * @return String containing comma-separated list of contact information
 */
private String buidContactInfo(Patient patient) {
  final StringBuilder sb = new StringBuilder(100);

  List<ContactPoint> matches = ContactPointUtil.find(patient.getTelecom(),
      ContactPointSystem.PHONE, ContactPointUse.MOBILE);

  if (matches.size() > 0) {
    sb.append(matches.get(0).getValue());
  }

  for (ContactPointSystem system : telecomSystems) {
    for (ContactPointUse use : telecomUses) {
      matches = ContactPointUtil.find(patient.getTelecom(), system, use);
      sb.append(COMMA);
      if (matches.size() > 0) {
        sb.append(matches.get(0).getValue());
      }
    }
  }

  return sb.toString();
}
 
开发者ID:mitre,项目名称:ptmatchadapter,代码行数:30,代码来源:SimplePatientCsvFormat.java

示例2: compare

import org.hl7.fhir.instance.model.ContactPoint; //导入依赖的package包/类
/**
 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
 */
@Override
public int compare(ContactPoint cp1, ContactPoint cp2) {
  final int rank1 = cp1.getRank();
  final int rank2 = cp2.getRank();
  
  int result = 0;
  
  if (rank1 == 0 && rank2 == 0) {
    result = 0;
  } else if (rank1 == 0) {
    result = -1;
  } else {
    result = cp1.getRank() - cp2.getRank();
  }
  
  return result;
}
 
开发者ID:mitre,项目名称:ptmatchadapter,代码行数:21,代码来源:ContactPointComparator.java

示例3: find

import org.hl7.fhir.instance.model.ContactPoint; //导入依赖的package包/类
public static List<ContactPoint> find(List<ContactPoint> contacts, 
    ContactPointSystem sys, ContactPointUse use) {
  
  final List<ContactPoint> match = new ArrayList<ContactPoint>();
  
  for (ContactPoint cp : contacts) {
    if (cp.getSystem() != null && cp.getSystem().equals(sys)) {
      if (cp.getUse() != null && cp.getUse().equals(use)) {
        match.add(cp);
      }
    }
  }
  
  Collections.sort(match, new ContactPointComparator());
  return match;
}
 
开发者ID:mitre,项目名称:ptmatchadapter,代码行数:17,代码来源:ContactPointUtil.java

示例4: testToCsv

import org.hl7.fhir.instance.model.ContactPoint; //导入依赖的package包/类
@Test
public void testToCsv() {
  final SimplePatientCsvFormat fmt = new SimplePatientCsvFormat();

  Patient patient = newPatient();

  
  JXPathContext patientCtx = JXPathContext.newContext(patient);
  Pointer ptr = patientCtx.getPointer("identifier[system='SSN']");
  assertNotNull(ptr);
  Identifier id = (Identifier) ptr.getValue();
  if (id != null) {
    assertNotNull("ssn", id.getValue());
  }
  Object obj1 = ptr.getNode();

  ptr = patientCtx.getPointer("name[use='official']");
  assertNotNull(ptr);
  Object obj2 = ptr.getValue();
  ptr = patientCtx.getPointer("name[not(use)]");
  assertNotNull(ptr);
  obj2 = ptr.getValue();
  
  String str = fmt.toCsv(patient);
  LOG.info("CSV: {}", str);
  assertTrue(str.length() > 0);
  // Ensure the literal, null doesn't appear
  assertTrue(!str.contains("null"));
  // Ensure there is no sign of array delimiters
  assertTrue(!str.contains("["));
  // Ensure line doesn't end with a comma
  assertTrue(!str.endsWith(","));
  assertTrue(str.contains("Smith"));
  
  List<ContactPoint> matches = ContactPointUtil.find(
      patient.getTelecom(), ContactPointSystem.PHONE, ContactPointUse.WORK);
  assertNotNull(matches);
  assertNotNull(matches.get(0));
}
 
开发者ID:mitre,项目名称:ptmatchadapter,代码行数:40,代码来源:SimplePatientCsvFormatTest.java

示例5: build

import org.hl7.fhir.instance.model.ContactPoint; //导入依赖的package包/类
public ContactPoint build() {
  ContactPoint contact = new ContactPoint();

  if (system != null) {
    contact.setSystem(system);
  }
  if (value != null) {
    contact.setValue(value);
  }
  if (use != null) {
    contact.setUse(use);
  }
  if (rank > 0) {
    contact.setRank(rank);
  }
  if (period != null) {
    contact.setPeriod(period);
  }
  return contact;
}
 
开发者ID:mitre,项目名称:ptmatchadapter,代码行数:21,代码来源:ContactPointBuilder.java

示例6: populateProfileHeaderInformation

import org.hl7.fhir.instance.model.ContactPoint; //导入依赖的package包/类
/**
 * Method populates the profile-level metadata based on information contained in a metadata
 * file.
 * 
 * @param profile
 * @param fhirClass
 */
public void populateProfileHeaderInformation(Profile profile, FhirClassAnnotationHandler fhirClass, ProfileMetadata metadata) {
	profile.setUrl(metadata.getSharedProperty("profileRootPath") + fhirClass.getTargetResource().getName() + "-" + MAP_IDENTITY + "-" + fhirClass.getStructureName());
	profile.setVersion(metadata.getSharedProperty("profileBaseVersion"));
	profile.setName(fhirClass.getStructureName());
	profile.setPublisher(metadata.getSharedProperty("profilePublisher"));
	ContactPoint contact1 = profile.addTelecom();
	contact1.setSystem(ContactPointSystem.URL);
	contact1.setValue(metadata.getSharedProperty("profileContact"));
	ContactPoint contact2 = profile.addTelecom();
	contact2.setSystem(ContactPointSystem.URL);
	contact2.setValue("http://www.hl7.org");
	profile.setDescription(metadata.getPropertyForProfile(fhirClass.getStructureName(), "profileDescription"));
	profile.setStatus(ResourceProfileStatus.DRAFT);//TODO read from config
	profile.setRequirements(metadata.getPropertyForProfile(fhirClass.getStructureName(), "profileRequirements"));
	profile.setDate(DateAndTime.now());//TODO Fix as needed
	profile.setFhirVersion(metadata.getSharedProperty("profileFhirVersion"));
	ProfileMappingComponent mapping = profile.addMapping();
	mapping.setIdentity("quick");
	mapping.setName(fhirClass.getUmlClassName());
}
 
开发者ID:cqframework,项目名称:ProfileGenerator,代码行数:28,代码来源:FhirProfileGenerator.java

示例7: convert

import org.hl7.fhir.instance.model.ContactPoint; //导入依赖的package包/类
public static List<ContactPoint> convert(List<Xtn> contact, Mapper mapper) throws TransformException, MapperException {
    List<ContactPoint> result = new ArrayList<>();

    for (Xtn xtn : contact) {
        ContactPoint contactPoint = convert(xtn, mapper);

        if (contactPoint != null)
            result.add(contactPoint);
    }

    return result;
}
 
开发者ID:endeavourhealth,项目名称:HL7Receiver,代码行数:13,代码来源:TelecomConverter.java

示例8: createWorkPhone

import org.hl7.fhir.instance.model.ContactPoint; //导入依赖的package包/类
public static ContactPoint createWorkPhone(String phoneNumber) {
    if (StringUtils.isBlank(phoneNumber))
        return null;

    return new ContactPoint()
            .setSystem(ContactPoint.ContactPointSystem.PHONE)
            .setUse(ContactPoint.ContactPointUse.WORK)
            .setValue(TelecomConverter.formatTelephoneNumber(phoneNumber));
}
 
开发者ID:endeavourhealth,项目名称:HL7Receiver,代码行数:10,代码来源:TelecomConverter.java


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