本文整理汇总了Java中ca.uhn.hl7v2.model.v22.segment.OBX类的典型用法代码示例。如果您正苦于以下问题:Java OBX类的具体用法?Java OBX怎么用?Java OBX使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OBX类属于ca.uhn.hl7v2.model.v22.segment包,在下文中一共展示了OBX类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOBXName
import ca.uhn.hl7v2.model.v22.segment.OBX; //导入依赖的package包/类
public String getOBXName(int i, int j){
try{
if (version.equals("2.2")) {
OBX obx = msg22.getPATIENT_RESULT().getORDER_OBSERVATION(i).getOBSERVATION(j).getOBX();
if (!obx.getValueType().getValue().equals("CE") && !oBXHasForm(i,j))
return(getString(obx.getObservationIdentifier().getText().getValue()));
else
return "";
} else {
return(getString(msg23.getRESPONSE().getORDER_OBSERVATION(i).getOBSERVATION(j).getOBX().getObservationIdentifier().getText().getValue()));
}
}catch(Exception e){
logger.error("Error retrieving obx name", e);
return("");
}
}
示例2: oBXHasForm
import ca.uhn.hl7v2.model.v22.segment.OBX; //导入依赖的package包/类
/** When the Test Source = ”FORM”, then REPLACE all previous NM and ST results with the FT results.
* When the Test Source<>”FORM”, then APPEND the FT results to the previous results.
* **/
public boolean oBXHasForm(int i, int j){
try{
if (version.equals("2.2")) {
if (msg22.getPATIENT_RESULT().getORDER_OBSERVATION(i).getOBSERVATION(j).getOBX().getValueType().getValue().equals("FT")) {
return false;
}
String testCode= msg22.getPATIENT_RESULT().getORDER_OBSERVATION(i).getOBSERVATION(j).getOBX().getObservationIdentifier().getIdentifier().getValue();
for (int k=0;k < getOBXCount(i);k++) {
OBX obx =msg22.getPATIENT_RESULT().getORDER_OBSERVATION(i).getOBSERVATION(k).getOBX();
if (testCode.contains(obx.getObservationIdentifier().getIdentifier().getValue()) && obx.getValueType().getValue().equals("FT") && obx.getObservationIdentifier().getComponent(5)!= null && obx.getObservationIdentifier().getComponent(5).toString().equals("FORM")) {
return true;
}
}
return false;
} else {
return(false);
}
}catch(Exception e){
logger.error("Error retrieving obx name", e);
return(false);
}
}
示例3: getOBXUnits
import ca.uhn.hl7v2.model.v22.segment.OBX; //导入依赖的package包/类
public String getOBXUnits(int i, int j) {
String ret = "";
try {
OBX obxSeg = (obrSegMap.get(obrSegKeySet.get(i))).get(j);
ret = getString(obxSeg.getUnits().getIdentifier().getValue());
// if there are no units specified check the formatted reference
// range for the units
if (ret.equals("")) {
ret = getString(Terser.get(obxSeg, 7, 0, 2, 1));
// only display units from the formatted reference range if they
// have not already been displayed as the reference range
if (ret.contains("-") || ret.contains("<") || ret.contains(">")
|| ret.contains("NEGATIVE"))
ret = "";
}
} catch (Exception e) {
logger.error("Exception retrieving units", e);
}
return ret;
}
示例4: getOBXCommentCount
import ca.uhn.hl7v2.model.v22.segment.OBX; //导入依赖的package包/类
/**
* Methods to get information from observation notes
*/
public int getOBXCommentCount(int i, int j) {
int count = 0;
try {
String comment = "";
OBX obxSeg = (obrSegMap.get(obrSegKeySet.get(i))).get(j);
while (comment != null) {
count++;
comment = Terser.get(obxSeg, 7, count, 1, 1);
if (comment == null)
comment = Terser.get(obxSeg, 7, count, 2, 1);
}
count--;
} catch (Exception e) {
logger.error("Exception retrieving obx comment count", e);
count = 0;
}
return count;
}
示例5: getOBXValueType
import ca.uhn.hl7v2.model.v22.segment.OBX; //导入依赖的package包/类
public String getOBXValueType(int i, int j) {
String ret = "";
try {
OBX obxSeg = (obrSegMap.get(obrSegKeySet.get(i))).get(j);
ret = obxSeg.getValueType().getValue();
} catch (Exception e) {
logger.error("Error returning OBX name", e);
}
return ret;
}
示例6: getOBXName
import ca.uhn.hl7v2.model.v22.segment.OBX; //导入依赖的package包/类
public String getOBXName(int i, int j) {
String ret = "";
try {
// leave the name blank if the value type is 'FT' this is because it
// is a comment, if the name is blank the obx segment will not be
// displayed
OBX obxSeg = (obrSegMap.get(obrSegKeySet.get(i))).get(j);
if (!obxSeg.getValueType().getValue().equals("FT"))
ret = getString(Terser.get(obxSeg, 3, 0, 2, 1));
} catch (Exception e) {
logger.error("Error returning OBX name", e);
}
return ret;
}
示例7: getOBXReferenceRange
import ca.uhn.hl7v2.model.v22.segment.OBX; //导入依赖的package包/类
public String getOBXReferenceRange(int i, int j) {
String ret = "";
try {
OBX obxSeg = (obrSegMap.get(obrSegKeySet.get(i))).get(j);
// If the units are not specified use the formatted reference range
// which will usually contain the units as well
if (getOBXUnits(i, j).equals(""))
ret = getString(Terser.get(obxSeg, 7, 0, 2, 1));
// may have to fall back to original reference range if the second
// component is empty
if (ret.equals("")) {
ret = getString(obxSeg.getReferencesRange().getValue());
if (!ret.equals("")) {
// format the reference range if using the unformatted one
String[] ranges = ret.split("-");
for (int k = 0; k < ranges.length; k++) {
if (ranges[k].endsWith("."))
ranges[k] = ranges[k].substring(0,
ranges[k].length() - 1);
}
if (ranges.length > 1) {
if (ranges[0].contains(">") || ranges[0].contains("<"))
ret = ranges[0] + "= " + ranges[1];
else
ret = ranges[0] + " - " + ranges[1];
} else if (ranges.length == 1) {
ret = ranges[0] + " -";
}
}
}
} catch (Exception e) {
logger.error("Exception retrieving reception range", e);
}
return ret;
}
示例8: getOBRComment
import ca.uhn.hl7v2.model.v22.segment.OBX; //导入依赖的package包/类
public String getOBRComment(int i, int j) {
String comment = "";
// update j to the number of the comment not the index of a comment array
j++;
try {
int count = 0;
int l = 0;
OBX obxSeg = null;
ArrayList<OBX> arrObx = obrSegMap.get(obrSegKeySet.get(i));
int obxCount = arrObx.size();
while (l < obxCount && count < j) {
if (getString(arrObx.get(l).getValueType().getValue()).equals("FT")) {
count++;
}
l++;
}
obxSeg = arrObx.get(l - 1);
int k = 0;
String nextComment = Terser.get(obxSeg, 5, k, 1, 1);
while (nextComment != null) {
comment = comment + nextComment;
k++;
nextComment = Terser.get(obxSeg, 5, k, 1, 1);
}
} catch (Exception e) {
logger.error("getOBRComment error", e);
comment = "";
}
return comment;
}
示例9: getOBXComment
import ca.uhn.hl7v2.model.v22.segment.OBX; //导入依赖的package包/类
public String getOBXComment(int i, int j, int k) {
String comment = "";
try {
k++;
OBX obxSeg = (obrSegMap.get(obrSegKeySet.get(i))).get(j);
comment = Terser.get(obxSeg, 7, k, 1, 1);
if (comment == null)
comment = Terser.get(obxSeg, 7, k, 2, 1);
} catch (Exception e) {
logger.error("Cannot return comment", e);
}
return comment;
}
示例10: init
import ca.uhn.hl7v2.model.v22.segment.OBX; //导入依赖的package包/类
public void init(String hl7Body) throws HL7Exception {
Parser p = new PipeParser();
p.setValidationContext(new NoValidation());
msg = (ORU_R01) p.parse(hl7Body.replaceAll("\n", "\r\n"));
ArrayList<String> labs = getMatchingAlphaLabs(hl7Body);
headers = new ArrayList<String>();
obrSegMap = new LinkedHashMap<OBR, ArrayList<OBX>>();
obrSegKeySet = new ArrayList<OBR>();
for (int i = 0; i < labs.size(); i++) {
msg = (ORU_R01) p.parse((labs.get(i)).replaceAll("\n", "\r\n"));
int obrCount = msg.getPATIENT_RESULT().getORDER_OBSERVATIONReps();
for (int j = 0; j < obrCount; j++) {
// ADD OBR SEGMENTS AND THEIR OBX SEGMENTS TO THE OBRSEGMAP
OBR obrSeg = msg.getPATIENT_RESULT().getORDER_OBSERVATION(j)
.getOBR();
ArrayList<OBX> obxSegs = obrSegMap.get(obrSeg);
// if the obrsegment has not yet been created it will be now
if (obxSegs == null)
obxSegs = new ArrayList<OBX>();
int obxCount = msg.getPATIENT_RESULT().getORDER_OBSERVATION(j)
.getOBSERVATIONReps();
for (int k = 0; k < obxCount; k++) {
obxSegs.add(msg.getPATIENT_RESULT().getORDER_OBSERVATION(j)
.getOBSERVATION(k).getOBX());
}
obrSegMap.put(obrSeg, obxSegs);
obrSegKeySet.add(obrSeg);
// ADD THE HEADER TO THE HEADERS ARRAYLIST
String header = getString(Terser.get(obrSeg, 4, 0, 2, 1));
if (!headers.contains(header)) {
headers.add(header);
}
}
}
}
示例11: readOBXResults
import ca.uhn.hl7v2.model.v22.segment.OBX; //导入依赖的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 (isTextOrNumeric(valueType)) {
name = obx.getObx3_ObservationIdentifier().getCe2_Text().getValue();
if (name == null) {
name = obx.getObx3_ObservationIdentifier().getCe1_Identifier().getValue();
}
String value = "";
Object tmp = obx.getObx5_ObservationValue().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 CE) {
value = ((CE) tmp).getCe2_Text().getValue();
}
itemCode = obx.getObx3_ObservationIdentifier().getCe1_Identifier().getValue();
unit = obx.getObx6_Units().getCe1_Identifier().getValue();
range = obx.getObx7_ReferencesRange().getValue();
flag = isPathologic(obx.getObx8_AbnormalFlags(0).getValue());
observationTime =
obx.getObx14_DateTimeOfTheObservation().getTs1_TimeOfAnEvent().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)) {
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));
}
}