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中的消息樹解析器 –