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


Java CX类代码示例

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


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

示例1: parsePid

import ca.uhn.hl7v2.model.v26.datatype.CX; //导入依赖的package包/类
/**
 * This method returns a non-persisted, detached demographic model object.
 * 
 * @throws HL7Exception
 */
public static Demographic parsePid(PID pid) throws HL7Exception {
	Demographic demographic = new Demographic();

	XAD xad = pid.getPatientAddress(0);
	demographic.setAddress(StringUtils.trimToNull(xad.getStreetAddress().getStreetOrMailingAddress().getValue()));
	demographic.setCity(StringUtils.trimToNull(xad.getCity().getValue()));
	demographic.setProvince(StringUtils.trimToNull(xad.getStateOrProvince().getValue()));
	demographic.setPostal(StringUtils.trimToNull(xad.getZipOrPostalCode().getValue()));

	GregorianCalendar birthDate = DataTypeUtils.getCalendarFromDTM(pid.getDateTimeOfBirth());
	demographic.setBirthDay(birthDate);

	CX cx = pid.getPatientIdentifierList(0);
	// health card string, excluding version code
	demographic.setHin(StringUtils.trimToNull(cx.getIDNumber().getValue()));
	// blank for everyone but ontario use version code
	demographic.setVer(StringUtils.trimToNull(cx.getIdentifierCheckDigit().getValue()));
	// province
	demographic.setHcType(StringUtils.trimToNull(cx.getAssigningJurisdiction().getIdentifier().getValue()));
	// valid
	GregorianCalendar tempCalendar = DataTypeUtils.getCalendarFromDT(cx.getEffectiveDate());
	if (tempCalendar != null) demographic.setEffDate(tempCalendar.getTime());
	// expire
	tempCalendar = DataTypeUtils.getCalendarFromDT(cx.getExpirationDate());
	if (tempCalendar != null) demographic.setHcRenewDate(tempCalendar.getTime());

	XPN xpn = pid.getPatientName(0);
	demographic.setLastName(StringUtils.trimToNull(xpn.getFamilyName().getSurname().getValue()));
	demographic.setFirstName(StringUtils.trimToNull(xpn.getGivenName().getValue()));

	XTN phone = pid.getPhoneNumberHome(0);
	demographic.setPhone(StringUtils.trimToNull(phone.getUnformattedTelephoneNumber().getValue()));

	Gender gender = getOscarGenderFromHl7Gender(pid.getAdministrativeSex().getValue());
	if (gender != null) demographic.setSex(gender.name());

	return (demographic);
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:44,代码来源:DataTypeUtils.java

示例2: getChartNo

import ca.uhn.hl7v2.model.v26.datatype.CX; //导入依赖的package包/类
private static String getChartNo(ADT_A09 message) throws HL7Exception {
	PID pid = message.getPID();
	CX cx = pid.getPatientIdentifierList(0);
	if (cx.getIdentifierTypeCode() != null && DataTypeUtils.CHART_NUMBER.equals(cx.getIdentifierTypeCode().getValue())) {
		return (StringUtils.trimToNull(cx.getIDNumber().getValue()));
	} else {
		return (null);
	}
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:10,代码来源:AdtA09Handler.java

示例3: handlePatientData

import ca.uhn.hl7v2.model.v26.datatype.CX; //导入依赖的package包/类
private void handlePatientData(ORU_R01_PATIENT patient, Element elemPR, Document doc) {
	Element elemPatient = doc.createElement("Patient");
	elemPR.appendChild(elemPatient);

	PID pid = patient.getPID();
	int numOfPatientIDs = pid.getPatientIdentifierListReps();
	for (int i = 0; i < numOfPatientIDs; i++) {
		Element elemID = doc.createElement("Identifier");
		elemPatient.appendChild(elemID);
		CX plist = pid.getPatientIdentifierList(i);
		elemID.setTextContent(plist.getIDNumber().getValueOrEmpty());
		elemID.setAttribute("authority", plist.getAssigningAuthority().getNamespaceID().getValueOrEmpty());
		elemID.setAttribute("typeCode", plist.getIdentifierTypeCode().getValueOrEmpty());
	}
	
	// handle visit
	ORU_R01_VISIT visit = patient.getVISIT();
	PL location = visit.getPV1().getAssignedPatientLocation();
	IS pointOfCare = location.getPointOfCare();
	IS room = location.getRoom();
	IS bed = location.getBed();
	String pointOfCareID = pointOfCare.getValueOrEmpty();
	String bedID = bed.getValueOrEmpty();
	String roomID = room.getValueOrEmpty();	
	// if there is either bed or room given, create an object
	if( !pointOfCareID.equals("") || !bedID.equals("") || !roomID.equals("")){
		Element elemLocation = doc.createElement("Location");
		elemPatient.appendChild(elemLocation);
		elemLocation.setAttribute("pointOfCare", pointOfCareID);
		elemLocation.setAttribute("bed", bedID);
	}
	
}
 
开发者ID:sll-mdilab,项目名称:t5-doc,代码行数:34,代码来源:PCD_01MessageToXMLConverter.java

示例4: fillPid

import ca.uhn.hl7v2.model.v26.datatype.CX; //导入依赖的package包/类
/**
 * @param pid
 * @param pidNumber pass in the # of this pid for the sequence, i.e. normally it's 1 if you only have 1 pid entry. if this is a list of pids, then the first one is 1, second is 2 etc..
 * @param demographic
 * @throws HL7Exception
 */
public static void fillPid(PID pid, int pidNumber, Demographic demographic) throws HL7Exception {
	// defined as first pid=1 second pid=2 etc
	pid.getSetIDPID().setValue(String.valueOf(pidNumber));

	CX cx = pid.getPatientIdentifierList(0);
	// health card string, excluding version code
	cx.getIDNumber().setValue(demographic.getHin());
	cx.getIdentifierTypeCode().setValue(HEALTH_NUMBER);
	// blank for everyone but ontario use version code
	cx.getIdentifierCheckDigit().setValue(demographic.getVer());
	// province
	cx.getAssigningJurisdiction().getIdentifier().setValue(demographic.getHcType());

	GregorianCalendar tempCalendar = new GregorianCalendar();
	if (demographic.getEffDate() != null) {
		tempCalendar.setTime(demographic.getEffDate());
		cx.getEffectiveDate().setYearMonthDayPrecision(tempCalendar.get(GregorianCalendar.YEAR), tempCalendar.get(GregorianCalendar.MONTH) + 1, tempCalendar.get(GregorianCalendar.DAY_OF_MONTH));
	}

	if (demographic.getHcRenewDate() != null) {
		tempCalendar.setTime(demographic.getHcRenewDate());
		cx.getExpirationDate().setYearMonthDayPrecision(tempCalendar.get(GregorianCalendar.YEAR), tempCalendar.get(GregorianCalendar.MONTH) + 1, tempCalendar.get(GregorianCalendar.DAY_OF_MONTH));
	}

	XPN xpn = pid.getPatientName(0);
	xpn.getFamilyName().getSurname().setValue(demographic.getLastName());
	xpn.getGivenName().setValue(demographic.getFirstName());
	// Value Description
	// -----------------
	// A Alias Name
	// B Name at Birth
	// C Adopted Name
	// D Display Name
	// I Licensing Name
	// L Legal Name
	// M Maiden Name
	// N Nickname /Call me Name/Street Name
	// P Name of Partner/Spouse - obsolete (DO NOT USE)
	// R Registered Name (animals only)
	// S Coded Pseudo-Name to ensure anonymity
	// T Indigenous/Tribal/Community Name
	// U Unspecified
	xpn.getNameTypeCode().setValue("L");

	if (demographic.getBirthDay() != null) {
		DTM bday = pid.getDateTimeOfBirth();
		tempCalendar = demographic.getBirthDay();
		bday.setDatePrecision(tempCalendar.get(GregorianCalendar.YEAR), tempCalendar.get(GregorianCalendar.MONTH) + 1, tempCalendar.get(GregorianCalendar.DAY_OF_MONTH));
	}

	// Value Description
	// -----------------
	// F Female
	// M Male
	// O Other
	// U Unknown
	// A Ambiguous
	// N Not applicable
	pid.getAdministrativeSex().setValue(getHl7GenderFromOscarGender(demographic.getSex()));

	XAD address = pid.getPatientAddress(0);
	fillXAD(address, demographic, null, "H");

	XTN phone = pid.getPhoneNumberHome(0);
	phone.getUnformattedTelephoneNumber().setValue(demographic.getPhone());

	// ISO 639, hrmmm shall we say 639-1 (2 digit)?
	pid.getPrimaryLanguage().getIdentifier().setValue(demographic.getSpokenLanguage());

	// ISO table 3166.
	pid.getCitizenship(0).getIdentifier().setValue(demographic.getCitizenship());
}
 
开发者ID:williamgrosset,项目名称:OSCAR-ConCert,代码行数:79,代码来源:DataTypeUtils.java


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