Queue: PublicMetaMap
Subject: Metamap Api: problem with Utterance return type
Status: resolved
Created: Fri Mar 22 10:08:33 2013
Resolved: Tue Jun 11 10:25:15 2013
LastUpdated: Tue Jun 11 10:25:16 2013
Subject: Metamap Api: problem with Utterance return type
Status: resolved
Created: Fri Mar 22 10:08:33 2013
Resolved: Tue Jun 11 10:25:15 2013
LastUpdated: Tue Jun 11 10:25:16 2013
Subject: Metamap Api: problem with Utterance return type Creator: 28 Created: 2013-03-22 14:08:33 Transaction: 1886 Parent: 0 MessageId: Filename: ContentType: multipart/mixed ContentEncoding: Content:
Subject: Creator: 28 Created: 2013-03-22 14:08:33 Transaction: 1886 Parent: 153 MessageId: Filename: ContentType: text/plain ContentEncoding: Content:
Subject: Creator: 28 Created: 2013-03-22 14:37:56 Transaction: 1890 Parent: 0 MessageId: [email redacted] Filename: ContentType: multipart/mixed ContentEncoding: Content:
Subject: Creator: 28 Created: 2013-03-22 14:37:56 Transaction: 1890 Parent: 158 MessageId: Filename: ContentType: text/html ContentEncoding: none Content: See attached message for possible resolution:
Something like this should get you the mappings:
List<Result> resultList = api.processCitationsFromString(terms);
for (Result result: resultList) {
if (result != null) {
for (Utterance utterance: result.getUtteranceList()) {
for (PCM pcm: utterance.getPCMList()) {
for (Mapping map: pcm.getMappingList()) {
System.out.println(" Map Score: " + map.getScore());
for (Ev mapEv: map.getEvList()) {
System.out.println(" Score: " + mapEv.getScore());
System.out.println(" Concept Id: " + mapEv.getConceptId());
System.out.println(" Concept Name: " + mapEv.getConceptName());
}
}
}
}
}
}
See also, example in the distribution:
public_mm/src/javaapi/sources/gov/nih/nlm/nls/metamap/MetaMapApiTest.java