Skip to content

PDQ Content Design

Blair Learn edited this page Jul 9, 2025 · 5 revisions

The Physician Data Query (PDQ) content only appears on the Cancer.Gov web site. As such, it should not be included in the core code shared with the microsites.

Modules

pdq_core

Provides implementation for elements common to all PDQ content types, including the PDQ Common Fields and PDQ workflow.

The APIs for receiving PDQ content from external systems (i.e. the CDR) are defined in the module which implements the specific content type. This allows changes to the API for one content type to be made without affecting others. (Code used by all the APIs is implemented in the core module.)

pdq_cancer_information_summary

Implements the PDQ Cancer Information Summary content type.

Fields which are unique to the content type (e.g. Summary Type) are defined in the module. Additional field definitions are re-used from the pdq_core and cgov_core modules.

Testing

When testing from your local environment, in addition to the unit tests, the PDQ endpoints may be exercised via curl.

Create a summary

Note

When creating a summary document, the English version must be created before the Spanish version.

If successful, this command will return a JSON object containing a "nid" key and the document's node ID and an HTTP status of 201.

curl -XPOST 'http://PDQ_USER:[email protected]/pdq/api/cis' \
     -H 'Content-type: application/json' \
     -w '\nHTTP status: %{http_code}\n'  \
     --data '{
               "nid": null,
               "title": "Test English Summary",
               "browser_title": "Test Browser Title",
               "cthp_card_title": "Test Card Title",
               "description": "Test description",
               "language": "en",
               "url": "/types/lymphoma/hp/adult-hodgkin-treatment-pdq",
               "cdr_id": 5001,
               "audience": "Patients",
               "summary_type": "Treatment",
               "posted_date": "2020-01-01",
               "updated_date": "2020-01-02",
               "sections": [
                 { "id": "_1", "title": "Section 1", "html": "<p>one</p>" },
                 { "id": "_2", "title": "Section 2", "html": "<p>two</p>" }
               ],
               "svpc": 0,
               "suppress_otp": 0,
               "intro_text": "<p><em>Look!</em></p>"
             }'

Retrieve the summary

If successful, returns a JSON document and HTTP status of 200.

curl -XGET http://PDQ_USER:[email protected]/pdq/api/cis/NODE_ID

Publish the summary

If successful, returns a JSON object containing an "errors" key to an empty array of errors, and an HTTP 200 status.

curl   -XPOST http://PDQ_USER:[email protected]/pdq/api  \
       -H 'Content-type: application/json'  \
       -w '\n%{http_code}\n'
       --data '[
          [NODE_ID_1, LANGUAGE_CODE_1],
          [NODE_ID_2, LANGUAGE_CODE_2],
             :
          [NODE_ID_N, LANGUAGE_CODE_N]
       ]'

pdq_drug_information_summary

Implements the PDQ Drug Information Summary content type.

Fields which are unique to the content type are defined in the module. Additional field definitions are re-used from the pdq_core and cgov_core modules.

Clone this wiki locally