# Generate PSMF Documents from Reports

Learn how to automatically generate PSMF documents from reports in your Vault.

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: Depending on your Admin’s configuration, object, field, and section labels, lifecycle states, and workflows may differ from the general information on this page. Refer to your organization’s business processes for guidance.</p>
    </div>
  </div>
</div>



## About Generating PSMF Documents from Vault Reports

SafetyDocs supports automatically generating PSMF Annexes and other PSMF documents from Vault reports. This process eliminates the need for manually running reports and uploading updated documents every time any information changes. 

You can set up reports in your Vault to collect PSMF data such as marketed products, studies, contracts, and other Safety information. These reports can then be linked to documents that are classified as **PSMF Generated Reports**. Based on the **Report Generation Type** selected, the relevant report will run and generate a new version of the respective document with the latest information. 

There are three (3) **Report Generation Types** to choose from:

* **Automatic**: The document will be generated every time a PSMF PDF is generated from a PSMF binder.
* **Manual**: The document will be generated every time you run a user action to update the content from the report.
* **Periodic**: The document will be generated every month when the PSMF Periodic Review job runs.

The following sections provide more details about the document generation process.

### Annex H Reports

If configured by your Admin, PSMF Documents may include Annex H reports. Generated PSMF Annex H reports:
- Group records with the same _Product Family_ field values
- Include all _Product Registration_ records, regardless of their _Marketing Status_ field values

For more information about generating Annex H reports, see <a href="/en/lr/01272/#psmf-annex-h">About the Safety-RIM Connection</a>.

### Prerequisites

Your Admin must configure all the steps for this feature. For more information, see <a href="/en/lr/01342/">Enable Automatic Generation of PSMF Documents from Vault Reports</a>. To include the <a href="/en/lr/01272/#psmf-annex-h">Annex H report in your PSMF document</a> using data received from your RIM Vault, your Admin must also <a href="/en/lr/01300/">enable the Safety-RIM Connection</a>.

## PSMF Generated Report Classification for PSMF Documents

To automatically generate a PSMF document from a report, you can create a placeholder with the **PSMF Generated Report** classification and then link it to the relevant Vault report. Depending on the **Report Generation Type** you select, a new version of the document will be generated from the report.

To learn how to create a placeholder, see <a href="/en/lr/15087/">Working with Content Placeholders</a>.

When uploading a document or placeholder with the **PSMF Generated Report** classification, the following fields link it to the report from which it can be generated:

<table>
    <thead>
            <tr>
                <th>Field</th>
                <th>Description</th>
            </tr>
    </thead>
    <tbody>
            <tr>
                <td>Source Report</td>
                <td>The string of characters identifying the report from which this document will be generated. 
                <p>From the report's URL, copy the 15-character string and paste it into this field. See the image below for reference.</p></td>
            </tr>
            <tr>
                <td>Source Report Prompt</td>
                <td>If your report has additional parameters, this is the string of characters identifying the specific parameter related to the document you want to generate. 
                <p>From the report's URL, copy the string of characters after the question mark (<code>?</code>) until the end of the URL and paste it into this field. See the image below for reference.</p></td>
            </tr>
            <tr>
                <td>Report Format</td>
                <td>Select the format in which you want the document to be generated. The available options include the following:
                    <ul>
                        <li><strong>PDF</strong></li>
                        <li><strong>Excel</strong></li>
                        <li><strong>Excel Template</strong> (Your report must have an Excel Template configured to use this option)</li>
                    </ul></td>
            </tr>
            <tr>
                <td>Report Generation Type</td>
                <td>Select when you want the report to run and the document to be subsequently generated. The available options include the following:
                    <ul>
                        <li><strong>Automatic</strong></li>
                        <li><strong>Manual</strong></li>
                        <li><strong>Periodic</strong></li>
                    </ul></td>
                </tr>
        </tbody>
</table>

<a href="https://platform.veevavault.help/assets/images/saf-psmf-vault-report-annexes-url-diagram.png" data-lightbox="saf-psmf-vault-report-annexes-url-diagram.png" data-title="Source Report and Source Report Prompt in Report URL" data-alt="Source Report and Source Report Prompt in Report URL">
  <img class="docimage" src="https://platform.veevavault.help/assets/images/saf-psmf-vault-report-annexes-url-diagram.png" alt="Source Report and Source Report Prompt in Report URL" style=""  />
</a>

To learn about other subtypes and classifications of PSMF Documents, see <a href="/en/lr/01277/#working-with-psmf-documents">Working with PSMF Documents</a>.

## Select a Report Generation Type

The **Report Generation Type** you select in the document information section determines when the document will be generated from its associated report. 

The following sections describe what happens when each **Report Generation Type** is selected:

### Automatic

The **Automatic** Report Generation Type is useful for documents within a PSMF binder that need to be regularly updated and can be generated from reports, such as PSMF Annexes. When this type is selected, the following actions take place:

* Every time the <a href="/en/lr/01277/#manually-generate-a-psmf-pdf">Generate PSMF PDF</a> action is selected, the relevant report is run and the system generates a new version of the document from this report.
* The document's lifecycle state changes to **Final**.
* The PSMF PDF generates as usual.

### Manual

The **Manual** Report Generation Type is useful when you want to manually control the timing of generating documents from reports. When this type is selected, the following actions take place:

* Every time you run a user action to update document content from a report, the relevant report is run and the system generates a new version of the document from this report.
* The document's lifecycle state remains unchanged.

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: All <strong>PSMF Generated Report</strong> documents can be manually updated, regardless of their Report Generation Type.</p>
    </div>
  </div>
</div>



### Periodic

The **Periodic** Report Generation Type is useful for documents in your library that need to be periodically updated with the monthly <a href="/en/lr/01241/#psmf-periodic-review-process">_PSMF Periodic Review_ job</a>. When this type is selected, the following actions take place:

* Every time the **PSMF Periodic Review job** runs, the relevant report is run and the system generates a new version of the document from this report.
* For each new version of the document, a **PSMF Document Review** is added to the **PSMF Periodic Review** record for that month.
* A review task is assigned to the document owner.
* Once the review task is successfully completed, the document's lifecycle state changes to **Final**.