本文整理汇总了Java中ca.uhn.hl7v2.model.v26.datatype.FT类的典型用法代码示例。如果您正苦于以下问题:Java FT类的具体用法?Java FT怎么用?Java FT使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FT类属于ca.uhn.hl7v2.model.v26.datatype包,在下文中一共展示了FT类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fillNte
import ca.uhn.hl7v2.model.v26.datatype.FT; //导入依赖的package包/类
/**
* @param nte
* @param subject should be a short string denoting what's in the comment data, i.e. "REASON_FOR_REFERRAL" or "ALLERGIES", max length is 250
* @param fileName should be the file name if applicable, can be null if it didn't come from a file.
* @param data and binary data, a String must pass in bytes too as it needs to be base64 encoded for \n and \r's
* @throws HL7Exception
* @throws UnsupportedEncodingException
*/
public static void fillNte(NTE nte, String subject, String fileName, byte[] data) throws HL7Exception, UnsupportedEncodingException {
nte.getCommentType().getText().setValue(subject);
if (fileName != null) nte.getCommentType().getNameOfCodingSystem().setValue(fileName);
String stringData = new String(Base64.encodeBase64(data), MiscUtils.DEFAULT_UTF8_ENCODING);
int dataLength = stringData.length();
int chunks = dataLength / DataTypeUtils.NTE_COMMENT_MAX_SIZE;
if (dataLength % DataTypeUtils.NTE_COMMENT_MAX_SIZE != 0) chunks++;
logger.debug("Breaking Observation Data (" + dataLength + ") into chunks:" + chunks);
for (int i = 0; i < chunks; i++) {
FT commentPortion = nte.getComment(i);
int startIndex = i * DataTypeUtils.NTE_COMMENT_MAX_SIZE;
int endIndex = Math.min(dataLength, startIndex + DataTypeUtils.NTE_COMMENT_MAX_SIZE);
commentPortion.setValue(stringData.substring(startIndex, endIndex));
}
}
示例2: fillNte
import ca.uhn.hl7v2.model.v26.datatype.FT; //导入依赖的package包/类
/**
* @param nte
* @param subject should be a short string denoting what's in the comment data, i.e. "REASON_FOR_REFERRAL" or "ALLERGIES", max length is 250
* @param fileName should be the file name if applicable, can be null if it didn't come from a file.
* @param data and binary data, a String must pass in bytes too as it needs to be base64 encoded for \n and \r's
* @throws HL7Exception
* @throws UnsupportedEncodingException
*/
public static void fillNte(NTE nte, String subject, String fileName, byte[] data) throws HL7Exception, UnsupportedEncodingException {
nte.getCommentType().getText().setValue(subject);
if (fileName != null) nte.getCommentType().getNameOfCodingSystem().setValue(fileName);
String stringData = MiscUtils.encodeToBase64String(data);
int dataLength = stringData.length();
int chunks = dataLength / DataTypeUtils.NTE_COMMENT_MAX_SIZE;
if (dataLength % DataTypeUtils.NTE_COMMENT_MAX_SIZE != 0) chunks++;
logger.debug("Breaking Observation Data (" + dataLength + ") into chunks:" + chunks);
for (int i = 0; i < chunks; i++) {
FT commentPortion = nte.getComment(i);
int startIndex = i * DataTypeUtils.NTE_COMMENT_MAX_SIZE;
int endIndex = Math.min(dataLength, startIndex + DataTypeUtils.NTE_COMMENT_MAX_SIZE);
commentPortion.setValue(stringData.substring(startIndex, endIndex));
}
}
示例3: getNteCommentsAsSingleDecodedByteArray
import ca.uhn.hl7v2.model.v26.datatype.FT; //导入依赖的package包/类
public static byte[] getNteCommentsAsSingleDecodedByteArray(NTE nte) {
FT[] fts = nte.getComment();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < fts.length; i++)
sb.append(fts[i].getValue());
return (Base64.decodeBase64(sb.toString()));
}
示例4: getNteCommentsAsSingleDecodedByteArray
import ca.uhn.hl7v2.model.v26.datatype.FT; //导入依赖的package包/类
public static byte[] getNteCommentsAsSingleDecodedByteArray(NTE nte) throws UnsupportedEncodingException {
FT[] fts = nte.getComment();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < fts.length; i++)
sb.append(fts[i].getValue());
return (MiscUtils.decodeBase64(sb.toString()));
}
示例5: readOBXResults
import ca.uhn.hl7v2.model.v26.datatype.FT; //导入依赖的package包/类
private void readOBXResults(ORU_R01_OBSERVATION obs, String commentNTE, String group,
String sequence, String defaultDateTime) throws ParseException{
OBX obx = obs.getOBX();
String valueType = obx.getObx2_ValueType().getValue();
String name = "";
String itemCode = "";
String unit = "";
String range = "";
String observationTime = "";
String status = "";
Boolean flag;
if (valueType.equals(HL7Constants.OBX_VALUE_TYPE_ED)) {
String observationId =
obx.getObx3_ObservationIdentifier().getCwe1_Identifier().getValue();
if (!"DOCUMENT".equals(observationId)) {
logger.warn(MessageFormat.format(
Messages.getString("HL7_ORU_R01.Error_WrongObsIdentifier"), observationId));
}
ED ed = (ED) obx.getObx5_ObservationValue(0).getData();
String filename = ed.getEd3_DataSubtype().getValue();
String encoding = ed.getEd4_Encoding().getValue();
String data = ed.getEd5_Data().getValue();
sequence = obx.getSetIDOBX().getValue();
observationTime = obx.getObx14_DateTimeOfTheObservation().getValue();
observation.add(new EncapsulatedData(filename, encoding, data, observationTime,
commentNTE, group, sequence));
} else if (isTextOrNumeric(valueType)) {
name = determineName(obx);
String value = "";
Object tmp = obx.getObx5_ObservationValue(0).getData();
if (tmp instanceof ST) {
value = ((ST) tmp).getValue();
} else if (tmp instanceof TX) {
value = ((TX) tmp).getValue();
if (value.contains("\\.br")) {
value = parseTextValue(value);
}
} else if (tmp instanceof FT) {
value = parseFormattedTextValue(((FT) tmp).getValue());
} else if (tmp instanceof NM) {
value = ((NM) tmp).getValue();
} else if (tmp instanceof SN) {
value = ((SN) tmp).getSn2_Num1().getValue();
} else if (tmp instanceof CE) {
value = ((CE) tmp).getCe2_Text().getValue();
}
itemCode = obx.getObx3_ObservationIdentifier().getCwe1_Identifier().getValue();
unit = obx.getObx6_Units().getCwe1_Identifier().getValue();
range = obx.getObx7_ReferencesRange().getValue();
flag = isPathologic(obx.getObx8_AbnormalFlags(0).getValue());
observationTime = obx.getObx14_DateTimeOfTheObservation().getValue();
status = obx.getObx11_ObservationResultStatus().getValue();
LabResultData lrd =
new LabResultData(itemCode, name, unit, value, range, flag, defaultDateTime,
observationTime, commentNTE, group, sequence, status,
extractName(obx.getObx4_ObservationSubID()));
if (valueType.equals(HL7Constants.OBX_VALUE_TYPE_NM)
|| valueType.equals(HL7Constants.OBX_VALUE_TYPE_SN)) {
lrd.setIsNumeric(true);
} else if (valueType.equals(HL7Constants.OBX_VALUE_TYPE_TX)) {
lrd.setIsPlainText(true);
} else if (valueType.equals(HL7Constants.OBX_VALUE_TYPE_FT)) {
lrd.setIsFormatedText(true);
}
observation.add(lrd);
} else {
logger.error(MessageFormat.format("Value type {0} is not implemented!", valueType));
}
}