0
通过CCDA的实验室工作需要遍历父儿童和儿童片段,但对于“实验室”变量没有然而“一节”和“头”的工作:组合嵌套的foreach循环
var file=""; var header=""; var Lab=""; var section="";
header=msg['recordTarget']['patientRole']['patient']['name']['family'].toString()+"|"+ //last name msg['recordTarget']['patientRole']['patient']['name']['given'].toString()+"|"+ //first name msg['recordTarget']['patientRole']['patient']['administrativeGenderCode']['@code'].toString()+"|"+ //gender msg['recordTarget']['patientRole']['patient']['birthTime']['@value'].toString(); //DOB msg['component']['structuredBody']['component'][8]['section']['title'].toString()
for each (seg in msg..component)
{ Lab = "";
Lab =seg['section']['title'].toString();
if (section == "Results")
{
for each (seg in seg..entry..organizer)
{
Lab+= seg ['code']['@code'].toString()+"|"+ //LOINC code
seg ['code']['@displayName'].toString()+"|"+//actText
seg ['effectiveTime']['@value'].toString();//collection timestamp
}
}
} for each (seg in msg..component)
{
section = "";
section =seg['section']['title'].toString();
if (section == "Results")
{
for each (seg in seg..entry..organizer..component)
{
file+=header+"|"+Lab+"|"+
seg ['observation']['code']['@code'].toString()+"|"+ //LOINC code
seg ['observation']['code']['@displayName'].toString()+"|"+//actText
seg ['observation']['effectiveTime']['@value'].toString()+"|"+//result timestamp
seg ['observation']['value']['@value'].toString()+"|"+//result value
seg ['observation']['value']['@unit'].toString()+"|"+//result unit
seg ['observation']['interpretationCode']['@code'].toString()+"!!!"+"\r"+"\n";//interpretationCode
}
}
}
channelMap.put("FILE",file);
谢谢 - 页眉和实际节完美地完成了它的实验室循环 - 它正在挑选结果之后的“护理计划”的“标题”,这是我不理解的部分。我不使用xml来使用Json解析器,而是使用Mirth中的消息树解析器 –