0241.html 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <!--
  2. 住院用药
  3. -->
  4. <div class="os-main">
  5. <ul class="info-list-t">
  6. <h3 class="os-tit-o o-t-o-nb"><i class="icon Rp"></i><span class="os-t-o-name">Rp</span></h3>
  7. <li class="il-t-item list-mt" ms-repeat="data['门诊用药记录']" ms-repeat-item="el['用药子项']">
  8. <h4 class="os-tit-f" ms-if="item['药品名称']" ms-text="item['药品名称']"></h4>
  9. <ul class="os-base-info pl0" ms-if="el['用药方法'] || item['次剂量'] || el['频率']">
  10. <li><label>用法:</label><span class="pd-r" ms-if="el['用药方法']" ms-text="el['用药方法']"></span><span ms-if="item['次剂量']" class="pd-r"><span ms-if="item['次剂量']">每次</span><span ms-text="item['次剂量']"></span></span><span class="pd-r" ms-if="el['频率']" ms-text="el['频率']"></span></li>
  11. </ul>
  12. <ul class="os-base-info pl0" ms-if="item['药品规格'] || item['总剂量']">
  13. <li ms-if="item['总剂量']" class="flex1"><label>总量:</label><span ms-text="item['总剂量']"></span></li>
  14. <li ms-if="item['药品规格']" class="flex2"><label>规格:</label><span ms-text="item['药品规格']"></span></li>
  15. </ul>
  16. </li>
  17. </ul>
  18. <p class="p-bottom">详情内容以医院出具纸质病例为准</p>
  19. </div>
  20. <script>
  21. function dsXmlToJson0241_2(xmlStr) {
  22. var $xmlDom = $(xmlStr),
  23. $nodes = {
  24. "用药记录" :$xmlDom.find('component section entry')
  25. } ;
  26. var resultData = [];
  27. return {
  28. data:{
  29. "门诊用药记录": _.map($nodes["用药记录"].find('group'),function(el) {
  30. var $ele = $(el);
  31. var $freq = $ele.find("freq");//频率
  32. var $method = $ele.find("method");//方法
  33. var $medicineArr = $ele.find("medicine");//用药子项
  34. return {
  35. "频率": $freq.text(),
  36. "用药方法":$method.text(),
  37. "用药子项": (function() {
  38. return _.map($medicineArr, function(secEl){
  39. var $eleItem = $(secEl);
  40. return {
  41. "药品名称": $eleItem.find('value').text().trim() ? $eleItem.find('value').text().trim(): $eleItem.find('custome').text().trim(),
  42. "药品规格": $eleItem.find('spec').text().trim(),
  43. "总剂量":$eleItem.find('totalQuantity').text()? parseFloat($eleItem.find('totalQuantity').text()).toFixed(0)+ $eleItem.find('totalUnit').text():'',
  44. "次剂量":$eleItem.find('doseQuantity').text()? parseFloat($eleItem.find('doseQuantity').text()).toFixed(2)+ $eleItem.find('doseUnit').text():''
  45. }
  46. })
  47. })()
  48. }
  49. })
  50. }
  51. }
  52. }
  53. function dsXmlToJson0241_1(xmlStr) {
  54. var $xmlDom = $(xmlStr),
  55. $nodes = {
  56. "用药记录" :$xmlDom
  57. } ;
  58. var resultData = [];
  59. return {
  60. data:{
  61. "门诊用药记录": _.map($nodes["用药记录"].find('group'),function(el) {
  62. var $ele = $(el);
  63. var $freq = $ele.attr("freq");//频率
  64. var $method = $ele.attr("method");//方法
  65. var $medicineArr = $ele.find("medicine");//用药子项
  66. return {
  67. "频率": $freq,
  68. "用药方法":$method,
  69. "用药子项": (function() {
  70. return _.map($medicineArr, function(secEl){
  71. var $eleItem = $(secEl);
  72. return {
  73. "药品名称": $eleItem.text().trim(),
  74. "药品规格": $eleItem.attr('spec').trim(),
  75. "总剂量":$eleItem.attr('total_quantity')? parseFloat($eleItem.attr('total_quantity')).toFixed(0)+ $eleItem.attr('total_unit'):'',
  76. "次剂量":$eleItem.attr('dose_quantity')? parseFloat($eleItem.attr('dose_quantity')).toFixed(2)+ $eleItem.attr('dose_unit'):''
  77. }
  78. })
  79. })()
  80. }
  81. })
  82. }
  83. }
  84. }
  85. </script>