Jump to content
Server Maintenance This Week. ×

Let If to combine multiple PubMed fields


This topic is 1546 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I've tried to combine Pubmed Fields into one Calculation field:

--------------------------

Let ( [

B = If ( PubMedArticles::Category = "Background" ; TextStyleAdd ( "Background: " ; Bold ) & PubMedArticles::Text & "¶" ; "" ) ;

O = If ( PubMedArticles::Category = "Objective" ; TextStyleAdd ( "Objective: " ; Bold ) & PubMedArticles::Text & "¶" ; "" ) ;

M = If ( PubMedArticles::Category = "Methods" ; TextStyleAdd ( "Methods: " ; Bold ) & PubMedArticles::Text & "¶" ; "" ) ;

R = If ( PubMedArticles::Category = "Results" ; TextStyleAdd ( "Results: " ; Bold ) & PubMedArticles::Text & "¶" ; "" ) ;

C = If ( PubMedArticles::Category = "Conclusions" ; TextStyleAdd ( "Conclusions: " ; Bold ) & PubMedArticles::Text & "¶" ; "" ) ;

BOMRC = B & O & M & R & C

] ;

BOMRC

)

----------------------

But it's disregarding all categories except "Objective". 

P.S. This is a continuation of 'https://fmforums.com/topic/105600-pubmed-xml-xsl-for-otherabstract/'

Best,

Daniel

 

Link to comment
Share on other sites

First, I believe your calculation formula could be reduced to just:

TextStyleAdd ( Category ; Bold ) & ": " & Text & ¶

However, your version should still work. If it doesn't, then your data is probably not what you think it is - for example, it may contain a trailing space.

 

  • Like 1
Link to comment
Share on other sites

Thank you, Comment:

I discovered that the script skips empty results and retrieves the first field with contents and then stops. For example, if 'Background' is empty, it skips to the next category. If it finds an 'Objective', then it retrieves that and the script stops, so the remainder of the PubmedArticle is not retrieved.  Thus, I'm not using Let/Case/If appropriately as I was expecting it to retrieve all categories within the PubmedArticles, while skipping the categories that are empty.

I'm adding the FileMaker demo file in hopes you or someone in the FM Forum can give it a look. There are three layouts. Portal is for seeing all the Categories and Text available for a given PMID. c_Abstract shows all the fields (empty or not) and the last field within it (c_English_FullAbstract) is trying to combine everything into a single field.  PMID: 31618392 has many content options for testing.  It's tricky, as the Text field depends on Language and Category, and there are many ways of writing a Category (Uppercase, Lowercase, Singular, Plural, etc). I discovered that the only constant in the Category is that the first letter is always Uppercase, so I created a calculated field and used it as a filter.

Best,

Daniel

PubMedAbstract.fmp12

Link to comment
Share on other sites

Hi, Comment:

One PubMed ID (PMID) can contain, depending on the language, either:

1. One field: Summary

2. Five fields: Background (or an Introduction), Objective, Population and Methods, Results and Conclusions

3. Four fields: Objective, Methods, Results and Conclusions

The field c_English_FullAbstract should combine options 1 or 2 or 3 with their corresponding contents.

Currently, if the script finds content within Summary, it retrieves that and stops.  I think what I'm missing is a parameter like this at the beginning of the script:

Find all records that have the same PMID and then combine options 1 or 2 or 3 with the contents of their fields into c_English_FullAbstract.

Best,

Daniel

Link to comment
Share on other sites

This topic is 1546 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.