We need answer user's request. Need produce final JSON only, no markdown. Need parse data and compute.

User Japanese: fictional measurement records. Need extract specified IDs in order: P2-0002, P2-0018, P2-0036, P2-0057, P2-0077, P2-0092. records array 6 objects keys id, code, value_mg integer. total_mg sum of 1st, 3rd, 6th (1-based) value_mg. missing is measurement value for ID=P2-9999 if not exists null. Keys only records,total_mg,missing.

Need extract:
P2-0002: line0003: code c4ece5ece84c, value 388.
P2-0018: line0019: code 520ed95ea275, value 388.
P2-0036: line0037: code 97a6c36c0eb3, value 961.
P2-0057: line0058: code c26a0ace6116, value 189.
P2-0077: line0078: code f750f4934907, value 721.
P2-0092: line0093: code fb56105f303e, value 798.

total_mg = records[0] + records[2] + records[5] = 388 + 961 + 798 = 2147? 388+961=1349; +798=2147.
missing: P2-9999 not present -> null.

Need output JSON object only. Ensure integers not strings. No code fences.
