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


Java EncodingCharacters类代码示例

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


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

示例1: setEntries

import ca.uhn.hl7v2.parser.EncodingCharacters; //导入依赖的package包/类
public void setEntries(final long participantCoupon, final List<String> itemNames, final List<String> itemValues,
		final long contextCoupon) {

	if (!participants.containsKey("" + participantCoupon))
		throw new RuntimeException("Unknown participant something");
	if (this.transactionIDcalledContextCoupon == null)
		throw new RuntimeException("No coupon issued");
	if (this.transactionIDcalledContextCoupon != contextCoupon)
		throw new RuntimeException("Wrong contextCoupon");
	if (!participants.get(participantCoupon + "").equals(owner))
		throw new RuntimeException("You are not the owner of the instigated session");
	if (itemNames.size() != itemValues.size())
		throw new RuntimeException("Mismatch between key size and value size");

	for (int i = 0; i < itemNames.size(); i++) {
		final int j = i;
		if (patientIdPattern.matcher(itemNames.get(i)).matches()) {
			try {
				pp.parse(cxContainer, itemValues.get(j), EncodingCharacters.defaultInstance());
				if (Strings.isNullOrEmpty(cxContainer.getAssigningAuthority().encode()))
					throw new RuntimeException("Not enough components in CX identifier");
				if (Strings.isNullOrEmpty(cxContainer.getIDNumber().getValue()))
					throw new RuntimeException("No ID it patient identifier");
				if (!whiteListedAssigningAuthorities
						.contains(cxContainer.getAssigningAuthority().getNamespaceID().getValue()))
					throw new RuntimeException("CX identifier does not contain whitelisted Assigning authority");
				state.put(itemNames.get(j), itemValues.get(j));
			} catch (final HL7Exception e) {
				throw new RuntimeException("Invalid CX structure", e);
			}
			/*
			 * String[] CXvalues = itemValues.get(j).split("\\^");
			 * 
			 * if (CXvalues.length < 4) throw new RuntimeException(
			 * "Not enough components in CX identifier"); if
			 * (Strings.isNullOrEmpty(CXvalues[0])) throw new
			 * RuntimeException("No ID it patient identifier"); if
			 * (!whiteListedAssigningAuthorities.contains(CXvalues[3]))
			 * throw new RuntimeException(
			 * "CX identifier does not contain whitelisted Assigning authority"
			 * ); state.put(itemNames.get(j), itemValues.get(j));
			 */
		} else if (FluentIterable.from(allowedValues).anyMatch(new Predicate<Pattern>() {

			@Override
			public boolean apply(final Pattern input) {
				return input.matcher(itemNames.get(j)).matches();
			}
		})) {
			state.put(itemNames.get(j), itemValues.get(j));
		} else {
			throw new RuntimeException("Unsupported keytype");
		}
	}
}
 
开发者ID:jkiddo,项目名称:ccow,代码行数:56,代码来源:ContextState.java


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