+ //*pr_res->records->u.nonSurrogateDiagnostic->condition =
+ // YAZ_BIB1_SYSTEM_ERROR_IN_PRESENTING_RECORDS;
+ }
+
+ // record transformation must take place
+ if (rc && pr_res
+ && pr_res->numberOfRecordsReturned
+ && *(pr_res->numberOfRecordsReturned) > 0
+ && pr_res->records
+ && pr_res->records->which == Z_Records_DBOSD
+ && pr_res->records->u.databaseOrSurDiagnostics->num_records)
+ {
+ //transform all records
+ for (int i = 0;
+ i < pr_res->records->u.databaseOrSurDiagnostics->num_records;
+ i++)
+ {
+ Z_NamePlusRecord *npr
+ = pr_res->records->u.databaseOrSurDiagnostics->records[i];
+ if (npr->which == Z_NamePlusRecord_databaseRecord)
+ {
+ Z_External *r = npr->u.databaseRecord;
+ //oident *ent = oid_getentbyoid(r->direct_reference);
+ if (r->which == Z_External_octet)
+ {
+ WRBUF output_record = wrbuf_alloc();
+ int ret_trans
+ = yaz_record_conv_record(rc,
+ (const char *)
+ r->u.octet_aligned->buf,
+ r->u.octet_aligned->len,
+ output_record);
+ if (ret_trans == 0)
+ {
+ struct oident *ident = oid_getentbyoid(match_syntax);
+ npr->u.databaseRecord =
+ z_ext_record(odr_en, ident->value,
+ wrbuf_buf(output_record),
+ wrbuf_len(output_record));
+ }
+ else
+ {
+ pr_res->records->
+ u.databaseOrSurDiagnostics->records[i]
+ = zget_surrogateDiagRec(
+ odr_en, npr->databaseName,
+ YAZ_BIB1_SYSTEM_ERROR_IN_PRESENTING_RECORDS,
+ yaz_record_conv_get_error(rc));
+ }
+ wrbuf_destroy(output_record);
+ }
+ }
+ }
+ }
+ package.response() = gdu_res;