te')); return $arr; } /* 遍历用户所有主题 * @param $uid 用户ID * @param int $page 页数 * @param int $pagesize 每页记录条数 * @param bool $desc 排序方式 TRUE降序 FALSE升序 * @param string $key 返回的数组用那一列的值作为 key * @param array $col 查询哪些列 */ function thread_tid_find_by_uid($uid, $page = 1, $pagesize = 1000, $desc = TRUE, $key = 'tid', $col = array()) { if (empty($uid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('uid' => $uid), array('tid' => $orderby), $page, $pagesize, $key, $col); return $arr; } // 遍历栏目下tid 支持数组 $fid = array(1,2,3) function thread_tid_find_by_fid($fid, $page = 1, $pagesize = 1000, $desc = TRUE) { if (empty($fid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('fid' => $fid), array('tid' => $orderby), $page, $pagesize, 'tid', array('tid', 'verify_date')); return $arr; } function thread_tid_delete($tid) { if (empty($tid)) return FALSE; $r = thread_tid__delete(array('tid' => $tid)); return $r; } function thread_tid_count() { $n = thread_tid__count(); return $n; } // 统计用户主题数 大数量下严谨使用非主键统计 function thread_uid_count($uid) { $n = thread_tid__count(array('uid' => $uid)); return $n; } // 统计栏目主题数 大数量下严谨使用非主键统计 function thread_fid_count($fid) { $n = thread_tid__count(array('fid' => $fid)); return $n; } ?>mirth - How do I handle multiple repeated segments when creating an EDI 214 message via javascript? - Stack Overflow
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

mirth - How do I handle multiple repeated segments when creating an EDI 214 message via javascript? - Stack Overflow

programmeradmin1浏览0评论

We use mirth for our EDI transactions. I am creating a channel for an EDI214 for a customer. I'm not really sure how to handle multiple repeated segments in the destination transformer, in specific the L11 segments. They have multiple occurrences. From the database, we fill in these segments into mirth and map a 214 document. Here is an example of a message:

`ISA00 00 ZZXXXX ZZXXXXXXX 2412191459U004010005206230P:

GSQMANTCXXXXXX202412191459520623X004010

ST214520623

B10164951F896890181*XXXX

L11XXXXX11

L11DRYVANOT

L11SOLOOT

L11XXXXXXXX12

L11172400000BM

N1SHCurrent Location

N4CATOOSAOK

LX*1

AT7X6NS**202412190659*LT

MS1CATOOSAOK*US

MS2ANTCNA

L111QN

L11172400000BM

L114500586483OT

L11BSWB17240001OT

L11IIIOT

L11LBOT

L1123332OT

L11HYPOCHLORITE SOLUTIONSOT

LX*2

AT7X6NS**202412190659*LT

MS1MUSKOGEEOK*US

MS2XXXXNA

L1199QN

L11172400000BM

L114500586483OT

L11BSWB17240001OT

L11IIIOT

L11LBOT

L1123332OT

L11TEST COMPANY NAMEOT

SE34520623

GE1520623

IEA1000520623`

At the moment, I have them filling in by index of occurence. I don't know if this will always work. Additionally, if a segment does not exist, I don't know if it will error. Am i going about this the right way?

// L11 Segment
  tmp['L11'][0]['L11.01']['L11.01.1'] = tradingpartner //L11 BM
  tmp['L11'][0]['L11.02']['L11.02.1'] = "11"
  tmp['L11'][1]['L11.03']['L11.03.1'] = parsed_additional_information.equipment_type 
  tmp['L11'][1]['L11.04']['L11.04.1'] = "OT" // qualification code 
  tmp['L11'][2]['L11.05']['L11.05.1'] = parsed_additional_information.drivermessage 
  tmp['L11'][2]['L11.06']['L11.06.1'] = "OT" // number of units
  tmp['L11'][3]['L11.07']['L11.07.1'] = parsed_additional_information.billingaccount 
  tmp['L11'][3]['L11.08']['L11.08.1'] = "12" // code for billing account 
  if (parsed_additional_information.BM) {
    tmp['L11'][4]['L11.09']['L11.09.1'] = parsed_additional_information.BM
    tmp['L11'][4]['L11.10']['L11.10.1'] = "BM" // bill of lading number
  }
  tmp['N1'][0]['N1.02']['N1.02.1'] = shipment_msg.from_company_name;

  tmp['N3'][0]['N3.01']['N3.01.1'] = shipment_msg.from_address; 

  tmp['N4'][0]['N4.01']['N4.01.1'] = shipment_msg.from_city; 
  tmp['N4'][0]['N4.02']['N4.02.1'] = shipment_msg.from_state;
  tmp['N4'][0]['N4.03']['N4.03.1'] = shipment_msg.from_zip 

  tmp['N1'][1]['N1.02']['N1.02.1'] = shipment_msg.to_company_name; 
  tmp['N3'][1]['N3.01']['N3.01.1'] = shipment_msg.to_address; 

  tmp['N4'][1]['N4.01']['N4.01.1'] = shipment_msg.to_city; 
  tmp['N4'][1]['N4.02']['N4.02.1'] = shipment_msg.to_state
  tmp['N4'][1]['N4.03']['N4.03.1'] = shipment_msg.to_zip 
  tmp['LX'][0]['LX.01']['LX.01.1'] = "1"

how do i handle the second occurence? just index it as well?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论