Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Let If to combine multiple PubMed fields

Featured Replies

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

 

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.

 

  • Author

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

I am not sure what to look at in your file. I suggest you try to reproduce the problem in a new file using only what is required.

  • Author

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

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.